aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-19 13:50:35 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-19 13:50:35 -0500
commitb0faa5adc2c5f56ae50cf21f855fa6805db926cf (patch)
treef79e21230108b45843c0bf21c32b08d814802917 /environment.c
parent1db70d46c62c9478ea84ccff204fb315136e518c (diff)
Add Text:from()/to() and Array:slice() for symmetry
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index af4c8530..1af173b8 100644
--- a/environment.c
+++ b/environment.c
@@ -399,6 +399,7 @@ env_t *new_compilation_unit(CORD libname)
{"each", "Text$each", "func(text:Text, pattern:Pattern, fn:func(match:Match))"},
{"find", "Text$find", "func(text:Text, pattern:Pattern, start=1 -> Match?)"},
{"find_all", "Text$find_all", "func(text:Text, pattern:Pattern -> [Match])"},
+ {"from", "Text$from", "func(text:Text, first:Int -> Text)"},
{"from_bytes", "Text$from_bytes", "func(bytes:[Byte] -> Text?)"},
{"from_c_string", "Text$from_str", "func(str:CString -> Text?)"},
{"from_codepoint_names", "Text$from_codepoint_names", "func(codepoint_names:[Text] -> Text?)"},
@@ -418,6 +419,7 @@ env_t *new_compilation_unit(CORD libname)
{"split", "Text$split", "func(text:Text, pattern=$Pattern'' -> [Text])"},
{"starts_with", "Text$starts_with", "func(text,prefix:Text -> Bool)"},
{"title", "Text$title", "func(text:Text -> Text)"},
+ {"to", "Text$to", "func(text:Text, last:Int -> Text)"},
{"trim", "Text$trim", "func(text:Text, pattern=$/{whitespace}/, trim_left=yes, trim_right=yes -> Text)"},
{"upper", "Text$upper", "func(text:Text -> Text)"},
{"utf32_codepoints", "Text$utf32_codepoints", "func(text:Text -> [Int32])"},