Commit Graph

1784 Commits

Author SHA1 Message Date
Christoffer Lerno
6789fab93c Panic function that may be redefined. Trap and stacktrace builtins. Bug using builtin fixed. Fixes to using $$LINE and friends. Produces a stacktrace on error. 2022-03-18 12:43:17 +01:00
Christoffer Lerno
55598b2de8 Remove multi-line strings. 2022-03-12 00:40:06 +01:00
Christoffer Lerno
1061b4e1dd Make doc an AST type. 2022-03-11 12:24:07 +01:00
Christoffer Lerno
8f6fb8b7d7 Move body param as decl. Fix lexer bug with docs. 2022-03-10 14:54:52 +01:00
Christoffer Lerno
4258fe4d01 Simple check for [in] and [out] parameters. 2022-03-10 12:46:45 +01:00
Christoffer Lerno
0565e87e5e Support '@pure' and parse the optreturn tag. 2022-03-10 09:46:30 +01:00
Christoffer Lerno
322d714305 Dev (#404)
Remove 'errtype' name and reduce Expr / TypeInfo memory footprint.
2022-03-08 23:38:27 +01:00
Christoffer Lerno
069a2d40cb Changing how defer works. Remove of undef. Simplify ensure. 2022-03-08 14:15:31 +01:00
Christoffer Lerno
2802b2b96d Ensure, $eval and $evaltype, @unreachable() replaces $unreachable. <Type>.sizeof 2022-03-04 15:49:17 +01:00
Christoffer Lerno
4f4bc80953 Symtab has a new hash map type. New, small, sourcespan, external symbols simplified. Updated docs. 2022-03-01 10:32:52 +01:00
Christoffer Lerno
df3e51c17e Implicit imports. 2022-02-16 20:41:54 +01:00
Christoffer Lerno
7226bff6ea Use JSON, unifying settings. 2022-02-15 18:53:54 +01:00
Christoffer Lerno
d42193dbd6 Fixes the alloca alignment on x64 for alignment > 16. Improved indexing into ConstInitializer adding const indexing into a const array during compile time. Add a temporary enum values result. 2022-02-08 11:41:34 +01:00
Christoffer Lerno
ee32a5fd47 Added $stringify. Remove of editor_plugin folder. 2022-02-02 15:22:28 +01:00
Christoffer Lerno
06917f2e65 Added "guess a number". Fix CT enum / int comparison. Fix some array pointer decay scenarios. Infer type of expression blocks. Correctly merge anyerr. 2022-02-01 22:46:32 +01:00
Christoffer Lerno
ba66aaaf12 Foreach overload is now done using attributes (@operator(elementat), @operator(elementref) and @operator(len)) rather than reserved functions. 2022-01-29 16:45:03 +01:00
Christoffer Lerno
e5bcb74822 Added levenshtein.c3 to working files. Fixes to reverse indexing. Added min/max functions. Tentatively removed "opaque" 2022-01-26 17:40:01 +01:00
Christoffer Lerno
8922399c36 Add $for 2022-01-24 22:52:01 +01:00
Christoffer Lerno
1e7ad2e241 Add $foreach 2022-01-24 18:53:44 +01:00
Christoffer Lerno
2c5ae858b8 Re-add () to ct constructs. 2022-01-24 00:52:43 +01:00
Christoffer Lerno
ef95c1a630 Fix $switch. And make top level $switch work. 2022-01-24 00:01:54 +01:00
Christoffer Lerno
b2be8349ed Add typeless varargs. 2022-01-23 19:43:57 +01:00
Christoffer Lerno
dce33ba5b5 Fixing #380 where const aggregates were copied by value. 2022-01-20 16:52:28 +01:00
Christoffer Lerno
e6ad9c324d This fixes the bug with "case 3 .. 1" #357 2022-01-19 23:11:03 +01:00
Christoffer Lerno
556be2ff7f "@autoimport" attribute #366 2022-01-18 23:16:48 +01:00
Christoffer Lerno
8adb0faa06 Multi module import support. #354 2022-01-18 22:53:31 +01:00
Christoffer Lerno
b6450861d2 Cast no longer needs (type)(expr) format. Ordinary C (type)expr now works. 2022-01-18 22:32:12 +01:00
Christoffer Lerno
1e56948a22 Prepare removing "func" 2022-01-18 14:15:44 +01:00
Christoffer Lerno
e4e8abbc6c Dev (#376)
Errno updates with errno for linux/win/macos. Updated $$ syntax to also match compiler constants.
2022-01-18 01:31:14 +01:00
Christoffer Lerno
4059d22315 Remove unnecessary load in LLVM statement lowering. Added more tests from Clang. 2022-01-17 17:08:28 +01:00
Christoffer Lerno
05f0059b1b Fix float conversion. Strings as array initializers work much better. 2022-01-17 16:06:17 +01:00
Christoffer Lerno
bc3b58b3e3 Optimized ternary where both branches are empty. 2022-01-17 12:01:27 +01:00
Christoffer Lerno
99ea0afcbf Optimize multiple int casts on ptrtoint, into a single cast. Fixed incorrect widening cast from signed -> unsigned. 2022-01-17 00:45:26 +01:00
Christoffer Lerno
d916f111b3 Fixes a | b when a | b are boolean. Fixes to RISCV and x64 ABI implementations. 2022-01-16 01:13:43 +01:00
Christoffer Lerno
0f4a43717e Fixes to the aarch64 ABI. 2022-01-15 01:37:43 +01:00
Christoffer Lerno
c5a862f4d1 Fix to the x64 ABI. More tests. 2022-01-14 21:30:29 +01:00
Christoffer Lerno
eed5b7db54 Correctly call x64 varargs. 2022-01-13 21:22:50 +01:00
Christoffer Lerno
5683fe3f8c Add parsing for escaping and remove "fault" token name. Allow excluding stdlib. Fixes to the x64 abi: no narrowing done for i32 results, assuming too many registers, more tests. 2022-01-12 23:56:59 +01:00
Christoffer Lerno
16179d2513 Make it easier to match LLVM 14 output. 2022-01-10 14:50:57 +01:00
Christoffer Lerno
ea3b50d039 Codegen with better annotations on globals. 2022-01-10 13:58:15 +01:00
Christoffer Lerno
a176ae353b Refactored function pointer. 2022-01-07 19:13:07 +01:00
Christoffer Lerno
869aa7ed76 Do not store direct parameters that are only read. 2022-01-04 23:16:32 +01:00
Christoffer Lerno
1d5ff71b21 Rearchitecture contexts. Fixing macro resulution, hash arguments and defers. 2022-01-04 20:45:58 +01:00
Christoffer Lerno
a0be188902 Lexing updated with simpler code. Note: may have bugs. 2021-12-27 15:45:54 +01:00
Christoffer Lerno
0a9a014e4a Builtins now properly work with $defined. A builtin may not be an rvalue. 2021-12-25 21:08:08 +01:00
Christoffer Lerno
cf61f427d4 Add noalias to sret. 2021-12-23 13:26:55 +01:00
Christoffer Lerno
cf0a04977a Prevent circular initializers. 2021-12-22 01:03:15 +01:00
Christoffer Lerno
eefe782dd6 Fix constant evaluation of | & ^ >> << 2021-12-20 21:35:36 +01:00
Christoffer Lerno
7c76fd02c6 Fix test data 2021-12-19 16:33:07 +01:00
Christoffer Lerno
4b3232ead6 Some initial wasm support. 2021-12-19 12:18:43 +01:00