Skip to content

Commit

Permalink
add support for LiveScript and CoffeeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Mesteery authored and birkenfeld committed Dec 28, 2020
1 parent e7ea950 commit 52677b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pygments/lexers/javascript.py
Expand Up @@ -255,15 +255,15 @@ class LiveScriptLexer(RegexLexer):
],
'multilineregex': [
include('commentsandwhitespace'),
(r'//([gim]+\b|\B)', String.Regex, '#pop'),
(r'//([gimuys]+\b|\B)', String.Regex, '#pop'),
(r'/', String.Regex),
(r'[^/#]+', String.Regex)
],
'slashstartsregex': [
include('commentsandwhitespace'),
(r'//', String.Regex, ('#pop', 'multilineregex')),
(r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
r'([gim]+\b|\B)', String.Regex, '#pop'),
r'([gimuys]+\b|\B)', String.Regex, '#pop'),
(r'/', Operator, '#pop'),
default('#pop'),
],
Expand Down Expand Up @@ -1054,15 +1054,15 @@ class CoffeeScriptLexer(RegexLexer):
],
'multilineregex': [
(r'[^/#]+', String.Regex),
(r'///([gim]+\b|\B)', String.Regex, '#pop'),
(r'///([gimuys]+\b|\B)', String.Regex, '#pop'),
(r'#\{', String.Interpol, 'interpoling_string'),
(r'[/#]', String.Regex),
],
'slashstartsregex': [
include('commentsandwhitespace'),
(r'///', String.Regex, ('#pop', 'multilineregex')),
(r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
r'([gim]+\b|\B)', String.Regex, '#pop'),
r'([gimuys]+\b|\B)', String.Regex, '#pop'),
# This isn't really guarding against mishighlighting well-formed
# code, just the ability to infinite-loop between root and
# slashstartsregex.
Expand Down

0 comments on commit 52677b8

Please sign in to comment.