Repository navigation
Recognize setter symbols before statement modifiers - #402
Merged
Merged
Conversation
284km
commented
Nov 28, 2026
284km
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed head e62ba7a8 (m_parse.mere +19 in lvt_stmt_start, corpus 996, record).
- A named setter Symbol (
:line=) before a statement modifier is now treated as the end of a value instead of an assignment, so no extra if/loop scope is pushed and the false "mismatched indentations" warning is gone. - The recognition reuses the existing colon rules:
colon_opens_sym/colon_cmd_head, and not after a spaced keyword or a value. It also requires::not to precede,scan_identto end exactly at the=, and the name to start alphabetic. SoA::B = 1,h[:a] = 1and ternary:forms keep their current behaviour. The author lists assignment/setter/ternary/eval controls. - For non-UTF-8 sources, the start is found by walking back to the colon or whitespace and then validating forwards with
scan_ident. That handles ASCII trail bytes (Windows-31J/Big5) as the corpus exercises. - Corpus 996 covers if/unless/while/until modifiers, direct and
requiremodes, three encodings under-w, and a real indentation mistake that must still warn. - No prior pass lost in the listed CRuby parser files. Instruction cost is neutral or slightly lower.
No findings from me. The merge waits for the automated reviewer on this head.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Valid bare setter symbols such as
undef_method :line= if method_defined?(:line=)were mistaken for assignment before a statement modifier, corrupting the scope stack and producing false indentation warnings. Recognize the symbol using existing colon rules and encoded-name boundaries. This removes the Nokogiri warning that blocked ActionMailer startup.Local validation against clean
tools/ref_ruby.sh4.0.10/a704b7cd95,Prism1.8.2:run_corpus.sh --both:1036/1036; VM1036/0fallback/0FAIL/0list differences.12 source gates and default hygiene pass.test_parse,test_syntax,test_m17n,test_m17n_comb,test_mixed_unicode_escapes,test_pattern_matchingversus mainc576 on both engines: no prior PASS lost. Existing test_parse3E/2VM failures and skips/assertion-count differences retained.Class#subclassessuper-lookup gap. No bound hit; this is not a passing Rails claim. Complete per-file states, times, provenance and limitations are in the record.The pure PR runtime is c6bb8f1, O2 compiler9dec2ff6/mgz661a01d8. The separate Mailer integration includes reviewed unmerged#395/#399 fixes and is explicitly distinguished. Interrupted pre-pause runs remain incomplete. No VM/CAPI implementation changes; the pre-existing VM encoded-attr_accessor gap is outside this fix. Global merge holds remain.