Commit Graph

258 Commits

Author SHA1 Message Date
4720ca7a5f Rename Text.utf8_bytes back to Text.bytes 2024-11-19 13:30:45 -05:00
4231789b71 Rename datetime -> moment 2024-11-17 14:49:03 -05:00
145a078387 Make the compiler stricter about not promoting local value variables to
pointers
2024-11-09 17:26:01 -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
3d9e562e2c Add byte hex tests 2024-11-05 15:34:01 -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
d0ebb66b30 Fix up test to use RNGs 2024-11-03 22:39:46 -05:00
fc9a6f1416 Add RNGs to the language 2024-11-03 22:37:48 -05:00
7ccb7a8a9b Use an RNG parameter for array:random(), array:shuffle(),
array:shuffled()
2024-11-03 16:10:03 -05:00
39a58bc129 Clean up behavior and syntax for unsigned bit shifts (<<<, >>>) 2024-11-03 16:06:26 -05:00
3743913ce2 Add unsigned integer shifts 2024-11-03 15:48:13 -05:00
078b443185 Add a repeat keyword 2024-11-03 12:20:53 -05:00
92a593b80f Support reductions for comparison operators like == and < 2024-11-02 22:34:35 -04:00
0b7a0dd043 Change reducers to use (OP: ...) syntax and return an optional value 2024-11-02 20:22:19 -04: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
074cf22ad4 Change function syntax from func(args)->ret to func(args -> ret) 2024-10-09 13:26:28 -04:00
a3dab7e726 Add a test for mutating closed-over variables in a defer statement 2024-10-09 00:47:42 -04:00
5103fde1c5 Add a test for optionals to ensure they size correctly 2024-10-08 13:39:45 -04:00
6b9055db7c Deprecate readonly pointers for now 2024-10-04 13:21:56 -04:00
ec0606091b Add datetime literal and tests 2024-09-30 13:55:55 -04:00
800e386105 Rename from_unsafe_text to without_escaping 2024-09-24 13:26:49 -04:00
a56ce0435d Support Int(yes/no) 2024-09-24 12:40:56 -04:00
e5f432d4c9 Fix not x for optional values 2024-09-16 16:10:05 -04:00
de49bc5bb3 Deprecate :or_else()/:or_fail()/:or_exit() in favor of the or operator 2024-09-16 16:06:19 -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
6b5a9d65e3 Overhaul of how libraries are installed 2024-09-15 21:18:42 -04:00
8ee23054bf Update Inline C syntax and documentation/tests 2024-09-15 17:34:34 -04:00
835eb7e896 Add optional:or_exit(...) 2024-09-15 16:42:42 -04:00
fb37b0ee42 Fix up if var := ...: in ternary expressions and optional checking
logic
2024-09-15 16:29:45 -04:00
2b454d1408 Fix up file test 2024-09-15 15:53:38 -04:00
e422079fcc Add a Byte datatype 2024-09-15 15:33:47 -04:00
75e0201fad Improve automatic text quoting so it minimizes escape sequences when
possible.
2024-09-15 14:03:16 -04:00
da9cc93c46 Make functions print with func name(...)->... [file:line] info 2024-09-12 23:41:32 -04:00
46a2aa2ffc Fix up comprehensions so set comprehensions work and everything is a bit
more clean
2024-09-12 14:27:13 -04:00
10795782c6 Implement optional hashing/equality/comparisons 2024-09-12 13:17:53 -04:00
43f4f3610e For single-member structs/enums, don't print the member name 2024-09-12 04:09:52 -04:00
05724a659f Change unicode escape to \{name} and add escape for ANSI CSI sequences:
\[...]
2024-09-12 01:43:00 -04:00
327d466b95 Table:get() now uses optional values instead of default or failure modes 2024-09-12 00:55:43 -04:00
fa7e52787f Add postfix ! operator for optionals 2024-09-12 00:13:53 -04:00
c034175ae1 Add optional:or_else(fallback) and optional:or_fail(message) 2024-09-11 23:17:03 -04:00
cfef667a89 Fix optional integer promotion 2024-09-11 23:13:41 -04:00
3443edf760 Use optionals for iterators 2024-09-11 22:28:43 -04:00
3dd8228a3b More tests 2024-09-11 13:46:38 -04:00
02930b84f8 Optionals for threads 2024-09-11 12:56:16 -04:00
908673c9d9 Optional channels (plus fixed some channel bugs) 2024-09-11 12:50:46 -04:00
30d39378c7 Optional C Strings 2024-09-11 12:39:56 -04:00
210179ee67 Optional enums (deprecated custom tag values) 2024-09-11 12:29:48 -04:00
dee3742b48 Optional structs 2024-09-11 12:01:17 -04:00
989dc3f442 Support if x := blah: ... 2024-09-11 01:48:15 -04:00
23209a0aab Use optional ints in the array find()/first() API 2024-09-11 01:39:19 -04:00
7126755275 Add optional types 2024-09-11 01:31:31 -04:00
cc94afcc56 Test nesting parens and escapes 2024-09-09 15:03:51 -04:00
dad567bfc8 Restore path interpolation 2024-09-09 14:37:13 -04:00
900b456a26 Ensure more rigoroous cleanup and validation of paths 2024-09-09 14:35:00 -04:00
e16792d5eb Add Text.starts_with() and Text.ends_with() 2024-09-09 05:31:25 -04:00
0b441054b3 Fix up some path logic 2024-09-09 04:49:02 -04:00
4f2de3568f More tests 2024-09-09 03:52:56 -04:00
a306f94557 Add mktemp functionality 2024-09-09 02:43:15 -04:00
b0d806a1f0 Add unicode name escapes: \U[penguin] 2024-09-07 01:43:36 -04:00
11fa4f548c Support 'when' statements as expressions 2024-09-06 14:15:55 -04:00
b36d4eaf67 Fix test 2024-09-06 12:17:43 -04:00
c789d25878 Text overhaul 2024-09-06 03:29:07 -04:00
44892df4c5 Add Text.trim() 2024-09-06 00:03:28 -04:00
47e8972427 Update 'use' test to include a '../examples/vectors.tm' import as well
as an unnamed import
2024-09-05 15:49:18 -04:00
34d98f067e For big or arbitrarily big integers not known to be constant, do full
Int$plus(a,b) logic so it's definitely correct and doesn't error.
2024-09-05 12:41:13 -04:00
d801681026 Add early outs for (or) and (and) reducers 2024-09-05 11:51:07 -04:00
73df39ff7e Fix stability of concatenation 2024-09-05 03:47:15 -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
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
91c5dc61c1 Change pattern syntax from [..pat] to {pat} 2024-09-03 14:27:09 -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
5f0b099e14 Better behavior for invalid character names 2024-09-03 01:32:00 -04:00
b517f3b287 Fix codepoint names by falling back to block names 2024-09-03 01:30:07 -04:00
e98e77e1d3 Fix for missing codepoint names 2024-09-03 01:20:36 -04:00
5441e6f287 Update docs 2024-09-03 00:54:48 -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
9d2e9c02fe Fix splitting an empty string 2024-09-02 23:24:16 -04:00
6e4be93848 Add Text:join() and tests 2024-09-02 23:13:02 -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
5c093e6a4a Improve test 2024-09-02 22:42:02 -04:00
708acda54e WIP fixes for synthetic graphemes and adding some text conversion
methods
2024-09-02 22:30:19 -04:00
96f276ec18 Fix test 2024-09-02 21:19:57 -04:00
cac560fdc3 Text fixes 2024-09-02 21:18:15 -04:00
620ebeab8d Fixing string methods 2024-09-02 20:22:13 -04:00
a4454df4b9 Bugfix int parsing 2024-09-02 19:23:35 -04:00
ad51b208b4 Overhaul of import syntax. Now everything uses use: use foo, `use
./foo.tm`, `use <foo.h>`, `use libfoo.so`
2024-08-22 14:02:48 -04:00
3c4f477b84 Bugfix some copy-on-write cases for when pointers are automatically
derefenced for method calls
2024-08-20 16:20:41 -04:00