Skip to content

fix parsing quirky incomplete expressions #1838

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

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

ggmichaelgo
Copy link
Contributor

#1832 introduced a new bug in lax parsing, and prevented incomplete expression from pasing.

Example Liquid code:

{% liquid assign foo = false - 
%}

@ggmichaelgo ggmichaelgo requested review from ianks, a team and Maaarcocr October 29, 2024 20:14
@output << found
@ss.scan_byte
else
raise SyntaxError, "Unexpected character #{peeked.chr}"
end
elsif (sub_table = COMPARISON_JUMP_TABLE[peeked])
@ss.scan_byte
if (found = sub_table[@ss.peek_byte])
if [email protected]? && (found = sub_table[@ss.peek_byte])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !@ss.eos? && (found = sub_table[@ss.peek_byte])
if (peeked = @ss.peek_byte) && (found = sub_table[peeked])

@ggmichaelgo ggmichaelgo merged commit 8e40f80 into main Oct 30, 2024
11 checks passed
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.

2 participants