summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Van Doren <thomas.vandoren@gmail.com>2013-11-25 21:09:25 -0800
committerThomas Van Doren <thomas.vandoren@gmail.com>2013-11-25 21:09:25 -0800
commit9e1eb76ca7f4445639e72eaf0251c7154dd1cec6 (patch)
tree2ff07d09677c3fb9b80fada9e3a54d8f1b406f68
parent23f983b2f7a4877b9f81c6c6c94d4e16ad3dc3c9 (diff)
downloadpygments-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.py8
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