Skip to content

fix parsing quirky incomplete expressions#1838

Merged
ggmichaelgo merged 3 commits into
mainfrom
quirky-lexer-parsing
Oct 30, 2024
Merged

fix parsing quirky incomplete expressions#1838
ggmichaelgo merged 3 commits into
mainfrom
quirky-lexer-parsing

Conversation

@ggmichaelgo
Copy link
Copy Markdown
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 a team, Maaarcocr and ianks October 29, 2024 20:14
Comment thread lib/liquid/lexer.rb Outdated
elsif (sub_table = COMPARISON_JUMP_TABLE[peeked])
@ss.scan_byte
if (found = sub_table[@ss.peek_byte])
if !@ss.eos? && (found = sub_table[@ss.peek_byte])
Copy link
Copy Markdown
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])

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