Christoffer Lerno
33b05bcfeb
More deprecations in lib6, and updates to lib7
2025-02-27 11:10:41 +01:00
Christoffer Lerno
cbacd64987
Update tests to (Foo) { ... } syntax.
2025-02-18 18:53:30 +01:00
Christoffer Lerno
4961d0433f
- Circumvent Aarch64 miscompilations of atomics.
...
- Fixes to ByteBuffer allocation/free.
- Fix issue where compiling both for asm and object file would corrupt the obj file output.
2025-02-12 12:50:30 +01:00
Christoffer Lerno
c4212c4649
- Test runner will also check for leaks.
...
- `write` of qoi would leak memory.
- Issue when having an empty `Path` or just "."
- `set_env` would leak memory.
2025-02-10 00:39:02 +01:00
Christoffer Lerno
63f619e5b6
Add tracking allocator to test runner. #1809
2025-02-09 03:10:35 +01:00
Snikimonkd
b7ffa3b17c
[feat] add test tmp files to gitignore
2025-01-21 12:44:13 +01:00
Christoffer Lerno
13e3ecbde2
Tab and style
2025-01-20 23:31:49 +01:00
Christoffer Lerno
b941f93416
Deprecate old void! @benchmark and @test functions.
2025-01-09 20:33:53 +01:00
Christoffer Lerno
8e0d6d11b9
Deprecated '&' macro arguments.
2025-01-08 22:13:49 +01:00
Denis Palashevskii
4839d8861d
increase BitWriter.write_bits nbits limit, add tests ( #1692 )
...
* increase BitWriter.write_bits nbits limit, add tests
* update releasenotes.md
2024-12-17 21:21:58 +01:00
konimarti
f3304acc93
Add io stream primitives ( #1626 )
...
* io: implement MultiReader struct
Implement a MultiReader (InStream) which sequentially read from the
provided readers (InStreams). Return IoError.EOF when all of the readers
are read.
* io: implement MultiWriter struct
Implement a MultiWriter (OutStream). The MultiWriter duplicates its
writes to all the provided writers (OutStream).
* io: implement TeeReader struct
Implement a TeeReader (InStream) which reads from a wrapped reader
(InStream) and writes data to the provided writer (OutStream).
2024-11-15 23:18:29 +01:00
Walther Chen
a233771433
Fix WriteBuffer.write_bytes off-by-one ( #1625 )
...
* fix WriteBuffer.write_bytes off-by-one
* test for WriteBuffer.write_bytes off-by-one
2024-11-14 14:58:09 +01:00
Christoffer Lerno
fa4ca7944f
- Add read/write to stream with big endian ints.
...
- Move accidently hidden "wrap_bytes".
2024-10-03 20:42:25 +02:00
Christoffer Lerno
ed5d338a39
Added new style named arguments.
2024-09-05 22:13:22 +02:00
Christoffer Lerno
6de17b9ae9
Fix use of deprecated function. Fix bug when compile time subtracting a distinct type. Fix test/benchmark debug info use.
2024-08-19 09:36:45 +02:00
Christoffer Lerno
3ccb4b9ec3
$exec may now provide a stdin parameter. Deprecated path.append, path.tappend, getcwd, tgetcwd, path.absolute, ls. Deprecated env::get_config_dir, replaced by env::new_get_config_dir. Added path.has_extension, path.new_append, path.temp_append, new_cwd, temp_cwd, path.new_absolute, new_ls, temp_ls. Added dstring.replace Updated win escapes for exec.
2024-08-15 00:31:47 +02:00
Christoffer Lerno
2706495668
Add temp allocator scribble. Make bufferstream safer.
2024-08-11 01:17:03 +02:00
Christoffer Lerno
b83d388523
Incorrect justify formatting of integers.
2024-08-01 01:20:42 +02:00
Christoffer Lerno
bc0d52142a
Added pull request #1189 : Fix os::native_is_{file,dir} bug. Add tests.
2024-07-15 03:02:54 +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
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
deb4cc7c4b
0.5.3: Single-module not respected. Fix issue with compiler defined types. Fix optimization levels for projects. Use GEP i8 on offsets. Optimize foreach on len 1 arrays. Move panic blocks last. Fix generic module wildcard imports. Deprecate init_temp / init_new. Fix issue with macro vaarg and untyped lists. Fix extern const globals.
2024-01-14 15:34:54 +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
1aa038c92f
Interface based streams. Fix for initializing with a force unwrap inside. Allow $define to take a list. Allow $define to return error on argument type mismatch in call. Fixed broken bit operations on boolean vectors.
2023-10-31 01:06:59 +01:00
Pierre Curto
3aa85cf641
misc ( #1033 )
...
* make conv::char32_to_utf8_unsafe() return the number of bytes it wrote
add tests for DString
fix pointer arithmetic in DString.insert_at
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* add support to printf for %d and enums
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-10-08 02:12:20 +02:00
Christoffer Lerno
a1ecf2211f
as_str() replaced by str_view()
2023-09-24 23:50:16 +02:00
Pierre Curto
d6edd80f3b
lib::std::encoding: add varint::{read,write}
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-22 15:16:44 +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
Christoffer Lerno
d67e846712
Remove cast from void! to anyfault. Rename @catchof to @catch
2023-09-09 22:49:32 +02:00
Pierre Curto
f8fa9a057e
lib/std/io: support . string format speficier ( #970 )
...
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-09-05 14:39:51 +02:00
Christoffer Lerno
4c081f59ff
Refactoring, adding printf / printfn to all streams.
2023-09-03 10:14:04 +02:00
Christoffer Lerno
9a6d83f526
Updated stream API.
2023-09-03 01:14:15 +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
7a39933c97
add NanoDuration.to_format() ( #935 )
...
* lib/std/time: avoid switch in DateTime.compare_to()
* lib/std/time: add NanoDuration.to_format()
* std/lib: fix #934
2023-08-17 10:30:20 +02:00
Eduardo José Gómez Hernández
c44a0528df
Tests:std/lib/io/file: Added unit tests for read_any and write_any
2023-08-08 10:12:36 +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
Pierre Curto
6808a38c9f
add std::io::stream::ByteBuffer; fix std::io::Path::walk ( #895 )
...
* lib/std/io/stream: add some inlines
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/io/stream add ByteBuffer
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/io/path: fix free of paths in walk
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* lib/std/bits: remove unnecessary receiver type
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-29 21:21:45 +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
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
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
Pierre Curto
2ac213a3ce
lib/std/io/stream: add ReadBuffer and WriteBuffer streams
...
ReadBuffer and WriterBuffer buffer stream reads and writes to a stream.
Useful in situations where the underlying stream is sensitive to the number
of read or write calls.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-07-01 17:38:09 +02:00
Christoffer Lerno
57c8b5fc75
Fix on rethrow + macros.
2023-06-27 20:41:17 +02:00
Pierre Curto
0ab0f727ad
lib/std: fix ByteWriter.read_from method ( #793 )
...
* lib/std: fix ByteWriter.read_from method
When reading from a stream which does not have an available method,
ByteWriter would not make any progress if its buffer was empty.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
* test/unit/stdlib/io: use separate module for TestReader
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com >
2023-06-23 10:44:36 +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
316af36723
Add dstringwriter.
2023-03-22 12:23:47 +01:00
Christoffer Lerno
9850adfa56
Rename OUT_OF_DISK => OUT_OF_SPACE. Allow byte writer to take a buffer.
2023-03-22 11:52:45 +01:00
Christoffer Lerno
954521228e
Make casts explicit when casting to pointer offset. Better localization of error when narrowing fails. New printf formatting based on musl plus %a output.
2023-03-19 21:15:44 +01:00
Christoffer Lerno
8b0df0ee11
try? / catch?
2023-03-17 22:49:48 +01: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
2607062cb6
Updated Path. Some work towards loading dirs.
2023-03-11 18:32:44 +01:00