Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗 parser: Add scoped typed analysis to declarations (#15)
Add scoped typed analysis to declarations, ensuring that variables or parameters do not get redeclared in same block. Variables may be re-declared in inner scope of a new block with a new type which does not affect the outer scope. Add detailed tests for various scenarios. As the parser will also take care of type analysis this is a necessary addition and patches a whole in the previous global type analysis for redeclaration. Add a minor test refactor for parse error assertions This merges the following commits: * parser: Factor out parseError function in tests * parser: Add scoped typed analysis to declarations pkg/parser/parser.go | 196 ++++++++++++++++++++--------------- pkg/parser/parser_literal.go | 18 ++-- pkg/parser/parser_test.go | 135 ++++++++++++++++++++++-- pkg/parser/scope.go | 34 ++++++ 4 files changed, 282 insertions(+), 101 deletions(-) Pull-Request: #15
- Loading branch information