Christoffer Lerno
a1bce81ed0
Fix growable bitset ( #1032 )
2023-10-06 01:27:32 +02:00
Christoffer Lerno
49c4595457
Dynamic protocols.
2023-10-05 15:20:41 +02:00
Pierre Curto
d61482dffc
fix Object.free ( #982 )
...
* lib/std/collections: add HashMap.@each_entry()
* lib/std/json: fix Object.free() when object is a map
* lib/std/collections: fix allocator use in Object.{set,set_at,append}
* lib/std: add char.from_hex
* lib/std/collections: print arrays and objects compactly
* lib/std/io: fix Formatter.vprintf result
* lib/std/io/stream: rename module for ByteBuffer
* lib/std/io/stream: make Scanner a Stream reader
* lib/std/io: make std{in,err,out} return File* if no libc
2023-09-12 13:49:52 +02:00
Pierre Curto
51f76c69c4
lib/std/collections: add Bitset
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-06 23:09:37 +02:00
Pierre Curto
e56313a204
use slice assign and add List.*using_test functions ( #967 )
...
* std/collections: use slice assignment
* std/collections: add List.remove_using_test and List.retain_using_test
2023-09-01 12:16:15 +02:00
Christoffer Lerno
70b9e811bd
Update of enummap.
2023-09-01 11:19:20 +02:00
Christoffer Lerno
0142e5fd33
Removed the need for lambda in remove_if, removed potential implementation specific behaviour.
2023-08-31 23:39:00 +02:00
Pierre Curto
cd950a0359
lib/std/collections: fix comments, List.remove_if() and List.retain_if() methods
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-31 23:20:50 +02:00
Christoffer Lerno
6ebb3caa20
Fix issue where type wasn't canonical. Addresses #957
2023-08-27 19:04:34 +02:00
Pierre Curto
c09b6154f4
std/lib/collections: add Object.get_len(); add some tests for encoding/json
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Pierre Curto
120d5a672c
std/collections: Object.get* return an error if requested type if invalid
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Pierre Curto
eedb2c3c52
std/collections: add RingBuffer.popc()
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-26 13:24:23 +02:00
Pierre Curto
c0b109fbc1
#934 followup
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-24 18:10:18 +02:00
Pierre Curto
6c3d6a4b05
std/lib: fix module path for RingBuffer
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-15 15:58:28 +02:00
Pierre Curto
65bea1cb2d
add ThreadPool ( #926 )
...
* lib/std/collections: fix tab indentation
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/threads: add ThreadPool
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* ats/lib/threads: add num_cpu()
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-14 15:33:51 +02:00
Pierre Curto
c060569599
add tests for Mutex ( #925 )
...
* std/lib: add tests for Mutex
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/collections: add missing import
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* std/collections: add RingBuffer
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-13 17:39:09 +02:00
Christoffer Lerno
3e765a3f3e
Hash maps now copy keys if keys are copyable.
2023-08-10 21:14:24 +02:00
Pierre Curto
9b1c75d061
std/lib: simplify String.{,r}index_of and improve speed for the index… ( #907 )
...
* std/lib: simplify String.{,r}index_of and improve speed for the index_of one
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/collections: add EnumMap.get_ref
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-02 11:43:58 +02:00
Christoffer Lerno
ada3ea08fc
Some initial parse output. Enforce handling of optionals. Fix issue where constants were folded despite the fact that they shouldn't be. Fix bug related to return foo() where foo() returns void!. ( #893 )
2023-07-27 22:58:41 +02:00
Christoffer Lerno
499c82b089
Updated indentation to C3 standard.
2023-07-26 14:01:24 +02:00
Christoffer Lerno
9e477056ed
Fixes to $defined implementation.
2023-07-23 23:55:38 +02:00
Christoffer Lerno
c4f8d5f25e
Update range.
2023-07-19 21:56:52 +02:00
Dmitry Atamanov
7fbedae604
Add has function to Range and ExclusiveRange.
2023-07-19 21:45:14 +02:00
Pierre Curto
b453186de5
lib/std/collections: add init and tinit methods to PriorityQueue
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-19 21:44:20 +02:00
Pierre Curto
491c5ceec5
support for List in quicksort; add HashMap.@each ( #861 )
...
* compiler: fix typo in error message about failed name resolution
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/sort: add List support to quicksort
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/collections: add HashMap.@each
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-18 12:18:12 +02:00
Pierre Curto
fd5336c56e
lib/std/io/stream: add LimitReader ( #858 )
...
* lib/std/io/stream: add LimitReader
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std: more method conversions to use new receiver notation
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-17 20:22:29 +02:00
Pierre Curto
35bffdadc2
improve the sort and collections libs ( #853 )
...
* lib/std/sort: unify binarysearch and binarysearch_with; add comments to quicksort
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/collections: mark List.{len, is_empty, get} with @inline
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/collections: add PriorityQueueMax; add tests for PriorityQueue and PriorityQueueMax
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-15 19:08:54 +02:00
Pierre Curto
7dc1eab185
std/lib/collections: make List support the []= operator ( #831 )
...
* std/lib/collections: make List support the []= operator
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* std/lib/io: rename receiver to self
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-07 13:51:44 +02:00
Christoffer Lerno
4f7b42cdc4
New generic syntax and ad hoc invocation.
2023-07-06 23:43:36 +02:00
Christoffer Lerno
848a5212ef
Fixes #811 . Update some stdlib methods. Header printout correctly picks a name. #804
2023-07-03 13:17:43 +02:00
Christoffer Lerno
50784d4df6
Updated to use the new implicit type for method calls in some libraries. Made the grammar a little more liberal.
2023-07-02 10:55:25 +02:00
Christoffer Lerno
21d8a8b6da
Fix #809 missing checks on generic types, accepting both types where constants should be and vice versa.
2023-07-01 23:58:00 +02:00
Christoffer Lerno
70ea6ce04b
Fix #806 , and also makes sure that things like FOO.x.a is a compile time value.
2023-07-01 16:29:17 +02:00
Christoffer Lerno
685be0981f
Fix priorityqueue.
2023-06-26 17:43:03 +02:00
Christoffer Lerno
fc054dad81
Added some to_string.
2023-06-26 16:21:07 +02:00
Christoffer Lerno
83f8bbb91b
Update range to have exclusive and inclusive range.
2023-06-26 10:18:09 +02:00
Christoffer Lerno
8c73a450a1
Reduce memory consumtion. Add "range"
2023-06-25 21:39:53 +02:00
Christoffer Lerno
4c1edfb941
Dev ( #777 )
...
* The new @if directive.
2023-06-10 23:16:28 +02:00
Christoffer Lerno
8eaad81800
Dead strip by default. Add list to_string. Fix missing check for dynamic calls.
2023-06-05 14:54:17 +02:00
Christoffer Lerno
b794c893d6
Dynamic dispatch.
2023-05-25 22:28:45 +02:00
Christoffer Lerno
ddd0497922
Better lowering of distinct types. Noreturn function call expr recognized as a "jump" for escape analysis. Preferring "def" in libs. To upper / to lower for ascii. Initial dynlib support.
2023-05-21 21:41:01 +02:00
Christoffer Lerno
021bcdcf21
Add "is_initialized" to check if a map has been initialized.
2023-05-10 13:12:31 +02:00
Christoffer Lerno
172d561f07
Change syntax of $if, $assert, $include, $echo. Introduces $error
2023-05-06 12:18:00 +02:00
Christoffer Lerno
3dd6675e1b
Fixed const vector codegen. Missing math comparisons.
2023-05-06 02:29:26 +02:00
Christoffer Lerno
e8642d6797
Fixes to access grammar. "delete" => "remove"
2023-04-24 09:10:35 +02:00
Christoffer Lerno
8059dc1539
delete_if, retain_if, rindex_of, compact, compact_count added to List.
2023-04-21 14:45:25 +02:00
Christoffer Lerno
809321e20c
Updated grammar. Removal of elif. Removal of ':' ';' in some ct statements. Empty faults is now an error. Remove "define" for types. Remove "private". Better errors on incorrect bitstruct syntax. Introduction of wildcard type rather than optional wildcard. Removal of scaled vector type. mkdir and rmdir. Disallow define @Foo() = { @inline }. Add handling for @optreturn and change it to @return!. Restrict interface style functions. Updated x64 ABI. stdlib updates to string. Removed deprecated functions. Update how variadics are implemented. Extended error messages. x86 ABI fixes. Shift check fixes. '!' and '?' are flipped. No trailing ',' allowed in functions. Fix to string parsing. Allow l suffix. Simplifying flatpath. any replaces variant, anyfault replaces anyerr. Allow getting the underlying type of anyfault. De-duplicate string constants. Fix of readme. Extended list. Fix of "(MyEnum)x + 1". Clock and DateTime types. Fixes to array concat.
2023-04-21 10:56:39 +02:00
Christoffer Lerno
9c145996b0
$elif deprecated.
2023-03-20 16:54:45 +01:00
Christoffer Lerno
5ee0d52ff1
Deprecate :; in $if etc.
2023-03-20 01:03:54 +01:00
Christoffer Lerno
8b0df0ee11
try? / catch?
2023-03-17 22:49:48 +01:00