From 112f9dd2a59663b93fd5c4c960f2104e9c2b9418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Thu, 3 Nov 2022 03:26:04 -0300 Subject: Add a whitespace parser This one just ignores the consumed input. --- json.lisp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'json.lisp') 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)) -- cgit v1.2.3