Skip to content

Catch invalid slice expressions at compile time#16

Open
mkantor wants to merge 1 commit intonanoporetech:masterfrom
mkantor:invalid-slices-are-compile-error
Open

Catch invalid slice expressions at compile time#16
mkantor wants to merge 1 commit intonanoporetech:masterfrom
mkantor:invalid-slices-are-compile-error

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