gobuffalo / plush

The powerful template system that Go needs
MIT License
895 stars 57 forks source link

Fix panic when let statement is not followed by an equal sign #174

Closed Mido-sys closed 1 year ago

Mido-sys commented 1 year ago

What is being done in this PR?

Type in here a description of the changes in this PR. Fix 170

What are the main choices made to get to this solution?

return stmt instead of nil to avoid using reflection in parseProgram. Also, improve parseStatement to return nil to safeguard parseProgram from panicking when trying to call String() on ast.Statement

List the manual test cases you've covered before sending this PR:

Added a new test Test_Let_Ident_NotInitialized under variables_test.go