Both tags previously accepted any string as a variable name via
`markup.strip`. Now they use `parse_with_selected_parser` and validate
the variable name with `p.consume(:id)` in strict2 mode.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Both tags previously used only regex (VariableSignature) to validate
variable names, which allowed invalid identifiers like (a(b(c) and
[x.y] in all parse modes.
- assign: strict2_parse uses Parser to validate the LHS as a valid
identifier before delegating RHS to Variable
- capture: strict2_parse uses Parser to validate the variable name
as a valid identifier
- Both tags now include ParserSwitching and dispatch through
strict_parse_with_error_mode_fallback
- Lax mode is unchanged — invalid names are still accepted
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Store @is_for_loop during parsing so consumers can determine the
with/for keyword from the AST instead of re-parsing raw markup.
Matches the existing pattern in the Render tag.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add bare-bracket rejection to Parser#expression in strict2 mode, so that
`['var']` is disallowed and `self['var']` is the required syntax.
- Add `Expression::SELF` constant ('self')
- Add `Parser#reject_bare_brackets` option, checked in `expression`
- Add `ParseContext#reject_bare_brackets?` and `force_reject_bare_brackets`
- Add `VariableLookupDrop` for `self['var']` scope-chain lookups
- Add `Variable#==` for rewriter state comparison
- Update `Context#find_variable` to return `VariableLookupDrop` for `self`
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The pinned version (v1.273.0) does not have prebuilt `ruby-head` binaries
for `ubuntu-24.04`, which `ubuntu-latest` now resolves to. This causes CI
to fail with "Unavailable version head for ruby on ubuntu-24.04".
Updating to v1.295.0 picks up ubuntu-24.04 support for all Ruby versions
including head builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>