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

Boolean logic not working for assignment in dotted "set" notation #156

Closed
TwitchBronBron opened this issue Feb 6, 2019 · 0 comments · Fixed by #191
Closed

Boolean logic not working for assignment in dotted "set" notation #156

TwitchBronBron opened this issue Feb 6, 2019 · 0 comments · Fixed by #191
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser
Milestone

Comments

@TwitchBronBron
Copy link
Contributor

These lines of valid brightscript all produce parse errors:

m.isTrue = true = true
m.isTrue = m.isTrue = true
m.isTrue = m.isTrue = m.isTrue

However, wrapping each of them in parentheses removes the error.

  m.isTrue = (true = true)
  m.isTrue = (m.isTrue = true)
  m.isTrue = (m.isTrue = m.isTrue)
@sjbarag sjbarag added this to Medium Priority in Issue Triage Mar 9, 2019
@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser labels Mar 9, 2019
sjbarag added a commit that referenced this issue Mar 9, 2019
The parser was a little bit too greedy when attempting to detect set
statements, which I should have noticed with the weird workarounds in
that function.  Now that we're _not_ trying to read an entire expression
as the left-hand side of a set statement (e.g.  `foo + bar *= 3`), that
complication can be removed.

Arbitrarily complex expressions are now supported on the right-hand side
of a set statement, e.g. `foo.bar = true and false or 3 > 4`

fixes #156
@sjbarag sjbarag added this to the v0.13.0 milestone Mar 9, 2019
Issue Triage automation moved this from Medium Priority to Closed Mar 9, 2019
sjbarag added a commit that referenced this issue Mar 9, 2019
The parser was a little bit too greedy when attempting to detect set
statements, which I should have noticed with the weird workarounds in
that function.  Now that we're _not_ trying to read an entire expression
as the left-hand side of a set statement (e.g.  `foo + bar *= 3`), that
complication can be removed.

Arbitrarily complex expressions are now supported on the right-hand side
of a set statement, e.g. `foo.bar = true and false or 3 > 4`

fixes #156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser
Projects
Development

Successfully merging a pull request may close this issue.

2 participants