diff options
-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))) |