summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:26:04 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:26:04 -0300
commit112f9dd2a59663b93fd5c4c960f2104e9c2b9418 (patch)
tree38e3cd8e2c8c8d31974e9d655a457e709465d6b1
parent550204b6840d2986b1707a16d0a77c0e69d5d5b3 (diff)
downloadjson-112f9dd2a59663b93fd5c4c960f2104e9c2b9418.tar.gz
json-112f9dd2a59663b93fd5c4c960f2104e9c2b9418.zip
Add a whitespace parser
This one just ignores the consumed input.
-rw-r--r--json.lisp6
1 files changed, 6 insertions, 0 deletions
diff --git a/json.lisp b/json.lisp
index 5f570d5..9c17bc8 100644
--- a/json.lisp
+++ b/json.lisp
@@ -48,3 +48,9 @@
(unit (lambda (x) (char/= x #\"))))))
(end (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)))))))
+ nil))