From 1f6aa4cac7af0e00c826d5348b06aed70cbcb3e3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 3 Mar 2024 19:40:01 -0500 Subject: Add methods for text:clusters(), text:codepoints(), text:bytes() --- environment.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'environment.c') 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]"}, )}, }; -- cgit v1.2.3