instance method
Prism::Translation::Parser::Compiler#within_pattern
within_pattern() { |copy_compiler(in_pattern: true)| ... }
lib/prism/translation/parser/compiler.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/parser/compiler.rb, line 2127
def within_pattern
begin
parser.pattern_variables.push
yield copy_compiler(in_pattern: true)
ensure
parser.pattern_variables.pop
end
end
Within the given block, track that we’re within a pattern.