-
Notifications
You must be signed in to change notification settings - Fork 101
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Currently Amber doesn't support recursion. We want to add this support to Amber.
Describe the solution you'd like
There are multiple key changes that have to be made for it to work:
- Variables declared in functions require
localprefix. Add this prefix toVarStmtFragment. Also updatedeclaration.rsfile to use the newly updatedVarStmtFragment. FunctionDeclarationstructures stored inParserMetadatarequire to store information whether or not this function is already being parsed (there might be a situation where the previous function wasn't parsed but we recursively call the same function)- Error message for recursion should be removed
- We should extensively test recursive functions for:
- pre order flow
- in order flow
- post order flow
- multiple (two is enough) recursive function calls in a single function (shallow recursion for quick script completion)
- multiple different (two is enough) recursive function calls in a single function (shallow recursion for quick script completion)
- multiple variants of recursion (calling the same function with the same parameter types, with different parameter types)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request