61#ifndef PCRE2_CODE_UNIT_WIDTH
62#define PCRE2_CODE_UNIT_WIDTH 8
69 if (
flags & 2)
opt |= PCRE2_MULTILINE;
72 if (
flags & 16)
opt |= PCRE2_EXTENDED;
80 pcre2_match_data *
mdata = pcre2_match_data_create_from_pattern(
re, NULL);
90 PCRE2_SIZE *
ov = pcre2_get_ovector_pointer(
mdata);
102 for (
int i = 1; i <
rc; ++i) {
103 int s = (int)
ov[2 * i];
104 int e = (int)
ov[2 * i + 1];
107 if (gstr)
free(gstr);
int map_set(Value *vm, const char *key, Value v)
Insert or replace a key in the map.
Value make_map_empty(void)
Construct a new empty map Value.
pcre2_match_data_free(mdata)
char * string_substr(const char *s, int start, int len)
Create a newly allocated substring of s.
Tagged union representing a Fun value.
Value make_nil(void)
Construct a nil Value.
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
char * value_to_string_alloc(const Value *v)
Allocate a printable C string for a Value.
int array_push(Value *v, Value newElem)
Append a Value to an array.
Value make_int(int64_t v)
Construct a Value representing a 64-bit integer.
Value make_array_from_values(const Value *vals, int count)
Create an array Value by copying items from an input span.
static Value pop_value(VM *vm)
Pop a Value from the VM operand stack.