Add user-defined functions to the grammar.
Functions are defined as def <name>(<parameters>) -> <return type> { <statements> }.
The return type is optional.
There is a return statement.
Functions are called as <name>(<arguments>).
Arguments need to be promotable to the types of the parameters.
Function calls are both expressions and statements.
Changest to the grammar
Add function declarations, global and local blocks, global and local block statements, return statements and expression statements.
Add types and simplified variable definitions and initializations.
Changes to the AST
Add global and local blocks, and block statements.
Changes to the v3x/analyzer
Add a stack of scopes.
Changes to v3x/resolver
Rename mapping to variable.
Rename FunctionTable to FunctionImplTable, for functions for which we have a C++ implementation.
Add FunctionTable, for functions defined in the cQASM file.
Changes to v3x/types
Rename real to float.
Changes to v3x/values
Add a ValueBase base class so that the arguments of a function call can refer to it.
Rename real to float.
Changes to v1x files
Move AnalyzerHelper and Scope classes out to separate files.
Use constants for type names instead of "magic" string literals.
Add user-defined functions to the grammar. Functions are defined as
def <name>(<parameters>) -> <return type> { <statements> }
. The return type is optional. There is areturn
statement.Functions are called as
<name>(<arguments>)
. Arguments need to be promotable to the types of the parameters. Function calls are both expressions and statements.Changest to the grammar
Changes to the AST
Changes to the
v3x/analyzer
Changes to
v3x/resolver
Changes to
v3x/types
Changes to
v3x/values
Changes to
v1x
files