You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would also make sense to move type infers into check. Having them in the parser is a bit unintuitive.
Should this be done while parsing the tree instead?
I think this should be a separate build step. Parse step should transform tokens into an AST, and check step should work on that AST (possibly updating it). If we try to merge them together it would overload the parser more than it should.
Should this be one large check, or modular checkers that run sequentially?
Let's not go into super modular design as it would complicate things. A single build step but the main check function can sequentially run helpers when needed would work for this.
// Can mutate the AST when doing type infersfncheck(prog:&mut ast::Program, ...) -> CheckResult{// ...infer_types(prog, ...);// ...check_compatible(prog, ...);// ...}fninfer_types(prog:&mut ast::Program, ...) -> CheckResult{
...}fncheck_compatible(prog:&ast::Program, ...) -> CheckResult{
...}
The checking of the AST currently happens through running the generated code. This is obviously a bad idea.
We should implement a
check
phase after parsing the AST. For now, the following checks should be in place:let x: int = "Hello"
is invalid, etc.)Room for discussion
checker
s that run sequentially?The text was updated successfully, but these errors were encountered: