instance method
Prism::IfNode#if_keyword_loc
if_keyword_loc
lib/prism/node.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/node.rb, line 8642
def if_keyword_loc
location = @if_keyword_loc
case location
when nil
nil
when Location
location
else
@if_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
end
end
The location of the if keyword if present.
bar if foo
^^
The if_keyword_loc field will be nil when the IfNode represents a ternary expression.