summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-12-20 07:28:05 -0800
committerKaz Kylheku <kaz@kylheku.com>2023-12-20 07:28:05 -0800
commitd5e22852fe180de1feda1d340ad30a15d6b99043 (patch)
treed4fc37c863f8d8be92984617b8035db8f67cbdbb /tests
parent8c68a36a88ec6fd056307b2eb13a3e8ab6eb0c42 (diff)
downloadtxr-d5e22852fe180de1feda1d340ad30a15d6b99043.tar.gz
txr-d5e22852fe180de1feda1d340ad30a15d6b99043.tar.bz2
txr-d5e22852fe180de1feda1d340ad30a15d6b99043.zip
json: support Lisp comments.
I've run into situations in which I wanted a comment in a big JSON quasiliteral to explain some embedded piece of code. We support only semicolon comments, and no #; ignore notation. * parser.l (grammar): Recognize Lisp comments in the JSON state also. That does it. * tests/010/json.tl: One modest little test. * txr.1: Documented. * lex.yy.c.shipped: Regenerated.
Diffstat (limited to 'tests')
-rw-r--r--tests/010/json.tl3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/010/json.tl b/tests/010/json.tl
index f613c93a..d419295f 100644
--- a/tests/010/json.tl
+++ b/tests/010/json.tl
@@ -189,3 +189,6 @@
(tojson 1) "1"
(tojson 123123123123123123123123123123) "123123123123123123123123123123"
(tojson '(1 2 3 4 5)) "[1,2,3,4,5]")
+
+(test
+ (get-json "[1, 2, ; foo\n 3]") #(1.0 2.0 3.0))