diff options
-rw-r--r-- | json.lisp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -6,17 +6,17 @@ (char= x #\+)))))) (natural (one-or-more (unit #'digit-char-p)))) (cons sign natural)))) - (comp ((base (any signed-digits - (fail "Malformed number."))) + (comp ((base (either signed-digits + (fail "Malformed number."))) (dot (zero-or-one (unit (lambda (x) (char= x #\.))))) (fraction (if dot - (any (one-or-more (unit #'digit-char-p)) - (fail "Malformed fractional part.")) - (new nil))) + (either (one-or-more (unit #'digit-char-p)) + (fail "Malformed fractional part.")) + nothing)) (e (zero-or-one (unit (lambda (x) (or (char= x #\e) (char= x #\E)))))) (exponent (if e - (any signed-digits - (fail "Malformed exponent part.")) - (new nil)))) + (either signed-digits + (fail "Malformed exponent part.")) + nothing))) (list 'number base fraction exponent)))) |