From d5e22852fe180de1feda1d340ad30a15d6b99043 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 20 Dec 2023 07:28:05 -0800 Subject: 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. --- tests/010/json.tl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/010/json.tl') 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)) -- cgit v1.2.3