49 Commits

Author SHA1 Message Date
Christoffer Lerno
9886d381c0 Update allocator and resolution. 2022-07-30 02:55:32 +02:00
Christoffer Lerno
e36e4b60e4 Fprintf changes. 2022-07-26 16:12:22 +02:00
Christoffer Lerno
7065c28a08 Some fixes to string. Added fprintf and String.printf. Updated boolerr example. 2022-07-26 13:44:08 +02:00
Christoffer Lerno
da4df9d626 Less libc in example. 2022-07-26 02:21:49 +02:00
Christoffer Lerno
a7e4dda360 Added examples. 2022-07-26 02:10:18 +02:00
Christoffer Lerno
4471ccff13 String works with printf. Example cleanup. 2022-07-26 01:15:36 +02:00
Christoffer Lerno
bb28f6e61c Fix stack setting after error return. Some fixes to examples. 2022-07-02 10:54:40 +02:00
Christoffer Lerno
224390ce5a Make builtins loaded by default. 2022-06-04 01:41:23 +02:00
Christoffer Lerno
9691d50a6f @ is now part of the name of an attribute or a macro. Macros without '@' must be function-like. 2022-05-08 22:16:33 +02:00
Christoffer Lerno
22ee082d00 0.2.1 SysV ABI fix for passing certain things by struct. Fix implicitly converting to float in the case of myfloat *= -1. Prefer inferred constant over global. Allow locals to shadow global variables. 2022-04-27 16:43:25 +02:00
Christoffer Lerno
b99db4be24 Allocators. Rename of "optenum" to fault. Memcpy and memset added. Cleanup of declaration use. 2022-04-09 20:07:59 +02:00
Christoffer Lerno
8743223dd6 Allocators. Rename of "optenum" to fault. Memcpy and memset added. Cleanup of declaration use. 2022-04-09 20:07:59 +02: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
2802b2b96d Ensure, $eval and $evaltype, @unreachable() replaces $unreachable. <Type>.sizeof 2022-03-04 15:49:17 +01:00
Christoffer Lerno
6b4e4f6114 Update formatting to consistently use tabs. 2022-02-18 12:56:17 +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
cf56825d26 Fixed bug when using indexing on a generic type. Made array::list::List work with [] and foreach. 2022-01-26 21:27:13 +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
bc2d789c2e Filter \r before lexing. 2021-12-03 16:43:37 +01:00
Christoffer Lerno
974cd0acc5 Rollback global. 2021-11-17 10:37:23 +01:00
Christoffer Lerno
b52b42d4da Complete transition to fn. Introduce global/threadlocal 2021-11-16 17:46:44 +01:00
Christoffer Lerno
0a4f35154a Addeded some hash functions. Fix of visibility resolution for macros. std lib is now loaded from a directory. 2021-09-22 10:27:10 +02:00
Christoffer Lerno
b87b67ebbb Factorial macro example. 2021-09-11 02:34:09 +02:00
Christoffer Lerno
17dcb742c6 Fixed codegen for subarray global initializers. Adding fasta example. 2021-09-11 00:44:35 +02:00
Christoffer Lerno
b7e423adc2 Update .len for subarray to not require () 2021-09-10 19:44:27 +02:00
Christoffer Lerno
0aef2810c8 Added fasta example. 2021-09-10 19:27:42 +02:00
Christoffer Lerno
2b2be6b491 Added mandelbrot example code. 2021-09-10 16:12:54 +02:00
Christoffer Lerno
49d13c23bb Fix issue with grouped expressions in macros. Adding spectral norml code example. 2021-09-10 15:47:31 +02:00
Christoffer Lerno
c76e8e0713 Added nbodies example 2021-09-10 10:30:20 +02:00
Christoffer Lerno
29b3535460 Added fannkuch example. 2021-09-10 09:20:27 +02:00
Christoffer Lerno
fd1eafe5bf Fix base64 and hash examples. 2021-09-08 23:54:56 +02:00
Christoffer Lerno
dd8b850544 Support for "static" keyword. 2021-05-30 16:30:16 +02:00
Christoffer Lerno
fc31c15914 Updated cast syntax in code samples. 2021-05-18 17:23:27 +02:00
Christoffer Lerno
4210f1ccb2 Some work on vararray. Fix span on post unary. Updated error recovery. Updated return analysis to handle void functions. "while" now disallows error prone next line statement. Working on auto linking. Failable load optimized. Optimization and corrections for call returns + documentation. 2021-04-05 23:34:40 +02:00
Christoffer Lerno
07595df412 Change cast and int rules: constant folding always starts. Promotion using left side on all operands to bit width. Implicit narrowing to max size on right hand side. 2021-03-17 18:25:00 +01:00
Christoffer Lerno
1d50beb330 Work on constant string and inferred array sizes. 2021-02-03 23:01:37 +01:00
Christoffer Lerno
4f064e7da2 Initial checkin of docs parsing. char is now unsigned, and signed char is "ichar". 2021-01-29 18:46:17 +01:00
Christoffer Lerno
26d25e3f74 Recursive references between globals are now correctly handled. 2021-01-27 00:14:16 +01:00
Christoffer Lerno
3a24fbfa6d Moved examples around. Updated (and corrected) const initialization. Removed "in" keyword. Added "member" attribute domain. Many fixes in struct padding and alignment and tests. Fixed extern global. 2021-01-24 00:55:09 +01:00
Christoffer Lerno
3c15e495dd Add macro arguments &foo $foo #foo.
C ABI compatibility aarch64, win64, x86, x64
Added debug info
2020-11-22 22:16:19 +01:00
Christoffer Lerno
77ccfc1f7c Added CT_SWITCH parsing in top level. Nil changed to null. Parsing more in line with grammar. Parse type as expressions. Zero init by default for locals. Corrected bool/fp conversion. Add memcpy pass to fix issue with value load/stores. 2020-09-21 11:38:12 +02:00
Christoffer Lerno
34c7df9ee1 Fixed multi line error reporting for tokens. Handle infinite empty for loops. Changed cast syntax to "cast(foo as Foo)". Completed enum casts. Added more tests. 2020-07-25 21:54:32 +02:00
Christoffer Lerno
dc86c21210 New failable based error handling. Labelled break/continue/next. 2020-07-09 13:07:08 +02:00
Christoffer Lerno
a6a4136685 Updated examples and grammar for big error change. 2020-06-17 18:19:00 +02:00
Christoffer Lerno
50c36789bf Fixes bug handling chained && ||. Work towards more macro functionality. Correctly emit stdcall. Corrected character parsing in escaped string entries. 2020-06-11 15:45:58 +02:00
Christoffer Lerno
f4b4bab947 Restructuring the parser & split parser into parts. Parsing more constructs now, like enums with extended syntax. Corrected handling of function block to be an expression. Added expression block codegen. 2020-03-29 17:40:42 +02:00
Christoffer Lerno
ebbea2ac42 Lookahead cleanup. Start work on throws. Fix try expressions. Beginning work on initializer. Some fixes on LLVM types. Moving more target info into C3. Moving alignment into types Introducing a meta type (incomplete). Start work on macros. Splitting '@' from macro name. 2020-03-29 17:39:33 +02:00
Christoffer Lerno
7b4ed09517 Introduced a Lexer context, comment parsing now actually works properly. Token use in decl/ast/expr is moved to SourceRange instead. And the SourceRange used start/end, which is better than using start + len for many uses. 2020-01-25 17:56:17 +01:00
Christoffer Lerno
cdc1bfe267 Start using UnaryOp/PostUnaryOp ++/-- now works post/pre and also on pointers. Fix ++/-- on any number. Added examples. c3c now compiles files by default. Extended symbol resolution. Addition of 'extern'. Multi-level paths. 2020-01-16 21:28:13 +01:00