Commit Graph

51 Commits

Author SHA1 Message Date
Christoffer Lerno
bbeed12600 Removing unused hash table functions. Removal of macro DECL_NEW. Smaller initial vector size. Remove unnecessary memclear. 2021-12-30 16:41:00 +01:00
Christoffer Lerno
52cc4f8ba5 Move compiler plain malloc calls to function to make them easy to track. 2021-12-19 23:11:32 +01:00
Christoffer Lerno
8aa00b015b Add support from compiling c from c3c. 2021-12-09 23:38:57 +01:00
Christoffer Lerno
379a66a14b Add switch(variant) 2021-12-09 22:52:48 +01:00
Christoffer Lerno
bc2d789c2e Filter \r before lexing. 2021-12-03 16:43:37 +01:00
Christoffer Lerno
1bb9c2d249 Allow the compiler to be called multiple times (while leaking) 2021-12-02 22:50:38 +01:00
Christoffer Lerno
05c9b7cb33 More explicit conversion and width changes to some field. 2021-11-21 23:37:54 +01:00
Christoffer Lerno
bb39cf20c0 Removal of #pragma mark, explicit conversions. 2021-11-21 21:43:06 +01:00
Christoffer Lerno
4f09b0c351 Bitstruct implementation. 2021-11-05 11:59:30 +01:00
Christoffer Lerno
f48661d35e Removed use of basename / dirname. 2021-10-19 23:09:05 +02:00
Christoffer Lerno
b4df56db54 Removed original_type, pure, removed bigint, added i128 type, lots of fixes to $Foo, reassigning ct type, catch/macro, "!", removed type inference. 2021-10-19 10:39:02 +02:00
Christoffer Lerno
b66ea1b4cd Updating CALLOCS 2021-08-31 22:09:56 +02:00
Christoffer Lerno
69d9775876 Removed define for declaring ct vars and replaced it with var for declarations. Updated error messages. Added $defined. 2021-08-31 12:44:18 +02:00
Christoffer Lerno
f198e6c53a Added multi line strings raw strings. This also somewhat improves error reporting on strings. 2021-08-21 21:50:41 +02:00
Christoffer Lerno
64f20da080 Better handling of void/void*, unified local/global var analysis. Native base64 / hex data array (needs more checks) 2021-08-20 10:29:17 +02:00
Christoffer Lerno
232632b74e Add section with (incomplete) checking for mach-o 2021-08-18 22:28:43 +02:00
Christoffer Lerno
2246b641b1 Fix stack overwrite. 2021-07-30 00:18:30 +02:00
Christoffer Lerno
89d831fc18 Remove debug printout unless explicitly required. Add compile-only option. 2021-07-19 14:10:31 +02:00
Christoffer Lerno
2778adbcb9 Fix bug #208 2021-07-18 18:53:00 +02:00
kvk1920
050382b68e Windows compatibility (#207)
* incorrect environment detection fixed
* use %zu instead of %ld for size_t
* fix rounding in integer division
* fix compiler error on Windows
* implement missed functions
* make linker available if MinGW environment is used
* make linker available under MSYS2 Clang64 and MSYS2 MinGW64
2021-07-13 12:59:55 +02:00
Christoffer Lerno
a5ce7c47ba Adding "require" precondition. Corrects inferred arrays and fixes so that it uses [*] everywhere. Distict type will now allow methods to be added to it. Added $alignof and $sizeof. 2021-07-09 23:57:35 +02:00
Christoffer Lerno
3a75032ba9 Workaround for GCC warning. 2021-06-11 18:39:48 +02:00
Christoffer Lerno
117cc6339b Add data to end of VHeader. 2021-06-11 17:35:44 +02:00
Christoffer Lerno
e650ae771f Thread pool and some updated lib code. 2021-06-11 13:23:45 +02:00
Christoffer Lerno
dafe0e6fb6 Updated scope code and variable tracking. Added trailing body macros. 2021-06-10 15:06:12 +02:00
Christoffer Lerno
95f39f42eb Fix nasty bug where the node copies did not get a proper id. 2021-05-31 21:11:10 +02:00
Christoffer Lerno
1f676c135c Removed func and rewrote typedefs. 2021-05-23 13:16:48 +02:00
Christoffer Lerno
9b86b00834 Compilation is now done with each module compiled together. 2021-05-11 14:58:21 +02:00
Christoffer Lerno
f7919edb35 Split modules into generic and normal modules on the top level. Prepare for static. Change local -> static as keyword. Add private include. Remove old sub module search. 2021-05-09 19:26:05 +02: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
21357c4fc1 Fix crash when having return value errors. Updated docs. Find and load builtin.c3 locate std lib. 2020-07-31 16:29:52 +02:00
Christoffer Lerno
f45d6ef84b Fix, separate out the function pass from the decl pass. Diagnose non-visible symbols as not visible rather than missing. Fix crash when module identifier is incorrect. !! operator added. New character literal parsing. Added simple test framework. 2020-07-21 23:43:28 +02:00
Christoffer Lerno
dc86c21210 New failable based error handling. Labelled break/continue/next. 2020-07-09 13:07:08 +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
d8423eff56 Fix space at end of file. 2020-05-03 02:08:33 +02:00
Christoffer Lerno
373001fd12 Error -> errset (temporarily). Catch / throw now works, but it will not yet correctly handle defer. 2020-05-03 02:04:13 +02:00
Christoffer Lerno
400c38b95b Use correct sizes and alignments. Fix designated initializers and literals. Added todo 2020-04-06 13:45:58 +02:00
Christoffer Lerno
2e3bbf119c Lexer cleanup 2020-03-29 17:40:03 +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
Christoffer Lerno
946ca18cee Support for subscripts. Added helloworld. 2019-12-11 17:22:48 +01:00
Christoffer Lerno
fc3bd57ecf Major type check rewrite. Fixed params to be writable. Conditionals work. Lots of assign operators fixed. Struct access works. 2019-12-08 16:52:29 +01:00
Christoffer Lerno
aee3f99ea7 Added some codegen & .o generation and (hopefully correct) optimization. Hacked strings in together with i++/i--. Fixed up parsing of strings supporting \u \U \x => UTF8 2019-11-27 16:16:44 +01:00
Christoffer Lerno
990918b609 LLVM Codegen 2019-11-20 17:09:25 +01:00
Christoffer Lerno
5f00d4c2bc More parsing, start working on packages. 2019-09-16 12:34:23 +02:00
Christoffer Lerno
3b2051ea80 More casts done, bugs fixed, codegen expanded, correct ordering in codegen, if, label, goto, break, switch, continue, compile time if analysed, 2019-09-07 00:58:56 +02:00
Christoffer Lerno
0dba2b8569 Partial codegen 2019-09-04 12:51:01 +02:00
Christoffer Lerno
2eb91083a6 Refactor type handling, some extremely simple codegen, but mostly work on casts (not finished) 2019-09-01 01:58:21 +02:00
Christoffer Lerno
ebce81ad51 Parses most of C3. 2019-08-25 08:40:07 +02:00
Christoffer Lerno
386ef35f36 Started a bit on parsing. Picking pieces from Titanos and trying to do things better. 2019-07-31 23:19:45 +02:00