This change is a complete revamp of the parser and how the parsed statements (now called nodes) are interpreted.
Additionally, this adds some features that were too hard to implement previously.
The parser now takes the tokens and generates an abstract syntax tree, consisting of different nodes.
The nodes are interpreted using the visitor pattern by the Interpreter class.
New features:
nullable function parameters
default values for function parameters
(only available for native functions) union types for functions parameters
(only available for native functions) return types for functions
exceptions that were previously printed with the affected code can now also show the causing token
The CLI has a new parse command to show the parsed abstract syntax tree (AST).
Inspired by and will fix #104.
This change is a complete revamp of the parser and how the parsed statements (now called nodes) are interpreted.
Additionally, this adds some features that were too hard to implement previously.
The parser now takes the tokens and generates an abstract syntax tree, consisting of different nodes. The nodes are interpreted using the visitor pattern by the
Interpreter
class.New features:
The CLI has a new
parse
command to show the parsed abstract syntax tree (AST).