aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-03 19:40:01 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-03 19:40:01 -0500
commit1f6aa4cac7af0e00c826d5348b06aed70cbcb3e3 (patch)
treea53f2264f98d329b01278161c7ff32b5c1506593 /environment.c
parentdc04286e3a75d8f94a69c204cb4fbb7b22e2d6a9 (diff)
Add methods for text:clusters(), text:codepoints(), text:bytes()
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/environment.c b/environment.c
index 5dd92beb..78c80c4e 100644
--- a/environment.c
+++ b/environment.c
@@ -147,18 +147,21 @@ env_t *new_compilation_unit(void)
#undef F
#undef C
{"Text", Type(TextType), "Text_t", "Text", $TypedArray(ns_entry_t,
- {"quoted", "Text__quoted", "func(s:Text, color=no)->Text"},
- {"upper", "Text__upper", "func(s:Text)->Text"},
- {"lower", "Text__lower", "func(s:Text)->Text"},
- {"title", "Text__title", "func(s:Text)->Text"},
- // {"has", "Text__has", "func(s:Text, target:Text, where=ANYWHERE)->Bool"},
- // {"without", "Text__without", "func(s:Text, target:Text, where=ANYWHERE)->Text"},
- // {"trimmed", "Text__without", "func(s:Text, skip:Text, where=ANYWHERE)->Text"},
- {"title", "Text__title", "func(s:Text)->Text"},
- // {"find", "Text__find", "func(s:Text, pattern:Text)->FindResult"},
- {"replace", "Text__replace", "func(s:Text, pattern:Text, replacement:Text, limit=Int.max)->Text"},
- {"split", "Text__split", "func(s:Text, split:Text)->[Text]"},
+ {"quoted", "Text__quoted", "func(text:Text, color=no)->Text"},
+ {"upper", "Text__upper", "func(text:Text)->Text"},
+ {"lower", "Text__lower", "func(text:Text)->Text"},
+ {"title", "Text__title", "func(text:Text)->Text"},
+ // {"has", "Text__has", "func(text:Text, target:Text, where=ANYWHERE)->Bool"},
+ // {"without", "Text__without", "func(text:Text, target:Text, where=ANYWHERE)->Text"},
+ // {"trimmed", "Text__without", "func(text:Text, skip:Text, where=ANYWHERE)->Text"},
+ {"title", "Text__title", "func(text:Text)->Text"},
+ // {"find", "Text__find", "func(text:Text, pattern:Text)->FindResult"},
+ {"replace", "Text__replace", "func(text:Text, pattern:Text, replacement:Text, limit=Int.max)->Text"},
+ {"split", "Text__split", "func(text:Text, split:Text)->[Text]"},
{"join", "Text__join", "func(glue:Text, pieces:[Text])->Text"},
+ {"clusters", "Text__clusters", "func(text:Text)->[Text]"},
+ {"codepoints", "Text__codepoints", "func(text:Text)->[Int32]"},
+ {"bytes", "Text__bytes", "func(text:Text)->[Int8]"},
)},
};