Skip to content

Commit 1c42a9c

Browse files
authored
Merge pull request #3645 from ruby/documentation-for-parse
Documentation for Prism::Translation::Parser
2 parents 914883a + 7285d1f commit 1c42a9c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/prism/translation/parser.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ module Translation
1919
# whitequark/parser gem's syntax tree. It inherits from the base parser for
2020
# the parser gem, and overrides the parse* methods to parse with prism and
2121
# then translate.
22+
#
23+
# Note that this version of the parser always parses using the latest
24+
# version of Ruby syntax supported by Prism. If you want specific version
25+
# support, use one of the version-specific subclasses, such as
26+
# `Prism::Translation::Parser34`. If you want to parse using the same
27+
# version of Ruby syntax as the currently running version of Ruby, use
28+
# `Prism::Translation::ParserCurrent`.
2229
class Parser < ::Parser::Base
2330
Diagnostic = ::Parser::Diagnostic # :nodoc:
2431
private_constant :Diagnostic
@@ -77,7 +84,7 @@ def initialize(builder = Prism::Translation::Parser::Builder.new, parser: Prism)
7784
end
7885

7986
def version # :nodoc:
80-
34
87+
35
8188
end
8289

8390
# The default encoding for Ruby files is UTF-8.

0 commit comments

Comments
 (0)