ae27995eb6
add rudimentary type analysis for return, if, loop
2019-09-26 14:23:15 -03:00
8065d0d905
s/nodePass/stmtPass
2019-09-26 00:12:47 -03:00
bf035abadf
add lots of TODOs for variables and type analysis of statements
...
- comp_ctx: replace Function.symbols to Function.env
2019-09-26 00:11:48 -03:00
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
e69451cdd9
example: function calls can't happen on consts yet
...
- add suggestion to make it work as TODO
2019-09-25 18:10:17 -03:00
0b72462954
codegen: add emitting of call exprs
...
- codegen: add llvm value ref table to more easily fetch function
values
- comp_ctx: add fetchGlobalSymbol
- types: use ctx.fetchGlobalSymbol
2019-09-25 18:05:56 -03:00
5036be02e3
add rudimentary return type analysis for call exprs
2019-09-25 17:17:47 -03:00
04c624e210
codegen: add emitting of const declarations
2019-09-25 17:05:37 -03:00
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
1040eef79f
codegen: add emitting for enum get expressions
2019-09-25 12:28:22 -03:00
5188dac3c0
add type analysis of enums
2019-09-25 11:59:36 -03:00
0b0a8896bb
add basic resolution of enums to llvm types
...
- pass ctx to codegen
- add better type solver error for unhandled nodes
2019-09-25 11:29:47 -03:00
6b3d54aed7
embed FnDecl inside FunctionSymbol for correct param order
2019-09-25 10:53:10 -03:00
e2cca03d52
add type resolving for structs and fn params
...
- add a printer for the symbol table
- add error contexts to type pass
2019-09-25 00:26:30 -03:00
8afab8e4ed
comp_ctx: add FunctionSymbol.findSymbol
...
- add Variable symbol
2019-09-24 23:09:00 -03:00
bfe9f4fe0d
s/testfile/output.ll
2019-09-24 18:59:00 -03:00
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
c1d6939c43
add the rest of (currently nonfunctional) emitting of if stmts
...
- add compilation context and basics of type solver
2019-09-24 17:47:17 -03:00
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
1ac63cdbef
resolve llvm types for function parameters
2019-09-24 13:32:00 -03:00
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
f08d613198
switch BinaryExpr.op to BinaryOperator instead of token
...
less strings, more fun!
2019-09-23 23:18:31 -03:00
013aafa8a4
add emitting of integer and float literals
...
- remove panics
- add emitting for return statements
- remove default emitting of return a+b;
2019-09-23 22:07:19 -03:00
4c1bdb5f91
codegen: add incomplete generation of expressions
2019-09-23 18:34:12 -03:00
05c480c364
initialize all llvm features befbore emitting
2019-09-22 18:40:15 -03:00
469625d32a
add CompileError error type
2019-09-22 18:26:00 -03:00
4a2cc4b524
gitignore: add object files
2019-09-21 23:56:35 -03:00
a1bf15fe4d
add support for target machine
2019-09-21 23:56:22 -03:00
86e899e771
cgen: output .bc file
2019-09-21 12:37:41 -03:00
243e3cc694
fix llvm linking
2019-09-21 12:31:47 -03:00
6c3d20bbbb
add the basics of llvm codegen
2019-09-20 23:40:21 -03:00
250631ff41
move Parser.mkFnDecl => ast.Node.mkFnDecl
2019-09-20 13:54:52 -03:00
d69365ba92
ast_printer: fix printing of func params
2019-09-20 13:36:15 -03:00
79107f876b
add semicolons after statements
2019-09-20 13:34:13 -03:00
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
075d2f22a5
add error contexts to other top levels
2019-09-20 13:24:52 -03:00
3ad0859bc9
add 'error contexts' to parser error reports
2019-09-20 13:16:55 -03:00
7ddd37b725
add synchronization to the parser
2019-09-20 12:22:46 -03:00
084c5cc6ee
main: reset the scanner
2019-09-18 16:54:57 -03:00
180444a5d6
fix for latest zig
2019-09-18 16:53:44 -03:00
927c0f6a1c
add vig's parser
2019-09-18 15:59:11 -03:00
b14a32a104
scanner: remove LeftDoubleChevron and single-quote strings
2019-09-18 15:07:08 -03:00
93e7d9db7b
copy-paste vig's scanner into rayoko
2019-09-18 14:30:23 -03:00
05509d1181
fix switch on value
2019-09-18 13:44:40 -03:00
3b8943731e
main: add Result enum
2019-09-18 12:11:08 -03:00
53d41b31e7
add examples/hello.ry
2019-09-18 11:37:08 -03:00
c46229154c
zig init-exe
2019-09-18 11:20:09 -03:00
106ee3afe5
add LICENSE
2019-09-18 11:19:23 -03:00
91cad88a21
add readme
2019-09-18 11:03:24 -03:00