Skip to content
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

Cannot interpret nested call statements in return #43

Open
kobbled opened this issue Nov 7, 2022 · 1 comment
Open

Cannot interpret nested call statements in return #43

kobbled opened this issue Nov 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kobbled
Copy link
Owner

kobbled commented Nov 7, 2022

local := R[70..80]

def func2(val, exp) : numreg
  return(Mth::exp(exp * Mth::ln(val)))
end

power := R[20]
power = ns1::func2(4, 2)

gives error:

indirect_node.rb:70:in `id': undefined method `value' for #<TPPlus::Nodes::ArgumentNode:0x000001f424c699f8 @id=3, @comment=:ret> (NoMethodError)

        @target.value\r
@kobbled kobbled added the bug Something isn't working label Nov 7, 2022
@kobbled
Copy link
Owner Author

kobbled commented Nov 7, 2022

Current work around is to put it outside of return using a local register

local := R[70..80]

def func2(val, exp) : numreg
  num := LR[]
  num = Mth::exp(exp * Mth::ln(val))
  return(num)
end

power := R[20]
power = ns1::func2(4, 2)

kobbled added a commit that referenced this issue Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant