diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-05 18:20:54 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-05 18:20:54 -0500 |
| commit | 147e0f0269440fce15d6b88a8a90627f3a3b2df2 (patch) | |
| tree | bc33522ba71b5a2996fae22e102cce5046cf1333 /stdlib/patterns.c | |
| parent | 2c4324670ff569ede360d13875c5e4b5720a626d (diff) | |
Overhaul of constructors, making it more consistent and correct. Also
changed T(), T, T_t, T_s type names to T(), T$$info, T$$type, T$$struct
for unambiguity
Diffstat (limited to 'stdlib/patterns.c')
| -rw-r--r-- | stdlib/patterns.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stdlib/patterns.c b/stdlib/patterns.c index ad6267f0..7d6ccd37 100644 --- a/stdlib/patterns.c +++ b/stdlib/patterns.c @@ -807,7 +807,7 @@ static int64_t _find(Text_t text, Pattern_t pattern, int64_t first, int64_t last public OptionalMatch_t Text$find(Text_t text, Pattern_t pattern, Int_t from_index) { - int64_t first = Int_to_Int64(from_index, false); + int64_t first = Int64$from_int(from_index, false); if (first == 0) fail("Invalid index: 0"); if (first < 0) first = text.length + first + 1; if (first > text.length || first < 1) @@ -874,7 +874,7 @@ public Array_t Text$find_all(Text_t text, Pattern_t pattern) OptionalMatch_t m = Text$find(text, pattern, I(i)); if (!m.index.small) break; - i = Int_to_Int64(m.index, false) + m.text.length; + i = Int64$from_int(m.index, false) + m.text.length; Array$insert(&matches, &m, I_small(0), sizeof(Match_t)); } return matches; @@ -888,7 +888,7 @@ typedef struct { static OptionalMatch_t next_match(match_iter_state_t *state) { - if (Int_to_Int64(state->i, false) > state->state.stack[0].text.length) + if (Int64$from_int(state->i, false) > state->state.stack[0].text.length) return NONE_MATCH; OptionalMatch_t m = Text$find(state->state.stack[0].text, state->pattern, state->i); |
