diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-11-02 15:42:18 -0400 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-11-03 10:13:50 -0400 |
commit | 8587d9a8bff3f329b3ebaddc0764220aa1879a84 (patch) | |
tree | 5f963657ffd7954a212ee01c8f5cad58b61f0e25 /lib | |
parent | d7d3243364ba39bfb5dddb10d5d6c8733b4ceb37 (diff) | |
download | ruby-8587d9a8bff3f329b3ebaddc0764220aa1879a84.tar.gz |
[ruby/prism] Wire up options through the Java parser
https://github.com/ruby/prism/commit/13fa262669
Diffstat (limited to 'lib')
-rw-r--r-- | lib/prism/ffi.rb | 3 | ||||
-rw-r--r-- | lib/prism/parse_result.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index cc84d00f14..931e277ef5 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -231,6 +231,7 @@ module Prism loader.load_header loader.load_force_encoding + loader.load_start_line loader.load_comments end end @@ -283,7 +284,7 @@ module Prism end template << "L" - values << options.fetch(:line, 0) + values << options.fetch(:line, 1) template << "L" if (encoding = options[:encoding]) diff --git a/lib/prism/parse_result.rb b/lib/prism/parse_result.rb index 92651cf766..c7f6cdcd16 100644 --- a/lib/prism/parse_result.rb +++ b/lib/prism/parse_result.rb @@ -9,7 +9,7 @@ module Prism attr_reader :source # The line number where this source starts. - attr_reader :start_line + attr_accessor :start_line # The list of newline byte offsets in the source code. attr_reader :offsets |