Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wildcard state \000 rules makes lexer behave weard #49

Closed
skvadrik opened this issue Apr 12, 2011 · 4 comments

Comments

@skvadrik
Copy link
Owner

commented Apr 12, 2011

Hi,

Using a <*> "\000" rule make the parser behave weard : It matches the rule at a place where it shouldn't. I've make a testcase that shows the behaviour. Tarball is available on http://www.palsenberg.com/plain/test-re2c.tar.gz

If you need more info : Please let me know.

Original comment by: palsenberg

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Apr 12, 2011

It seems to go wrong with all single-character matches : \x01 also gives wrong results.

Original comment by: palsenberg

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Mar 24, 2012

Please attach a fail case, the smaller the better. I tried to download your url but got a 404. I am dropping the priority until a fail case is supplied.

Original comment by: paulmcq

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Mar 24, 2012

  • priority: 5 --> 1

Original comment by: paulmcq

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Mar 19, 2019

Can't reproduce. This works fine with current master:

/*!re2c
  <c1> *      { default }
  <*>  "\000" { rule-01 }
*/

Run as:

$ ./re2c -ci 3.re 
/* Generated by re2c 1.1.1 on Tue Mar 19 17:52:10 2019 */

{
        YYCTYPE yych;
        switch (YYGETCONDITION()) {
        case yycc1: goto yyc_c1;
        }
/* *********************************** */
yyc_c1:
        if (YYLIMIT <= YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        if (yych >= 0x01) goto yy5;
        ++YYCURSOR;
        { rule-01 }
yy5:
        ++YYCURSOR;
        { default }
}

Seems the correct output to me.

@skvadrik skvadrik closed this Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.