summaryrefslogtreecommitdiff
path: root/lib/prism/parse_result/errors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prism/parse_result/errors.rb')
-rw-r--r--lib/prism/parse_result/errors.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/prism/parse_result/errors.rb b/lib/prism/parse_result/errors.rb
index eb4f317248..388309d23d 100644
--- a/lib/prism/parse_result/errors.rb
+++ b/lib/prism/parse_result/errors.rb
@@ -1,4 +1,7 @@
# frozen_string_literal: true
+# :markup: markdown
+#--
+# rbs_inline: enabled
require "stringio"
@@ -8,14 +11,18 @@ module Prism
# can be used to format the errors in a human-readable way.
class Errors
# The parse result that contains the errors.
- attr_reader :parse_result
+ attr_reader :parse_result #: ParseResult
# Initialize a new set of errors from the given parse result.
+ #--
+ #: (ParseResult parse_result) -> void
def initialize(parse_result)
@parse_result = parse_result
end
# Formats the errors in a human-readable way and return them as a string.
+ #--
+ #: () -> String
def format
error_lines = {} #: Hash[Integer, Array[ParseError]]
parse_result.errors.each do |error|