Commit Graph

18 Commits

Author SHA1 Message Date
Luna c3d3486163 rename types.zig to analysis.zig 2019-09-27 00:00:06 -03:00
Luna 2cb328c3f9 analysis: ensure Get.name exists in enum 2019-09-26 22:27:05 -03:00
Luna 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
Luna dfb954c39c analysis: insert "incomplete" function as soon as possible
by inserting it before we analyze statements, we allow ourselves to
analyze statements *with the data we already have*, for example, we can
now check the return statements' type, and see if it matches with the
functions' declared return type.

this is done via setting CompilationContext.cur_function on insertFn()

 - don't just ignore function analysis if its incomplete, do an error
2019-09-26 22:00:32 -03:00
Luna 093a8003b6 ast_printer: fix children printing
- add scope ids for debug purposes
 - add children to parent on Scope.createChild
 - types: add validation of if's condition expr type
 - types: add scopes to ifs
2019-09-26 21:36:26 -03:00
Luna fc9f5d9ce0 add get expr analysis
- rename GetExpr.struc to GetExpr.target
2019-09-26 18:03:39 -03:00
Luna 97c2437d97 add basic business logic for scopes 2019-09-26 16:04:11 -03:00
Luna e91c2dfdaf fix errs 2019-09-26 14:32:23 -03:00
Luna ae27995eb6 add rudimentary type analysis for return, if, loop 2019-09-26 14:23:15 -03:00
Luna 8065d0d905 s/nodePass/stmtPass 2019-09-26 00:12:47 -03:00
Luna 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
Luna 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
Luna 5036be02e3 add rudimentary return type analysis for call exprs 2019-09-25 17:17:47 -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 5188dac3c0 add type analysis of enums 2019-09-25 11:59:36 -03:00
Luna 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
Luna 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
Luna 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