Christoffer Lerno
d313afa487
Add String.count to count the number of instances of a string.
2025-05-02 21:48:04 +02:00
Christoffer Lerno
a411f20762
Assert when a macro with compile time value is discarded, e.g. foo(); where foo() returns an untyped list. #2117
2025-05-02 21:16:56 +02:00
Christoffer Lerno
8a0907cb70
Add String.tokenize_all to replace the now deprecated String.splitter
2025-05-02 20:51:15 +02:00
Christoffer Lerno
8a09b2e5f7
std::ascii moved into std::core::ascii. Old _m variants are deprecated, as is uint methods.
2025-05-02 18:06:28 +02:00
Christoffer Lerno
0d3299f267
Added String.quick_ztr and String.is_zstr
2025-05-02 13:22:13 +02:00
Christoffer Lerno
11bb8b49da
- Assert triggered when casting from int[2] to uint[2] #2115
2025-05-01 18:23:48 +02:00
Christoffer Lerno
3636898ac0
Fixed enum regression after 0.7.0 enum change.
2025-04-29 11:53:32 +02:00
Christoffer Lerno
8b86d1461d
"Length mismatch between slices" when there is none #2110
2025-04-25 16:03:36 +02:00
Christoffer Lerno
05094b4f47
@ensure should be allowed to read "out" variables. #2107
2025-04-25 15:36:07 +02:00
Christoffer Lerno
9a59cd164d
Fixed regression slice copy #2106
2025-04-25 15:14:00 +02:00
Christoffer Lerno
3eecaf9e29
Compiler crash when passing an untyped list as an argument to assert #2108 .
2025-04-25 15:02:23 +02:00
Christoffer Lerno
8b47673524
Added Enum.lookup and Enum.lookup_field.
2025-04-25 14:44:00 +02:00
Christoffer Lerno
e39c7cae8d
Comparing a distinct type with an enum with an inline distinct type failed unexpectedly
2025-04-22 21:51:37 +02:00
Christoffer Lerno
8a2907806b
Fixes to tclone and other temp allocations with overaligned data.
2025-04-20 21:30:36 +02:00
Christoffer Lerno
f778e75757
Added missing @clone_aligned and add checks to @tclone
2025-04-20 18:31:52 +02:00
joshringuk@gmail.com
434a0e8e4b
array contains
2025-04-18 18:15:01 +02:00
Christoffer Lerno
946c167bf1
Improve error for default args #2096 . Deprecated old inference with slice copy. Copying must now ensure a slicing operator at the end of the right hand side: foo[1..2] = bar[..] rather than the old foo[1..2] = bar. The old behaviour can be mostly retained with --use-old-slice-copy).
2025-04-18 17:19:04 +02:00
Christoffer Lerno
ba10c8953d
@ensure was not included when the function doesn't return a value #2098 .
2025-04-17 20:26:21 +02:00
Christoffer Lerno
72d7813c20
@if was ignored on attrdef, regression 0.7 #2093
2025-04-17 19:07:48 +02:00
Christoffer Lerno
1083de1f81
- Fix broken enum inline -> bool conversions #2094 .
2025-04-17 19:00:04 +02:00
Christoffer Lerno
b4b6cba301
- Improved error messages on Foo { 3, abc } #2099 .
2025-04-17 18:42:25 +02:00
Christoffer Lerno
3244898610
- @if now does implicit conversion to bool like $if. #2086
2025-04-16 23:49:12 +02:00
Christoffer Lerno
6454856fdb
String str = "" is now guaranteed to be null terminated. #2083
2025-04-16 23:19:28 +02:00
Boris Barbulovski
b5d0739de0
Add env::ANDROID to std.*
2025-04-16 17:47:49 +02:00
Christoffer Lerno
37ffd92f7b
- Bug with slice acces as inline struct member #2088 .
2025-04-16 17:02:22 +02:00
Christoffer Lerno
a44e932806
ABI bug on x64 Linux / MacOS when passing a union containing a struct of 3 floats. #2087
2025-04-16 15:58:14 +02:00
Christoffer Lerno
668175851b
Improved error message #2084
2025-04-16 15:25:05 +02:00
Christoffer Lerno
fde2bb2a7e
Support @if on locals.
2025-04-15 13:20:10 +02:00
Christoffer Lerno
0a9bb2e8e0
Fix to simple a += b overload fallback. Renaming and reordering in the stdlib.
2025-04-15 12:01:58 +02:00
Christoffer Lerno
b64dcde21d
Make aliases able to use @deprecated. Prefer math::I and math::I_F for math::IMAGINARY and math::IMAGINARYF the latter is deprecated. Combination of += and [] overloads now properly handled in most cases.
2025-04-14 20:51:01 +02:00
Christoffer Lerno
f85198e3ee
Added += and related as overloads. Updated tests and docs. Slice2 extracted to its own file.
2025-04-14 00:55:46 +02:00
Christoffer Lerno
dca805bd8a
Added tests to sincos. Correctly detect multiple overloads of the same type. Fix regression quaternion overload. Remove "1." style.
2025-04-13 15:46:27 +02:00
Christoffer Lerno
3888fcb182
- Add @operator_r and @operator_s attributes.
2025-04-13 13:43:03 +02:00
Christoffer Lerno
89d205258e
Fix test.
2025-04-11 19:11:49 +02:00
Christoffer Lerno
0f2d425297
Operator overloading for + - * / % & | ^ << >> ~ == !=
2025-04-11 18:46:22 +02:00
Christoffer Lerno
8cce7f6836
Incorrect rounding at compile time going from double to int.
2025-04-07 02:36:04 +02:00
Christoffer Lerno
ded5fde2d5
Fix test, fix type name.
2025-04-04 13:48:07 +02:00
Christoffer Lerno
65fb977e89
Clearer errors when using a &ref parameter with type.
2025-04-04 13:21:53 +02:00
Christoffer Lerno
e3f3b6f5f1
Better errors trying to convert an enum to an int and vice versa. Trying to cast an enum to int and back caused the compiler to crash.
2025-04-04 02:38:51 +02:00
Christoffer Lerno
1668999f90
Better errors on some common casting mistakes (pointer->slice, String->ZString, deref pointer->array) #2064 .
2025-04-04 00:12:52 +02:00
Sander van den Bosch
561a683230
Added .hash() functions for vectors ( #2043 )
...
* Added .hash() functions for vectors
* Update test to a non-zero sized vector
* Changed vector hash functions to hash the underlying bytes in a char slice, the same approch is used for arrays
* Added test for hashed
* Updated formatting to be consistant with C3 code style
* Formatting, use "self"
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-03-31 16:33:48 +02:00
Christoffer Lerno
5c46b0c2a0
Add @each_row for the csv module.
2025-03-26 18:19:19 +01:00
Christoffer Lerno
4538a1f50d
- Correctly errors when a generic module contains a self-generic type.
2025-03-26 18:04:00 +01:00
Christoffer Lerno
fa707db078
Do not implicitly convert enums to ordinal in formatting functions.
2025-03-25 12:27:51 +01:00
Christoffer Lerno
d760378b02
- Added @format attribute for compile time printf validation #2057 .
...
- Bug when printing a boolean value as an integer using printf.
2025-03-24 13:32:44 +01:00
Christoffer Lerno
82f1b543ed
&self not runtime null-checked in macro #1827 . Regression in temp allocators.
2025-03-23 22:50:09 +01:00
Christoffer Lerno
a03d821602
- Use @pool_init() to set up a temp pool on a thread. Only the main thread has implicit temp pool setup.
...
- `tmem` is now a variable.
2025-03-21 17:08:58 +01:00
Christoffer Lerno
207bcfea02
os::exit and os::fastexit added.
2025-03-20 13:36:59 +01:00
Christoffer Lerno
0beb30c979
Updated error message #2037
2025-03-19 23:25:56 +01:00
Christoffer Lerno
84753bde6d
- Allow inferred type on body parameters. E.g. @stack_mem(1024; alloc) { ... };
2025-03-18 15:40:26 +01:00