Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast: Refactor type checker and environment state
This commit does not change any functionality it just updates the implementation so that type environment mutation only occurs within the type checker. This makes it easier to reason about changes to the type environment data structure(s). Specifically: * The type environment constructor is now private. Callers do not need to instantiate type environments. This should only be done by the checker. No one appears to be using this constructor so while this is backwards incompatible, it should be safe. * The schema set is now held by the checker as opposed to the type environment. The environment should not have to know anything about the schemas. * The global input schema is now loaded by the compiler on init() on and provided as input to the checker along with other global options like the schema set. This avoids having the compiler reach into the type environment to perform updates. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information
Showing
4 changed files
with
92 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters