Sofia teascade
teascade pushed to main at teascade/c-compiler 2026-04-30 19:44:12 +02:00
db8de8fc30 Add additional checks for creating br
teascade pushed to main at teascade/c-compiler 2026-04-30 19:42:51 +02:00
de702514d9 Fix bug in if-statements, implement continue and break correctly
6ca1641705 Add broken continue functionality
ddea133138 Typecheck break and continue correctly
9f3f64e6bd Parse break and continue
2b8d55b004 Codegen compound statements correctly
Compare 6 commits »
teascade pushed to main at teascade/c-compiler 2026-04-30 18:50:48 +02:00
a90259eccc Add AST for compound statement, break and continue
745447265e Parse comments correctly
Compare 2 commits »
teascade pushed to main at teascade/c-compiler 2026-04-28 15:19:59 +02:00
0fb63ee703 Update test.c
52614a7f01 Codegen while-loops
4cf5c9791a Parse while-statements
9817d9b8b6 Fix bug with typecheckign for-loops
Compare 4 commits »
teascade pushed to main at teascade/c-compiler 2026-04-28 00:45:37 +02:00
941e19d4dd Codegen for-loops
6247bc91f6 Add for-loop parsing
52e43ea1e2 Move ; parsing upper down the line
2d004cc5d8 Make for-loop parts optional
8d826326fa Add for-loop AST
Compare 5 commits »
teascade pushed to main at teascade/c-compiler 2026-04-28 00:07:01 +02:00
ba21718f71 Format unary plus correctly
4a0257c771 Add unary plus
5b776a1d66 Add negation unary
Compare 3 commits »
teascade pushed to main at teascade/c-compiler 2026-04-27 23:38:19 +02:00
43df7efd6f Add decrement and negation unops
teascade pushed to main at teascade/c-compiler 2026-04-27 23:16:25 +02:00
dd632b6bcc Codegen unary expressions
00689d3637 Parse unops
1103efe6fe Start adding unary operators
Compare 3 commits »
teascade pushed to main at teascade/c-compiler 2026-04-27 22:11:42 +02:00
d3d487159a Use static allocator
8530e1162d Pass allocator in codegen
bf87aa8c08 Add static allocator
Compare 3 commits »
teascade pushed to main at teascade/c-compiler 2026-04-16 22:47:54 +02:00
226118bcbb Fix some indexing problems
668e18e8ba Fix somelist_pointer
Compare 2 commits »
teascade pushed to main at teascade/c-compiler 2026-04-16 19:45:49 +02:00
c3e12b087a Add escaped backslash
c4837ca9b0 Improve escaped character parsing
63584525f2 Add escaping of characters
28be145a70 Remove const array formatting
53872373bf Check for const in assignment binop
Compare 11 commits »
teascade pushed to main at teascade/c-compiler 2026-04-16 01:09:09 +02:00
f0607a2310 Allow forward-declaration of structs
teascade pushed to main at teascade/c-compiler 2026-04-15 19:04:16 +02:00
21d17bb02d Parse field accesses
a12cf52c48 Add FieldAccessExpression
9ed753a238 Implement struct initialization
4b4d3ce14b Implement types_equal for Structs
b664ca8f9d Typecheck list initializer for structs
Compare 13 commits »
teascade pushed to main at teascade/c-compiler 2026-04-15 15:07:14 +02:00
55388bc6e3 Parse listinitializer
aa698c7ed6 Fix string type lvalue return type
eacbac9205 Implement ListInitializer
Compare 3 commits »
teascade pushed to main at teascade/c-compiler 2026-04-14 19:02:18 +02:00
5175878407 Fix wonky casting rules
teascade pushed to main at teascade/c-compiler 2026-04-14 18:27:58 +02:00
de881d73d2 Fix bug with string literals
e76540182f Possibly fix passing of arrays
b97aa3f212 Fix parsing of array type parameters
6efcb23d6b Add get_codegen_type
Compare 4 commits »
teascade pushed to main at teascade/c-compiler 2026-04-14 17:27:08 +02:00
45df4fdf5f Fix array to ptr cast
d3f0a730fd Make strings be char[n]
26779414a7 Implement arrays
c0a2c41c33 Fix parsing of empty arrays
0400aa1d99 Make empty arrays into just pointers
Compare 10 commits »
teascade pushed to main at teascade/c-compiler 2026-04-14 00:51:33 +02:00
be2d809986 Make ref and deref only parse primary expression
d3a4964f10 Add ret void to every function, to make sure one exists
01d4999e14 Store params in stack properly as well
acd1e5d39b Fix bug in deref
d4016e3ab7 Parse ref/deref/parenthesis
Compare 7 commits »
teascade pushed to main at teascade/c-compiler 2026-04-13 22:16:47 +02:00
57dc022241 Improve binop typechecking
51c54e375a Add better error raporting
28483812ea Allow implicit cast from char to int
e0f2a1620e Implicitly add cast if implicit cast is found
ee0e30934a Allow typechecker to perform implicit casts
Compare 5 commits »
teascade pushed to main at teascade/c-compiler 2026-04-13 20:29:08 +02:00
1555c12bbd Improve casts