Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::Translation::Ripper#visit_token
visit_token(token, allow_keywords = true)
lib/prism/translation/ripper.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/prism/translation/ripper.rb, line 3292
def visit_token(token, allow_keywords = true)
case token
when "."
on_period(token)
when "`"
on_backtick(token)
when *(allow_keywords ? KEYWORDS : [])
on_kw(token)
when /^_/
on_ident(token)
when /^[[:upper:]]\w*$/
on_const(token)
when /^@@/
on_cvar(token)
when /^@/
on_ivar(token)
when /^\$/
on_gvar(token)
when /^[[:punct:]]/
on_op(token)
else
on_ident(token)
end
end
Visit the string content of a particular node. This method is used to split into the various token types.