Christoffer Lerno
f7143c1852
Fix tests, reenable LLVM 22
2025-08-26 20:55:58 +02:00
Christoffer Lerno
1781e97f02
Update jumptable codegen.
2025-08-26 20:34:44 +02:00
Christoffer Lerno
c17cb7d0ca
Fix alignment on jump table.
2025-08-26 20:09:04 +02:00
Christoffer Lerno
21343baa75
Update for LLVM 21 ( #2435 )
...
Support LLVM 21
2025-08-26 17:29:39 +02:00
Christoffer Lerno
58c59361ea
- Add linklib-dir to c3l-libraries to place their linked libraries in. Defaults to linked-libs
...
- If the `os-arch` linked library doesn't exist, try with `os` for c3l libs.
2025-08-26 15:21:45 +02:00
Christoffer Lerno
cb17cfff7d
Deprecation of @assignable_to
2025-08-26 13:21:42 +02:00
Christoffer Lerno
1634217fc4
Grabbing (missing) methods on function pointers would cause crash #2434 .
2025-08-25 16:39:17 +02:00
Christoffer Lerno
bc9b0900a5
- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.
2025-08-25 15:26:47 +02:00
Christian Brendlin
f43a7540c5
clarify directory creation error messages ( #2388 )
...
* Improve error messages for project creation
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-25 14:56:59 +02:00
Zack Puhl
410a25f334
Add array @reduce, @filter, @any, @all, & @indices_of ( #2419 )
...
* wip: array reduce and any/all
* wip: continue adding more functional-like array module functions
* wip: documentation and other fixes
* finish unit tests, require INDEX variable in lambdas, ready for first review
* don't worry about iterating by ref (it wasn't passing it that way anyhow)
* update release notes again
* simplify, remove "summary operators" and related tests
* Use more $defined, remove "has_operator". Fix regression in `$defined(var $f = 123)`
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-25 14:47:08 +02:00
Zack Puhl
35c04cdc36
Add form-feed and vertical tab to trim defaults ( #2407 )
...
* Add form-feed and vertical tab to` trim` defaults
* add some initial string-based benchmarking
* update to non-const string
* do not account for mem times in bench
* misc bench fixes to repair reporting times; improve trim tests
* ok last one for real..remove (void) casts
* finally, swap to more efficient default whitespace order in `trim`
2025-08-25 14:23:14 +02:00
Christoffer Lerno
3e641ab82b
Properly add "inlined at" for generic instantiation errors #2382 .
2025-08-25 13:31:56 +02:00
Christoffer Lerno
7972397c65
Incorrect name on wincrt, likely a regression.
2025-08-24 13:54:52 +02:00
Christoffer Lerno
9bf933ae31
- has_tagof on tagged lambdas returns false #2432
2025-08-23 23:41:32 +02:00
Christoffer Lerno
a69ee59b82
Fix tests.
2025-08-23 22:49:33 +02:00
Christoffer Lerno
961aa0ef61
Struct and typedef subtypes inherit dynamic functions.
2025-08-23 22:31:29 +02:00
Christoffer Lerno
48318c3ad4
Fixed tests.
2025-08-23 19:43:01 +02:00
Christoffer Lerno
a004cd3d03
Lambdas on the top level were not exported by default. #2428
2025-08-23 19:40:18 +02:00
Christoffer Lerno
768ce6092d
@tag was not allowed to repeat.
2025-08-23 18:42:57 +02:00
Christoffer Lerno
e4e499edd2
Allow $defined take declarations: $defined(int x = y)
...
Taking the address of a label would cause a crash. #2430
2025-08-23 12:00:17 +02:00
Christoffer Lerno
f36e9fea48
Types converts to typeid implicitly.
2025-08-22 00:26:18 +02:00
Christoffer Lerno
d5eec296a0
Some cleanup.
2025-08-21 17:06:06 +02:00
Christoffer Lerno
e2e2ca1d7f
Add @safeinfer to allow var to be used locally.
2025-08-21 12:39:08 +02:00
Christoffer Lerno
6ab7198f2f
- Added AsciiCharset for matching ascii characters quickly.
...
- Added `String.trim_charset`.
2025-08-21 02:57:17 +02:00
Christoffer Lerno
2e1f7c95ce
Cleanup.
2025-08-21 01:46:41 +02:00
Christoffer Lerno
a2ef63f5b6
Error if a stack allocated variable is too big (configurable with --max-stack-object-size).
2025-08-21 00:33:56 +02:00
vssukharev
b7c9a4e2e9
Several fixes for the compiler ( #2422 )
...
* Update .gitignore for nix
* Fix build failure when compiling with -Werror=maybe-uninitialized
* Fix test failure formatting
* Add separateDebugInfo to c3c Nix build
2025-08-20 21:47:22 +02:00
Christoffer Lerno
28ffb864a3
Deprecated PollSubscribes and PollEvents in favour of PollSubscribe and PollEvent and made them const enums.
2025-08-19 12:20:17 +02:00
Book-reader
18b4ce4e7d
fix Socket.get_option calling setsockopt instead of getsockopt ( #2421 )
...
* fix Socket.get_option
* `Socket.get_option` didn't properly call `getsockopt`, and `getsockopt` had an invalid signature.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-19 11:36:18 +02:00
Christoffer Lerno
551ce34b9b
- foo[x][y] = b now interpreted as (*&foo[x])[y] = b which allows overloads to do chained [] accesses.
2025-08-19 01:57:51 +02:00
Christoffer Lerno
de09a19a48
- Incorrect type checking when &[] and [] return optional values.
...
- Failed to find subscript overloading on optional values.
- Added `&[]` overload to HashMap.
2025-08-19 00:41:40 +02:00
Manu Linares
ba55946c9a
Fixes slicing with negative value error message - llvm_codegen_expr.c ( #2410 )
...
* Fixes slicing with negative value error message - llvm_codegen_expr.c
Fixes printing negative value
Example:
```
fn void main()
{
int[100] arr;
usz a = 35;
usz b = 36;
arr[b:a - b];
}
```
output should be:
ERROR: 'Negative value (-1) given for slice length.'
* Update releasenotes.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-18 23:12:03 +02:00
Christian Brendlin
33ab18033a
#2391 : Improve missing $endif error message ( #2413 )
...
* Improve error message missing
* remove temp comment
* Update releasenotes.md
* Use sema_note to print the "$if" line
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-18 23:09:07 +02:00
Christian Brendlin
96127d4ff3
Fix crash when exporting functions with const enums #2384 ( #2414 )
...
* headers: handle const enums in exported signatures as base type
* update releasenotes.md
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-18 22:49:42 +02:00
Alessandro Mauri
43163fe2a0
Fix out of bounds access when stdout is empty
2025-08-18 22:31:46 +02:00
Christoffer Lerno
a52b30c951
Update releasenotes for fix, which was the previous commit for fixing "Compiler assert when calling unassigned CT functions #2418 ". Fail :(
2025-08-18 21:29:36 +02:00
Christoffer Lerno
7d6a864d56
Miscompilation of do-while when the while starts with a branch #2394 . Also: change do-while to make the lowering follow the execution.
2025-08-18 21:28:19 +02:00
Christoffer Lerno
eeab73df4e
Miscompilation of do-while when the while starts with a branch #2394 . Also: change do-while to make the lowering follow the execution.
2025-08-18 21:04:52 +02:00
Christoffer Lerno
db45abdfc7
Update releasenotes for #2398 fix.
2025-08-18 13:09:24 +02:00
vssukharev
cb32441533
Temporary fix for #2398 ( #2415 )
...
* Temporary fix for #2398
* Update sema_liveness.c
Remove comment
---------
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com >
2025-08-18 13:06:23 +02:00
Christoffer Lerno
643aa47e99
Compiler segfault with struct containing list of structs with an inline member #2416
2025-08-18 12:19:14 +02:00
Christoffer Lerno
5e1bf75621
Updated release notes
2025-08-18 12:03:05 +02:00
Christoffer Lerno
7c8e3dd4fd
Fix max module name to 31 chars and the entire module path to 63 characters.
2025-08-18 12:02:00 +02:00
Zack Puhl
ad02fad167
Add Freestanding OS Types ( #2399 )
...
* Add Freestanding OS Types to `env::`
2025-08-16 19:47:03 +02:00
Sander van den Bosch
261184b5c1
Add HashSet and String methods ( #2386 )
...
* Add `String.contains_char` using `String.index_of_char` and `HashSet.values` together with `HashSet.tvalues`
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-16 16:57:31 +02:00
Manu Linares
d07da2804e
Update sema_decls.c
...
Fix compilation error
```
[ 48%] Building C object CMakeFiles/c3c.dir/src/compiler/sema_passes.c.o
/home/mb/.cache/yay/c3c-git/src/c3c/src/compiler/sema_decls.c: In function ‘sema_analyse_operator_method’:
/home/mb/.cache/yay/c3c-git/src/c3c/src/compiler/sema_decls.c:2312:25: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
2312 | is_wildcard = method->func_decl.is_wildcard_overload = true;
| ^~~~~~~~~~~
```
2025-08-16 16:47:59 +02:00
Zack Puhl
702b63ddb7
Add array::zip and Related Macros ( #2370 )
...
* zip / zip_into
* Deprecate `add_array` in favour of `push_all` on lists.
* Add support for generic lists for zip.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-08-16 13:30:24 +02:00
konimarti
e35dbd29fb
string: use correct allocator in replace ( #2405 )
...
`replace` accepts an Allocator but uses `mem` instead.
2025-08-16 03:41:59 +02:00
Christoffer Lerno
b52ab886d2
Compiler segfault on global slice initialization with null[:0] #2404 .
2025-08-15 20:10:28 +02:00
Christoffer Lerno
4b95d6be4c
New method resolution.
2025-08-15 19:48:08 +02:00