-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't do recursive call: move function names to a goto_stack *dictionary*? #46
Comments
try using timer to see line number steps/goto's |
"end function" not working: After checking goto_stack's functions' local_variables and index_called_froms, it seems that actually |
Maybe move functions from |
check_function(): i = function.index_called_from = None <-- goto_stack = [...] but goto_stack[-1][1].index_called_from = None |
Issue found: Tracked index_called_from for each item in goto_stack: for some reason all recursive instances have the same index_called_from (they should have different index_called_from's; i.e. the first call should have been made outside the function). Possible fix(es):
|
Problem 1: When trying to assign a function output to a variable, it seems the variable is created in the global variable_dictionary instead of the local function local_variables, and
Test 0c98e2c with:
|
should output:
|
not quite closed: test with:
this incorrectly outputs:
when it should output:
[EDIT:] What does not work is using two recursive calls within the function (even if assigning to separate variables first). |
v0.1.0 Interpreter --> v0.2.0 Transformer (translates to Python code) |
Test with https://github.com/hchiam/please/blob/06f686e6dc1793e5bea88c024c7a63b3f46d02e5/text.txt
And then test that nothing else broke with https://github.com/hchiam/please/blob/master/library/expected_output.md
Variables to fix:
goto_stack: append(), pop(), [-1]
goto_locations in check_for() for current_loop
The text was updated successfully, but these errors were encountered: