-
Notifications
You must be signed in to change notification settings - Fork 5
Try blocks aligned #29
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
Conversation
The However, I think that's because I'd forgotten that I'd won the battle not to enforce matching |
If you are willing to enforce syntax with |
Yeah. I'm finally starting to lean that direction 😉 As you know, the thinking behind the flexibility is that the linter should enforce consistency, and the compiler permit poor style, so that while a developer is quickly iterating on code they can proceed with mismatched style and then fix it up later. However, we don't currently have lsc-specific linting rules, and it's now looking like that might be a ways out. So while there will probably be other language features that are permissive in the hopes of a future linter coming to the rescue, I think it might be worth just enforcing consistency at the compiler level for now, and possibly reimplementing the current behavior later. @wcjohnson it sounds like you'd be in favor of that (you always wanted consistency enforced here anyway, IIRC) – @citycide any thoughts on this? |
Actually, the stack looks necessary in cases like this anyway: x = if a:
if (b) {
c
}
else if d:
e where, when parsing the inner |
I'll give that a try, thanks |
Err, sorry, @wcjohnson at a high level can you explain how you handled the lookahead problem there? |
The approach I outlined probably won't work; I thought about it some more and deleted the comment. I do think it can be done without lookahead but it wouldn't be that straightforward. |
Hmm, k. I think I'll continue to use the stack but might still enforce |
(FYI, I have to head out for the day soon and likely won't finish before then) |
22fa5bb
to
a64557c
Compare
Updated, now enforces matching |
Will merge tomorrow unless anyone has concerns |
I think this is the right way to go, no objections here. |
Addresses lightscript/lightscript#23
cc @wcjohnson