Skip to content

Commit 26243d5

Browse files
committed
fix(parser): read_edn returns first form, matching cljs read-string
Upstream cljs tools.reader/read-string and cljs.reader/read-string both return the first parsed form and ignore trailing input; the strict EOF check rejected inputs cljs accepts (e.g. quote-wrapped query strings truncated by inner quotes).
1 parent 9b1108c commit 26243d5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎impl/parser.ml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ let read_edn input =
295295
Buffer.add_char buffer char;
296296
parse_string (index + 1) buffer
297297
in
298-
let form, index = parse_form 0 in
299-
if skip index <> length then invalid_arg "trailing EDN input";
300-
form
298+
(* cljs tools.reader/read-string semantics: parse the first form and
299+
ignore trailing input — upstream never checks EOF. *)
300+
fst (parse_form 0)
301301

302302
let rec query_value_of_form = function
303303
| QueryFormNil -> Nil

0 commit comments

Comments
 (0)