diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2023-05-01 23:09:58 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2023-05-01 23:09:58 -0300 |
commit | 23da3203aa908b1a6f24177d55fabf72c95d0331 (patch) | |
tree | 443b07046f4d55b8e5bb04dcc7c5015b826d9e2c | |
parent | ce4838b58104b589894081b6c5cbd52554cf87a7 (diff) | |
download | json-23da3203aa908b1a6f24177d55fabf72c95d0331.tar.gz json-23da3203aa908b1a6f24177d55fabf72c95d0331.zip |
Adapt to changes in Monparser
-rw-r--r-- | load.lisp | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,9 @@ (in-package #:json) +(defparameter whitespace + (comp ((_ (optional (many (unit-if #'char:whitespace?))))) + nil)) + (defparameter number-literal (let ((signed-digits (comp ((sign (optional (one-of (unit #\-) @@ -113,8 +117,14 @@ (_ whitespace)) v)) +(defun run (input) + (let ((result (funcall json-value input))) + (if (parsing-p result) + (parsing-tree result) + result))) + (defun from-string (str) - (run json-value (input:from-string str))) + (run (input:from-string str))) (defun from-file (file) - (run json-value (input:from-file file))) + (run (input:from-file file))) |