Skip to content

Lexer: Allow an ERB delimiter inside a Ruby string - #2656

Merged
marcoroth merged 1 commit into
mainfrom
erb-delimiter-in-ruby-string
Sep 15, 2026
Merged

marcoroth merged 1 commit into
mainfrom
erb-delimiter-in-ruby-string

Conversation

@marcoroth

@marcoroth marcoroth commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Supersedes #2655, which reached the same behavior through lexer string tracking. This takes the parseability route instead, so the lexer stays free of quote and heredoc state.

Also covers the one case left in #1548, <% x = '<%' %><%= x %>, now asserted with enforce_erubi_equality.

Resolves #1548
Resolves #2655

@github-actions github-actions Bot added parser HTML+ERB parser lexer HTML+ERB lexer c C source for the core parser, lexer, and AST labels Sep 14, 2026
@marcoroth
marcoroth force-pushed the erb-delimiter-in-ruby-string branch from c652482 to 54e8f68 Compare September 14, 2026 23:55
@github-actions github-actions Bot added the engine Herb engine and Rails template compilation label Sep 14, 2026
Co-Authored-By: Joel Hawksley <joelhawksley@github.com>
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit c652482


✅ Preview deployment has been cleaned up.

@pkg-pr-new

pkg-pr-new Bot commented Sep 15, 2026

Copy link
Copy Markdown
@herb-tools/analysis

npx https://pkg.pr.new/@herb-tools/analysis@2656

@herb-tools/browser

npx https://pkg.pr.new/@herb-tools/browser@2656

@herb-tools/client

npx https://pkg.pr.new/@herb-tools/client@2656

@herb-tools/config

npx https://pkg.pr.new/@herb-tools/config@2656

@herb-tools/core

npx https://pkg.pr.new/@herb-tools/core@2656

@herb-tools/dev-tools

npx https://pkg.pr.new/@herb-tools/dev-tools@2656

@herb-tools/formatter

npx https://pkg.pr.new/@herb-tools/formatter@2656

herb-language-server

npx https://pkg.pr.new/herb-language-server@2656

@herb-tools/highlighter

npx https://pkg.pr.new/@herb-tools/highlighter@2656

@herb-tools/language-server

npx https://pkg.pr.new/@herb-tools/language-server@2656

@herb-tools/language-service

npx https://pkg.pr.new/@herb-tools/language-service@2656

@herb-tools/linter

npx https://pkg.pr.new/@herb-tools/linter@2656

@herb-tools/minifier

npx https://pkg.pr.new/@herb-tools/minifier@2656

@herb-tools/node

npx https://pkg.pr.new/@herb-tools/node@2656

@herb-tools/node-wasm

npx https://pkg.pr.new/@herb-tools/node-wasm@2656

@herb-tools/printer

npx https://pkg.pr.new/@herb-tools/printer@2656

@herb-tools/rewriter

npx https://pkg.pr.new/@herb-tools/rewriter@2656

stimulus-lint

npx https://pkg.pr.new/stimulus-lint@2656

@herb-tools/tailwind-class-sorter

npx https://pkg.pr.new/@herb-tools/tailwind-class-sorter@2656

commit: c652482

@marcoroth
marcoroth enabled auto-merge (squash) September 15, 2026 00:04
@github-actions

Copy link
Copy Markdown

Corpus: this branch (0ba36c5) vs main (a840880)

main (a840880) this branch (0ba36c5)
Malformed templates 236 235 -1
Parse issues (all) 1067 1067 –
Compile issues 474 474 –
Files with line drift 87 87 –
Tags off their line 679 679 –
Clean files 36434 36434 –

Measured over 38006 templates from herb-corpus.

2 diagnostics changed count
Diagnostic main (a840880) this branch (0ba36c5)
NestedERBTagError 178 176 -2
ERBControlFlowScopeError 112 111 -1

A count can drop because a false positive was fixed, or because a diagnostic is no longer reported when it should be. Worth confirming which.

1 file got a better verdict
File Was Now
foreman/app/views/apipie_dsl/apipie_dsls/help.html.erb template_error strict_parse_error

@marcoroth
marcoroth merged commit 8b51d51 into main Sep 15, 2026
34 checks passed
@marcoroth
marcoroth deleted the erb-delimiter-in-ruby-string branch September 15, 2026 00:10

This branch was successfully deployed

1 active deployment
herb-tools (Preview) — 5e8bdc9e Deployed Sep 15, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c C source for the core parser, lexer, and AST engine Herb engine and Rails template compilation lexer HTML+ERB lexer parser HTML+ERB parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant