4 Commits
Author SHA1 Message Date
Yusuke EndohandClaude Opus 5.5 9b23d39c44 [ruby/prism] Resync prism as Ruby::Prism
This is the output of

    ruby tool/sync_default_gems.rb prism
    git rm -r lib/prism.rb lib/prism

at https://github.com/ruby/prism/commit/0a5f9c9, with the new mapping:
lib/prism is now lib/ruby/prism, the namespace is rewritten to
Ruby::Prism, and lib/prism/prism.gemspec is no longer imported, so
prism is no longer installed as a default gem.

prism/srcs.mk.in (excluded from the sync) follows the template engine,
now Ruby::Prism::Template: it defines the Ruby module, which does not
exist in BASERUBY older than Ruby 4.0, before loading
templates/template.rb.

Ruby::Prism is the very parser that parsed the running code, no
matter which version of the prism gem is installed; the two can be
loaded side by side (the ruby binary is built with -fvisibility=hidden,
so the gem's pm_* and rb_cPrism* symbols do not collide with the
built-in ones).

[Bug #22379]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:27:15 +09:00
Earlopain f3ed64d30c [ruby/prism] Return a plain Token for Prism.lex etc.
Instead of a 2-element array. Nobody should care about the state, and nobody seems to.
A code search on Github shows that it only gets discarded (like via `value.map(&:first)`, or similar things.

But because our own ripper translator still needs it for compatibility, we have to keep it around in some way.
I played around with `Prism.lex_internal` that keeps the same return value but that duplicates much
logic like serialization/deserialization.

This achieves the same thing and is much smaller in scope.

https://github.com/ruby/prism/commit/32455d191c
2026-08-18 21:05:33 +00:00
Kevin Newton f8d62cdbd9 [ruby/prism] Encoding leaking
Fixed encoding was leaking around elements because it wasn't being
cleared around elements that had only a single token.

https://github.com/ruby/prism/commit/03bde59c40
2026-08-01 18:20:26 +00:00
Kevin Newton 72452f4387 [ruby/prism] Tests overhaul
https://github.com/ruby/prism/commit/6f886be0a4
2024-05-30 15:18:20 -04:00