Commit graph

62 commits

Author SHA1 Message Date
800de413cf Add sizeof & alignof builtins 2026-04-03 00:04:12 +03:00
2a3e2171b0 Implement field access for pointer-to-struct 2026-04-02 22:48:54 +03:00
8ba5345daf Implement ternary ifs 2026-04-02 20:19:55 +03:00
06d509bcab Add break & continue statements 2026-04-02 17:10:42 +03:00
e2781fef8f Add ast::type_alignment 2026-03-31 19:27:14 +03:00
580ae22a98 Fix printing struct fields 2026-03-30 20:29:39 +03:00
ac6eacd80b Add a hacky implememntation of global constants 2026-03-30 20:02:41 +03:00
75f1cea3f3 Support casting pointers <-> u64 2026-03-30 20:01:56 +03:00
38fd23b50e Add left/right shift operators 2026-03-30 12:04:34 +03:00
1404437324 IR & Aarch64 compiler arrays support wip 2026-03-29 19:37:49 +03:00
79101ff3bd Fix computing struct layouts 2026-03-29 12:20:17 +03:00
14cb393076 Support comparison operators for integers of different types 2026-03-26 23:49:28 +03:00
81825aee7f Tweak reporting function call type error 2026-03-26 15:53:06 +03:00
5d7968c30b Implement IR + Aarch64 pointers 2026-03-25 16:30:43 +03:00
42e7f7961e New IR -> Aarch64 compiler wip: basic operations done (no pointers, structs, arrays) 2026-03-25 00:22:50 +03:00
0c11b09548 Pointers wip 2026-03-23 14:41:47 +03:00
ebc19fad20 Refactor type checker: remove useless scoping, resolve type layouts all in one go 2026-03-22 23:49:29 +03:00
c4d1252462 Refactor return AST node: store direct function node reference instead of relative scope level 2026-03-22 20:18:39 +03:00
5d00f1ddb7 Refactor AST: store direct references to AST nodes in indentifiers 2026-03-22 20:02:40 +03:00
292d6eeabf Refactor: split pre-AST (contains if/else if/else blocks, field definitions, no hierarchy) and the actual AST obtained after resolving scoping & indentation (contains if chains, no field definitions) 2026-03-22 14:06:34 +03:00
56c63d50ac Struct types refactor v2: store AST node pointer in struct type 2026-03-22 13:34:35 +03:00
d363be0eef Replace some usages of ostringstream with std::format 2026-03-22 12:51:38 +03:00
357baa9652 Fix printing function types like (a -> b) -> c 2026-03-22 12:50:22 +03:00
1a0dd2a48f Aarch64 JIT compiler wip: partial struct support 2026-03-17 18:08:23 +03:00
53be7b92df Store inferred struct field type in the field node itself 2026-03-16 12:44:27 +03:00
8c0b371fdb Implement computing struct layout (size, alignment, field offsets) in type checking 2026-03-15 20:12:01 +03:00
0d6b491fd4 Fix resolving top scope variables in resolve_identifiers (were considered global, but not anymore) 2026-03-15 16:34:14 +03:00
4b555c2ad4 Fix filename tracking in locations & separate prelude location and full block location for AST nodes containing statement lists 2026-03-14 00:48:46 +03:00
51c78169b3 Validate functions with no return & automatically add return in the end of a function returning unit 2026-03-13 13:40:09 +03:00
c8cd86dd0b Add foreign functions (stub in interpreter, implemented in aarch64 compiler) 2026-03-13 11:01:53 +03:00
13a9ba24f2 Refactor: split function definition & declaration in ast 2026-03-12 21:45:21 +03:00
927368aa80 Add short-circuiting versions of and/or (&& and ||) and implement them for bools and integers in interpreter and aarch64 compiler 2026-03-12 21:37:15 +03:00
7a3c7cca5d Support mutually recursive functions in identifier resolution & type checker 2026-01-16 15:25:44 +03:00
45004ce812 Fix inferring type of a != expression node 2026-01-05 10:23:13 +03:00
7ddc8ba25d Add f16 type & literals support in parser, type checker & interpreter 2026-01-05 00:36:11 +03:00
0ba3e4324d Interpreter clean-up (wip - identifier/function resolving is broken) 2025-12-29 14:42:25 +03:00
dea5c18cfd Explicitly mark constructor AST nodes 2025-12-23 13:43:54 +03:00
46a1031a08 Move return_statement to function.hpp 2025-12-23 12:18:22 +03:00
a36ba2610b Add inferred type to AST nodes & implement type checking & inference 2025-12-23 12:17:42 +03:00
7bca803136 Add scope level to return statement 2025-12-23 12:16:49 +03:00
a35add07db Refactor error types 2025-12-22 23:50:52 +03:00
c3c208b6a3 Rename numeric_literal -> primitive_literal 2025-12-22 23:49:08 +03:00
35435ac626 Rewrite get_location(statement/expression) using visitors 2025-12-22 18:52:57 +03:00
b5f46e77b6 Make tree visitors more type-safe by preventing implicit casts 2025-12-22 18:52:28 +03:00
438620db2f Remove unused expression type 2025-12-22 18:34:54 +03:00
5419f87a56 Support zero-initialization of built-in types and structs 2025-12-20 16:09:25 +03:00
d33b00e368 Refactor tree visitors (again) 2025-12-20 15:52:59 +03:00
8c07e1950b Simplify tree visitors 2025-12-20 13:20:44 +03:00
aee506d102 Rewrite identifier resolution using visitors 2025-12-20 13:05:51 +03:00
6276d97c6b Add type identifier source locations 2025-12-20 01:10:56 +03:00