Commit graph

38 commits

Author SHA1 Message Date
tocariimaa
873b691ca0 implement line comments 2025-01-31 21:46:28 -03:00
tocariimaa
91375ea572 allocate AST node only when needed 2025-01-30 23:37:17 -03:00
tocariimaa
8cd31829ad move to C-style braces 2025-01-30 18:14:43 -03:00
tocariimaa
e6b0294807 guess what, it CAN happen 2025-01-30 18:01:55 -03:00
tocariimaa
35167781cd move string functions out from the header 2025-01-30 17:59:26 -03:00
tocariimaa
a66b88b1d3 unretard
What was I thinking????
2025-01-30 17:52:01 -03:00
tocariimaa
fe27d20130 fix function call parsing
was broken by commit #ac6cc21
2025-01-30 17:42:17 -03:00
tocariimaa
828b84e1cc parser: adjust location info for variable_decl 2025-01-21 19:42:07 -03:00
tocariimaa
ac6cc2154d parser: implement subexpressions with parentheses
LOL I forgot to implement this before.
2025-01-21 18:13:33 -03:00
tocariimaa
db91cf09fc sema: use ast field here, add assertion 2025-01-21 14:36:18 -03:00
tocariimaa
632fe260fe sema: return proc return type instead of proc type itself 2025-01-21 14:35:47 -03:00
tocariimaa
53d1825d5b C codegen: emit correct operator instead of placeholder 2025-01-21 14:35:01 -03:00
tocariimaa
319047ccea add < and > operators to enviroment 2025-01-21 14:34:23 -03:00
tocariimaa
b127522ef7 C codegen: always use int return type for main 2025-01-21 00:29:27 -03:00
tocariimaa
69f6509083 remove useless function 2025-01-21 00:20:21 -03:00
tocariimaa
71fb88602f move to nominal typing for some types 2025-01-20 19:30:22 -03:00
tocariimaa
6ff868a646 rename: attribute -> pragma in fields 2025-01-20 19:03:33 -03:00
tocariimaa
ea9e8b7d0d rename: attribute -> pragma 2025-01-20 18:54:23 -03:00
tocariimaa
9b120090c0 move compiler entry point file to project root 2025-01-19 20:27:45 -03:00
tocariimaa
57097d6779 comment here 2025-01-19 19:42:44 -03:00
tocariimaa
ea75f19804 move expression to func 2025-01-19 19:32:01 -03:00
tocariimaa
c1d54991c0 remove usage of goto 2025-01-19 19:23:39 -03:00
tocariimaa
c984c94ac8 tweak graphic 2025-01-19 19:21:15 -03:00
tocariimaa
58aabecb3d style: remove braces 2025-01-19 19:19:23 -03:00
tocariimaa
abc6a16294 use macro constant here 2025-01-19 19:12:45 -03:00
tocariimaa
41589320de preliminary variable decl type inference from expr
Start work on basic type inference, here for inferring the type of a
variable declaration from its assigned expression.
2025-01-15 13:47:59 -03:00
tocariimaa
001a06dd2d pass correct location to return expression check
The `return` statement location was being used instead of the expression
location.
2025-01-15 13:07:17 -03:00
tocariimaa
af60de0d62 lexer: use Str_from_buf here 2 2025-01-13 14:52:14 -03:00
tocariimaa
3d8c20f5c3 fix wrong null terminator assertion 2025-01-13 14:48:12 -03:00
tocariimaa
33c8f0b841 lexer: use Str_from_buf here
Instead of handcrafting the `Str` struct.
2025-01-13 14:38:25 -03:00
tocariimaa
0bedfa70c5 convert Sb macro to a proper function
...this way we can assert that the provided buffer is actually
null-terminated.
`Sb()` -> `Str_from_buf()`.
2025-01-13 14:34:25 -03:00
tocariimaa
842322bedc lexer: increment column count in multibyte tokens 2025-01-13 14:17:14 -03:00
tocariimaa
628d656207 lexer: remove this useless code 2025-01-12 23:50:41 -03:00
tocariimaa
cad0e29978 lexer: move this macro definition 2025-01-12 23:17:46 -03:00
tocariimaa
698a10e4ba lexer: save token location here too 2025-01-12 23:17:32 -03:00
tocariimaa
f5230501a9 separate Location for identifier and type in AST
`AstIdentTypePair` AST node.
2025-01-12 23:15:03 -03:00
tocariimaa
7f5bcf4f77 lexer: make each token return its location 2025-01-12 23:13:17 -03:00
tocariimaa
bba597f7bf Initial commit 2025-01-12 18:20:42 -03:00