Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Request #11912 Case-insensitive literal strings
Submitted: 2007-08-28 10:04 UTC
From: joror Assigned: instance
Status: Closed Package: PHP_LexerGenerator (version 0.3.4)
PHP Version: 5.2.3 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-08-28 10:04 UTC] joror (Daan Broekhof)
Description: ------------ RE2C has a feature to match literal strings case-insensitively when using single quotes instead of double quotes. [quote] "foo" the literal string foo. ANSI-C escape sequences can be used. 'foo' the literal string foo (characters [a-zA-Z] treated case-insensitive). ANSI-C escape sequences can be used. [/quote] This is quite handy when making flexible languages, so I implemented a solution. (see patch) Essentially, it turns 'test' into the regexp '[Tt][Ee][Ss][Tt]'. Note: The patch file also contains the changes for a number of other bugs/features. ('Single line comments', 'Missing placeholder strings', 'Faster regexp matching with \G instead of substr()', 'Missing spaces in exception messages'). Splitting them would be quite a chore, but I can do that if needed.

Comments

 [2007-08-28 10:19 UTC] joror (Daan Broekhof)
For some reason I was not allowed to upload the patch file while it was named 'caseinsensitive.diff', instead I had to name if 'caseinsensitive.txt'.
 [2007-12-02 04:36 UTC] instance (Alan Langford)
Changes integrated with other work, update is now in CVS.