Christoffer Lerno
168c11e006
{| |} expression blocks deprecated.
2025-02-18 12:50:34 +01:00
Christoffer Lerno
e1d546225f
Update stdlib with new syntax for short function decl.
2025-02-08 23:04:59 +01:00
Louis Brauer
35812bd7ba
Add String.trim_left() / right() ( #1773 )
...
* Add String.trim_left() / right()
* Fix formatting
2025-01-05 21:53:18 +01:00
Christoffer Lerno
67ff78f1ca
Fix not freeing a zero length String
2025-01-05 14:30:00 +01:00
Louis Brauer
d027a15b4a
add std::net::url - with fixes ( #1748 )
...
* add std::net::url for parsing/generating URLs
* Move String.index_of_chars into std
* Fix param contract
* Idiomatic type naming, Allman formatting, slicing, document functions
* Use String.tokenize
* Don't return str_view() from freed dstring
* Change indentation to tabs
* Variable casing according to guidlelines
* Updated API and added line to the releasenotes.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-01-02 21:13:42 +01:00
Christoffer Lerno
9c22ab8925
Add "skip_empty" to split methods. Add split_to_buffer method.
2024-12-21 15:43:37 +01:00
Christoffer Lerno
16bbc5a026
Add "tokenizer" to String.
2024-12-20 13:18:40 +01:00
Walther Chen
c13cdcdd36
in new_struct_to_str, fix uaf
2024-12-17 11:29:18 +01:00
Christoffer Lerno
4be08ee0bd
string::new_struct_to_str and io::struct_to_format to dump struct data. io::print will now print structs.
2024-10-26 21:00:07 +02:00
Christoffer Lerno
31cd839063
Switch to <* *> docs. Fix issue with dynamically loaded C3 libs with other C3 code.
2024-10-14 02:14:34 +02:00
Koni Marti
0cc62058a9
fix(string): use heap allocator for ZString.copy
...
Use the heap allocator for ZString.copy() instead of the temp allocator
to stay consistent across the code base.
The temp allocator is used for ZString.tcopy().
2024-10-08 17:33:29 +02:00
Fernando López Guevara
c9b9de2838
fix(string): remove allocator argument on temp_ascii_to_lower
2024-09-30 22:01:44 +02:00
Christoffer Lerno
1cc1b83b6f
format functions are now functions and work better with splat.
2024-09-07 14:34:30 +02:00
Christoffer Lerno
ed5d338a39
Added new style named arguments.
2024-09-05 22:13:22 +02:00
Christoffer Lerno
4b2019cf20
Add "allocator-required" functions.
2024-08-25 21:53:54 +02:00
Christoffer Lerno
edfea639cf
- Introduce $vaarg[...] syntax and deprecate the old $vaarg(...).
...
- Similar change to `$vasplat`: `$vasplat` and `$vasplat[1..]`.
2024-08-16 09:28:28 +02:00
Christoffer Lerno
14358417c8
Refactoring -> ensure built in aliases have a valid unit.
2024-08-05 21:44:02 +02:00
Christoffer Lerno
e293c435af
0.6.0: init_new/init_temp removed. LinkedList API rewritten. List "pop" and "remove" function now return Optionals. RingBuffer API rewritten. Allocator interface changed. Deprecated Allocator, DString and mem functions removed. "identity" functions are now constants for Matrix and Complex numbers. @default implementations for interfaces removed. any* => any, same for interfaces. Emit local/private globals as "private" in LLVM, following C "static". Updated enum syntax. Add support [rgba] properties in vectors. Improved checks of aliased "void". Subarray -> slice. Fix of llvm codegen enum check. Improved alignment handling. Add --output-dir #1155 . Removed List/Object append. GenericList renamed AnyList. Remove unused "unwrap". Fixes to cond. Optimize output in dead branches. Better checking of operator methods. Disallow any from implementing dynamic methods. Check for operator mismatch. Remove unnecessary bitfield. Remove numbering in --list* commands Old style enum declaration for params/type, but now the type is optional. Add note on #1086 . Allow making distinct types out of "void", "typeid", "anyfault" and faults. Remove system linker build options. "Try" expressions must be simple expressions. Add optimized build to Mac tests. Register int. assert(false) only allowed in unused branches or in tests. Compile time failed asserts is a compile time error. Remove current_block_is_target. Bug when assigning an optional from an optional. Remove unused emit_zstring. Simplify phi code. Remove unnecessary unreachable blocks and remove unnecessary current_block NULL assignments. Proper handling of '.' and Win32 '//server' paths. Add "no discard" to expression blocks with a return value. Detect "unsigned >= 0" as errors. Fix issue with distinct void as a member #1147 . Improve callstack debug information #1184 . Fix issue with absolute output-dir paths. Lambdas were not type checked thoroughly #1185 . Fix compilation warning #1187 . Request jump table using @jump for switches. Path normalization - fix possible null terminator out of bounds. Improved error messages on inlined macros.
...
Upgrade of mingw in CI. Fix problems using reflection on interface types #1203 . Improved debug information on defer. $foreach doesn't create an implicit syntactic scope.
Error if `@if` depends on `@if`. Updated Linux stacktrace. Fix of default argument stacktrace. Allow linking libraries directly by file path. Improve inlining warning messages. Added `index_of_char_from`. Compiler crash using enum nameof from different module #1205 . Removed unused fields in find_msvc. Use vswhere to find msvc. Update tests for LLVM 19
2024-06-12 10:14:26 +02:00
Christoffer Lerno
8b6735a6aa
Allow recursive function definitions as long as they are pointers #1182 . Add 'zstr' variants for string::new_format / string::tformat.
2024-04-16 19:42:32 +02:00
Christoffer Lerno
748c737e8f
0.5.4: Hash variables accept designated initializers. @safemacro overrides the need for @ in macro names. Fixes to macro context evaluation. Updated allocator api. Removed install_win_reqs.bat. Deterministic @init for MacOS. Fixed temp memory issue with formatter. Support LLVM 19. Add support to compare bitstructs using == and !=. Support Windows .def files. Removed invalid grammar from grammar.y. Support compile time folding of &|^~ for bitstructs. output project setting now respected. Fix issue where constants were not properly constant folded. Add temp_push/pop. Aliased declarations caused errors when used in initializers. Fix export output. Fix of const ternary #1118 . Fix of $$MODULE in nested macros #1117 . Fix debug info on globals. out now correctly detects subscript[] use #1116 . Lateral implicit imports removed. Default to '.' if no libdir is specified. Improved error messages for --lib. Fix raylib snake example. Overzealous local escape check corrected #1127 . Improved yacc grammar #1128 . --linker argument #1067 . Fixes to the matrix operations #1130 . Added GenericList.
2024-02-15 21:39:33 +01:00
Christoffer Lerno
e91f6e268e
0.5.2: Allow trailing comma in calls and parameter declarations #1092 . Fixes issue where single character filenames like 'a.c3' would be rejected. Improve error messages for incorrect user defined foreach. Fix bug with generics in generics. Fix to error with modified vector parameters. Crash with lhs vector inference. Fixes to priority queue.
2023-12-23 23:15:51 +01:00
Christoffer Lerno
1d61ace302
Do not link with debug libc on win32 when using cross compile libs. Add delete methods to dstring. Fixes to macOS aarch64 codegen. Use glibc backtrace when available. Add load_* methods to file. The cast (int[8])int_slice[:8] now works.
2023-12-08 18:59:57 +01:00
Christoffer Lerno
ffb0021d04
Use backtrace on windows. Updated backtrace API
2023-11-17 00:36:42 +01:00
Christoffer Lerno
f39aa1a41e
Add location tracking for memory allocations.
2023-11-09 22:03:25 +01:00
Christoffer Lerno
1e38ccdd2b
Fix missing free on GrowableBitSet. init_new/init_temp for GrowableBitSet, LinkedList, List, HashMap, DString, ByteBuffer. Interface to_string renamed to_new_string. Change in allocator usage, malloc is now heap. Added new_array, new_zero_array, new, new_clear, clone. Concat => concat_new. string::printf => string::new_format, string::tprintf => string::tformat. "to_*" are now "to_new_*" and "to_temp_*". "from_*" is "new_from*"
2023-11-09 01:59:49 +01:00
Christoffer Lerno
99cfaa1583
Refactor protocols.
2023-10-06 22:31:41 +02:00
Christoffer Lerno
a1ecf2211f
as_str() replaced by str_view()
2023-09-24 23:50:16 +02:00
Christoffer Lerno
c4228e08c5
MacOS uses regular stacktrace for errors.
2023-09-21 16:39:13 +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
Pierre Curto
701d6a0746
std/lib/io: add Scanner ( #904 )
...
* std/lib/io: add Scanner
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/core: use existing methods in String.convert_ascii_to_{lower, upper}
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-08-01 10:47:21 +02:00
Christoffer Lerno
499c82b089
Updated indentation to C3 standard.
2023-07-26 14:01:24 +02:00
Pierre Curto
242006d05d
add is_absolute and absolute methods to path::Path ( #882 )
...
* lib/std/io/os: remove unnecessary dup in native_ls
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/core: add String.index_of_char and String.rindex_of_char
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/io: add Path.is_absolute
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/io: add Path.absolute
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std: fix Path.normalize on files starting with `.`; add Path.walk
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-25 23:23:56 +02:00
Christoffer Lerno
5c2e82fc8b
More use of temp allocator.
2023-07-19 02:46:43 +02:00
Christoffer Lerno
4dcfb7a675
Fix of #862 where enums declarations where not regenerated. Updated @pool implementation.
2023-07-18 23:23:53 +02:00
Pierre Curto
2437573a8f
lib/std/io: add Stream.read_all ( #843 )
...
* lib/std/io: add Stream.read_all
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/core: use shortened receiver notation
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-10 20:13:31 +02:00
Christoffer Lerno
e2676a5c7f
Change zero terminated wide strings to use WString over Char16
2023-07-09 20:10:17 +02:00
Pierre Curto
d709c18f5f
std/lib/core: rename DString.str to DString.as_str ( #834 )
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-08 00:10:04 +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
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
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
fb761b0cc5
Added OnStack allocator. Added dirname, basename and extension to path functions.
2023-03-13 11:51:27 +01:00
Christoffer Lerno
4ffeada3c7
Updated stdlib. Prefer file::open. Fix to slice assign with distinct types.
2023-03-12 00:33:16 +01:00
Christoffer Lerno
7a2d73c690
mproved Path code.
2023-03-10 18:46:21 +01:00
Christoffer Lerno
d2a16961cf
More refactorings in the stdlib. More Path functions. Updated Win32 format for types. Fix bug with codegen of defer if ... More string functions.
2023-03-09 20:44:27 +01:00
Christoffer Lerno
b94c647ead
Distinct String
2023-03-08 14:32:07 +01:00
Christoffer Lerno
cfba19ab77
Remove deprecated to avoid warnings for VarString. Fix issue casting subarrays to distinct types.
2023-03-08 00:13:48 +01:00
Christoffer Lerno
89de0a70d2
"@ensure" now correctly only runs on non-optional results. Subtypes now merge to a single type. Beginning deprecation of "std::core::str". Refreshed String functions. Consistent use of ".using" parameter. Functions moved to string methods. Tests on more string methods. Fixes to split, rindex_of.
2023-03-08 00:13:48 +01:00
Christoffer Lerno
9eee250b10
Add DString init.
2023-03-06 09:12:52 +01:00
Christoffer Lerno
d1626ada6f
List no longer uses a temp allocator by default. Incorrect check in the temp allocator removed. Added DString.
2023-03-05 23:14:16 +01:00