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

Add Expression.isResult(child?: Expression) #128

Open
ClickerMonkey opened this issue Oct 20, 2020 · 0 comments
Open

Add Expression.isResult(child?: Expression) #128

ClickerMonkey opened this issue Oct 20, 2020 · 0 comments
Assignees

Comments

@ClickerMonkey
Copy link
Member

We need a way to know whether an expression is used as a value (commonly referred to as rvalue).

When we're building runtimes that output certain languages as text, things like for/while/do/if/switch can be inline UNLESS it's being used as an rvalue.

The function will look at the parent expression, and run parent.isResult(this). If the child is used as an rvalue in the parent expression return true, otherwise default to the grandparent if one exists.

@ClickerMonkey ClickerMonkey self-assigned this Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant