diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-25 15:18:03 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-25 15:18:03 -0500 |
| commit | f6b140681d21a6cb631e0ea5733d82a53ef97d25 (patch) | |
| tree | 68d851293d95475ff034417fe93cce671af4c018 /src/stdlib | |
| parent | 5acea7089c82c7449ada88ed60d61797f0303e2a (diff) | |
General cleanup
Diffstat (limited to 'src/stdlib')
| -rw-r--r-- | src/stdlib/text.c | 2 | ||||
| -rw-r--r-- | src/stdlib/text.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/stdlib/text.c b/src/stdlib/text.c index 969c2e51..ce48091a 100644 --- a/src/stdlib/text.c +++ b/src/stdlib/text.c @@ -1113,7 +1113,7 @@ static bool _has_grapheme(TextIter_t *text, int32_t g) { } public -OptionalInt_t Text$find(Text_t text, Text_t target, Int_t start) { +PUREFUNC OptionalInt_t Text$find(Text_t text, Text_t target, Int_t start) { if (text.length < target.length) return NONE_INT; if (target.length <= 0) return I(1); TextIter_t text_state = NEW_TEXT_ITER_STATE(text), target_state = NEW_TEXT_ITER_STATE(target); diff --git a/src/stdlib/text.h b/src/stdlib/text.h index d3ed032b..44b7d736 100644 --- a/src/stdlib/text.h +++ b/src/stdlib/text.h @@ -86,7 +86,7 @@ PUREFUNC bool Text$starts_with(Text_t text, Text_t prefix, Text_t *remainder); PUREFUNC bool Text$ends_with(Text_t text, Text_t suffix, Text_t *remainder); Text_t Text$without_prefix(Text_t text, Text_t prefix); Text_t Text$without_suffix(Text_t text, Text_t suffix); -OptionalInt_t Text$find(Text_t text, Text_t target, Int_t start); +PUREFUNC OptionalInt_t Text$find(Text_t text, Text_t target, Int_t start); Text_t Text$replace(Text_t text, Text_t target, Text_t replacement); Text_t Text$translate(Text_t text, Table_t translations); PUREFUNC bool Text$has(Text_t text, Text_t target); @@ -120,7 +120,7 @@ Text_t Text$layout(Text_t text); void Text$serialize(const void *obj, FILE *out, Table_t *, const TypeInfo_t *); void Text$deserialize(FILE *in, void *out, List_t *, const TypeInfo_t *); -MACROLIKE int32_t Text$get_grapheme(Text_t text, int64_t index) { +MACROLIKE PUREFUNC int32_t Text$get_grapheme(Text_t text, int64_t index) { TextIter_t state = NEW_TEXT_ITER_STATE(text); return Text$get_grapheme_fast(&state, index); } |
