diff options
author | Thomas Van Doren <thomas.vandoren@gmail.com> | 2013-11-25 21:09:25 -0800 |
---|---|---|
committer | Thomas Van Doren <thomas.vandoren@gmail.com> | 2013-11-25 21:09:25 -0800 |
commit | 9e1eb76ca7f4445639e72eaf0251c7154dd1cec6 (patch) | |
tree | 2ff07d09677c3fb9b80fada9e3a54d8f1b406f68 | |
parent | 23f983b2f7a4877b9f81c6c6c94d4e16ad3dc3c9 (diff) | |
download | pygments-9e1eb76ca7f4445639e72eaf0251c7154dd1cec6.tar.gz |
Fix float pattern in ChapelLexer.
reals cannot end with a period in chapel due to lexical ambiguity with the
.. operator. See the Chapel reference for details.
-rw-r--r-- | pygments/lexers/compiled.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 81e62302..dd56f045 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -3761,10 +3761,10 @@ class ChapelLexer(RegexLexer): (r'\.\d+([Ee][-+]\d+)?i', Number), (r'\d+[Ee][-+]\d+i', Number), - # reals - (r'\d+(\.\d+[eE][+\-]?\d+|' - r'\.\d*|[eE][+\-]?\d+)', Number.Float), - (r'\.\d+([eE][+\-]?\d+)?', Number.Float), + # reals cannot end with a period due to lexical ambiguity with + # .. operator. See reference for rationale. + (r'(\d*\.\d+)([eE][+-]?[0-9]+)?i?', Number.Float), + (r'\d+[eE][+-]?[0-9]+i?', Number.Float), # integer literals # -- binary |