* Add Report.debug
* Implement function call scoping
* Implement variable scoping
- Rename `Identifier::scope` to `calling_scope`, and concatenate the identifier scope into `name` if necessary.
- Track current scope in SemanticAnalyzer, similar to UserFunctionVisitor.
- Use current scope in SemanticAnalyzer when visiting identifiers.
* Update grammar for `::identifier` global scoping
* Introduce ScopableName for function resolution
* Address review comments
- Check for display_debugs missing
* Add ScopableName for identifier resolution
* Some cleanup
- Remove `Identifier::calling_scope`, as it is tracked in the semantic
analyzer
- Refactor `ScopeName::exists` to `global` for better clarification of
its use
- Removed `X::maybe_scoped_string/name`
* Address self-review comments
* Rename `Function::module_name` to `scope`
* Update grammar
* Update parser and AST generator
* Update semantic analysis
* Executor implementation
- Move Executor stack modification logic to BFunctionRef
- Handle user function calls
- Handle expression function calls
* Tests
* Update existing listfile snapshots
- Adds variadic boolean to instruction stack
- Changes instruction counts and offsets
* Fix test issue
* Better implementation of calling user functions
* Add var-args-captures test
* Refactor continuation handling + handle variadic args
- Move stack modifications from make/withContinuation into the executor's handling of the continuation
- Only trim args in continuation call if function is not variadic
* Add var-args-continuation test (via array.filter)
* update escriptguide + formatting, docs
* Fix CI annotations
- '=': conversion from 'size_t' to 'unsigned int', possible loss of data
- declaration of 'continuation' hides previous local declaration
Adds:
- ast/UserFunction AST node for user-defined functions.
- astbuilder/AvailableUserFunction: reference to a parse tree for a user function.
- The AST builder only generates ASTs for user functions that are actually referenced.
- astbuilder/UserFunctionVisitor: visits (builds an AST for) a parse tree for a user function.
- This happens after the .src or .inc file has been otherwise processed, so this class serves to hook up the correct SourceFileIdentifier to the AST.
Adds enough to build the AST nodes for the module function declarations in a .em file.
Adds:
- Function: base class for module function declarations and user functions
- FunctionParameterDeclaration: declaration for a function parameter, as well as its default value if any
- FunctionParameterList: just a holder for function parameter declarations
- ModuleFunctionDeclaration: for function declarations in .em files
- FunctionResolver: hooks up function calls to module functions or user functions
- ModuleProcessor: a visitor for processing const declarations and module function declarations (const declarations are yet to come from the main branch)