diff options
Diffstat (limited to 'json.lisp')
-rw-r--r-- | json.lisp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -12,7 +12,10 @@ (defparameter number-literal (let ((signed-digits (comp ((sign (zero-or-one (some-char #\- #\+))) - (natural (one-or-more (unit #'digit-char-p)))) + (natural (if sign + (either (one-or-more (unit #'digit-char-p)) + (fail "Malformed number.")) + (one-or-more (unit #'digit-char-p))))) (cons sign natural)))) (comp ((base signed-digits) (dot (zero-or-one (the-char #\.))) |