Nodeclipse / coffeescript-eclipse

CoffeeScript plugin for Eclipse using XText (moved to Nodeclipse; looking for new owner)
http://www.nodeclipse.org/coffeescript/
20 stars 9 forks source link

/"/ and /'/ are not parsed correctly #11

Open scharf opened 11 years ago

scharf commented 11 years ago

There is a missing rule for simple regular expressions in the parser

Here is my proposal for a better rule for regular expressions:

terminal REGEX: 
    '///' -> '///' |
    '/' ( (!('/'|'\\') | ('\\' !('\n' | '\r'))) ('\\' !('\n' | '\r') | !('\\'|"'"))*)? '/';

the github syntax highlighter does coffeesctipt highlighting of regular expressions correctly:

x=/'/
y=///
   '
///
y=/\Yaaaa/
scharf commented 11 years ago

I just fixed the rule -- there was a problem with \//\ because the first character was not seen as quote