Richard Metzler  committed cdab856

CoffeeScript's fat arrow (=>) now highlighted properly

- Bug Report:
- test file in tests/examplefiles/

I also refactored the regex to be more readable (put a group in one line instead of breaking it). I needed to do this to spot the error.

  • Participants
  • Parent commits 59aff1b
  • Branches default

Comments (0)

Files changed (2)

File pygments/lexers/

             #(r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
-             r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|'
-             r'=(?!>)|-(?!>)|[<>+*`%&\|\^/])=?',
+             r'\|\||\\(?=\n)|'
+             r'(<<|>>>?|==?(?!>)|!=?|=(?!>)|-(?!>)|[<>+*`%&\|\^/])=?',
              Operator, 'slashstartsregex'),
-            (r'(?:\([^()]+\))?\s*[=-]>', Name.Function),
+            (r'(?:\([^()]*\))?\s*[=-]>', Name.Function),
             (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
             (r'[})\].]', Punctuation),

File tests/examplefiles/

+methodA:-> 'A'
+methodB:=> 'B'
+methodC:()=> 'C'
+methodD:()-> 'D'
+methodE:(a,b)-> 'E'
+methodF:(c,d)-> 'F'
+-> 'G'
+=> 'H'
+(-> 'I')
+(=> 'J')