summaryrefslogtreecommitdiff
path: root/sci2jslex.py
diff options
context:
space:
mode:
Diffstat (limited to 'sci2jslex.py')
-rwxr-xr-xsci2jslex.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sci2jslex.py b/sci2jslex.py
index c4a3c562..1bd140af 100755
--- a/sci2jslex.py
+++ b/sci2jslex.py
@@ -3,6 +3,7 @@
from __future__ import print_function
import ply.lex as lex
+import re
import sys
''' keep track of how many open brackets have been encountered so far '''
@@ -109,9 +110,10 @@ def t_COMMENT(t):
pass
def t_NUMBER(t):
- r'(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?'
+ r'(\d+(\.\d*)?|\.\d+)([dDeE][+-]?\d+)?'
global afterarray
afterarray = False
+ t.value = re.sub(r'[de]', r'e', t.value, flags=re.IGNORECASE)
return t
def t_PREVAR(t):