summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:36:58 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:36:58 -0300
commitcd21f6d9873f77b808ee55feca8062abe909532e (patch)
tree5f4d516795a9366c37a5a0b898754d492ad0744a
parent112f9dd2a59663b93fd5c4c960f2104e9c2b9418 (diff)
downloadjson-cd21f6d9873f77b808ee55feca8062abe909532e.tar.gz
json-cd21f6d9873f77b808ee55feca8062abe909532e.zip
Adapt to using empty values in comp
Also changed some names to make them more parser-y.
-rw-r--r--json.lisp16
1 files changed, 8 insertions, 8 deletions
diff --git a/json.lisp b/json.lisp
index 9c17bc8..94f04ee 100644
--- a/json.lisp
+++ b/json.lisp
@@ -1,6 +1,6 @@
(in-package #:json)
-(defparameter number-parser
+(defparameter number-literal
(let ((signed-digits
(comp ((sign (zero-or-one (unit (lambda (x) (or (char= x #\-)
(char= x #\+))))))
@@ -21,8 +21,8 @@
nothing)))
(list 'number base fraction exponent))))
-(defparameter string-parser
- (comp ((start (unit (lambda (x) (char= x #\"))))
+(defparameter string-literal
+ (comp ((_ (unit (lambda (x) (char= x #\"))))
(chars (zero-or-more (either (comp ((slash (unit (lambda (x) (char= x #\\))))
(escaped (unit))
(codepoints (if (and escaped (char= escaped #\u))
@@ -46,11 +46,11 @@
codepoints)
(t escaped)))
(unit (lambda (x) (char/= x #\"))))))
- (end (unit (lambda (x) (char= x #\")))))
+ (_ (unit (lambda (x) (char= x #\")))))
(list 'string chars)))
-(defparameter whitespace-parser
- (comp ((whitespace (zero-or-more (unit (lambda (x) (or (char= x #\Space)
- (char= x #\Newline)
- (char= x #\Tab)))))))
+(defparameter whitespace
+ (comp ((_ (zero-or-more (unit (lambda (x) (or (char= x #\Space)
+ (char= x #\Newline)
+ (char= x #\Tab)))))))
nil))