Commit Graph

28 Commits

Author SHA1 Message Date
Luna 5713df2a8b more fixes 2020-07-23 17:17:06 -03:00
Luna 56be677c7a at() -> items[] 2020-07-23 16:46:46 -03:00
Luna 03561ebe6a zig fmt pass 2020-07-23 16:42:49 -03:00
Luna 049a388660 more fixes for latest zig 2020-04-01 21:48:08 -03:00
Luna 5ae47fb962 zig fmt pass 2020-04-01 16:09:52 -03:00
Luna 7976b64cf6 tuple-inator pass 2020-04-01 16:09:39 -03:00
Luna e42a97e192 use 'as' builtin
- move src/codegen.zig to src/codegen/llvm.zig
2019-11-25 21:42:24 -03:00
Luna 5348e2b5c4 remove Stmt as an AST node
it was only used for printing purposes, even though we can use the
existing printStmt() function.
2019-10-05 10:37:28 -03:00
Luna 88e505b524 parser: rename main function to __rayoko_main 2019-09-29 12:46:31 -03:00
Luna 9869cca2ae remove mutability/publicability
i may implement those in a better way, which isn't V's
2019-09-28 18:09:58 -03:00
Luna 3d47c0cca8 parser: fix unary operators causing stack overflow 2019-09-28 17:52:30 -03:00
Luna 7def9abc5a add "variable metadata"
this is inserted in the analysis pass into a map from expr ptrs to
metadata in the compilation context itself, this enables codegen to
fetch that metadata with the expr pointer

the other approach was embedding it into the variable expr itself (as
seen by VariableExpr), but that causes a compiler crash
2019-09-27 17:08:01 -03:00
Luna 7e41d03eb9 add proper Integer32 and Integer64 literals 2019-09-27 12:07:20 -03:00
Luna fc9f5d9ce0 add get expr analysis
- rename GetExpr.struc to GetExpr.target
2019-09-26 18:03:39 -03:00
Luna 45275d73db change variable declarations to statements
doing them as expressions was a hack since no 'var' keyword,
also, yeet the := operator from the parser.
2019-09-25 22:22:13 -03:00
Luna cb8908dc80 add type analysis for consts
- add the basics of recursive type resolving for expressions
 - set err context for enum
2019-09-25 14:34:32 -03:00
Luna 9e80ad4c23 fix if statement emitting
- don't emit br instructions (or any other) if branch emits ret
 - remove phi node (ifs are statements, not exprs)

 - emit to testfile (even if ir is broken)
2019-09-24 18:49:35 -03:00
Luna 1bb1fb813d add basics of if statement emitting
- add util mkLLVMBool
 - add left/right paren to if statements
 - lowkey fix for statements' semicolon
2019-09-24 14:12:37 -03:00
Luna e25621350a fix boolean operators
- remove Logical expressions
 - add basic token return type to LLVMTypeRef converter
 - add codegen for Bool literals
 - fix "and" and "or" being identified as identifiers
2019-09-24 13:23:23 -03:00
Luna f08d613198 switch BinaryExpr.op to BinaryOperator instead of token
less strings, more fun!
2019-09-23 23:18:31 -03:00
Luna 250631ff41 move Parser.mkFnDecl => ast.Node.mkFnDecl 2019-09-20 13:54:52 -03:00
Luna 79107f876b add semicolons after statements 2019-09-20 13:34:13 -03:00
Luna 126bd476d6 fix function parameter parsing
- fix struct's err ctx
 - rm err when parsing get exprs and others
2019-09-20 13:32:35 -03:00
Luna 075d2f22a5 add error contexts to other top levels 2019-09-20 13:24:52 -03:00
Luna 3ad0859bc9 add 'error contexts' to parser error reports 2019-09-20 13:16:55 -03:00
Luna 7ddd37b725 add synchronization to the parser 2019-09-20 12:22:46 -03:00
Luna 180444a5d6 fix for latest zig 2019-09-18 16:53:44 -03:00
Luna 927c0f6a1c add vig's parser 2019-09-18 15:59:11 -03:00