Skip to content

wildcard state \000 rules makes lexer behave weard #49

Closed

Description

@skvadrik

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

Activity

  1. skvadrik commented on Apr 12, 2011

    @skvadrik
    OwnerAuthor

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

    Original comment by: palsenberg

  2. skvadrik commented on Mar 24, 2012

    @skvadrik
    OwnerAuthor

    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

  3. skvadrik commented on Mar 24, 2012

    @skvadrik
    OwnerAuthor
    • priority: 5 --> 1

    Original comment by: paulmcq

  4. self-assigned this
    on Jul 23, 2015
  5. skvadrik commented on Mar 19, 2019

    @skvadrik
    OwnerAuthor

    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.

  6. added a commit that references this issue on Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions