^ in regular expressions (C#)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

^ in regular expressions (C#)

Oliver Bock
I am using Grammatica 1.5 (2009-03-07) to generate a C# parser.  If I
use ^ in regular expressions then the expression fail to match, although
no error is produced.  I see that bug #3597 claims to have fixed this,
but perhaps the fix only works with Java parsers.

I can get around this by changing my tokens from (for example):

WHITESPACE = <<\s+>> %ignore%


COMMAND = <<[\r\n]COMMAND>>   // must be before EOL
WHITESPACE = <<[ \t]+>> %ignore%
EOL = <<[\r\n]>> %ignore%

and also:

- adding a newline to the beginning of my script before parsing, and
- hacking the reporting of the line number in errors

so I am not stuck, it's just ugly.


Grammatica-users mailing list
[hidden email]