From 23da3203aa908b1a6f24177d55fabf72c95d0331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 1 May 2023 23:09:58 -0300 Subject: Adapt to changes in Monparser --- load.lisp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/load.lisp b/load.lisp index a58e4a2..3158c18 100644 --- a/load.lisp +++ b/load.lisp @@ -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))) -- cgit v1.2.3