summaryrefslogtreecommitdiff
path: root/lib/syntax_suggest/explain_syntax.rb
diff options
context:
space:
mode:
authorSchneems <[email protected]>2023-12-04 16:59:10 -0600
committergit <[email protected]>2023-12-05 17:51:29 +0000
commit6d39d6d2143f7b910f310de0ff92772839ac72a2 (patch)
tree7b2071ab9e74334b2a18c05068b3e8a81938c692 /lib/syntax_suggest/explain_syntax.rb
parent62c96959114ea165f7434da9edc42d15e4aaebfa (diff)
[ruby/syntax_suggest] Update docs, clean up PR
Removes or updates mentions of Ripper https://github.com/ruby/syntax_suggest/commit/08aaa3f50a
Diffstat (limited to 'lib/syntax_suggest/explain_syntax.rb')
-rw-r--r--lib/syntax_suggest/explain_syntax.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/syntax_suggest/explain_syntax.rb b/lib/syntax_suggest/explain_syntax.rb
index 8de962c157..ee7d44ea00 100644
--- a/lib/syntax_suggest/explain_syntax.rb
+++ b/lib/syntax_suggest/explain_syntax.rb
@@ -2,6 +2,10 @@
require_relative "left_right_lex_count"
+if !SyntaxSuggest.use_prism_parser?
+ require_relative "ripper_errors"
+end
+
module SyntaxSuggest
class GetParseErrors
def self.errors(source)
@@ -25,8 +29,8 @@ module SyntaxSuggest
# # => "Unmatched keyword, missing `end' ?"
#
# When the error cannot be determined by lexical counting
- # then ripper is run against the input and the raw ripper
- # errors returned.
+ # then the parser is run against the input and the raw
+ # errors are returned.
#
# Example:
#
@@ -101,7 +105,7 @@ module SyntaxSuggest
# Returns an array of syntax error messages
#
# If no missing pairs are found it falls back
- # on the original ripper error messages
+ # on the original error messages
def errors
if missing.empty?
return GetParseErrors.errors(@code_lines.map(&:original).join)