Skip to content

Commit b897a47

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/prism] Documentation for Prism::Translation::Parser
Make it clear that it parses with the most recent version of Ruby syntax. ruby/prism@7285d1fbab
1 parent 6c9408d commit b897a47

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)