Skip to content

Support comment blocks inside liquid tags - #71

Merged
cappuc merged 1 commit into
mainfrom
feature/fix/liquid-comment-blocks
Jul 30, 2026
Merged

Support comment blocks inside liquid tags#71
cappuc merged 1 commit into
mainfrom
feature/fix/liquid-comment-blocks

Conversation

@cappuc

@cappuc cappuc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add line-based comment/endcomment block handling inside {% liquid %} tags.
  • Preserve opaque comment contents and report unclosed blocks with the correct line number.
  • Add integration coverage for valid, nested, whitespace-controlled, and invalid comment blocks.

Testing

  • Integration tests covering liquid comment blocks and syntax errors.

Closes #56

- Skip comment bodies without lexing their contents
- Cover valid and unclosed liquid comments
@github-actions

Copy link
Copy Markdown
Contributor

PHPBench comparison (PHP 8.2)

PHP 8.2 | Runner ubuntu24 | Base 60b7dbe | PR cac2f04 | 10 iterations x 20 revs | 1 warmup

Positive ops/s is faster. RSD above 5% is marked high.

Benchmark Base ops/s PR ops/s Delta ops/s RSD (base / PR) Delta memory Memory %
ThemeBench::benchParse 531.90 ops/s 526.85 ops/s -0.95% 0.92% / 1.32% -176.00 B -0.00%
ThemeBench::benchRender 309.97 ops/s 308.73 ops/s -0.40% 2.02% / 1.71% -240.00 B -0.00%
ThemeBench::benchStream 303.94 ops/s 309.94 ops/s +1.97% 1.29% / 0.94% -240.00 B -0.00%
ThemeBench::benchTokenize 1,119.59 ops/s 1,123.73 ops/s +0.37% 0.83% / 1.27% -176.00 B -0.00%
  • Improved (> +2%): 0

  • Neutral (within ±2%): 4

  • Regressed (< -2%): 0

  • Worst throughput regression: n/a

  • Total memory change: -0.00%

  • Regression threshold (PHPBENCH_MAX_REG): 5.00%

  • Threshold status: PASSED

@github-actions

Copy link
Copy Markdown
Contributor

PHPBench comparison (PHP 8.3)

PHP 8.3 | Runner ubuntu24 | Base 60b7dbe | PR cac2f04 | 10 iterations x 20 revs | 1 warmup

Positive ops/s is faster. RSD above 5% is marked high.

Benchmark Base ops/s PR ops/s Delta ops/s RSD (base / PR) Delta memory Memory %
ThemeBench::benchParse 485.85 ops/s 477.90 ops/s -1.64% 1.89% / 1.71% -176.00 B -0.00%
ThemeBench::benchRender 289.61 ops/s 282.96 ops/s -2.30% 2.16% / 2.49% -240.00 B -0.00%
ThemeBench::benchStream 285.80 ops/s 285.69 ops/s -0.04% 1.95% / 1.29% -240.00 B -0.00%
ThemeBench::benchTokenize 1,125.47 ops/s 1,085.55 ops/s -3.55% 2.66% / 2.53% -176.00 B -0.00%
  • Improved (> +2%): 0

  • Neutral (within ±2%): 2

  • Regressed (< -2%): 2 (median -2.92%)

  • Worst throughput regression: ThemeBench::benchTokenize (-3.55%)

  • Total memory change: -0.00%

  • Regression threshold (PHPBENCH_MAX_REG): 5.00%

  • Threshold status: PASSED

@github-actions

Copy link
Copy Markdown
Contributor

PHPBench comparison (PHP 8.4)

PHP 8.4 | Runner ubuntu24 | Base 60b7dbe | PR cac2f04 | 10 iterations x 20 revs | 1 warmup

Positive ops/s is faster. RSD above 5% is marked high.

Benchmark Base ops/s PR ops/s Delta ops/s RSD (base / PR) Delta memory Memory %
ThemeBench::benchParse 334.01 ops/s 323.38 ops/s -3.18% 1.70% / 1.42% -363.45 KiB -4.07%
ThemeBench::benchRender 205.23 ops/s 203.70 ops/s -0.75% 1.32% / 1.22% +122.76 KiB +1.38%
ThemeBench::benchStream 206.76 ops/s 206.38 ops/s -0.18% 1.56% / 1.49% -29.34 KiB -0.37%
ThemeBench::benchTokenize 988.35 ops/s 959.56 ops/s -2.91% 2.90% / 2.05% +174.23 KiB +2.33%
  • Improved (> +2%): 0

  • Neutral (within ±2%): 2

  • Regressed (< -2%): 2 (median -3.05%)

  • Worst throughput regression: ThemeBench::benchParse (-3.18%)

  • Total memory change: -0.29%

  • Regression threshold (PHPBENCH_MAX_REG): 5.00%

  • Threshold status: PASSED

@github-actions

Copy link
Copy Markdown
Contributor

PHPBench comparison (PHP 8.5)

PHP 8.5 | Runner ubuntu24 | Base 60b7dbe | PR cac2f04 | 10 iterations x 20 revs | 1 warmup

Positive ops/s is faster. RSD above 5% is marked high.

Benchmark Base ops/s PR ops/s Delta ops/s RSD (base / PR) Delta memory Memory %
ThemeBench::benchParse 309.53 ops/s 300.56 ops/s -2.90% 1.80% / 1.87% -306.50 KiB -3.39%
ThemeBench::benchRender 192.23 ops/s 195.15 ops/s +1.52% 1.59% / 2.00% -134.84 KiB -1.50%
ThemeBench::benchStream 193.73 ops/s 197.74 ops/s +2.07% 2.21% / 1.99% +117.61 KiB +1.48%
ThemeBench::benchTokenize 861.88 ops/s 875.76 ops/s +1.61% 1.50% / 1.65% -176.00 B -0.00%
  • Improved (> +2%): 1 (median +2.07%)

  • Neutral (within ±2%): 2

  • Regressed (< -2%): 1 (median -2.90%)

  • Worst throughput regression: ThemeBench::benchParse (-2.90%)

  • Total memory change: -0.97%

  • Regression threshold (PHPBENCH_MAX_REG): 5.00%

  • Threshold status: PASSED

@cappuc
cappuc merged commit 4c1358e into main Jul 30, 2026
14 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.

[Bug]: comment in liquid tag is error

1 participant