summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2022-12-17 15:29:12 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2022-12-17 15:30:09 -0300
commit6b8e45d89b22ed51751dc976068a0e0350edff4d (patch)
tree37a23c6a5fce270c9910985fdf4ee3264b4e1904
parentf3cc5d4cc7e722e44fe92e63a66983dfb012395c (diff)
downloadmonparser-6b8e45d89b22ed51751dc976068a0e0350edff4d.tar.gz
monparser-6b8e45d89b22ed51751dc976068a0e0350edff4d.zip
Add whitespace parser
-rw-r--r--package.lisp3
-rw-r--r--parser.lisp4
2 files changed, 6 insertions, 1 deletions
diff --git a/package.lisp b/package.lisp
index 50ce3df..6e868f9 100644
--- a/package.lisp
+++ b/package.lisp
@@ -19,4 +19,5 @@
#:nothing
#:optional
#:many
- #:separated-list))
+ #:separated-list
+ #:whitespace))
diff --git a/parser.lisp b/parser.lisp
index 55ded57..7567b1f 100644
--- a/parser.lisp
+++ b/parser.lisp
@@ -134,3 +134,7 @@
(if include-separator
(cons v (cons sep vn))
(cons v vn))))
+
+(defparameter whitespace
+ (comp ((_ (optional (many (unit-if (lambda (x) (or (char= x #\Space) (char= x #\Newline) (char= x #\Tab))))))))
+ nil))