instance method
Prism::IfNode#then_keyword_loc
then_keyword_loc
lib/prism/node.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/node.rb, line 8681
def then_keyword_loc
location = @then_keyword_loc
case location
when nil
nil
when Location
location
else
@then_keyword_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
end
end
The location of the then keyword (if present) or the ? in a ternary expression, nil otherwise.
if foo then bar end
^^^^
a ? b : c
^