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

bug: Panic when let statement is not correctly used #170

Closed
Mido-sys opened this issue Dec 14, 2022 · 4 comments · Fixed by #171 or #174
Closed

bug: Panic when let statement is not correctly used #170

Mido-sys opened this issue Dec 14, 2022 · 4 comments · Fixed by #171 or #174
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Mido-sys
Copy link
Contributor

Mido-sys commented Dec 14, 2022

Description

When an uninitialized variable is called plush panics. Due to parseLetStatement() returns nil if the next token isn't =. As a result, when parseProgram() calls stmt.String() it panics as stmt is holding a nil value.

To Reproduce

let foo
if (foo){
 foo = 1
}

@Mido-sys
Copy link
Contributor Author

@sio4 I sent a PR request

@sio4 sio4 added this to the v4.1.18 milestone Jan 10, 2023
@sio4 sio4 added the bug Something isn't working label Jan 10, 2023
@sio4 sio4 self-assigned this Jan 10, 2023
@sio4 sio4 changed the title bug: Panic when uninitialized variable is called bug: Panic when let statement is not correctly used Jan 10, 2023
@sio4
Copy link
Member

sio4 commented Jan 10, 2023

(Note for future reference: The description is almost correct but the condition is not "when an uninitialized variable is called" but "the let statement is not correctly used without equal sign".)

@sio4 sio4 reopened this Jan 10, 2023
@sio4
Copy link
Member

sio4 commented Jan 10, 2023

I reverted merged PR #171 with #172. Please take a look at the comments on PR #171 and please consider filing a new PR! I will do my best to review that this time! (Sorry again for the delayed review :-)

@Mido-sys
Copy link
Contributor Author

@sio4, I sent another PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment