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

Panic on consecutive "enclosing items" (lists, strings, maps) #4

Open
patataofcourse opened this issue Dec 23, 2021 · 2 comments
Open
Labels
bug Something isn't working panic

Comments

@patataofcourse
Copy link
Owner

Example:

["game over & other shit", {gameover}] ["exit", None]

Panic shown:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/parsing/mod.rs:349:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@patataofcourse patataofcourse added bug Something isn't working panic labels Dec 23, 2021
@patataofcourse
Copy link
Owner Author

Can confirm it still happens on commit 597b559

@patataofcourse
Copy link
Owner Author

patataofcourse commented Oct 13, 2022

Fix from 848b18a turned out to be p bad so I reverted it.
Basically these two expressions get interpreted as one due to the lack of delimiters. Probably gonna need to polish up a bunch of parser stuff to get it to work as intended.

The thing is - if the expression is "foo" [bar] "baz", the parser detects that this expression starts and ends with quotes, so it tries to get the index for this string. With "simplified" strings and brackets, instead of "0", this looks like "0" {0} "1", so it tries to parse 0" {0} "1 as a number, which obviously fails. The fix isn't adding an error message to this edge case, but avoiding it altogether.

@patataofcourse patataofcourse changed the title Panic on consecutive lists Panic on consecutive "enclosing items" (lists, strings, maps) Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working panic
Projects
None yet
Development

No branches or pull requests

1 participant