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

Please add support for the PICO-8 Shorthand if #4

Open
JakeCarter opened this issue Dec 17, 2016 · 2 comments · May be fixed by #5
Open

Please add support for the PICO-8 Shorthand if #4

JakeCarter opened this issue Dec 17, 2016 · 2 comments · May be fixed by #5

Comments

@JakeCarter
Copy link

JakeCarter commented Dec 17, 2016

PICO-8 supports a shorthand for if/then statements.

if (foo=="foo") then
 x+=1
end

is the same as

if (foo=="foo") x+=1

When I use the shorthand, vim flags the next else or end as a mismatch. Unfortunately I'm new enough to vim to not understand the syntax files, but it would be awesome if this syntax file supported the shorthand.

@justinj
Copy link
Owner

justinj commented Dec 18, 2016

I'm also not super familiar with writing syntax files, I'm unfortunately really sure the best way to fix this. The problem is that when there's a shorthand if, the region following is wrongly interpreted as the inside of the condition (because it goes from an if to a then), specified by this line.

I can sort of make the indenting work, but I'm not sure how to fix the else/end problem because the syntax seems weird to parse with just vim syntax files. I'll think about it a bit more but if you have any idea of the best way to fix it I'd be open to hearing it! I agree this should be fixed.

@JakeCarter
Copy link
Author

Thanks for the feedback. I'll look into it as well. I'll let you know if I come up with anything.

@ghost ghost linked a pull request Sep 15, 2017 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants