#241 "missing )" in {pattern}(@|$)

closed
nobody
None
5
2013-05-28
2012-03-13
Clem Wang
No

I created this anti-pattern with a $:

\A{foo$} => QUEX_TKN_END(Lexeme);

and I got this error:

simple.qx:21:error: Missing closing '}' after anti-pattern pattern in \A{ ... }.

Quex version 0.61.2

Perhaps $ isn't allowed in Anti-Pattern? If so, the error message is misleading.

Discussion

  • Clem Wang

    Clem Wang - 2012-03-13

    This may be a related problem:

    I want to match a pattern that either ends in a newline or is followed by an "@"

    {pattern}(@|$) { / stuff / }

    foo.qx:321:error: Regular expression parsing:
    foo.qx::321:error: Missing closing ')' after expression; found '@|$) {'.
    foo.qx::321:error: Note, that patterns end with the first non-quoted whitespace.
    foo.qx::321:error: Also, closing brackets in quotes do not close a syntax block.

    Also version 0.61.2

     
  • Frank-Rene Schäfer

    For your purpose, you would have to split your pattern into two
    and associate it with the same actions, i.e.

    [a-z]"\n" => QUEX_TKN_X;
    [a-z]/@ => QUEX_TKN_X;

     
  • Clem Wang

    Clem Wang - 2012-03-14

    (Changed title of bug).

    I'd rather not have to split the pattern into two, as it would add extra lines with duplicate code and be harder to maintain my rather complex Quex code.

    Other regexp systems permit this. Can/should I make a feature request?

    Thanks

     
  • Clem Wang

    Clem Wang - 2012-03-14

    (Fix the title a little bit more.)

     
  • Clem Wang

    Clem Wang - 2012-03-17

    It seems (@|\n) works whereas (@|$) doesn't. Assuming EOF is signified by \n, this seems like a reasonable thing to do.

     
  • Frank-Rene Schäfer

    Duplicate to 3503831, would say.

     
  • Frank-Rene Schäfer

    • Status: pending --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks