-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let/var, block, stmt list semantics fixed
- let and var section semantics clarified: - section normalization rules - macro pragma processing - nkError generation - normalize symbol pragma data storage - block semantic analysis uses case/let style - stmt list semantic analysis clarified: - collapses nested stmtLists, unless a block arg - pragma block analysis less likely to break defer - number of other fixes let and var section semantics clarifications: - section asts are normalized per identdef and var tuple - macro pragmas are processed on the normalized ast - macro pragmas receive one normalized section at a time - then each normalized section is semantically analysed - identifier related pragmas are processed here - other pragmas remain and are processed on the symbol during codegen - identdef symbols always have a pragmaexpr, even if empty let and var section internal change remarks: - semVarOrLet renamed to semLetOrVar - uses nkError exclusively, resulting in some cascade changes - production nodes (result) are now entirely distinct from input nodes this results in more allocations but it'll make DOD easier in the end - introduced `ast.newTypeError` to create error types with the `n` field containing an nkError, establishing a tyError convention - documented analysis in proc comment cascade internal changes: - vmgen and transf handling of let/var sections and normalized data - `msgs.illformedAstReport` introduced to stop forced `localReport` cascade changes template evaluation: - template evaluation watches and reports nkErrors -- not ideal cascade changes block semantic analysis: - `semBlock`: now produces nkErrors - production and input nodes are now separated - added some docs cascade changes stmtlist semantic analysis: - `semStmtList`: now produces nkErrors - production and input nodes are now separated - flattens nested stmts, unless a `do:` `nfBlockArg` - added some docs cascade changes type sections: - semTypeNode and semTypeOf/2 are becoming nk/tyError aware cascade changes semPragmaBlock: - pragmas blocks are less likely to screw up defer processing - pragmas block items disappear after processing from the production - updated `exception/tdefer1` test with a `{.line.}` pragma for this miscellaneous changes: - adding tracing to more sem procs (block, stmtlist, when, const expr, ...) - added many more asserts and checks to clarify input expectations - tracing output is more compact and also faster - introduced `ast.newSymNode2` that is skError aware, future refactors will likely have this used nearly everywhere in the compiler - slightly more precise error messages for let and var sections - fixed bug in astrepr leading to NPE for type printing - fixed bug so error nodes now generate node ids - fixed bug in stdlib.macros to handle empty nkPragmaExprs next steps for later: - bring semConstSection in line with this section - `nfBlockArg` is a hack, should be removed for a node - error msg in `errmsgs/twrongcolon` wasn't good before not great now
- Loading branch information
Showing
24 changed files
with
1,199 additions
and
456 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
Oops, something went wrong.