Skip to content

Catch invalid slice expressions at compile time #16

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkantor
Copy link

@mkantor mkantor commented Dec 21, 2021

For programs which compile expressions and then later evaluate them it is nice to flag invalid syntax during the compilation stage.

As far as I can tell, invalid slices with a step of 0 were the only realistic situation where this wasn't already the case (it's validated by TreeInterpreter.ts but ignored in the compiler). This pull request changes that to make invalid slice expressions like a[2:1:0] trigger compilation errors.

@mkantor mkantor force-pushed the invalid-slices-are-compile-error branch from 7f4fd53 to d06d5b2 Compare December 21, 2021 18:34
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 this pull request may close these issues.

1 participant