summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/prism.rb4
-rw-r--r--lib/prism/parse_result/comments.rb7
-rw-r--r--lib/prism/parse_result/newlines.rb6
-rw-r--r--lib/prism/pattern.rb3
-rw-r--r--lib/prism/prism.gemspec1
-rw-r--r--lib/prism/translation.rb2
6 files changed, 6 insertions, 17 deletions
diff --git a/lib/prism.rb b/lib/prism.rb
index b22d640b5d..ac746630fc 100644
--- a/lib/prism.rb
+++ b/lib/prism.rb
@@ -44,7 +44,7 @@ module Prism
#
# For supported options, see Prism::parse.
def self.lex_compat(source, **options)
- LexCompat.new(source, **options).result #: ParseResult[Array[[[Integer, Integer], Symbol, String, untyped]]]
+ LexCompat.new(source, **options).result # steep:ignore
end
# :call-seq:
@@ -54,7 +54,7 @@ module Prism
# returns the same tokens. Raises SyntaxError if the syntax in source is
# invalid.
def self.lex_ripper(source)
- LexRipper.new(source).result
+ LexRipper.new(source).result # steep:ignore
end
# :call-seq:
diff --git a/lib/prism/parse_result/comments.rb b/lib/prism/parse_result/comments.rb
index 4e1b9a68e5..f8f74d2503 100644
--- a/lib/prism/parse_result/comments.rb
+++ b/lib/prism/parse_result/comments.rb
@@ -188,12 +188,7 @@ module Prism
# Attach the list of comments to their respective locations in the tree.
def attach_comments!
- if ProgramNode === value
- this = self #: ParseResult[ProgramNode]
- Comments.new(this).attach!
- else
- raise
- end
+ Comments.new(self).attach! # steep:ignore
end
end
end
diff --git a/lib/prism/parse_result/newlines.rb b/lib/prism/parse_result/newlines.rb
index 96c97646ff..927c17fe2f 100644
--- a/lib/prism/parse_result/newlines.rb
+++ b/lib/prism/parse_result/newlines.rb
@@ -58,11 +58,7 @@ module Prism
# Walk the tree and mark nodes that are on a new line.
def mark_newlines!
- if ProgramNode === value
- value.accept(Newlines.new(Array.new(1 + source.offsets.size, false)))
- else
- raise "ParseResult does not contain ProgramNode value"
- end
+ value.accept(Newlines.new(Array.new(1 + source.offsets.size, false))) # steep:ignore
end
end
end
diff --git a/lib/prism/pattern.rb b/lib/prism/pattern.rb
index 8e0d235796..57b30fe678 100644
--- a/lib/prism/pattern.rb
+++ b/lib/prism/pattern.rb
@@ -87,11 +87,10 @@ module Prism
return to_enum(__method__ || raise, root) unless block_given?
@compiled ||= compile
- compiled = @compiled #: Proc
queue = [root]
while (node = queue.shift)
- yield node if compiled.call(node)
+ yield node if @compiled.call(node) # steep:ignore
queue.concat(node.compact_child_nodes)
end
end
diff --git a/lib/prism/prism.gemspec b/lib/prism/prism.gemspec
index 905cd1b90b..58201ed53a 100644
--- a/lib/prism/prism.gemspec
+++ b/lib/prism/prism.gemspec
@@ -133,7 +133,6 @@ Gem::Specification.new do |spec|
"sig/prism/pack.rbs",
"sig/prism/parse_result.rbs",
"sig/prism/pattern.rbs",
- "sig/prism/ripper_compat.rbs",
"sig/prism/serialize.rbs",
"sig/prism/visitor.rbs",
"rbi/prism.rbi",
diff --git a/lib/prism/translation.rb b/lib/prism/translation.rb
index 84b9311fe2..e367c6e053 100644
--- a/lib/prism/translation.rb
+++ b/lib/prism/translation.rb
@@ -3,7 +3,7 @@
module Prism
# This module is responsible for converting the prism syntax tree into other
# syntax trees.
- module Translation
+ module Translation # steep:ignore
autoload :Parser, "prism/translation/parser"
autoload :Ripper, "prism/translation/ripper"
autoload :RubyParser, "prism/translation/ruby_parser"