Skip to content

Test: a symbol in a prism-skimmed method body - #24

Merged
Largo merged 2 commits into
masterfrom
fix/prism-skim-symbol-content-loc
Oct 26, 2026
Merged

Largo merged 2 commits into
masterfrom
fix/prism-skim-symbol-content-loc

Conversation

@Largo

@Largo Largo commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

A regression test for the prism loader fix that landed in #23 (324a4b3, "regenerate SkimNode for SymbolNode").

#21 regenerated Src/Prism/Generated for prism cd76b0d1, where SymbolNode's optional value_loc became the required content_loc, but SkimNode (which reads past a method body at load time, to be bridged when the method is first called) kept reading it as optional. Every node after a symbol in a method body was then read from the wrong offset: a file with def m; :sym; end failed with "Unknown prism node type" or an IndexOutOfRangeException, and mspec could not load its own runner. CI's smoke test has no such method, which is how it got through.

This PR first carried the same one-line fix; after #23 merged, master has it, and what is left here is MethodDef_SymbolInBody1, which calls methods whose bodies hold symbols, through prism, so that the next regeneration cannot quietly undo it. It fails on the loader before #23 and passes on master.

Tested on Windows, .NET 10, libprism built at cd76b0d1: full IronRuby.Tests suite, 0 failures, after merging master.

#21 regenerated Src/Prism/Generated for prism cd76b0d1, where SymbolNode's
optional value_loc became the required content_loc. LoadNode reads it as a
location, but SkimNode - which reads past a method body at load time, to be
bridged when the method is first called - still read it as an optional one,
so every node after a symbol in a method body came from the wrong offset:
"Unknown prism node type: 203" or an IndexOutOfRangeException as soon as a
file has `def m; :sym; end`. mspec could not load its own runner.

The file is now what generate.rb writes from cd76b0d1's config.yml; this one
line was the only difference. MethodDef_SymbolInBody1 calls methods whose
bodies hold symbols, through prism.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b787c6a-0596-46dc-a16a-5de08eeee75e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ol-content-loc

# Conflicts:
#	Src/IronRuby.Tests/RubyTests.cs
#	Src/IronRuby.Tests/Runtime/MethodTests.cs
@Largo Largo changed the title prism: skim a SymbolNode's content location as the location it now is Test: a symbol in a prism-skimmed method body Oct 26, 2026
@Largo
Largo merged commit 7cae2c0 into master Oct 26, 2026
7 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.

1 participant