instance method
Prism::Pattern#compile_constant_name
compile_constant_name(node, name)
lib/prism/pattern.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/pattern.rb, line 169
def compile_constant_name(node, name)
if Prism.const_defined?(name, false)
clazz = Prism.const_get(name)
->(other) { clazz === other }
elsif Object.const_defined?(name, false)
clazz = Object.const_get(name)
->(other) { clazz === other }
else
compile_error(node)
end
end
Compile a name associated with a constant.