Closed sogaiu closed 2 months ago
The table in this section suggests that lenprefix supports an optional tag argument:
lenprefix
(lenprefix n patt ?tag)
However, the current implementation of lenprefix seems to accept only two arguments, e.g.
(peg/match ~(* (lenprefix (/ (* '(any (if-not ":" 1)) ":") ,scan-number) 1 :tag) -1) "3:xyz")
results in:
error: grammar error in (lenprefix (/ (* (quote (any (if-not ":" 1))) ":") <cfunction scan-number>) 1 :tag), expected 2 arguments, got 3 in peg/match [src/core/peg.c] on line 1795 in thunk [repl] (tail call) on line 8, column 1
whereas the following works:
(peg/match ~(* (lenprefix (/ (* '(any (if-not ":" 1)) ":") ,scan-number) 1) -1) "3:xyz") # => @[]
The table in this section suggests that
lenprefix
supports an optional tag argument:However, the current implementation of
lenprefix
seems to accept only two arguments, e.g.results in:
whereas the following works: