Commit Graph

236 Commits

Author SHA1 Message Date
0e10313d64 Switch NaN to be identical to the null value 2024-11-24 16:13:23 -05:00
4720ca7a5f Rename Text.utf8_bytes back to Text.bytes 2024-11-19 13:30:45 -05:00
ccada385c4 Add Text.at(i) for getting a single cluster 2024-11-19 13:27:27 -05:00
4231789b71 Rename datetime -> moment 2024-11-17 14:49:03 -05:00
0df908f55f Support iterating over pointers to collections again 2024-11-09 17:54:32 -05:00
06d3ec1380 Bugfix for fixed-size integer ranges 2024-11-09 16:55:44 -05:00
898bee1581 Introduce a Match struct to represent pattern matching results, which
improves the usability of a lot of the APIs. Also bugfix some issues
with ranges.
2024-11-09 16:27:54 -05:00
7a4f2e73ad Rename from_text() to parse() 2024-11-09 15:11:11 -05:00
a8a35ea688 Add Byte.hex() 2024-11-05 15:33:08 -05:00
b8d7eabc02 Deprecate bit-width integer/num literals in favor of using type
constructors
2024-11-05 15:18:32 -05:00
aabc0a3cff Update text API to use optional returns when applicable 2024-11-04 01:17:47 -05:00
81a180eda0 RNG seed should be non-optional 2024-11-03 22:45:49 -05:00
fc9a6f1416 Add RNGs to the language 2024-11-03 22:37:48 -05:00
52e3d3fe6f Update Path:read_bytes() API to take a byte count 2024-11-03 16:58:12 -05:00
39a58bc129 Clean up behavior and syntax for unsigned bit shifts (<<<, >>>) 2024-11-03 16:06:26 -05:00
792743dff3 Add Int64:unsigned_left_shift() and :unsigned_right_shift() 2024-11-03 15:27:44 -05:00
87176ead2d Add wrapping plus/minus for fixed-size integers 2024-11-03 15:04:28 -05:00
be2673ef2b Make Text:find() return an optional int 2024-11-02 13:51:58 -04:00
7cd67dd7f3 Add file globbing 2024-10-29 14:36:49 -04:00
052316261a Finish deprecating stack refs with & 2024-10-27 20:35:30 -04:00
0d615443dc Update DateTime API to have separate methods for getting each component
instead of get(...)
2024-10-27 18:41:00 -04:00
67702b2d77 Fix issue with non-ID chars in filenames 2024-10-10 01:09:17 -04:00
074cf22ad4 Change function syntax from func(args)->ret to func(args -> ret) 2024-10-09 13:26:28 -04:00
a25699282d Tidy up some function annotations to use func(x,y:Foo) syntax instead of
func(x:Foo,y:Foo)
2024-10-09 02:22:32 -04:00
1a6ce0047b Rename TypeInfo -> TypeInfo_t and fix up some typeinfo code 2024-09-30 14:39:30 -04:00
793717729a Parameterize with timezones 2024-09-30 01:53:39 -04:00
d714519809 Fix some timezone issues 2024-09-29 23:09:37 -04:00
05515d8645 Add DateTime 2024-09-29 20:06:09 -04:00
9b15799e73 Support iterating over thunks that always return non-null values (useful
for infinite loops)
2024-09-27 14:45:06 -04:00
ed8b8901c0 Add '$' prefix on all user code 2024-09-24 14:54:22 -04:00
800e386105 Rename from_unsafe_text to without_escaping 2024-09-24 13:26:49 -04:00
89c427172a Support creating parent directories as needed (mkdir -p) and also set a
better default permission for new dirs
2024-09-23 14:53:44 -04:00
b432fc82c7 Add shell escaping for arrays of text 2024-09-23 14:36:20 -04:00
708e7b9070 Remove dead code 2024-09-18 01:02:13 -04:00
aaa51fc734 Perform topological ordering when compiling typedefs so users don't need
to think about ordering their definitions.
2024-09-17 15:17:13 -04:00
9703ca45f0 Update Shell API to have byte-based mode and by_line() just like files 2024-09-16 17:02:20 -04:00
6d0f04375d Have Text:matches() return an optional array of matches 2024-09-16 15:12:54 -04:00
3cbacbd675 Add some basic pattern matching/suffix code for paths 2024-09-16 14:04:51 -04:00
835eb7e896 Add optional:or_exit(...) 2024-09-15 16:42:42 -04:00
33876323aa Update path reading APIs to use optional values instead of erroring 2024-09-15 15:50:28 -04:00
e422079fcc Add a Byte datatype 2024-09-15 15:33:47 -04:00
2b05560849 Fix Path:by_line() iterator 2024-09-14 00:09:18 -04:00
c455e7b67d Rename builtins/ -> stdlib/ 2024-09-13 20:18:08 -04:00
4380039acc Rename builtins to use plurals when appropriate 2024-09-13 20:08:20 -04:00
51c346bbc5 Code cleanup 2024-09-13 19:59:28 -04:00
34c562e88e Move cord helper functions into their own file 2024-09-13 14:23:24 -04:00
fb6dc0a8b9 Fix up CString:as_text() 2024-09-12 03:41:44 -04:00
fc98d05ef9 Add sleep() 2024-09-12 03:20:17 -04:00
d4d803fa15 Make sure global types don't get library's prefix 2024-09-12 02:24:55 -04:00
bd111dbe2e Automatically interpolate ints for pattern/shell/path 2024-09-12 01:24:26 -04:00
3443edf760 Use optionals for iterators 2024-09-11 22:28:43 -04:00
db0d5a1c20 Change *:from_text() methods to return optional values and set up CLI
parsing to use that approach
2024-09-11 14:53:48 -04:00
7126755275 Add optional types 2024-09-11 01:31:31 -04:00
d356309023 Add (/path):by_line() 2024-09-09 22:16:40 -04:00
3657257330 Improve tool 2024-09-09 17:04:46 -04:00
23de8e1f5a Fix up some stuff with path escaping 2024-09-09 16:54:08 -04:00
0bc207266e Add Path.from_unsafe_text() etc 2024-09-09 16:09:21 -04:00
e61096d6eb Fix up ini example 2024-09-09 15:02:47 -04:00
dad567bfc8 Restore path interpolation 2024-09-09 14:37:13 -04:00
e16792d5eb Add Text.starts_with() and Text.ends_with() 2024-09-09 05:31:25 -04:00
6f174aa85d Fix some logic for extensions and base names 2024-09-09 04:19:31 -04:00
3081da3dd0 Add Path.base_name(), Path.parent(), Path.extension() 2024-09-09 03:51:35 -04:00
a306f94557 Add mktemp functionality 2024-09-09 02:43:15 -04:00
1fbe2cb5dd For parsing paths, use nested parens: (./foo), also add some methods 2024-09-09 02:02:08 -04:00
6752c60f32 More methods 2024-09-09 01:48:37 -04:00
11c560ebcc More path stuff including some methods 2024-09-09 01:14:33 -04:00
13a9304dec Initial working version 2024-09-09 00:22:12 -04:00
a4fff5cb49 Bugfix for default arguments not supporting enclosing types 2024-09-08 21:55:15 -04:00
aeed1992e9 Fix nearly every GCC warning and add __attribute__((pure/const)) where
appropriate
2024-09-08 17:17:15 -04:00
cf7ea6fbef Add exit() function 2024-09-07 00:44:47 -04:00
594d1a627f Fix some C string and path resolving issues 2024-09-06 15:39:00 -04:00
176205a22d Print stack trace if $TOMO_STACKTRACE is set 2024-09-06 14:41:34 -04:00
4b352f89a3 Add Shell dsl type 2024-09-06 11:37:33 -04:00
44892df4c5 Add Text.trim() 2024-09-06 00:03:28 -04:00
04c8fb0362 Replace $Type with Type$info for builtin TypeInfos 2024-09-05 15:31:54 -04:00
391c1b6bde Rename table_t -> Table_t 2024-09-05 14:57:31 -04:00
abe45a3c25 Rename array_t -> Array_t 2024-09-05 14:56:37 -04:00
3a556296b6 Add Text:repeat() 2024-09-04 21:22:03 -04:00
00543b4e87 Add Text.map(pat, fn) 2024-09-04 21:02:37 -04:00
3513b94fc7 Unify parsing code to correctly handle parsing integers and numbers with
a &success boolean. Check for overflow as well.
2024-09-04 16:08:34 -04:00
05bc754679 Add ask() as a way to get user input 2024-09-04 14:55:00 -04:00
1092185c84 Improve codegen by making test() even more concise 2024-09-04 05:01:21 -04:00
df844946f7 Add Text:matches() for convenience and performance 2024-09-04 00:34:27 -04:00
b8bb4ada8b Add recursive mode to text replacement and update docs 2024-09-03 23:16:45 -04:00
850fc8fbe1 Clean up text replacement API to use backrefs instead of match_chain() 2024-09-03 22:56:53 -04:00
c14ed3e3e7 Add Text.replace_all({Pattern:Text}) and tweak API for replacement to
support placeholders
2024-09-03 20:48:11 -04:00
3c2c1a308b Bugifx for Pattern.from_unsafe_text 2024-09-03 15:27:13 -04:00
6622fb8089 Bugfix for text method lookups 2024-09-03 15:25:33 -04:00
64143f0a13 Syntax overhaul (comments back to #, print statments to !!),
using `$/.../` for patterns and using a DSL for patterns
2024-09-03 13:19:41 -04:00
5feecff9d9 Deprecate Where and change channel API to use a boolean front value 2024-09-03 03:53:36 -04:00
6c22999ede Add text slicing 2024-09-02 23:56:08 -04:00
5aa5a5e99b Fix some stuff around Text:find() and text indexing 2024-09-02 23:47:16 -04:00
5d6fa135b1 Add Text:find_all() 2024-09-02 23:26:55 -04:00
6d7e09bf18 Add Text:split() and use that with an empty pattern instead of Text:clusters() 2024-09-02 23:07:08 -04:00
9214e621bf Add Text:lines() 2024-09-02 22:57:49 -04:00
708acda54e WIP fixes for synthetic graphemes and adding some text conversion
methods
2024-09-02 22:30:19 -04:00
620ebeab8d Fixing string methods 2024-09-02 20:22:13 -04:00
337aa911a9 Auto promote to C String from Text 2024-09-02 19:53:09 -04:00
6d7a359f8f Bugfix some text replacement things 2024-09-02 19:49:52 -04:00
a197875214 Bugfix for say() when length is >512, and added back the newline
optional parameter (default=yes)
2024-08-23 12:42:10 -04:00