From 81e4c899b80b751d06afbbf317662b5f8cdb7a8f Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Tue, 13 Jan 2026 13:19:50 -0500 Subject: [PATCH 1/2] Fix lax specs & yaml error in error-handling.yml --- specs/basics/error-handling.yml | 26 ++++++++++++-------------- specs/liquid_ruby_lax/specs.yml | 12 ++++++++---- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/specs/basics/error-handling.yml b/specs/basics/error-handling.yml index 7e67200..0af3dcb 100644 --- a/specs/basics/error-handling.yml +++ b/specs/basics/error-handling.yml @@ -200,18 +200,18 @@ template: "{{ 'hello' || upcase }}" complexity: 330 error_mode: lax - errors: - parse_error: - - "unexpected" - - "filter" + expected: "HELLO" hint: | - Double pipes (||) are not valid Liquid syntax. The lexer/parser should - detect malformed filter chains. While '|' separates filters, '||' is - invalid. Syntax errors should be detected during parsing. + WART: Double pipes (||) in lax mode are treated as a single pipe followed + by a blank token, then another filter. The lexer interprets '||' as '|' + followed by '|upcase'. This quirky behavior is specific to lax mode. - name: "very_long_string_filter" template: "{{ long_string | size }}" - environment: { long_string: instantiate:LongString: { length: 100000 } } + environment: + long_string: + instantiate:LongString: + length: 100000 expected: "100000" complexity: 290 error_mode: lax @@ -308,13 +308,11 @@ template: "{{ 'hello' | }}" complexity: 340 error_mode: lax - errors: - parse_error: - - "filter" + expected: "hello" hint: | - A filter pipe with no filter name is a syntax error. Even in lax mode, - this cannot be parsed correctly. The parser should detect the incomplete - filter chain syntax - a '|' must be followed by a filter name. + WART: A trailing pipe with no filter name is silently ignored in lax mode. + The parser treats the empty filter chain as a no-op, passing through the + original value unchanged. - name: "recursive_variable_reference" template: "{{ a }}" diff --git a/specs/liquid_ruby_lax/specs.yml b/specs/liquid_ruby_lax/specs.yml index 4796750..005e7a7 100644 --- a/specs/liquid_ruby_lax/specs.yml +++ b/specs/liquid_ruby_lax/specs.yml @@ -46,16 +46,20 @@ - name: Conditional tag returns false when the operator is unknown template: "{% if a true %}{% endif %}" expected: "" + render_errors: true hint: | - Lax mode quirk: unknown operators in conditions with empty bodies don't render errors. - In strict mode this would be a parse error. + Lax mode quirk: unknown operators in conditions with empty bodies are + silently swallowed (no error in output). Requires render_errors: true + so the runner doesn't raise exceptions, allowing the swallowing to occur. - name: Ignore unknown operators when the tags body is empty template: "{% if true true %}{% endif %}" expected: "" + render_errors: true hint: | - Lax mode quirk: blank tag bodies swallow render errors. - In strict mode {% if true true %} is a syntax error. + Lax mode quirk: blank tag bodies swallow render errors entirely. + Requires render_errors: true so the runner doesn't raise exceptions, + allowing the swallowing behavior to be observed. - name: Does not ignore unknown operators when the tags body is empty but there is an else template: "{% if true true %}{% else %}1{% endif %}" From 3d1a863b1fc761003c2596581d3c4f4974a80739 Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Tue, 13 Jan 2026 13:32:54 -0500 Subject: [PATCH 2/2] Use main from GH for green CI --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index b93962a..183b0a4 100644 --- a/Gemfile +++ b/Gemfile @@ -4,12 +4,12 @@ source "https://rubygems.org" gemspec -# Use local liquid gem if available, otherwise use latest from rubygems +# Use local liquid gem if available, otherwise use main from GitHub local_liquid_path = File.expand_path("../liquid", __dir__) if File.exist?(local_liquid_path) gem "liquid", path: local_liquid_path else - gem "liquid" + gem "liquid", github: "Shopify/liquid", branch: "main" end # Core test dependencies