diff options
author | Tim Hatch <tim@timhatch.com> | 2014-04-23 17:07:26 -0400 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-04-23 17:07:26 -0400 |
commit | 2586a63b4796a97bf0c5549a7f708a07f716fc59 (patch) | |
tree | ae1c4fa415256a44c00e1cc564eaa21c724538a0 | |
parent | cc3e8ed0d6aa5c3461475d702a4e2840f56d295a (diff) | |
download | pygments-2586a63b4796a97bf0c5549a7f708a07f716fc59.tar.gz |
Forgot to include lexer changes in previous Chai commit.
-rw-r--r-- | pygments/lexers/agile.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index 17e97c3b..a3e60f59 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -2466,7 +2466,9 @@ class HyLexer(RegexLexer): class ChaiscriptLexer(RegexLexer): """ - For ChaiScript source code. + For `ChaiScript <http://chaiscript.com/>`_ source code. + + .. versionadded:: 2.0 """ name = 'ChaiScript' @@ -2500,6 +2502,7 @@ class ChaiscriptLexer(RegexLexer): r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?', Operator, 'slashstartsregex'), (r'[{(\[;,]', Punctuation, 'slashstartsregex'), (r'[})\].]', Punctuation), + (r'[=+\-*/]', Operator), (r'(for|in|while|do|break|return|continue|if|else|' r'throw|try|catch' r')\b', Keyword, 'slashstartsregex'), @@ -2512,7 +2515,15 @@ class ChaiscriptLexer(RegexLexer): (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), (r'0x[0-9a-fA-F]+', Number.Hex), (r'[0-9]+', Number.Integer), - (r'"(\\\\|\\"|[^"])*"', String.Double), + (r'"', String.Double, 'dqstring'), (r"'(\\\\|\\'|[^'])*'", String.Single), - ] + ], + 'dqstring': [ + (r'\${[^"}]+?}', String.Iterpol), + (r'\$', String.Double), + (r'\\\\', String.Double), + (r'\\"', String.Double), + (r'[^\\\\\\"$]+', String.Double), + (r'"', String.Double, '#pop'), + ], } |