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-4.0.0/lib/prism/translation/ripper.rb, line 3318
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.