-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
big code reorganization: TypeChecker record
Several big changes, that were done in tandem, and which would be too troublesome to break into separate commits. The goal here is to ultimately be able to break tl.tl into multiple files (because its size started hitting limits in both Lua 5.1 (number of upvalues) and Lua 5.4 (number of locals). Here's a high-level summary of the changes: * new Errors record, encapsulating error-reporting concerns; * all Type occurrences have unique objects reporting their locations (no more singletons for base types such as BOOLEAN and INVALID); * some enums renamed for more consistency across Gen and Feat options; * TypeCheckOptions and EnvOptions tables reorganized for easier forwarding of options across them; * simplifications in the various function signatures of the public API; * all Types and Nodes store filename, line and column location (`f`, `y`, `x`); * Scope is now a record containing the variables map and unresolved items -- no more "@unresolved" pseudo-variable and `unresolved` pseudo-type for storing this data in the symbols table; * `type_check` now uses a TypeChecker object for storing all state, instead of relying on closures and function nesting (that's a bit sad is it ended up spreading `self:` and extra function arguments everywhere, but I guess state management will be more explicit for others reading the code now...); * all Fact objects have a Where location as well, and supressions of inference data in error messages for widened-back types is marked explicitly with `no_infer` instead of missing a `w` field; * general simplification of the sourcing of error locations (though I would still like to improve that further);
- Loading branch information
Showing
14 changed files
with
6,465 additions
and
6,168 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
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
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
Oops, something went wrong.