Skip to content

Fix cross-file C namespace references - #1831

Open
sb123sb123 wants to merge 1 commit into
ruby:masterfrom
sb123sb123:fix-1744-cross-file-c-enclosures
Open

sb123sb123 wants to merge 1 commit into
ruby:masterfrom
sb123sb123:fix-1744-cross-file-c-enclosures

Conversation

@sb123sb123

@sb123sb123 sb123sb123 commented Sep 24, 2026 •

Copy link
Copy Markdown

Summary

  • Resolve C namespace variables through the shared store when parsing later C files.
  • Reuse the stored class or module object so constants and methods attach to the existing namespace.
  • Add a two-file regression test covering both a constant and a method.

Fixes #1744.

Validation

  • RUBYOPT=--enable-frozen_string_literal ruby -Ilib test/rdoc/parser/c_test.rb with Ruby 3.2.11 and Prism 1.7.0: 108 tests, 534 assertions, 0 failures or errors.
  • ruby -c lib/rdoc/parser/c.rb
  • ruby -c test/rdoc/parser/c_test.rb
  • git diff --check
  • The full test suite was not run locally.

AI assistance: Codex assisted with implementation and review.

This branch has not been deployed

No deployments
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.

C parser drops docs under namespace variables defined in another file

1 participant