OSDN Git Service

Zero-or-one not one-or-more.
authorSimon Forman <sforman@hushmail.com>
Tue, 19 May 2020 03:45:04 +0000 (20:45 -0700)
committerSimon Forman <sforman@hushmail.com>
Tue, 19 May 2020 03:45:04 +0000 (20:45 -0700)
joy/parser.py

index 6d3a379..de8a873 100644 (file)
@@ -41,7 +41,7 @@ from .utils.stack import list_to_stack
 
 
 #TODO: explain the details of float lits and strings.
-FLOAT = r'-?\d+\.\d*(e(-|\+)\d+)+'
+FLOAT = r'-?\d+\.\d*(e(-|\+)\d+)?'
 INT = r'-?\d+'
 SYMBOL = r'[•\w!@$%^&*()_+<>?|\/;:`~,.=-]+'
 BRACKETS = r'\[|\]'