summaryrefslogtreecommitdiff
path: root/test/ruby/test_shapes.rb
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2023-11-29 11:46:33 +0100
committergit <[email protected]>2023-11-29 13:56:19 +0000
commit2af82e23165180f20ca2af374aedb7a45dedcc20 ()
tree1bd829f6f15140c645496167a208d38736ac8d81 /test/ruby/test_shapes.rb
parent2653404840952d25bbdd7deaf599fbfb1f5287f0 (diff)
[ruby/prism] Convert start line to signed integers
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://.com/ruby/prism/commit/0d14ed1452
0 files changed, 0 insertions, 0 deletions