1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-18 08:15:13 +00:00

peg replacement functions have access to captures

When peg/replace or peg/replace-all are given a function to serve as the text
replacement, any captures produced by the PEG are passed as additional
arguments to that function.
This commit is contained in:
Ian Henry
2023-04-23 09:09:14 -07:00
parent 485099fd6e
commit 9dc7e8ed3a
5 changed files with 56 additions and 21 deletions

View File

@@ -93,7 +93,11 @@ void janet_buffer_format(
Janet *argv);
Janet janet_next_impl(Janet ds, Janet key, int is_interpreter);
JanetBinding janet_binding_from_entry(Janet entry);
JanetByteView janet_text_substitution(Janet *subst, const uint8_t *bytes, uint32_t len);
JanetByteView janet_text_substitution(
Janet *subst,
const uint8_t *bytes,
uint32_t len,
JanetArray *extra_args);
/* Registry functions */
void janet_registry_put(