Commit graph

33 commits

Author SHA1 Message Date
c7920246a5 codegen: add emitting of unary exprs 2019-09-28 17:58:17 -03:00
3d47c0cca8 parser: fix unary operators causing stack overflow 2019-09-28 17:52:30 -03:00
a136a377ce change symbol table to use pointers to heap allocated symbols 2019-09-28 13:17:11 -03:00
d235ce0d13 add codegen for allocating vardecls onto stack (not init yet)
codegen pass needs type information about the variable. thankfully,
analyze pass already did the hard work for it, and scope info has types
of all its declared names. we use that info to generate the alloca

to have information about which current scope we are, we add a "child
index" to scopes so we can repoint current context at them instead of
bumpScope(), which always creates new, empty ones.

initializer exprs are next
2019-09-27 22:36:35 -03:00
dfb7989123 add necessary hello.c code as we dont have linking step 2019-09-27 21:22:03 -03:00
849bbc0e94 add support for resolving parameters in function body 2019-09-27 20:39:16 -03:00
3f48be3420 codegen: prepare for variable emitting 2019-09-27 17:18:38 -03:00
362fc7e3ef analysis: add name type resolution
this only adds resolution for the types. for the actual metadata, such
as e.g parameters, that isn't available, so codegen isn't helped by
this.
2019-09-27 15:12:30 -03:00
4346636cfa analysis: add check for call expr's arguments 2019-09-27 14:31:59 -03:00
3f94082477 analyze: make VarDecl statements insert symbols to current scope 2019-09-27 14:07:42 -03:00
466243fc2b add checking of numeric types around boolean operators 2019-09-27 13:49:53 -03:00
68b9855309 remove _start from examples/hello.ry 2019-09-27 13:40:05 -03:00
86c7f7dd6a comp_ctx: remove Environment in favor of UnderlyingTypeMap 2019-09-27 13:39:04 -03:00
7e41d03eb9 add proper Integer32 and Integer64 literals 2019-09-27 12:07:20 -03:00
76d888bde8 analysis: create err ctx buffer on init()
- do better error message for resolveGlobalType
2019-09-27 10:47:34 -03:00
2cb328c3f9 analysis: ensure Get.name exists in enum 2019-09-26 22:27:05 -03:00
6543884366 analysis: add check of composite types (structs and enums)
- analysis: add bool check for loop condition exprs
2019-09-26 22:22:11 -03:00
64e39a6f1e ast_printer: print scopes inside functions
- comp_ctx: add children attr for debug info
2019-09-26 16:58:57 -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
5036be02e3 add rudimentary return type analysis for call exprs 2019-09-25 17:17:47 -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
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
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
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
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
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
3ad0859bc9 add 'error contexts' to parser error reports 2019-09-20 13:16:55 -03:00
53d41b31e7 add examples/hello.ry 2019-09-18 11:37:08 -03:00