diff --git a/Gemfile.lock b/Gemfile.lock
index eaa2a624..2fd889cd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -43,7 +43,7 @@ GEM
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
- rbi (0.2.2)
+ rbi (0.2.3)
prism (~> 1.0)
sorbet-runtime (>= 0.5.9204)
rdoc (6.10.0)
diff --git a/lib/spoom/sorbet/sigs.rb b/lib/spoom/sorbet/sigs.rb
index 2d055d58..b9b95903 100644
--- a/lib/spoom/sorbet/sigs.rb
+++ b/lib/spoom/sorbet/sigs.rb
@@ -101,13 +101,22 @@ def translate_method_sig(sig, node)
out = StringIO.new
p = RBI::RBSPrinter.new(out: out, indent: sig.loc&.begin_column)
+ if node.sigs.any?(&:is_final)
+ p.printn("# @final")
+ p.printt
+ end
+
if node.sigs.any?(&:is_abstract)
p.printn("# @abstract")
p.printt
end
if node.sigs.any?(&:is_override)
- p.printn("# @override")
+ if node.sigs.any?(&:allow_incompatible_override)
+ p.printn("# @override(allow_incompatible: true)")
+ else
+ p.printn("# @override")
+ end
p.printt
end
diff --git a/sorbet/rbi/gems/builder@3.2.4.rbi b/sorbet/rbi/gems/builder@3.3.0.rbi
similarity index 93%
rename from sorbet/rbi/gems/builder@3.2.4.rbi
rename to sorbet/rbi/gems/builder@3.3.0.rbi
index f99d4923..6b1256f0 100644
--- a/sorbet/rbi/gems/builder@3.2.4.rbi
+++ b/sorbet/rbi/gems/builder@3.3.0.rbi
@@ -4,10 +4,11 @@
# This is an autogenerated file for types exported from the `builder` gem.
# Please instead update this file by running `bin/tapioca gem builder`.
+
# If the Builder::XChar module is not currently defined, fail on any
# name clashes in standard library classes.
#
-# source://builder//lib/builder/blankslate.rb#17
+# source://builder//lib/builder/xmlbase.rb#4
module Builder
class << self
# source://builder//lib/builder/xchar.rb#13
@@ -15,12 +16,9 @@ module Builder
end
end
-# source://builder//lib/builder/blankslate.rb#19
-Builder::BlankSlate = BasicObject
-
# Generic error for builder
#
-# source://builder//lib/builder/xmlbase.rb#9
+# source://builder//lib/builder/xmlbase.rb#7
class Builder::IllegalBlockError < ::RuntimeError; end
# source://builder//lib/builder/xchar.rb#33
@@ -85,7 +83,7 @@ Builder::XChar::XML_PREDEFINED = T.let(T.unsafe(nil), Regexp)
# XmlBase is a base class for building XML builders. See
# Builder::XmlMarkup and Builder::XmlEvents for examples.
#
-# source://builder//lib/builder/xmlbase.rb#13
+# source://builder//lib/builder/xmlbase.rb#11
class Builder::XmlBase < ::BasicObject
# Create an XML markup builder.
#
@@ -100,7 +98,7 @@ class Builder::XmlBase < ::BasicObject
#
# @return [XmlBase] a new instance of XmlBase
#
- # source://builder//lib/builder/xmlbase.rb#29
+ # source://builder//lib/builder/xmlbase.rb#27
def initialize(indent = T.unsafe(nil), initial = T.unsafe(nil), encoding = T.unsafe(nil)); end
# Append text to the output target without escaping any markup.
@@ -117,19 +115,19 @@ class Builder::XmlBase < ::BasicObject
# method/operation builders can use other builders as their
# targets.
#
- # source://builder//lib/builder/xmlbase.rb#118
+ # source://builder//lib/builder/xmlbase.rb#116
def <<(text); end
# @return [Boolean]
#
- # source://builder//lib/builder/xmlbase.rb#35
+ # source://builder//lib/builder/xmlbase.rb#33
def explicit_nil_handling?; end
# Create XML markup based on the name of the method. This method
# is never invoked directly, but is called for each markup method
# in the markup block that isn't cached.
#
- # source://builder//lib/builder/xmlbase.rb#92
+ # source://builder//lib/builder/xmlbase.rb#90
def method_missing(sym, *args, &block); end
# For some reason, nil? is sent to the XmlMarkup object. If nil?
@@ -141,14 +139,14 @@ class Builder::XmlBase < ::BasicObject
#
# @return [Boolean]
#
- # source://builder//lib/builder/xmlbase.rb#128
+ # source://builder//lib/builder/xmlbase.rb#126
def nil?; end
# Create a tag named +sym+. Other than the first argument which
# is the tag name, the arguments are the same as the tags
# implemented via method_missing.
#
- # source://builder//lib/builder/xmlbase.rb#42
+ # source://builder//lib/builder/xmlbase.rb#40
def tag!(sym, *args, &block); end
# Append text to the output target. Escape any markup. May be
@@ -156,24 +154,24 @@ class Builder::XmlBase < ::BasicObject
#
# builder.p { |b| b.br; b.text! "HI" } #=>
HI
#
- # source://builder//lib/builder/xmlbase.rb#101
+ # source://builder//lib/builder/xmlbase.rb#99
def text!(text); end
private
- # source://builder//lib/builder/xmlbase.rb#136
+ # source://builder//lib/builder/xmlbase.rb#134
def _escape(text); end
- # source://builder//lib/builder/xmlbase.rb#159
+ # source://builder//lib/builder/xmlbase.rb#157
def _escape_attribute(text); end
- # source://builder//lib/builder/xmlbase.rb#169
+ # source://builder//lib/builder/xmlbase.rb#167
def _indent; end
- # source://builder//lib/builder/xmlbase.rb#174
+ # source://builder//lib/builder/xmlbase.rb#172
def _nested_structures(block); end
- # source://builder//lib/builder/xmlbase.rb#164
+ # source://builder//lib/builder/xmlbase.rb#162
def _newline; end
# If XmlBase.cache_method_calls = true, we dynamicly create the method
@@ -183,20 +181,20 @@ class Builder::XmlBase < ::BasicObject
# method_missing is very slow, this speeds up document generation
# significantly.
#
- # source://builder//lib/builder/xmlbase.rb#187
+ # source://builder//lib/builder/xmlbase.rb#185
def cache_method_call(sym); end
class << self
# Returns the value of attribute cache_method_calls.
#
- # source://builder//lib/builder/xmlbase.rb#16
+ # source://builder//lib/builder/xmlbase.rb#14
def cache_method_calls; end
# Sets the attribute cache_method_calls
#
# @param value the value to set the attribute cache_method_calls to.
#
- # source://builder//lib/builder/xmlbase.rb#16
+ # source://builder//lib/builder/xmlbase.rb#14
def cache_method_calls=(_arg0); end
end
end
@@ -347,15 +345,15 @@ end
#
# Example:
#
-# xm = Builder.new(:indent=>2)
+# xm = Builder::XmlMarkup.new(:indent=>2)
# # xm will produce nicely formatted and indented XML.
#
-# xm = Builder.new(:indent=>2, :margin=>4)
+# xm = Builder::XmlMarkup.new(:indent=>2, :margin=>4)
# # xm will produce nicely formatted and indented XML with 2
# # spaces per indent and an over all indentation level of 4.
#
# builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2)
-# builder.name { |b| b.first("Jim"); b.last("Weirich) }
+# builder.name { |b| b.first("Jim"); b.last("Weirich") }
# # prints:
# #
# # Jim
@@ -384,7 +382,7 @@ end
#
# xml_builder = Builder::XmlMarkup.new
# xml_builder.div { |xml|
-# xml.stong("text")
+# xml.strong("text")
# }
#
# source://builder//lib/builder/xmlmarkup.rb#161
diff --git a/sorbet/rbi/gems/erubi@1.12.0.rbi b/sorbet/rbi/gems/erubi@1.13.0.rbi
similarity index 91%
rename from sorbet/rbi/gems/erubi@1.12.0.rbi
rename to sorbet/rbi/gems/erubi@1.13.0.rbi
index c52738fa..16d45faf 100644
--- a/sorbet/rbi/gems/erubi@1.12.0.rbi
+++ b/sorbet/rbi/gems/erubi@1.13.0.rbi
@@ -4,14 +4,19 @@
# This is an autogenerated file for types exported from the `erubi` gem.
# Please instead update this file by running `bin/tapioca gem erubi`.
+
# source://erubi//lib/erubi.rb#3
module Erubi
+ private
+
+ def h(_arg0); end
+
class << self
def h(_arg0); end
end
end
-# source://erubi//lib/erubi.rb#54
+# source://erubi//lib/erubi.rb#51
class Erubi::Engine
# Initialize a new Erubi::Engine. Options:
# +:bufval+ :: The value to use for the buffer variable, as a string (default '::String.new').
@@ -42,64 +47,64 @@ class Erubi::Engine
#
# @return [Engine] a new instance of Engine
#
- # source://erubi//lib/erubi.rb#94
+ # source://erubi//lib/erubi.rb#91
def initialize(input, properties = T.unsafe(nil)); end
# The variable name used for the buffer variable.
#
- # source://erubi//lib/erubi.rb#65
+ # source://erubi//lib/erubi.rb#62
def bufvar; end
# The filename of the template, if one was given.
#
- # source://erubi//lib/erubi.rb#62
+ # source://erubi//lib/erubi.rb#59
def filename; end
# The frozen ruby source code generated from the template, which can be evaled.
#
- # source://erubi//lib/erubi.rb#59
+ # source://erubi//lib/erubi.rb#56
def src; end
private
# Add ruby code to the template
#
- # source://erubi//lib/erubi.rb#226
+ # source://erubi//lib/erubi.rb#223
def add_code(code); end
# Add the given ruby expression result to the template,
# escaping it based on the indicator given and escape flag.
#
- # source://erubi//lib/erubi.rb#235
+ # source://erubi//lib/erubi.rb#232
def add_expression(indicator, code); end
# Add the result of Ruby expression to the template
#
- # source://erubi//lib/erubi.rb#244
+ # source://erubi//lib/erubi.rb#241
def add_expression_result(code); end
# Add the escaped result of Ruby expression to the template
#
- # source://erubi//lib/erubi.rb#249
+ # source://erubi//lib/erubi.rb#246
def add_expression_result_escaped(code); end
# Add the given postamble to the src. Can be overridden in subclasses
# to make additional changes to src that depend on the current state.
#
- # source://erubi//lib/erubi.rb#255
+ # source://erubi//lib/erubi.rb#252
def add_postamble(postamble); end
# Add raw text to the template. Modifies argument if argument is mutable as a memory optimization.
# Must be called with a string, cannot be called with nil (Rails's subclass depends on it).
#
- # source://erubi//lib/erubi.rb#213
+ # source://erubi//lib/erubi.rb#210
def add_text(text); end
# Raise an exception, as the base engine class does not support handling other indicators.
#
# @raise [ArgumentError]
#
- # source://erubi//lib/erubi.rb#261
+ # source://erubi//lib/erubi.rb#258
def handle(indicator, code, tailch, rspace, lspace); end
# Make sure that any current expression has been terminated.
@@ -107,7 +112,7 @@ class Erubi::Engine
# the chain_appends option is used, expressions may not be
# terminated.
#
- # source://erubi//lib/erubi.rb#289
+ # source://erubi//lib/erubi.rb#286
def terminate_expression; end
# Make sure the buffer variable is the target of the next append
@@ -117,13 +122,13 @@ class Erubi::Engine
# This method should only be called if the block will result in
# code where << will append to the bufvar.
#
- # source://erubi//lib/erubi.rb#271
+ # source://erubi//lib/erubi.rb#268
def with_buffer; end
end
# The default regular expression used for scanning.
#
-# source://erubi//lib/erubi.rb#56
+# source://erubi//lib/erubi.rb#53
Erubi::Engine::DEFAULT_REGEXP = T.let(T.unsafe(nil), Regexp)
# source://erubi//lib/erubi.rb#17
diff --git a/sorbet/rbi/gems/json@2.7.2.rbi b/sorbet/rbi/gems/json@2.8.1.rbi
similarity index 73%
rename from sorbet/rbi/gems/json@2.7.2.rbi
rename to sorbet/rbi/gems/json@2.8.1.rbi
index 3ef0f88c..b2a43546 100644
--- a/sorbet/rbi/gems/json@2.7.2.rbi
+++ b/sorbet/rbi/gems/json@2.8.1.rbi
@@ -4,9 +4,10 @@
# This is an autogenerated file for types exported from the `json` gem.
# Please instead update this file by running `bin/tapioca gem json`.
+
# Extends any Class to include _json_creatable?_ method.
#
-# source://json//lib/json/common.rb#690
+# source://json//lib/json/common.rb#867
class Class < ::Module
# Returns true if this class can be used to create an instance
# from a serialised JSON string. The class has to implement a class
@@ -15,7 +16,7 @@ class Class < ::Module
#
# @return [Boolean]
#
- # source://json//lib/json/common.rb#695
+ # source://json//lib/json/common.rb#872
def json_creatable?; end
end
@@ -395,13 +396,13 @@ end
# json1 = JSON.generate(ruby)
# ruby1 = JSON.parse(json1, create_additions: true)
# # Make a nice display.
-# display = <" (String)
# With custom addition: # (Foo)
#
-# source://json//lib/json/version.rb#2
+# source://json//lib/json/version.rb#3
module JSON
private
@@ -630,7 +631,7 @@ module JSON
# Output:
# {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
#
- # source://json//lib/json/common.rb#615
+ # source://json//lib/json/common.rb#771
def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end
# :call-seq:
@@ -647,13 +648,13 @@ module JSON
# # Raises SystemStackError (stack level too deep):
# JSON.fast_generate(a)
#
- # source://json//lib/json/common.rb#329
+ # source://json//lib/json/common.rb#312
def fast_generate(obj, opts = T.unsafe(nil)); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
#
- # source://json//lib/json/common.rb#329
+ # source://json//lib/json/common.rb#312
def fast_unparse(obj, opts = T.unsafe(nil)); end
# :call-seq:
@@ -692,7 +693,7 @@ module JSON
# # Raises JSON::NestingError (nesting of 100 is too deep):
# JSON.generate(a)
#
- # source://json//lib/json/common.rb#300
+ # source://json//lib/json/common.rb#284
def generate(obj, opts = T.unsafe(nil)); end
# :call-seq:
@@ -717,6 +718,7 @@ module JSON
# BEWARE: This method is meant to serialise data from trusted user input,
# like from your own database server or clients under your control, it could
# be dangerous to allow untrusted users to pass JSON sources into it.
+ # If you must use it, use JSON.unsafe_load instead to make it clear.
# - Argument +opts+, if given, contains a \Hash of options for the parsing.
# See {Parsing Options}[#module-JSON-label-Parsing+Options].
# The default options can be changed via method JSON.load_default_options=.
@@ -727,17 +729,17 @@ module JSON
# parse(source, opts); see #parse.
#
# Source for following examples:
- # source = <<-EOT
- # {
- # "name": "Dave",
- # "age" :40,
- # "hats": [
- # "Cattleman's",
- # "Panama",
- # "Tophat"
- # ]
- # }
- # EOT
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
#
# Load a \String:
# ruby = JSON.load(source)
@@ -823,7 +825,7 @@ module JSON
# #"Admin", "password"=>"0wn3d"}>}
#
- # source://json//lib/json/common.rb#541
+ # source://json//lib/json/common.rb#690
def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
# :call-seq:
@@ -834,7 +836,7 @@ module JSON
#
# See method #parse.
#
- # source://json//lib/json/common.rb#249
+ # source://json//lib/json/common.rb#233
def load_file(filespec, opts = T.unsafe(nil)); end
# :call-seq:
@@ -845,10 +847,10 @@ module JSON
#
# See method #parse!
#
- # source://json//lib/json/common.rb#260
+ # source://json//lib/json/common.rb#244
def load_file!(filespec, opts = T.unsafe(nil)); end
- # source://json//lib/json/common.rb#643
+ # source://json//lib/json/common.rb#815
def merge_dump_options(opts, strict: T.unsafe(nil)); end
# :call-seq:
@@ -879,17 +881,17 @@ module JSON
# {Parsing \JSON}[#module-JSON-label-Parsing+JSON].
#
# Parses nested JSON objects:
- # source = <<-EOT
- # {
- # "name": "Dave",
- # "age" :40,
- # "hats": [
- # "Cattleman's",
- # "Panama",
- # "Tophat"
- # ]
- # }
- # EOT
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
# ruby = JSON.parse(source)
# ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
#
@@ -899,7 +901,7 @@ module JSON
# # Raises JSON::ParserError (783: unexpected token at ''):
# JSON.parse('')
#
- # source://json//lib/json/common.rb#219
+ # source://json//lib/json/common.rb#203
def parse(source, opts = T.unsafe(nil)); end
# :call-seq:
@@ -914,7 +916,7 @@ module JSON
# which disables checking for nesting depth.
# - Option +allow_nan+, if not provided, defaults to +true+.
#
- # source://json//lib/json/common.rb#234
+ # source://json//lib/json/common.rb#218
def parse!(source, opts = T.unsafe(nil)); end
# :call-seq:
@@ -947,30 +949,161 @@ module JSON
# }
# }
#
- # source://json//lib/json/common.rb#374
+ # source://json//lib/json/common.rb#357
def pretty_generate(obj, opts = T.unsafe(nil)); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
#
- # source://json//lib/json/common.rb#374
+ # source://json//lib/json/common.rb#357
def pretty_unparse(obj, opts = T.unsafe(nil)); end
# Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
#
- # source://json//lib/json/common.rb#559
+ # source://json//lib/json/common.rb#716
def recurse_proc(result, &proc); end
- # source://json//lib/json/common.rb#541
+ # source://json//lib/json/common.rb#690
def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and
# later delete them.
#
- # source://json//lib/json/common.rb#300
+ # source://json//lib/json/common.rb#284
def unparse(obj, opts = T.unsafe(nil)); end
+ # :call-seq:
+ # JSON.unsafe_load(source, proc = nil, options = {}) -> object
+ #
+ # Returns the Ruby objects created by parsing the given +source+.
+ #
+ # - Argument +source+ must be, or be convertible to, a \String:
+ # - If +source+ responds to instance method +to_str+,
+ # source.to_str becomes the source.
+ # - If +source+ responds to instance method +to_io+,
+ # source.to_io.read becomes the source.
+ # - If +source+ responds to instance method +read+,
+ # source.read becomes the source.
+ # - If both of the following are true, source becomes the \String 'null':
+ # - Option +allow_blank+ specifies a truthy value.
+ # - The source, as defined above, is +nil+ or the empty \String ''.
+ # - Otherwise, +source+ remains the source.
+ # - Argument +proc+, if given, must be a \Proc that accepts one argument.
+ # It will be called recursively with each result (depth-first order).
+ # See details below.
+ # BEWARE: This method is meant to serialise data from trusted user input,
+ # like from your own database server or clients under your control, it could
+ # be dangerous to allow untrusted users to pass JSON sources into it.
+ # - Argument +opts+, if given, contains a \Hash of options for the parsing.
+ # See {Parsing Options}[#module-JSON-label-Parsing+Options].
+ # The default options can be changed via method JSON.unsafe_load_default_options=.
+ #
+ # ---
+ #
+ # When no +proc+ is given, modifies +source+ as above and returns the result of
+ # parse(source, opts); see #parse.
+ #
+ # Source for following examples:
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
+ #
+ # Load a \String:
+ # ruby = JSON.unsafe_load(source)
+ # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # Load an \IO object:
+ # require 'stringio'
+ # object = JSON.unsafe_load(StringIO.new(source))
+ # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # Load a \File object:
+ # path = 't.json'
+ # File.write(path, source)
+ # File.open(path) do |file|
+ # JSON.unsafe_load(file)
+ # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # ---
+ #
+ # When +proc+ is given:
+ # - Modifies +source+ as above.
+ # - Gets the +result+ from calling parse(source, opts).
+ # - Recursively calls proc(result).
+ # - Returns the final result.
+ #
+ # Example:
+ # require 'json'
+ #
+ # # Some classes for the example.
+ # class Base
+ # def initialize(attributes)
+ # @attributes = attributes
+ # end
+ # end
+ # class User < Base; end
+ # class Account < Base; end
+ # class Admin < Base; end
+ # # The JSON source.
+ # json = <<-EOF
+ # {
+ # "users": [
+ # {"type": "User", "username": "jane", "email": "jane@example.com"},
+ # {"type": "User", "username": "john", "email": "john@example.com"}
+ # ],
+ # "accounts": [
+ # {"account": {"type": "Account", "paid": true, "account_id": "1234"}},
+ # {"account": {"type": "Account", "paid": false, "account_id": "1235"}}
+ # ],
+ # "admins": {"type": "Admin", "password": "0wn3d"}
+ # }
+ # EOF
+ # # Deserializer method.
+ # def deserialize_obj(obj, safe_types = %w(User Account Admin))
+ # type = obj.is_a?(Hash) && obj["type"]
+ # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj
+ # end
+ # # Call to JSON.unsafe_load
+ # ruby = JSON.unsafe_load(json, proc {|obj|
+ # case obj
+ # when Hash
+ # obj.each {|k, v| obj[k] = deserialize_obj v }
+ # when Array
+ # obj.map! {|v| deserialize_obj v }
+ # end
+ # })
+ # pp ruby
+ # Output:
+ # {"users"=>
+ # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>,
+ # #"User", "username"=>"john", "email"=>"john@example.com"}>],
+ # "accounts"=>
+ # [{"account"=>
+ # #"Account", "paid"=>true, "account_id"=>"1234"}>},
+ # {"account"=>
+ # #"Account", "paid"=>false, "account_id"=>"1235"}>}],
+ # "admins"=>
+ # #"Admin", "password"=>"0wn3d"}>}
+ #
+ # source://json//lib/json/common.rb#536
+ def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
+
class << self
# :call-seq:
# JSON[object] -> new_array or new_string
@@ -987,23 +1120,23 @@ module JSON
# source://json//lib/json/common.rb#22
def [](object, opts = T.unsafe(nil)); end
- # source://json//lib/json/common.rb#85
+ # source://json//lib/json/common.rb#79
def create_fast_state; end
# Returns the current create identifier.
# See also JSON.create_id=.
#
- # source://json//lib/json/common.rb#130
+ # source://json//lib/json/common.rb#114
def create_id; end
# Sets create identifier, which is used to decide if the _json_create_
# hook of a class should be called; initial value is +json_class+:
# JSON.create_id # => 'json_class'
#
- # source://json//lib/json/common.rb#124
+ # source://json//lib/json/common.rb#108
def create_id=(new_value); end
- # source://json//lib/json/common.rb#95
+ # source://json//lib/json/common.rb#89
def create_pretty_state; end
# Return the constant located at _path_. The format of _path_ has to be
@@ -1011,7 +1144,7 @@ module JSON
# level (absolute namespace path?). If there doesn't exist a constant at
# the given path, an ArgumentError is raised.
#
- # source://json//lib/json/common.rb#46
+ # source://json//lib/json/common.rb#49
def deep_const_get(path); end
# :call-seq:
@@ -1042,23 +1175,23 @@ module JSON
# Output:
# {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
#
- # source://json//lib/json/common.rb#615
+ # source://json//lib/json/common.rb#771
def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end
# Sets or returns the default options for the JSON.dump method.
# Initially:
# opts = JSON.dump_default_options
- # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false}
+ # opts # => {:max_nesting=>false, :allow_nan=>true}
#
- # source://json//lib/json/common.rb#580
+ # source://json//lib/json/common.rb#737
def dump_default_options; end
# Sets or returns the default options for the JSON.dump method.
# Initially:
# opts = JSON.dump_default_options
- # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false}
+ # opts # => {:max_nesting=>false, :allow_nan=>true}
#
- # source://json//lib/json/common.rb#580
+ # source://json//lib/json/common.rb#737
def dump_default_options=(_arg0); end
# :call-seq:
@@ -1075,13 +1208,13 @@ module JSON
# # Raises SystemStackError (stack level too deep):
# JSON.fast_generate(a)
#
- # source://json//lib/json/common.rb#329
+ # source://json//lib/json/common.rb#312
def fast_generate(obj, opts = T.unsafe(nil)); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
#
- # source://json//lib/json/common.rb#329
+ # source://json//lib/json/common.rb#312
def fast_unparse(obj, opts = T.unsafe(nil)); end
# :call-seq:
@@ -1120,24 +1253,22 @@ module JSON
# # Raises JSON::NestingError (nesting of 100 is too deep):
# JSON.generate(a)
#
- # source://json//lib/json/common.rb#300
+ # source://json//lib/json/common.rb#284
def generate(obj, opts = T.unsafe(nil)); end
- # Returns the JSON generator module that is used by JSON. This is
- # either JSON::Ext::Generator or JSON::Pure::Generator:
- # JSON.generator # => JSON::Ext::Generator
+ # Returns the JSON generator module that is used by JSON.
#
- # source://json//lib/json/common.rb#107
+ # source://json//lib/json/common.rb#99
def generator; end
# Set the module _generator_ to be used by JSON.
#
- # source://json//lib/json/common.rb#62
+ # source://json//lib/json/common.rb#56
def generator=(generator); end
# Encodes string using String.encode.
#
- # source://json//lib/json/common.rb#639
+ # source://json//lib/json/common.rb#811
def iconv(to, from, string); end
# :call-seq:
@@ -1162,6 +1293,7 @@ module JSON
# BEWARE: This method is meant to serialise data from trusted user input,
# like from your own database server or clients under your control, it could
# be dangerous to allow untrusted users to pass JSON sources into it.
+ # If you must use it, use JSON.unsafe_load instead to make it clear.
# - Argument +opts+, if given, contains a \Hash of options for the parsing.
# See {Parsing Options}[#module-JSON-label-Parsing+Options].
# The default options can be changed via method JSON.load_default_options=.
@@ -1172,17 +1304,17 @@ module JSON
# parse(source, opts); see #parse.
#
# Source for following examples:
- # source = <<-EOT
- # {
- # "name": "Dave",
- # "age" :40,
- # "hats": [
- # "Cattleman's",
- # "Panama",
- # "Tophat"
- # ]
- # }
- # EOT
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
#
# Load a \String:
# ruby = JSON.load(source)
@@ -1268,7 +1400,7 @@ module JSON
# #"Admin", "password"=>"0wn3d"}>}
#
- # source://json//lib/json/common.rb#541
+ # source://json//lib/json/common.rb#690
def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
# Sets or returns default options for the JSON.load method.
@@ -1276,7 +1408,7 @@ module JSON
# opts = JSON.load_default_options
# opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
#
- # source://json//lib/json/common.rb#404
+ # source://json//lib/json/common.rb#401
def load_default_options; end
# Sets or returns default options for the JSON.load method.
@@ -1284,7 +1416,7 @@ module JSON
# opts = JSON.load_default_options
# opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
#
- # source://json//lib/json/common.rb#404
+ # source://json//lib/json/common.rb#401
def load_default_options=(_arg0); end
# :call-seq:
@@ -1295,7 +1427,7 @@ module JSON
#
# See method #parse.
#
- # source://json//lib/json/common.rb#249
+ # source://json//lib/json/common.rb#233
def load_file(filespec, opts = T.unsafe(nil)); end
# :call-seq:
@@ -1306,7 +1438,7 @@ module JSON
#
# See method #parse!
#
- # source://json//lib/json/common.rb#260
+ # source://json//lib/json/common.rb#244
def load_file!(filespec, opts = T.unsafe(nil)); end
# :call-seq:
@@ -1337,17 +1469,17 @@ module JSON
# {Parsing \JSON}[#module-JSON-label-Parsing+JSON].
#
# Parses nested JSON objects:
- # source = <<-EOT
- # {
- # "name": "Dave",
- # "age" :40,
- # "hats": [
- # "Cattleman's",
- # "Panama",
- # "Tophat"
- # ]
- # }
- # EOT
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
# ruby = JSON.parse(source)
# ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
#
@@ -1357,7 +1489,7 @@ module JSON
# # Raises JSON::ParserError (783: unexpected token at ''):
# JSON.parse('')
#
- # source://json//lib/json/common.rb#219
+ # source://json//lib/json/common.rb#203
def parse(source, opts = T.unsafe(nil)); end
# :call-seq:
@@ -1372,19 +1504,17 @@ module JSON
# which disables checking for nesting depth.
# - Option +allow_nan+, if not provided, defaults to +true+.
#
- # source://json//lib/json/common.rb#234
+ # source://json//lib/json/common.rb#218
def parse!(source, opts = T.unsafe(nil)); end
- # Returns the JSON parser class that is used by JSON. This is either
- # JSON::Ext::Parser or JSON::Pure::Parser:
- # JSON.parser # => JSON::Ext::Parser
+ # Returns the JSON parser class that is used by JSON.
#
- # source://json//lib/json/common.rb#33
+ # source://json//lib/json/common.rb#36
def parser; end
# Set the JSON parser class _parser_ to be used by JSON.
#
- # source://json//lib/json/common.rb#36
+ # source://json//lib/json/common.rb#39
def parser=(parser); end
# :call-seq:
@@ -1417,56 +1547,266 @@ module JSON
# }
# }
#
- # source://json//lib/json/common.rb#374
+ # source://json//lib/json/common.rb#357
def pretty_generate(obj, opts = T.unsafe(nil)); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
#
- # source://json//lib/json/common.rb#374
+ # source://json//lib/json/common.rb#357
def pretty_unparse(obj, opts = T.unsafe(nil)); end
# Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
#
- # source://json//lib/json/common.rb#559
+ # source://json//lib/json/common.rb#716
def recurse_proc(result, &proc); end
- # source://json//lib/json/common.rb#541
+ # source://json//lib/json/common.rb#690
def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
- # Sets or Returns the JSON generator state class that is used by JSON. This is
- # either JSON::Ext::Generator::State or JSON::Pure::Generator::State:
- # JSON.state # => JSON::Ext::Generator::State
+ # Sets or Returns the JSON generator state class that is used by JSON.
#
- # source://json//lib/json/common.rb#112
+ # source://json//lib/json/common.rb#102
def state; end
- # Sets or Returns the JSON generator state class that is used by JSON. This is
- # either JSON::Ext::Generator::State or JSON::Pure::Generator::State:
- # JSON.state # => JSON::Ext::Generator::State
+ # Sets or Returns the JSON generator state class that is used by JSON.
#
- # source://json//lib/json/common.rb#112
+ # source://json//lib/json/common.rb#102
def state=(_arg0); end
# :stopdoc:
# I want to deprecate these later, so I'll first be silent about them, and
# later delete them.
#
- # source://json//lib/json/common.rb#300
+ # source://json//lib/json/common.rb#284
def unparse(obj, opts = T.unsafe(nil)); end
+ # :call-seq:
+ # JSON.unsafe_load(source, proc = nil, options = {}) -> object
+ #
+ # Returns the Ruby objects created by parsing the given +source+.
+ #
+ # - Argument +source+ must be, or be convertible to, a \String:
+ # - If +source+ responds to instance method +to_str+,
+ # source.to_str becomes the source.
+ # - If +source+ responds to instance method +to_io+,
+ # source.to_io.read becomes the source.
+ # - If +source+ responds to instance method +read+,
+ # source.read becomes the source.
+ # - If both of the following are true, source becomes the \String 'null':
+ # - Option +allow_blank+ specifies a truthy value.
+ # - The source, as defined above, is +nil+ or the empty \String ''.
+ # - Otherwise, +source+ remains the source.
+ # - Argument +proc+, if given, must be a \Proc that accepts one argument.
+ # It will be called recursively with each result (depth-first order).
+ # See details below.
+ # BEWARE: This method is meant to serialise data from trusted user input,
+ # like from your own database server or clients under your control, it could
+ # be dangerous to allow untrusted users to pass JSON sources into it.
+ # - Argument +opts+, if given, contains a \Hash of options for the parsing.
+ # See {Parsing Options}[#module-JSON-label-Parsing+Options].
+ # The default options can be changed via method JSON.unsafe_load_default_options=.
+ #
+ # ---
+ #
+ # When no +proc+ is given, modifies +source+ as above and returns the result of
+ # parse(source, opts); see #parse.
+ #
+ # Source for following examples:
+ # source = <<~JSON
+ # {
+ # "name": "Dave",
+ # "age" :40,
+ # "hats": [
+ # "Cattleman's",
+ # "Panama",
+ # "Tophat"
+ # ]
+ # }
+ # JSON
+ #
+ # Load a \String:
+ # ruby = JSON.unsafe_load(source)
+ # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # Load an \IO object:
+ # require 'stringio'
+ # object = JSON.unsafe_load(StringIO.new(source))
+ # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # Load a \File object:
+ # path = 't.json'
+ # File.write(path, source)
+ # File.open(path) do |file|
+ # JSON.unsafe_load(file)
+ # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]}
+ #
+ # ---
+ #
+ # When +proc+ is given:
+ # - Modifies +source+ as above.
+ # - Gets the +result+ from calling parse(source, opts).
+ # - Recursively calls proc(result).
+ # - Returns the final result.
+ #
+ # Example:
+ # require 'json'
+ #
+ # # Some classes for the example.
+ # class Base
+ # def initialize(attributes)
+ # @attributes = attributes
+ # end
+ # end
+ # class User < Base; end
+ # class Account < Base; end
+ # class Admin < Base; end
+ # # The JSON source.
+ # json = <<-EOF
+ # {
+ # "users": [
+ # {"type": "User", "username": "jane", "email": "jane@example.com"},
+ # {"type": "User", "username": "john", "email": "john@example.com"}
+ # ],
+ # "accounts": [
+ # {"account": {"type": "Account", "paid": true, "account_id": "1234"}},
+ # {"account": {"type": "Account", "paid": false, "account_id": "1235"}}
+ # ],
+ # "admins": {"type": "Admin", "password": "0wn3d"}
+ # }
+ # EOF
+ # # Deserializer method.
+ # def deserialize_obj(obj, safe_types = %w(User Account Admin))
+ # type = obj.is_a?(Hash) && obj["type"]
+ # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj
+ # end
+ # # Call to JSON.unsafe_load
+ # ruby = JSON.unsafe_load(json, proc {|obj|
+ # case obj
+ # when Hash
+ # obj.each {|k, v| obj[k] = deserialize_obj v }
+ # when Array
+ # obj.map! {|v| deserialize_obj v }
+ # end
+ # })
+ # pp ruby
+ # Output:
+ # {"users"=>
+ # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>,
+ # #"User", "username"=>"john", "email"=>"john@example.com"}>],
+ # "accounts"=>
+ # [{"account"=>
+ # #"Account", "paid"=>true, "account_id"=>"1234"}>},
+ # {"account"=>
+ # #"Account", "paid"=>false, "account_id"=>"1235"}>}],
+ # "admins"=>
+ # #"Admin", "password"=>"0wn3d"}>}
+ #
+ # source://json//lib/json/common.rb#536
+ def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
+
+ # Sets or returns default options for the JSON.unsafe_load method.
+ # Initially:
+ # opts = JSON.load_default_options
+ # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
+ #
+ # source://json//lib/json/common.rb#387
+ def unsafe_load_default_options; end
+
+ # Sets or returns default options for the JSON.unsafe_load method.
+ # Initially:
+ # opts = JSON.load_default_options
+ # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
+ #
+ # source://json//lib/json/common.rb#387
+ def unsafe_load_default_options=(_arg0); end
+
private
- # source://json//lib/json/common.rb#643
+ # source://json//lib/json/common.rb#815
def merge_dump_options(opts, strict: T.unsafe(nil)); end
end
end
-# source://json//lib/json/common.rb#118
-JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String)
+# source://json//lib/json/ext/generator/state.rb#6
+class JSON::Ext::Generator::State
+ # call-seq: new(opts = {})
+ #
+ # Instantiates a new State object, configured by _opts_.
+ #
+ # _opts_ can have the following keys:
+ #
+ # * *indent*: a string used to indent levels (default: ''),
+ # * *space*: a string that is put after, a : or , delimiter (default: ''),
+ # * *space_before*: a string that is put before a : pair delimiter (default: ''),
+ # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
+ # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
+ # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
+ # generated, otherwise an exception is thrown, if these values are
+ # encountered. This options defaults to false.
+ # * *ascii_only*: true if only ASCII characters should be generated. This
+ # option defaults to false.
+ # * *buffer_initial_length*: sets the initial length of the generator's
+ # internal buffer.
+ #
+ # @return [State] a new instance of State
+ #
+ # source://json//lib/json/ext/generator/state.rb#25
+ def initialize(opts = T.unsafe(nil)); end
+
+ # call-seq: [](name)
+ #
+ # Returns the value returned by method +name+.
+ #
+ # source://json//lib/json/ext/generator/state.rb#83
+ def [](name); end
+
+ # call-seq: []=(name, value)
+ #
+ # Sets the attribute name to value.
+ #
+ # source://json//lib/json/ext/generator/state.rb#95
+ def []=(name, value); end
-# source://json//lib/json/common.rb#115
-JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String)
+ # call-seq: configure(opts)
+ #
+ # Configure this State instance with the Hash _opts_, and return
+ # itself.
+ #
+ # source://json//lib/json/ext/generator/state.rb#35
+ def configure(opts); end
+
+ # call-seq: configure(opts)
+ #
+ # Configure this State instance with the Hash _opts_, and return
+ # itself.
+ #
+ # source://json//lib/json/ext/generator/state.rb#35
+ def merge(opts); end
+
+ # call-seq: to_h
+ #
+ # Returns the configuration instance variables as a hash, that can be
+ # passed to the configure method.
+ #
+ # source://json//lib/json/ext/generator/state.rb#54
+ def to_h; end
+
+ # call-seq: to_h
+ #
+ # Returns the configuration instance variables as a hash, that can be
+ # passed to the configure method.
+ #
+ # source://json//lib/json/ext/generator/state.rb#54
+ def to_hash; end
+end
# source://json//lib/json/generic_object.rb#9
class JSON::GenericObject < ::OpenStruct
@@ -1511,10 +1851,10 @@ end
# The base exception for JSON errors.
#
-# source://json//lib/json/common.rb#141
+# source://json//lib/json/common.rb#125
class JSON::JSONError < ::StandardError
class << self
- # source://json//lib/json/common.rb#142
+ # source://json//lib/json/common.rb#126
def wrap(exception); end
end
end
@@ -1522,18 +1862,18 @@ end
# source://json//lib/json/common.rb#7
JSON::NOT_SET = T.let(T.unsafe(nil), Object)
-# source://json//lib/json/common.rb#39
+# source://json//lib/json/common.rb#42
JSON::Parser = JSON::Ext::Parser
-# source://json//lib/json/common.rb#77
+# source://json//lib/json/common.rb#71
JSON::State = JSON::Ext::Generator::State
# For backwards compatibility
#
-# source://json//lib/json/common.rb#163
+# source://json//lib/json/common.rb#147
JSON::UnparserError = JSON::GeneratorError
-# source://json//lib/json/common.rb#653
+# source://json//lib/json/common.rb#825
module Kernel
private
@@ -1544,18 +1884,18 @@ module Kernel
# The _opts_ argument is passed through to generate/parse respectively. See
# generate and parse for their documentation.
#
- # source://json//lib/json/common.rb#680
+ # source://json//lib/json/common.rb#852
def JSON(object, *args); end
# Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
# one line.
#
- # source://json//lib/json/common.rb#658
+ # source://json//lib/json/common.rb#830
def j(*objs); end
# Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
# indentation and over many lines.
#
- # source://json//lib/json/common.rb#667
+ # source://json//lib/json/common.rb#839
def jj(*objs); end
end
diff --git a/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi b/sorbet/rbi/gems/minitest-reporters@1.7.1.rbi
similarity index 95%
rename from sorbet/rbi/gems/minitest-reporters@1.6.1.rbi
rename to sorbet/rbi/gems/minitest-reporters@1.7.1.rbi
index eb78a488..29d7c715 100644
--- a/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi
+++ b/sorbet/rbi/gems/minitest-reporters@1.7.1.rbi
@@ -4,85 +4,89 @@
# This is an autogenerated file for types exported from the `minitest-reporters` gem.
# Please instead update this file by running `bin/tapioca gem minitest-reporters`.
+
# source://minitest-reporters//lib/minitest/reporters.rb#3
module Minitest
class << self
- # source://minitest/5.22.3/lib/minitest.rb#197
+ # source://minitest/5.25.4/lib/minitest.rb#323
def __run(reporter, options); end
- # source://minitest/5.22.3/lib/minitest.rb#97
+ # source://minitest/5.25.4/lib/minitest.rb#97
def after_run(&block); end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def allow_fork; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def allow_fork=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#69
+ # source://minitest/5.25.4/lib/minitest.rb#70
def autorun; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def backtrace_filter; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def backtrace_filter=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#18
+ # source://minitest/5.25.4/lib/minitest.rb#19
def cattr_accessor(name); end
- # source://minitest/5.22.3/lib/minitest.rb#1146
+ # source://minitest/5.25.4/lib/minitest.rb#1216
def clock_time; end
- # source://minitest/5.22.3/lib/minitest.rb#177
+ # source://minitest/5.25.4/lib/minitest.rb#303
def empty_run!(options); end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def extensions; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def extensions=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#292
+ # source://minitest/5.25.4/lib/minitest.rb#336
def filter_backtrace(bt); end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def info_signal; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def info_signal=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#101
+ # source://minitest/5.25.4/lib/minitest.rb#125
def init_plugins(options); end
- # source://minitest/5.22.3/lib/minitest.rb#108
+ # source://minitest/5.25.4/lib/minitest.rb#109
def load_plugins; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def parallel_executor; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def parallel_executor=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#210
+ # source://minitest/5.25.4/lib/minitest.rb#143
def process_args(args = T.unsafe(nil)); end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#104
+ def register_plugin(name_or_mod); end
+
+ # source://minitest/5.25.4/lib/minitest.rb#20
def reporter; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def reporter=(_arg0); end
- # source://minitest/5.22.3/lib/minitest.rb#143
+ # source://minitest/5.25.4/lib/minitest.rb#269
def run(args = T.unsafe(nil)); end
- # source://minitest/5.22.3/lib/minitest.rb#1137
+ # source://minitest/5.25.4/lib/minitest.rb#1207
def run_one_method(klass, method_name); end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def seed; end
- # source://minitest/5.22.3/lib/minitest.rb#19
+ # source://minitest/5.25.4/lib/minitest.rb#20
def seed=(_arg0); end
end
end
@@ -544,25 +548,28 @@ class Minitest::Reporters::JUnitReporter < ::Minitest::Reporters::BaseReporter
private
- # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#168
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#166
def analyze_suite(tests); end
- # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#181
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#179
def filename_for(suite); end
# source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#77
def get_source_location(result); end
- # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#158
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#156
def location(exception); end
- # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#142
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#134
def message_for(test); end
# source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#85
def parse_xml_for(xml, suite, tests); end
- # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#119
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#150
+ def xml_attachment_for(test); end
+
+ # source://minitest-reporters//lib/minitest/reporters/junit_reporter.rb#111
def xml_message_for(test); end
end
@@ -946,36 +953,37 @@ class Minitest::Reporters::SpecReporter < ::Minitest::Reporters::BaseReporter
# The constructor takes an `options` hash
#
# @option options
+ # @option options
# @param options [Hash]
# @return [SpecReporter] a new instance of SpecReporter
#
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#18
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#20
def initialize(options = T.unsafe(nil)); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#50
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#53
def record(test); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#29
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#32
def report; end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#23
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#26
def start; end
protected
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#62
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#65
def after_suite(_suite); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#58
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#61
def before_suite(suite); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#66
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#69
def print_failure(name, tests); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#76
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#79
def record_print_failures_if_any(test); end
- # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#83
+ # source://minitest-reporters//lib/minitest/reporters/spec_reporter.rb#86
def record_print_status(test); end
end
diff --git a/sorbet/rbi/gems/minitest@5.22.3.rbi b/sorbet/rbi/gems/minitest@5.25.4.rbi
similarity index 73%
rename from sorbet/rbi/gems/minitest@5.22.3.rbi
rename to sorbet/rbi/gems/minitest@5.25.4.rbi
index b8bcbdc0..bab87e2b 100644
--- a/sorbet/rbi/gems/minitest@5.22.3.rbi
+++ b/sorbet/rbi/gems/minitest@5.25.4.rbi
@@ -4,7 +4,9 @@
# This is an autogenerated file for types exported from the `minitest` gem.
# Please instead update this file by running `bin/tapioca gem minitest`.
-# :include: README.rdoc
+
+# The top-level namespace for Minitest. Also the location of the main
+# runtime. See +Minitest.run+ for more information.
#
# source://minitest//lib/minitest/parallel.rb#1
module Minitest
@@ -12,7 +14,7 @@ module Minitest
# Internal run method. Responsible for telling all Runnable
# sub-classes to run.
#
- # source://minitest//lib/minitest.rb#197
+ # source://minitest//lib/minitest.rb#323
def __run(reporter, options); end
# A simple hook allowing you to run a block of code after everything
@@ -23,66 +25,71 @@ module Minitest
# source://minitest//lib/minitest.rb#97
def after_run(&block); end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def allow_fork; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def allow_fork=(_arg0); end
# Registers Minitest to run at process exit
#
- # source://minitest//lib/minitest.rb#69
+ # source://minitest//lib/minitest.rb#70
def autorun; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def backtrace_filter; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def backtrace_filter=(_arg0); end
- # source://minitest//lib/minitest.rb#18
+ # source://minitest//lib/minitest.rb#19
def cattr_accessor(name); end
- # source://minitest//lib/minitest.rb#1146
+ # source://minitest//lib/minitest.rb#1216
def clock_time; end
- # source://minitest//lib/minitest.rb#177
+ # source://minitest//lib/minitest.rb#303
def empty_run!(options); end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def extensions; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def extensions=(_arg0); end
- # source://minitest//lib/minitest.rb#292
+ # source://minitest//lib/minitest.rb#336
def filter_backtrace(bt); end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def info_signal; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def info_signal=(_arg0); end
- # source://minitest//lib/minitest.rb#101
+ # source://minitest//lib/minitest.rb#125
def init_plugins(options); end
- # source://minitest//lib/minitest.rb#108
+ # source://minitest//lib/minitest.rb#109
def load_plugins; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def parallel_executor; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def parallel_executor=(_arg0); end
- # source://minitest//lib/minitest.rb#210
+ # source://minitest//lib/minitest.rb#143
def process_args(args = T.unsafe(nil)); end
- # source://minitest//lib/minitest.rb#19
+ # Register a plugin to be used. Does NOT require / load it.
+ #
+ # source://minitest//lib/minitest.rb#104
+ def register_plugin(name_or_mod); end
+
+ # source://minitest//lib/minitest.rb#20
def reporter; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def reporter=(_arg0); end
# This is the top-level run method. Everything starts from here. It
@@ -93,6 +100,9 @@ module Minitest
#
# Minitest.autorun
# Minitest.run(args)
+ # Minitest.load_plugins
+ # Minitest.process_args
+ # Minitest.init_plugins
# Minitest.__run(reporter, options)
# Runnable.runnables.each
# runnable_klass.run(reporter, options)
@@ -101,16 +111,16 @@ module Minitest
# Minitest.run_one_method(klass, runnable_method)
# klass.new(runnable_method).run
#
- # source://minitest//lib/minitest.rb#143
+ # source://minitest//lib/minitest.rb#269
def run(args = T.unsafe(nil)); end
- # source://minitest//lib/minitest.rb#1137
+ # source://minitest//lib/minitest.rb#1207
def run_one_method(klass, method_name); end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def seed; end
- # source://minitest//lib/minitest.rb#19
+ # source://minitest//lib/minitest.rb#20
def seed=(_arg0); end
end
end
@@ -118,24 +128,24 @@ end
# Defines the API for Reporters. Subclass this and override whatever
# you want. Go nuts.
#
-# source://minitest//lib/minitest.rb#638
+# source://minitest//lib/minitest.rb#687
class Minitest::AbstractReporter
# @return [AbstractReporter] a new instance of AbstractReporter
#
- # source://minitest//lib/minitest.rb#640
+ # source://minitest//lib/minitest.rb#689
def initialize; end
# Did this run pass?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#675
+ # source://minitest//lib/minitest.rb#724
def passed?; end
# About to start running a test. This allows a reporter to show
# that it is starting or that we are in the middle of a test run.
#
- # source://minitest//lib/minitest.rb#654
+ # source://minitest//lib/minitest.rb#703
def prerecord(klass, name); end
# Output and record the result of the test. Call
@@ -143,43 +153,43 @@ class Minitest::AbstractReporter
# result character string. Stores the result of the run if the run
# did not pass.
#
- # source://minitest//lib/minitest.rb#663
+ # source://minitest//lib/minitest.rb#712
def record(result); end
# Outputs the summary of the run.
#
- # source://minitest//lib/minitest.rb#669
+ # source://minitest//lib/minitest.rb#718
def report; end
# Starts reporting on the run.
#
- # source://minitest//lib/minitest.rb#647
+ # source://minitest//lib/minitest.rb#696
def start; end
- # source://minitest//lib/minitest.rb#679
+ # source://minitest//lib/minitest.rb#728
def synchronize(&block); end
end
# Represents run failures.
#
-# source://minitest//lib/minitest.rb#962
+# source://minitest//lib/minitest.rb#1020
class Minitest::Assertion < ::Exception
- # source://minitest//lib/minitest.rb#965
+ # source://minitest//lib/minitest.rb#1023
def error; end
# Where was this run before an assertion was raised?
#
- # source://minitest//lib/minitest.rb#972
+ # source://minitest//lib/minitest.rb#1030
def location; end
- # source://minitest//lib/minitest.rb#980
+ # source://minitest//lib/minitest.rb#1038
def result_code; end
- # source://minitest//lib/minitest.rb#984
+ # source://minitest//lib/minitest.rb#1042
def result_label; end
end
-# source://minitest//lib/minitest.rb#963
+# source://minitest//lib/minitest.rb#1021
Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp)
# Minitest Assertions. All assertion methods accept a +msg+ which is
@@ -191,22 +201,22 @@ Minitest::Assertion::RE = T.let(T.unsafe(nil), Regexp)
# provided by the thing including Assertions. See Minitest::Runnable
# for an example.
#
-# source://minitest//lib/minitest/assertions.rb#18
+# source://minitest//lib/minitest/assertions.rb#16
module Minitest::Assertions
- # source://minitest//lib/minitest/assertions.rb#188
+ # source://minitest//lib/minitest/assertions.rb#181
def _synchronize; end
- # source://minitest//lib/minitest/assertions.rb#201
+ # source://minitest//lib/minitest/assertions.rb#194
def _where; end
# Fails unless +test+ is truthy.
#
- # source://minitest//lib/minitest/assertions.rb#178
+ # source://minitest//lib/minitest/assertions.rb#171
def assert(test, msg = T.unsafe(nil)); end
# Fails unless +obj+ is empty.
#
- # source://minitest//lib/minitest/assertions.rb#195
+ # source://minitest//lib/minitest/assertions.rb#188
def assert_empty(obj, msg = T.unsafe(nil)); end
# Fails unless exp == act printing the difference between
@@ -221,7 +231,7 @@ module Minitest::Assertions
#
# See also: Minitest::Assertions.diff
#
- # source://minitest//lib/minitest/assertions.rb#221
+ # source://minitest//lib/minitest/assertions.rb#214
def assert_equal(exp, act, msg = T.unsafe(nil)); end
# For comparing Floats. Fails unless +exp+ and +act+ are within +delta+
@@ -229,50 +239,50 @@ module Minitest::Assertions
#
# assert_in_delta Math::PI, (22.0 / 7.0), 0.01
#
- # source://minitest//lib/minitest/assertions.rb#242
+ # source://minitest//lib/minitest/assertions.rb#235
def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
# For comparing Floats. Fails unless +exp+ and +act+ have a relative
# error less than +epsilon+.
#
- # source://minitest//lib/minitest/assertions.rb#254
+ # source://minitest//lib/minitest/assertions.rb#247
def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
# Fails unless +collection+ includes +obj+.
#
- # source://minitest//lib/minitest/assertions.rb#261
+ # source://minitest//lib/minitest/assertions.rb#254
def assert_includes(collection, obj, msg = T.unsafe(nil)); end
# Fails unless +obj+ is an instance of +cls+.
#
- # source://minitest//lib/minitest/assertions.rb#272
+ # source://minitest//lib/minitest/assertions.rb#265
def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end
# Fails unless +obj+ is a kind of +cls+.
#
- # source://minitest//lib/minitest/assertions.rb#283
+ # source://minitest//lib/minitest/assertions.rb#276
def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
# Fails unless +matcher+ =~ +obj+.
#
- # source://minitest//lib/minitest/assertions.rb#293
+ # source://minitest//lib/minitest/assertions.rb#287
def assert_match(matcher, obj, msg = T.unsafe(nil)); end
- # Assert that the mock verifies correctly.
+ # Assert that the mock verifies correctly and fail if not.
#
- # source://minitest//lib/minitest/mock.rb#250
- def assert_mock(mock); end
+ # source://minitest//lib/minitest/mock.rb#253
+ def assert_mock(mock, msg = T.unsafe(nil)); end
# Fails unless +obj+ is nil
#
- # source://minitest//lib/minitest/assertions.rb#305
+ # source://minitest//lib/minitest/assertions.rb#299
def assert_nil(obj, msg = T.unsafe(nil)); end
# For testing with binary operators. Eg:
#
# assert_operator 5, :<=, 4
#
- # source://minitest//lib/minitest/assertions.rb#315
+ # source://minitest//lib/minitest/assertions.rb#309
def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
# Fails if stdout or stderr do not output the expected results.
@@ -286,12 +296,12 @@ module Minitest::Assertions
#
# See also: #assert_silent
#
- # source://minitest//lib/minitest/assertions.rb#333
+ # source://minitest//lib/minitest/assertions.rb#327
def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
# Fails unless +path+ exists.
#
- # source://minitest//lib/minitest/assertions.rb#357
+ # source://minitest//lib/minitest/assertions.rb#351
def assert_path_exists(path, msg = T.unsafe(nil)); end
# For testing with pattern matching (only supported with Ruby 3.0 and later)
@@ -309,7 +319,7 @@ module Minitest::Assertions
#
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest/assertions.rb#376
+ # source://minitest//lib/minitest/assertions.rb#370
def assert_pattern; end
# For testing with predicates. Eg:
@@ -320,7 +330,7 @@ module Minitest::Assertions
#
# str.must_be :empty?
#
- # source://minitest//lib/minitest/assertions.rb#397
+ # source://minitest//lib/minitest/assertions.rb#391
def assert_predicate(o1, op, msg = T.unsafe(nil)); end
# Fails unless the block raises one of +exp+. Returns the
@@ -344,37 +354,37 @@ module Minitest::Assertions
#
# assert_equal 'This is really bad', error.message
#
- # source://minitest//lib/minitest/assertions.rb#424
+ # source://minitest//lib/minitest/assertions.rb#418
def assert_raises(*exp); end
# Fails unless +obj+ responds to +meth+.
# include_all defaults to false to match Object#respond_to?
#
- # source://minitest//lib/minitest/assertions.rb#456
+ # source://minitest//lib/minitest/assertions.rb#450
def assert_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
# Fails unless +exp+ and +act+ are #equal?
#
- # source://minitest//lib/minitest/assertions.rb#466
+ # source://minitest//lib/minitest/assertions.rb#460
def assert_same(exp, act, msg = T.unsafe(nil)); end
# +send_ary+ is a receiver, message and arguments.
#
# Fails unless the call returns a true value
#
- # source://minitest//lib/minitest/assertions.rb#479
+ # source://minitest//lib/minitest/assertions.rb#473
def assert_send(send_ary, m = T.unsafe(nil)); end
# Fails if the block outputs anything to stderr or stdout.
#
# See also: #assert_output
#
- # source://minitest//lib/minitest/assertions.rb#493
+ # source://minitest//lib/minitest/assertions.rb#488
def assert_silent; end
# Fails unless the block throws +sym+
#
- # source://minitest//lib/minitest/assertions.rb#502
+ # source://minitest//lib/minitest/assertions.rb#497
def assert_throws(sym, msg = T.unsafe(nil)); end
# Captures $stdout and $stderr into strings:
@@ -391,7 +401,7 @@ module Minitest::Assertions
# capture IO for subprocesses. Use #capture_subprocess_io for
# that.
#
- # source://minitest//lib/minitest/assertions.rb#543
+ # source://minitest//lib/minitest/assertions.rb#538
def capture_io; end
# Captures $stdout and $stderr into strings, using Tempfile to
@@ -408,7 +418,7 @@ module Minitest::Assertions
# NOTE: This method is approximately 10x slower than #capture_io so
# only use it when you need to test the output of a subprocess.
#
- # source://minitest//lib/minitest/assertions.rb#576
+ # source://minitest//lib/minitest/assertions.rb#571
def capture_subprocess_io; end
# Returns a diff between +exp+ and +act+. If there is no known
@@ -418,29 +428,29 @@ module Minitest::Assertions
#
# See +things_to_diff+ for more info.
#
- # source://minitest//lib/minitest/assertions.rb#59
+ # source://minitest//lib/minitest/assertions.rb#57
def diff(exp, act); end
# Returns details for exception +e+
#
- # source://minitest//lib/minitest/assertions.rb#608
+ # source://minitest//lib/minitest/assertions.rb#603
def exception_details(e, msg); end
# Fails after a given date (in the local time zone). This allows
# you to put time-bombs in your tests if you need to keep
# something around until a later date lest you forget about it.
#
- # source://minitest//lib/minitest/assertions.rb#624
+ # source://minitest//lib/minitest/assertions.rb#619
def fail_after(y, m, d, msg); end
# Fails with +msg+.
#
- # source://minitest//lib/minitest/assertions.rb#631
+ # source://minitest//lib/minitest/assertions.rb#626
def flunk(msg = T.unsafe(nil)); end
# Returns a proc that will output +msg+ along with the default message.
#
- # source://minitest//lib/minitest/assertions.rb#639
+ # source://minitest//lib/minitest/assertions.rb#634
def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end
# This returns a human-readable version of +obj+. By default
@@ -449,7 +459,7 @@ module Minitest::Assertions
#
# See Minitest::Test.make_my_diffs_pretty!
#
- # source://minitest//lib/minitest/assertions.rb#129
+ # source://minitest//lib/minitest/assertions.rb#127
def mu_pp(obj); end
# This returns a diff-able more human-readable version of +obj+.
@@ -457,67 +467,67 @@ module Minitest::Assertions
# newlines and makes hex-values (like object_ids) generic. This
# uses mu_pp to do the first pass and then cleans it up.
#
- # source://minitest//lib/minitest/assertions.rb#152
+ # source://minitest//lib/minitest/assertions.rb#145
def mu_pp_for_diff(obj); end
# used for counting assertions
#
- # source://minitest//lib/minitest/assertions.rb#650
+ # source://minitest//lib/minitest/assertions.rb#645
def pass(_msg = T.unsafe(nil)); end
# Fails if +test+ is truthy.
#
- # source://minitest//lib/minitest/assertions.rb#657
+ # source://minitest//lib/minitest/assertions.rb#652
def refute(test, msg = T.unsafe(nil)); end
# Fails if +obj+ is empty.
#
- # source://minitest//lib/minitest/assertions.rb#665
+ # source://minitest//lib/minitest/assertions.rb#660
def refute_empty(obj, msg = T.unsafe(nil)); end
# Fails if exp == act.
#
# For floats use refute_in_delta.
#
- # source://minitest//lib/minitest/assertions.rb#676
+ # source://minitest//lib/minitest/assertions.rb#671
def refute_equal(exp, act, msg = T.unsafe(nil)); end
# For comparing Floats. Fails if +exp+ is within +delta+ of +act+.
#
# refute_in_delta Math::PI, (22.0 / 7.0)
#
- # source://minitest//lib/minitest/assertions.rb#688
+ # source://minitest//lib/minitest/assertions.rb#683
def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
# For comparing Floats. Fails if +exp+ and +act+ have a relative error
# less than +epsilon+.
#
- # source://minitest//lib/minitest/assertions.rb#700
+ # source://minitest//lib/minitest/assertions.rb#695
def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
# Fails if +collection+ includes +obj+.
#
- # source://minitest//lib/minitest/assertions.rb#707
+ # source://minitest//lib/minitest/assertions.rb#702
def refute_includes(collection, obj, msg = T.unsafe(nil)); end
# Fails if +obj+ is an instance of +cls+.
#
- # source://minitest//lib/minitest/assertions.rb#718
+ # source://minitest//lib/minitest/assertions.rb#713
def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end
# Fails if +obj+ is a kind of +cls+.
#
- # source://minitest//lib/minitest/assertions.rb#728
+ # source://minitest//lib/minitest/assertions.rb#723
def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
# Fails if +matcher+ =~ +obj+.
#
- # source://minitest//lib/minitest/assertions.rb#736
+ # source://minitest//lib/minitest/assertions.rb#731
def refute_match(matcher, obj, msg = T.unsafe(nil)); end
# Fails if +obj+ is nil.
#
- # source://minitest//lib/minitest/assertions.rb#746
+ # source://minitest//lib/minitest/assertions.rb#741
def refute_nil(obj, msg = T.unsafe(nil)); end
# Fails if +o1+ is not +op+ +o2+. Eg:
@@ -525,12 +535,12 @@ module Minitest::Assertions
# refute_operator 1, :>, 2 #=> pass
# refute_operator 1, :<, 2 #=> fail
#
- # source://minitest//lib/minitest/assertions.rb#781
+ # source://minitest//lib/minitest/assertions.rb#776
def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
# Fails if +path+ exists.
#
- # source://minitest//lib/minitest/assertions.rb#790
+ # source://minitest//lib/minitest/assertions.rb#785
def refute_path_exists(path, msg = T.unsafe(nil)); end
# For testing with pattern matching (only supported with Ruby 3.0 and later)
@@ -546,7 +556,7 @@ module Minitest::Assertions
#
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest/assertions.rb#763
+ # source://minitest//lib/minitest/assertions.rb#758
def refute_pattern; end
# For testing with predicates.
@@ -557,18 +567,18 @@ module Minitest::Assertions
#
# str.wont_be :empty?
#
- # source://minitest//lib/minitest/assertions.rb#804
+ # source://minitest//lib/minitest/assertions.rb#799
def refute_predicate(o1, op, msg = T.unsafe(nil)); end
# Fails if +obj+ responds to the message +meth+.
# include_all defaults to false to match Object#respond_to?
#
- # source://minitest//lib/minitest/assertions.rb#813
+ # source://minitest//lib/minitest/assertions.rb#808
def refute_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end
# Fails if +exp+ is the same (by object identity) as +act+.
#
- # source://minitest//lib/minitest/assertions.rb#822
+ # source://minitest//lib/minitest/assertions.rb#817
def refute_same(exp, act, msg = T.unsafe(nil)); end
# Skips the current run. If run in verbose-mode, the skipped run
@@ -577,7 +587,7 @@ module Minitest::Assertions
#
# @raise [Minitest::Skip]
#
- # source://minitest//lib/minitest/assertions.rb#835
+ # source://minitest//lib/minitest/assertions.rb#830
def skip(msg = T.unsafe(nil), _ignored = T.unsafe(nil)); end
# Skips the current run until a given date (in the local time
@@ -585,14 +595,14 @@ module Minitest::Assertions
# date, but still holds you accountable and prevents you from
# forgetting it.
#
- # source://minitest//lib/minitest/assertions.rb#847
+ # source://minitest//lib/minitest/assertions.rb#842
def skip_until(y, m, d, msg); end
# Was this testcase skipped? Meant for #teardown.
#
# @return [Boolean]
#
- # source://minitest//lib/minitest/assertions.rb#856
+ # source://minitest//lib/minitest/assertions.rb#851
def skipped?; end
# Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff.
@@ -604,104 +614,102 @@ module Minitest::Assertions
# 3. or: Strings are equal to each other (but maybe different encodings?).
# 4. and: we found a diff executable.
#
- # source://minitest//lib/minitest/assertions.rb#104
+ # source://minitest//lib/minitest/assertions.rb#102
def things_to_diff(exp, act); end
class << self
# Returns the diff command to use in #diff. Tries to intelligently
# figure out what diff to use.
#
- # source://minitest//lib/minitest/assertions.rb#29
+ # source://minitest//lib/minitest/assertions.rb#27
def diff; end
# Set the diff command to use in #diff.
#
- # source://minitest//lib/minitest/assertions.rb#47
+ # source://minitest//lib/minitest/assertions.rb#45
def diff=(o); end
end
end
-# source://minitest//lib/minitest/assertions.rb#206
+# source://minitest//lib/minitest/assertions.rb#199
Minitest::Assertions::E = T.let(T.unsafe(nil), String)
-# source://minitest//lib/minitest/assertions.rb#19
+# source://minitest//lib/minitest/assertions.rb#17
Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object)
# The standard backtrace filter for minitest.
#
# See Minitest.backtrace_filter=.
#
-# source://minitest//lib/minitest.rb#1108
+# source://minitest//lib/minitest.rb#1175
class Minitest::BacktraceFilter
# @return [BacktraceFilter] a new instance of BacktraceFilter
#
- # source://minitest//lib/minitest.rb#1114
+ # source://minitest//lib/minitest.rb#1184
def initialize(regexp = T.unsafe(nil)); end
# Filter +bt+ to something useful. Returns the whole thing if
# $DEBUG (ruby) or $MT_DEBUG (env).
#
- # source://minitest//lib/minitest.rb#1122
+ # source://minitest//lib/minitest.rb#1192
def filter(bt); end
- # Returns the value of attribute regexp.
+ # The regular expression to use to filter backtraces. Defaults to +MT_RE+.
#
- # source://minitest//lib/minitest.rb#1112
+ # source://minitest//lib/minitest.rb#1182
def regexp; end
- # Sets the attribute regexp
+ # The regular expression to use to filter backtraces. Defaults to +MT_RE+.
#
- # @param value the value to set the attribute regexp to.
- #
- # source://minitest//lib/minitest.rb#1112
+ # source://minitest//lib/minitest.rb#1182
def regexp=(_arg0); end
end
-# source://minitest//lib/minitest.rb#1110
+# source://minitest//lib/minitest.rb#1177
Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp)
# Dispatch to multiple reporters as one.
#
-# source://minitest//lib/minitest.rb#911
+# source://minitest//lib/minitest.rb#969
class Minitest::CompositeReporter < ::Minitest::AbstractReporter
# @return [CompositeReporter] a new instance of CompositeReporter
#
- # source://minitest//lib/minitest.rb#917
+ # source://minitest//lib/minitest.rb#975
def initialize(*reporters); end
# Add another reporter to the mix.
#
- # source://minitest//lib/minitest.rb#929
+ # source://minitest//lib/minitest.rb#987
def <<(reporter); end
- # source://minitest//lib/minitest.rb#922
+ # source://minitest//lib/minitest.rb#980
def io; end
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#933
+ # source://minitest//lib/minitest.rb#991
def passed?; end
- # source://minitest//lib/minitest.rb#941
+ # source://minitest//lib/minitest.rb#999
def prerecord(klass, name); end
- # source://minitest//lib/minitest.rb#948
+ # source://minitest//lib/minitest.rb#1006
def record(result); end
- # source://minitest//lib/minitest.rb#954
+ # source://minitest//lib/minitest.rb#1012
def report; end
# The list of reporters to dispatch to.
#
- # source://minitest//lib/minitest.rb#915
+ # source://minitest//lib/minitest.rb#973
def reporters; end
# The list of reporters to dispatch to.
#
- # source://minitest//lib/minitest.rb#915
+ # source://minitest//lib/minitest.rb#973
def reporters=(_arg0); end
- # source://minitest//lib/minitest.rb#937
+ # source://minitest//lib/minitest.rb#995
def start; end
end
@@ -716,6 +724,27 @@ module Minitest::Compress
def compress(orig); end
end
+# It's where you hide your "assertions".
+#
+# Please note, because of the way that expectations are implemented,
+# all expectations (eg must_equal) are dependent upon a thread local
+# variable +:current_spec+. If your specs rely on mixing threads into
+# the specs themselves, you're better off using assertions or the new
+# _(value) wrapper. For example:
+#
+# it "should still work in threads" do
+# my_threaded_thingy do
+# (1+1).must_equal 2 # bad
+# assert_equal 2, 1+1 # good
+# _(1 + 1).must_equal 2 # good
+# value(1 + 1).must_equal 2 # good, also #expect
+# _ { 1 + "1" }.must_raise TypeError # good
+# end
+# end
+#
+# source://minitest//lib/minitest/mock.rb#261
+module Minitest::Expectations; end
+
# Provides a simple set of guards that you can use in your tests
# to skip execution if it is not applicable. These methods are
# mixed into Test as both instance and class methods so you
@@ -730,48 +759,48 @@ end
# # ... lots of test methods ...
# end
#
-# source://minitest//lib/minitest.rb#1052
+# source://minitest//lib/minitest.rb#1119
module Minitest::Guard
# Is this running on jruby?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1057
+ # source://minitest//lib/minitest.rb#1124
def jruby?(platform = T.unsafe(nil)); end
# Is this running on maglev?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1064
+ # source://minitest//lib/minitest.rb#1131
def maglev?(platform = T.unsafe(nil)); end
# Is this running on mri?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1074
+ # source://minitest//lib/minitest.rb#1141
def mri?(platform = T.unsafe(nil)); end
# Is this running on macOS?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1081
+ # source://minitest//lib/minitest.rb#1148
def osx?(platform = T.unsafe(nil)); end
# Is this running on rubinius?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1088
+ # source://minitest//lib/minitest.rb#1155
def rubinius?(platform = T.unsafe(nil)); end
# Is this running on windows?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#1098
+ # source://minitest//lib/minitest.rb#1165
def windows?(platform = T.unsafe(nil)); end
end
@@ -783,18 +812,18 @@ end
class Minitest::Mock
# @return [Mock] a new instance of Mock
#
- # source://minitest//lib/minitest/mock.rb#50
+ # source://minitest//lib/minitest/mock.rb#53
def initialize(delegator = T.unsafe(nil)); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def ===(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#122
+ # source://minitest//lib/minitest/mock.rb#125
def __call(name, data); end
def __respond_to?(*_arg0); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def class(*args, **kwargs, &b); end
# Expect that method +name+ is called, optionally with +args+ (and
@@ -830,48 +859,48 @@ class Minitest::Mock
# @mock.ordinal_increment # => 'second'
# @mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment"
#
- # source://minitest//lib/minitest/mock.rb#93
+ # source://minitest//lib/minitest/mock.rb#96
def expect(name, retval, args = T.unsafe(nil), **kwargs, &blk); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def inspect(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def instance_eval(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def instance_variables(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#152
+ # source://minitest//lib/minitest/mock.rb#155
def method_missing(sym, *args, **kwargs, &block); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def object_id(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def public_send(*args, **kwargs, &b); end
# @return [Boolean]
#
- # source://minitest//lib/minitest/mock.rb#238
+ # source://minitest//lib/minitest/mock.rb#241
def respond_to?(sym, include_private = T.unsafe(nil)); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def send(*args, **kwargs, &b); end
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def to_s(*args, **kwargs, &b); end
# Verify that all methods were called as expected. Raises
# +MockExpectationError+ if the mock object was not called as
# expected.
#
- # source://minitest//lib/minitest/mock.rb#142
+ # source://minitest//lib/minitest/mock.rb#145
def verify; end
private
- # source://minitest//lib/minitest/mock.rb#33
+ # source://minitest//lib/minitest/mock.rb#34
def respond_to_missing?(*args, **kwargs, &b); end
end
@@ -934,36 +963,36 @@ end
# plugin, pull this out of the composite and replace it with your
# own.
#
-# source://minitest//lib/minitest.rb#710
+# source://minitest//lib/minitest.rb#759
class Minitest::ProgressReporter < ::Minitest::Reporter
- # source://minitest//lib/minitest.rb#711
+ # source://minitest//lib/minitest.rb#760
def prerecord(klass, name); end
- # source://minitest//lib/minitest.rb#718
+ # source://minitest//lib/minitest.rb#767
def record(result); end
end
# Shared code for anything that can get passed to a Reporter. See
# Minitest::Test & Minitest::Result.
#
-# source://minitest//lib/minitest.rb#532
+# source://minitest//lib/minitest.rb#581
module Minitest::Reportable
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest.rb#554
+ # source://minitest//lib/minitest.rb#603
def class_name; end
# Did this run error?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#575
+ # source://minitest//lib/minitest.rb#624
def error?; end
# The location identifier of this test. Depends on a method
# existing called class_name.
#
- # source://minitest//lib/minitest.rb#549
+ # source://minitest//lib/minitest.rb#598
def location; end
# Did this run pass?
@@ -973,50 +1002,50 @@ module Minitest::Reportable
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#539
+ # source://minitest//lib/minitest.rb#588
def passed?; end
# Returns ".", "F", or "E" based on the result of the run.
#
- # source://minitest//lib/minitest.rb#561
+ # source://minitest//lib/minitest.rb#610
def result_code; end
# Was this run skipped?
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#568
+ # source://minitest//lib/minitest.rb#617
def skipped?; end
end
-# source://minitest//lib/minitest.rb#543
+# source://minitest//lib/minitest.rb#592
Minitest::Reportable::BASE_DIR = T.let(T.unsafe(nil), String)
-# source://minitest//lib/minitest.rb#686
+# source://minitest//lib/minitest.rb#735
class Minitest::Reporter < ::Minitest::AbstractReporter
# @return [Reporter] a new instance of Reporter
#
- # source://minitest//lib/minitest.rb#695
+ # source://minitest//lib/minitest.rb#744
def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
# The IO used to report.
#
- # source://minitest//lib/minitest.rb#688
+ # source://minitest//lib/minitest.rb#737
def io; end
# The IO used to report.
#
- # source://minitest//lib/minitest.rb#688
+ # source://minitest//lib/minitest.rb#737
def io=(_arg0); end
# Command-line options for this run.
#
- # source://minitest//lib/minitest.rb#693
+ # source://minitest//lib/minitest.rb#742
def options; end
# Command-line options for this run.
#
- # source://minitest//lib/minitest.rb#693
+ # source://minitest//lib/minitest.rb#742
def options=(_arg0); end
end
@@ -1026,80 +1055,80 @@ end
# blow up. By using Result.from(a_test) you can be reasonably sure
# that the test result can be marshalled.
#
-# source://minitest//lib/minitest.rb#587
+# source://minitest//lib/minitest.rb#636
class Minitest::Result < ::Minitest::Runnable
include ::Minitest::Reportable
- # source://minitest//lib/minitest.rb#621
+ # source://minitest//lib/minitest.rb#670
def class_name; end
# The class name of the test result.
#
- # source://minitest//lib/minitest.rb#596
+ # source://minitest//lib/minitest.rb#645
def klass; end
# The class name of the test result.
#
- # source://minitest//lib/minitest.rb#596
+ # source://minitest//lib/minitest.rb#645
def klass=(_arg0); end
# The location of the test method.
#
- # source://minitest//lib/minitest.rb#601
+ # source://minitest//lib/minitest.rb#650
def source_location; end
# The location of the test method.
#
- # source://minitest//lib/minitest.rb#601
+ # source://minitest//lib/minitest.rb#650
def source_location=(_arg0); end
- # source://minitest//lib/minitest.rb#625
+ # source://minitest//lib/minitest.rb#674
def to_s; end
class << self
# Create a new test result from a Runnable instance.
#
- # source://minitest//lib/minitest.rb#606
+ # source://minitest//lib/minitest.rb#655
def from(runnable); end
end
end
# re-open
#
-# source://minitest//lib/minitest.rb#305
+# source://minitest//lib/minitest.rb#349
class Minitest::Runnable
# @return [Runnable] a new instance of Runnable
#
- # source://minitest//lib/minitest.rb#463
+ # source://minitest//lib/minitest.rb#512
def initialize(name); end
# Number of assertions executed in this run.
#
- # source://minitest//lib/minitest.rb#309
+ # source://minitest//lib/minitest.rb#353
def assertions; end
# Number of assertions executed in this run.
#
- # source://minitest//lib/minitest.rb#309
+ # source://minitest//lib/minitest.rb#353
def assertions=(_arg0); end
- # source://minitest//lib/minitest.rb#459
+ # source://minitest//lib/minitest.rb#508
def failure; end
# An assertion raised during the run, if any.
#
- # source://minitest//lib/minitest.rb#314
+ # source://minitest//lib/minitest.rb#358
def failures; end
# An assertion raised during the run, if any.
#
- # source://minitest//lib/minitest.rb#314
+ # source://minitest//lib/minitest.rb#358
def failures=(_arg0); end
- # source://minitest//lib/minitest.rb#445
+ # source://minitest//lib/minitest.rb#494
def marshal_dump; end
- # source://minitest//lib/minitest.rb#455
+ # source://minitest//lib/minitest.rb#504
def marshal_load(ary); end
# Metadata you attach to the test results that get sent to the reporter.
@@ -1109,29 +1138,29 @@ class Minitest::Runnable
# NOTE: this data *must* be plain (read: marshal-able) data!
# Hashes! Arrays! Strings!
#
- # source://minitest//lib/minitest.rb#478
+ # source://minitest//lib/minitest.rb#527
def metadata; end
# Sets metadata, mainly used for +Result.from+.
#
- # source://minitest//lib/minitest.rb#485
+ # source://minitest//lib/minitest.rb#534
def metadata=(_arg0); end
# Returns true if metadata exists.
#
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#490
+ # source://minitest//lib/minitest.rb#539
def metadata?; end
# Name of the run.
#
- # source://minitest//lib/minitest.rb#332
+ # source://minitest//lib/minitest.rb#376
def name; end
# Set the name of the run.
#
- # source://minitest//lib/minitest.rb#339
+ # source://minitest//lib/minitest.rb#383
def name=(o); end
# Did this run pass?
@@ -1142,7 +1171,7 @@ class Minitest::Runnable
# @raise [NotImplementedError]
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#507
+ # source://minitest//lib/minitest.rb#556
def passed?; end
# Returns a single character string to print based on the result
@@ -1151,14 +1180,14 @@ class Minitest::Runnable
#
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest.rb#516
+ # source://minitest//lib/minitest.rb#565
def result_code; end
# Runs a single method. Needs to return self.
#
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest.rb#497
+ # source://minitest//lib/minitest.rb#546
def run; end
# Was this run skipped? See #passed? for more information.
@@ -1166,42 +1195,42 @@ class Minitest::Runnable
# @raise [NotImplementedError]
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#523
+ # source://minitest//lib/minitest.rb#572
def skipped?; end
# The time it took to run.
#
- # source://minitest//lib/minitest.rb#319
+ # source://minitest//lib/minitest.rb#363
def time; end
# The time it took to run.
#
- # source://minitest//lib/minitest.rb#319
+ # source://minitest//lib/minitest.rb#363
def time=(_arg0); end
- # source://minitest//lib/minitest.rb#321
+ # source://minitest//lib/minitest.rb#365
def time_it; end
class << self
- # source://minitest//lib/minitest.rb#1156
+ # source://minitest//lib/minitest.rb#1226
def inherited(klass); end
# Returns all instance methods matching the pattern +re+.
#
- # source://minitest//lib/minitest.rb#346
+ # source://minitest//lib/minitest.rb#390
def methods_matching(re); end
- # source://minitest//lib/minitest.rb#415
+ # source://minitest//lib/minitest.rb#464
def on_signal(name, action); end
- # source://minitest//lib/minitest.rb#350
+ # source://minitest//lib/minitest.rb#394
def reset; end
# Responsible for running all runnable methods in a given class,
# each in its own instance. Each instance is passed to the
# reporter to record.
#
- # source://minitest//lib/minitest.rb#361
+ # source://minitest//lib/minitest.rb#405
def run(reporter, options = T.unsafe(nil)); end
# Runs a single method and has the reporter record the result.
@@ -1209,7 +1238,7 @@ class Minitest::Runnable
# that subclasses can specialize the running of an individual
# test. See Minitest::ParallelTest::ClassMethods for an example.
#
- # source://minitest//lib/minitest.rb#387
+ # source://minitest//lib/minitest.rb#445
def run_one_method(klass, method_name, reporter); end
# Each subclass of Runnable is responsible for overriding this
@@ -1217,33 +1246,33 @@ class Minitest::Runnable
#
# @raise [NotImplementedError]
#
- # source://minitest//lib/minitest.rb#432
+ # source://minitest//lib/minitest.rb#481
def runnable_methods; end
# Returns all subclasses of Runnable.
#
- # source://minitest//lib/minitest.rb#439
+ # source://minitest//lib/minitest.rb#488
def runnables; end
# Defines the order to run tests (:random by default). Override
# this or use a convenience method to change it for your tests.
#
- # source://minitest//lib/minitest.rb#396
+ # source://minitest//lib/minitest.rb#454
def test_order; end
- # source://minitest//lib/minitest.rb#400
+ # source://minitest//lib/minitest.rb#458
def with_info_handler(reporter, &block); end
end
end
-# source://minitest//lib/minitest.rb#413
+# source://minitest//lib/minitest.rb#462
Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
# Assertion raised when skipping a run.
#
-# source://minitest//lib/minitest.rb#992
+# source://minitest//lib/minitest.rb#1050
class Minitest::Skip < ::Minitest::Assertion
- # source://minitest//lib/minitest.rb#993
+ # source://minitest//lib/minitest.rb#1051
def result_label; end
end
@@ -1267,114 +1296,124 @@ end
# end
# end
#
-# source://minitest//lib/minitest.rb#746
+# source://minitest//lib/minitest.rb#795
class Minitest::StatisticsReporter < ::Minitest::Reporter
# @return [StatisticsReporter] a new instance of StatisticsReporter
#
- # source://minitest//lib/minitest.rb#790
+ # source://minitest//lib/minitest.rb#844
def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
# Total number of assertions.
#
- # source://minitest//lib/minitest.rb#750
+ # source://minitest//lib/minitest.rb#799
def assertions; end
# Total number of assertions.
#
- # source://minitest//lib/minitest.rb#750
+ # source://minitest//lib/minitest.rb#799
def assertions=(_arg0); end
# Total number of test cases.
#
- # source://minitest//lib/minitest.rb#755
+ # source://minitest//lib/minitest.rb#804
def count; end
# Total number of test cases.
#
- # source://minitest//lib/minitest.rb#755
+ # source://minitest//lib/minitest.rb#804
def count=(_arg0); end
# Total number of tests that erred.
#
- # source://minitest//lib/minitest.rb#783
+ # source://minitest//lib/minitest.rb#832
def errors; end
# Total number of tests that erred.
#
- # source://minitest//lib/minitest.rb#783
+ # source://minitest//lib/minitest.rb#832
def errors=(_arg0); end
# Total number of tests that failed.
#
- # source://minitest//lib/minitest.rb#778
+ # source://minitest//lib/minitest.rb#827
def failures; end
# Total number of tests that failed.
#
- # source://minitest//lib/minitest.rb#778
+ # source://minitest//lib/minitest.rb#827
def failures=(_arg0); end
# @return [Boolean]
#
- # source://minitest//lib/minitest.rb#803
+ # source://minitest//lib/minitest.rb#858
def passed?; end
- # source://minitest//lib/minitest.rb#811
+ # source://minitest//lib/minitest.rb#866
def record(result); end
# Report on the tracked statistics.
#
- # source://minitest//lib/minitest.rb#821
+ # source://minitest//lib/minitest.rb#876
def report; end
# An +Array+ of test cases that failed or were skipped.
#
- # source://minitest//lib/minitest.rb#760
+ # source://minitest//lib/minitest.rb#809
def results; end
# An +Array+ of test cases that failed or were skipped.
#
- # source://minitest//lib/minitest.rb#760
+ # source://minitest//lib/minitest.rb#809
def results=(_arg0); end
# Total number of tests that where skipped.
#
- # source://minitest//lib/minitest.rb#788
+ # source://minitest//lib/minitest.rb#842
def skips; end
# Total number of tests that where skipped.
#
- # source://minitest//lib/minitest.rb#788
+ # source://minitest//lib/minitest.rb#842
def skips=(_arg0); end
- # source://minitest//lib/minitest.rb#807
+ # source://minitest//lib/minitest.rb#862
def start; end
# Time the test run started. If available, the monotonic clock is
# used and this is a +Float+, otherwise it's an instance of
# +Time+.
#
- # source://minitest//lib/minitest.rb#767
+ # source://minitest//lib/minitest.rb#816
def start_time; end
# Time the test run started. If available, the monotonic clock is
# used and this is a +Float+, otherwise it's an instance of
# +Time+.
#
- # source://minitest//lib/minitest.rb#767
+ # source://minitest//lib/minitest.rb#816
def start_time=(_arg0); end
# Test run time. If available, the monotonic clock is used and
# this is a +Float+, otherwise it's an instance of +Time+.
#
- # source://minitest//lib/minitest.rb#773
+ # source://minitest//lib/minitest.rb#822
def total_time; end
# Test run time. If available, the monotonic clock is used and
# this is a +Float+, otherwise it's an instance of +Time+.
#
- # source://minitest//lib/minitest.rb#773
+ # source://minitest//lib/minitest.rb#822
def total_time=(_arg0); end
+
+ # Total number of tests that warned.
+ #
+ # source://minitest//lib/minitest.rb#837
+ def warnings; end
+
+ # Total number of tests that warned.
+ #
+ # source://minitest//lib/minitest.rb#837
+ def warnings=(_arg0); end
end
# A reporter that prints the header, summary, and failure details at
@@ -1385,48 +1424,36 @@ end
# plugin, pull this out of the composite and replace it with your
# own.
#
-# source://minitest//lib/minitest.rb#841
+# source://minitest//lib/minitest.rb#897
class Minitest::SummaryReporter < ::Minitest::StatisticsReporter
- # source://minitest//lib/minitest.rb#876
+ # source://minitest//lib/minitest.rb#930
def aggregated_results(io); end
- # Returns the value of attribute old_sync.
- #
- # source://minitest//lib/minitest.rb#844
+ # source://minitest//lib/minitest.rb#899
def old_sync; end
- # Sets the attribute old_sync
- #
- # @param value the value to set the attribute old_sync to.
- #
- # source://minitest//lib/minitest.rb#844
+ # source://minitest//lib/minitest.rb#899
def old_sync=(_arg0); end
- # source://minitest//lib/minitest.rb#859
+ # source://minitest//lib/minitest.rb#913
def report; end
- # :startdoc:
- #
- # source://minitest//lib/minitest.rb#847
+ # source://minitest//lib/minitest.rb#901
def start; end
- # source://minitest//lib/minitest.rb#871
+ # source://minitest//lib/minitest.rb#925
def statistics; end
- # source://minitest//lib/minitest.rb#896
+ # source://minitest//lib/minitest.rb#950
def summary; end
- # :stopdoc:
- #
- # source://minitest//lib/minitest.rb#843
+ # source://minitest//lib/minitest.rb#898
def sync; end
- # :stopdoc:
- #
- # source://minitest//lib/minitest.rb#843
+ # source://minitest//lib/minitest.rb#898
def sync=(_arg0); end
- # source://minitest//lib/minitest.rb#892
+ # source://minitest//lib/minitest.rb#946
def to_s; end
end
@@ -1445,16 +1472,16 @@ class Minitest::Test < ::Minitest::Runnable
# LifecycleHooks
#
- # source://minitest//lib/minitest/test.rb#191
+ # source://minitest//lib/minitest/test.rb#189
def capture_exceptions; end
# source://minitest//lib/minitest/test.rb#15
def class_name; end
- # source://minitest//lib/minitest/test.rb#208
+ # source://minitest//lib/minitest/test.rb#206
def neuter_exception(e); end
- # source://minitest//lib/minitest/test.rb#219
+ # source://minitest//lib/minitest/test.rb#217
def new_exception(klass, msg, bt, kill = T.unsafe(nil)); end
# Runs a single test with setup/teardown hooks.
@@ -1462,12 +1489,9 @@ class Minitest::Test < ::Minitest::Runnable
# source://minitest//lib/minitest/test.rb#87
def run; end
- # source://minitest//lib/minitest/test.rb#201
+ # source://minitest//lib/minitest/test.rb#199
def sanitize_exception(e); end
- # source://minitest//lib/minitest/test.rb#233
- def with_info_handler(&block); end
-
class << self
# Call this at the top of your tests when you absolutely
# positively need to have ordered tests. In doing so, you're
@@ -1517,7 +1541,7 @@ end
# meant for library writers, NOT for regular test authors. See
# #before_setup for an example.
#
-# source://minitest//lib/minitest/test.rb#114
+# source://minitest//lib/minitest/test.rb#112
module Minitest::Test::LifecycleHooks
# Runs before every test, after setup. This hook is meant for
# libraries to extend minitest. It is not meant to be used by
@@ -1525,7 +1549,7 @@ module Minitest::Test::LifecycleHooks
#
# See #before_setup for an example.
#
- # source://minitest//lib/minitest/test.rb#164
+ # source://minitest//lib/minitest/test.rb#162
def after_setup; end
# Runs after every test, after teardown. This hook is meant for
@@ -1534,7 +1558,7 @@ module Minitest::Test::LifecycleHooks
#
# See #before_setup for an example.
#
- # source://minitest//lib/minitest/test.rb#188
+ # source://minitest//lib/minitest/test.rb#186
def after_teardown; end
# Runs before every test, before setup. This hook is meant for
@@ -1569,7 +1593,7 @@ module Minitest::Test::LifecycleHooks
# include MyMinitestPlugin
# end
#
- # source://minitest//lib/minitest/test.rb#149
+ # source://minitest//lib/minitest/test.rb#147
def before_setup; end
# Runs after every test, before teardown. This hook is meant for
@@ -1578,19 +1602,19 @@ module Minitest::Test::LifecycleHooks
#
# See #before_setup for an example.
#
- # source://minitest//lib/minitest/test.rb#173
+ # source://minitest//lib/minitest/test.rb#171
def before_teardown; end
# Runs before every test. Use this to set up before each test
# run.
#
- # source://minitest//lib/minitest/test.rb#155
+ # source://minitest//lib/minitest/test.rb#153
def setup; end
# Runs after every test. Use this to clean up after each test
# run.
#
- # source://minitest//lib/minitest/test.rb#179
+ # source://minitest//lib/minitest/test.rb#177
def teardown; end
end
@@ -1605,45 +1629,53 @@ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array)
# Assertion wrapping an unexpected error that was raised during a run.
#
-# source://minitest//lib/minitest.rb#1001
+# source://minitest//lib/minitest.rb#1059
class Minitest::UnexpectedError < ::Minitest::Assertion
include ::Minitest::Compress
# @return [UnexpectedError] a new instance of UnexpectedError
#
- # source://minitest//lib/minitest.rb#1007
+ # source://minitest//lib/minitest.rb#1065
def initialize(error); end
- # source://minitest//lib/minitest.rb#1020
+ # source://minitest//lib/minitest.rb#1078
def backtrace; end
# TODO: figure out how to use `cause` instead
#
- # source://minitest//lib/minitest.rb#1005
+ # source://minitest//lib/minitest.rb#1063
def error; end
# TODO: figure out how to use `cause` instead
#
- # source://minitest//lib/minitest.rb#1005
+ # source://minitest//lib/minitest.rb#1063
def error=(_arg0); end
- # source://minitest//lib/minitest.rb#1026
+ # source://minitest//lib/minitest.rb#1084
def message; end
- # source://minitest//lib/minitest.rb#1032
+ # source://minitest//lib/minitest.rb#1090
def result_label; end
end
-# source://minitest//lib/minitest.rb#1024
+# source://minitest//lib/minitest.rb#1082
Minitest::UnexpectedError::BASE_RE = T.let(T.unsafe(nil), Regexp)
-# source://minitest//lib/minitest.rb#12
+# Assertion raised on warning when running in -Werror mode.
+#
+# source://minitest//lib/minitest.rb#1098
+class Minitest::UnexpectedWarning < ::Minitest::Assertion
+ # source://minitest//lib/minitest.rb#1099
+ def result_label; end
+end
+
+# source://minitest//lib/minitest.rb#13
Minitest::VERSION = T.let(T.unsafe(nil), String)
# source://minitest//lib/minitest/mock.rb#1
class MockExpectationError < ::StandardError; end
-# source://minitest//lib/minitest/mock.rb#258
+# source://minitest//lib/minitest/mock.rb#276
class Object < ::BasicObject
include ::Kernel
include ::PP::ObjectMixin
@@ -1667,6 +1699,6 @@ class Object < ::BasicObject
# NOTE: keyword args in callables are NOT checked for correctness
# against the existing method. Too many edge cases to be worth it.
#
- # source://minitest//lib/minitest/mock.rb#280
+ # source://minitest//lib/minitest/mock.rb#298
def stub(name, val_or_callable, *block_args, **block_kwargs, &block); end
end
diff --git a/sorbet/rbi/gems/parallel@1.24.0.rbi b/sorbet/rbi/gems/parallel@1.26.3.rbi
similarity index 84%
rename from sorbet/rbi/gems/parallel@1.24.0.rbi
rename to sorbet/rbi/gems/parallel@1.26.3.rbi
index 5dd73750..854c4870 100644
--- a/sorbet/rbi/gems/parallel@1.24.0.rbi
+++ b/sorbet/rbi/gems/parallel@1.26.3.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `parallel` gem.
# Please instead update this file by running `bin/tapioca gem parallel`.
+
# source://parallel//lib/parallel/version.rb#2
module Parallel
class << self
@@ -24,10 +25,10 @@ module Parallel
def each_with_index(array, options = T.unsafe(nil), &block); end
# source://parallel//lib/parallel.rb#307
- def filter_map(*args, &block); end
+ def filter_map(*_arg0, **_arg1, &_arg2); end
# source://parallel//lib/parallel.rb#303
- def flat_map(*args, &block); end
+ def flat_map(*_arg0, **_arg1, &_arg2); end
# source://parallel//lib/parallel.rb#228
def in_processes(options = T.unsafe(nil), &block); end
@@ -46,70 +47,80 @@ module Parallel
# source://parallel//lib/parallel.rb#312
def physical_processor_count; end
- # Number of processors seen by the OS, used for process scheduling
+ # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup,
+ # used for process scheduling
#
- # source://parallel//lib/parallel.rb#345
+ # source://parallel//lib/parallel.rb#342
def processor_count; end
- # source://parallel//lib/parallel.rb#350
+ # source://parallel//lib/parallel.rb#346
def worker_number; end
# TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed
#
- # source://parallel//lib/parallel.rb#355
+ # source://parallel//lib/parallel.rb#351
def worker_number=(worker_num); end
private
- # source://parallel//lib/parallel.rb#361
+ # source://parallel//lib/parallel.rb#384
def add_progress_bar!(job_factory, options); end
- # source://parallel//lib/parallel.rb#624
+ # source://parallel//lib/parallel.rb#699
+ def available_processor_count; end
+
+ # source://parallel//lib/parallel.rb#647
def call_with_index(item, index, options, &block); end
- # source://parallel//lib/parallel.rb#556
+ # source://parallel//lib/parallel.rb#579
def create_workers(job_factory, options, &block); end
# options is either a Integer or a Hash with :count
#
- # source://parallel//lib/parallel.rb#614
+ # source://parallel//lib/parallel.rb#637
def extract_count_from_options(options); end
- # source://parallel//lib/parallel.rb#642
+ # source://parallel//lib/parallel.rb#665
def instrument_finish(item, index, result, options); end
# yield results in the order of the input items
# needs to use `options` to store state between executions
# needs to use `done` index since a nil result would also be valid
#
- # source://parallel//lib/parallel.rb#651
+ # source://parallel//lib/parallel.rb#674
def instrument_finish_in_order(item, index, result, options); end
- # source://parallel//lib/parallel.rb#671
+ # source://parallel//lib/parallel.rb#694
def instrument_start(item, index, options); end
- # source://parallel//lib/parallel.rb#590
+ # source://parallel//lib/parallel.rb#357
+ def physical_processor_count_windows; end
+
+ # source://parallel//lib/parallel.rb#613
def process_incoming_jobs(read, write, job_factory, options, &block); end
- # source://parallel//lib/parallel.rb#544
+ # source://parallel//lib/parallel.rb#567
def replace_worker(job_factory, workers, index, options, blk); end
- # source://parallel//lib/parallel.rb#635
+ # source://parallel//lib/parallel.rb#378
+ def run(command); end
+
+ # source://parallel//lib/parallel.rb#658
def with_instrumentation(item, index, options); end
- # source://parallel//lib/parallel.rb#386
+ # source://parallel//lib/parallel.rb#409
def work_direct(job_factory, options, &block); end
- # source://parallel//lib/parallel.rb#496
+ # source://parallel//lib/parallel.rb#519
def work_in_processes(job_factory, options, &blk); end
- # source://parallel//lib/parallel.rb#430
+ # source://parallel//lib/parallel.rb#453
def work_in_ractors(job_factory, options); end
- # source://parallel//lib/parallel.rb#405
+ # source://parallel//lib/parallel.rb#428
def work_in_threads(job_factory, options, &block); end
- # source://parallel//lib/parallel.rb#564
+ # source://parallel//lib/parallel.rb#587
def worker(job_factory, options, &block); end
end
end
diff --git a/sorbet/rbi/gems/parser@3.3.1.0.rbi b/sorbet/rbi/gems/parser@3.3.6.0.rbi
similarity index 99%
rename from sorbet/rbi/gems/parser@3.3.1.0.rbi
rename to sorbet/rbi/gems/parser@3.3.6.0.rbi
index 383051a5..e5a2bb42 100644
--- a/sorbet/rbi/gems/parser@3.3.1.0.rbi
+++ b/sorbet/rbi/gems/parser@3.3.6.0.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `parser` gem.
# Please instead update this file by running `bin/tapioca gem parser`.
+
# @api public
#
# source://parser//lib/parser.rb#19
diff --git a/sorbet/rbi/gems/prism@0.29.0.rbi b/sorbet/rbi/gems/prism@1.2.0.rbi
similarity index 60%
rename from sorbet/rbi/gems/prism@0.29.0.rbi
rename to sorbet/rbi/gems/prism@1.2.0.rbi
index df5bddcd..c6c606d9 100644
--- a/sorbet/rbi/gems/prism@0.29.0.rbi
+++ b/sorbet/rbi/gems/prism@1.2.0.rbi
@@ -7,6 +7,11 @@
# typed: strict
+# =begin
+# This file is generated by the templates/template.rb script and should not be
+# modified manually. See templates/rbi/prism/dsl.rbi.erb
+# if you are looking to modify the template
+# =end
# =begin
# This file is generated by the templates/template.rb script and should not be
# modified manually. See templates/rbi/prism/node.rbi.erb
@@ -50,7 +55,7 @@ module Prism
#
# For supported options, see Prism::parse.
#
- # source://prism//lib/prism.rb#47
+ # source://prism//lib/prism.rb#45
sig { params(source: String, options: T::Hash[Symbol, T.untyped]).returns(Prism::LexCompat::Result) }
def lex_compat(source, **options); end
@@ -64,7 +69,7 @@ module Prism
# returns the same tokens. Raises SyntaxError if the syntax in source is
# invalid.
#
- # source://prism//lib/prism.rb#57
+ # source://prism//lib/prism.rb#55
sig { params(source: String).returns(T::Array[T.untyped]) }
def lex_ripper(source); end
@@ -73,7 +78,7 @@ module Prism
#
# Load the serialized AST using the source as a reference into a tree.
#
- # source://prism//lib/prism.rb#65
+ # source://prism//lib/prism.rb#63
sig { params(source: String, serialized: String).returns(Prism::ParseResult) }
def load(source, serialized); end
@@ -121,33 +126,55 @@ module Prism
#
# @return [Boolean]
def parse_success?(*_arg0); end
+
+ # Mirror the Prism.profile API by using the serialization API.
+ def profile(*_arg0); end
+
+ # Mirror the Prism.profile_file API by using the serialization API.
+ def profile_file(*_arg0); end
end
end
# Specialized version of Prism::Source for source code that includes ASCII
# characters only. This class is used to apply performance optimizations that
-# cannot be applied to sources that include multibyte characters. Sources that
-# include multibyte characters are represented by the Prism::Source class.
+# cannot be applied to sources that include multibyte characters.
#
-# source://prism//lib/prism/parse_result.rb#126
+# In the extremely rare case that a source includes multi-byte characters but
+# is marked as binary because of a magic encoding comment and it cannot be
+# eagerly converted to UTF-8, this class will be used as well. This is because
+# at that point we will treat everything as single-byte characters.
+#
+# source://prism//lib/prism/parse_result.rb#236
class Prism::ASCIISource < ::Prism::Source
# Return the column number in characters for the given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#133
+ # source://prism//lib/prism/parse_result.rb#243
sig { params(byte_offset: Integer).returns(Integer) }
def character_column(byte_offset); end
# Return the character offset for the given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#128
+ # source://prism//lib/prism/parse_result.rb#238
sig { params(byte_offset: Integer).returns(Integer) }
def character_offset(byte_offset); end
+ # Returns a cache that is the identity function in order to maintain the
+ # same interface. We can do this because code units are always equivalent to
+ # byte offsets for ASCII-only sources.
+ #
+ # source://prism//lib/prism/parse_result.rb#260
+ sig do
+ params(
+ encoding: Encoding
+ ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)))
+ end
+ def code_units_cache(encoding); end
+
# Specialized version of `code_units_column` that does not depend on
# `code_units_offset`, which is a more expensive operation. This is
- # essentialy the same as `Prism::Source#column`.
+ # essentially the same as `Prism::Source#column`.
#
- # source://prism//lib/prism/parse_result.rb#150
+ # source://prism//lib/prism/parse_result.rb#267
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
def code_units_column(byte_offset, encoding); end
@@ -158,7 +185,7 @@ class Prism::ASCIISource < ::Prism::Source
# concept of code units that differs from the number of characters in other
# encodings, it is not captured here.
#
- # source://prism//lib/prism/parse_result.rb#143
+ # source://prism//lib/prism/parse_result.rb#253
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
def code_units_offset(byte_offset, encoding); end
end
@@ -168,77 +195,81 @@ end
# alias $foo $bar
# ^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#188
+# source://prism//lib/prism/node.rb#227
class Prism::AliasGlobalVariableNode < ::Prism::Node
- # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void
+ # Initialize a new AliasGlobalVariableNode node.
#
# @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode
#
- # source://prism//lib/prism/node.rb#190
+ # source://prism//lib/prism/node.rb#229
sig do
params(
source: Prism::Source,
- new_name: Prism::Node,
- old_name: Prism::Node,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode),
+ old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, new_name, old_name, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#294
+ # source://prism//lib/prism/node.rb#316
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#200
+ # source://prism//lib/prism/node.rb#240
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#205
+ # source://prism//lib/prism/node.rb#245
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#215
+ # source://prism//lib/prism/node.rb#255
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#210
+ # source://prism//lib/prism/node.rb#250
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasGlobalVariableNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, ?old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, ?keyword_loc: Location) -> AliasGlobalVariableNode
#
- # source://prism//lib/prism/node.rb#220
+ # source://prism//lib/prism/node.rb#260
sig do
params(
- new_name: Prism::Node,
- old_name: Prism::Node,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode),
+ old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
).returns(Prism::AliasGlobalVariableNode)
end
- def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#205
+ # source://prism//lib/prism/node.rb#245
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode, old_name: GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | SymbolNode | MissingNode, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#228
+ # source://prism//lib/prism/node.rb#268
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -247,13 +278,13 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#260
+ # source://prism//lib/prism/node.rb#300
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#255
+ # source://prism//lib/prism/node.rb#295
sig { returns(String) }
def keyword; end
@@ -262,56 +293,40 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node
# alias $foo $bar
# ^^^^^
#
- # source://prism//lib/prism/node.rb#248
+ # source://prism//lib/prism/node.rb#288
sig { returns(Prism::Location) }
def keyword_loc; end
- # Represents the new name of the global variable that can be used after aliasing. This can be either a global variable, a back reference, or a numbered reference.
+ # Represents the new name of the global variable that can be used after aliasing.
#
# alias $foo $bar
# ^^^^
#
- # source://prism//lib/prism/node.rb#236
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#276
+ sig { returns(T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)) }
def new_name; end
- # Represents the old name of the global variable that could be used before aliasing. This can be either a global variable, a back reference, or a numbered reference.
+ # Represents the old name of the global variable that can be used before aliasing.
#
# alias $foo $bar
# ^^^^
#
- # source://prism//lib/prism/node.rb#242
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#282
+ sig do
+ returns(T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode))
+ end
def old_name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#278
+ # source://prism//lib/prism/node.rb#305
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#288
+ # source://prism//lib/prism/node.rb#310
def type; end
end
end
@@ -321,77 +336,81 @@ end
# alias foo bar
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#306
+# source://prism//lib/prism/node.rb#328
class Prism::AliasMethodNode < ::Prism::Node
- # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void
+ # Initialize a new AliasMethodNode node.
#
# @return [AliasMethodNode] a new instance of AliasMethodNode
#
- # source://prism//lib/prism/node.rb#308
+ # source://prism//lib/prism/node.rb#330
sig do
params(
source: Prism::Source,
- new_name: Prism::Node,
- old_name: Prism::Node,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode),
+ old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, new_name, old_name, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, new_name, old_name, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#403
+ # source://prism//lib/prism/node.rb#426
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#318
+ # source://prism//lib/prism/node.rb#341
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#323
+ # source://prism//lib/prism/node.rb#346
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#333
+ # source://prism//lib/prism/node.rb#356
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#328
+ # source://prism//lib/prism/node.rb#351
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasMethodNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?new_name: SymbolNode | InterpolatedSymbolNode, ?old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, ?keyword_loc: Location) -> AliasMethodNode
#
- # source://prism//lib/prism/node.rb#338
+ # source://prism//lib/prism/node.rb#361
sig do
params(
- new_name: Prism::Node,
- old_name: Prism::Node,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode),
+ old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
).returns(Prism::AliasMethodNode)
end
- def copy(new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#323
+ # source://prism//lib/prism/node.rb#346
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, new_name: SymbolNode | InterpolatedSymbolNode, old_name: SymbolNode | InterpolatedSymbolNode | GlobalVariableReadNode | MissingNode, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#346
+ # source://prism//lib/prism/node.rb#369
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -400,62 +419,64 @@ class Prism::AliasMethodNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#369
+ # source://prism//lib/prism/node.rb#410
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#364
+ # source://prism//lib/prism/node.rb#405
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#357
+ # source://prism//lib/prism/node.rb#398
sig { returns(Prism::Location) }
def keyword_loc; end
- # attr_reader new_name: Prism::node
+ # Represents the new name of the method that will be aliased.
#
- # source://prism//lib/prism/node.rb#351
- sig { returns(Prism::Node) }
+ # alias foo bar
+ # ^^^
+ #
+ # alias :foo :bar
+ # ^^^^
+ #
+ # alias :"#{foo}" :"#{bar}"
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/node.rb#383
+ sig { returns(T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)) }
def new_name; end
- # attr_reader old_name: Prism::node
+ # Represents the old name of the method that will be aliased.
#
- # source://prism//lib/prism/node.rb#354
- sig { returns(Prism::Node) }
- def old_name; end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # alias foo bar
+ # ^^^
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # alias :foo :bar
+ # ^^^^
+ #
+ # alias :"#{foo}" :"#{bar}"
+ # ^^^^^^^^^
#
- # def type: () -> Symbol
+ # source://prism//lib/prism/node.rb#395
+ sig do
+ returns(T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode))
+ end
+ def old_name; end
+
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#387
+ # source://prism//lib/prism/node.rb#415
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#397
+ # source://prism//lib/prism/node.rb#420
def type; end
end
end
@@ -465,77 +486,81 @@ end
# foo => bar | baz
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#415
+# source://prism//lib/prism/node.rb#438
class Prism::AlternationPatternNode < ::Prism::Node
- # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void
+ # Initialize a new AlternationPatternNode node.
#
# @return [AlternationPatternNode] a new instance of AlternationPatternNode
#
- # source://prism//lib/prism/node.rb#417
+ # source://prism//lib/prism/node.rb#440
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, left, right, operator_loc, location); end
+ def initialize(source, node_id, location, flags, left, right, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#512
+ # source://prism//lib/prism/node.rb#527
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#427
+ # source://prism//lib/prism/node.rb#451
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#432
+ # source://prism//lib/prism/node.rb#456
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#442
+ # source://prism//lib/prism/node.rb#466
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#437
+ # source://prism//lib/prism/node.rb#461
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AlternationPatternNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AlternationPatternNode
#
- # source://prism//lib/prism/node.rb#447
+ # source://prism//lib/prism/node.rb#471
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::AlternationPatternNode)
end
- def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#432
+ # source://prism//lib/prism/node.rb#456
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#455
+ # source://prism//lib/prism/node.rb#479
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -544,62 +569,53 @@ class Prism::AlternationPatternNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#478
+ # source://prism//lib/prism/node.rb#511
sig { override.returns(String) }
def inspect; end
- # attr_reader left: Prism::node
+ # Represents the left side of the expression.
+ #
+ # foo => bar | baz
+ # ^^^
#
- # source://prism//lib/prism/node.rb#460
+ # source://prism//lib/prism/node.rb#487
sig { returns(Prism::Node) }
def left; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#473
+ # source://prism//lib/prism/node.rb#506
sig { returns(String) }
def operator; end
- # attr_reader operator_loc: Location
+ # Represents the alternation operator location.
#
- # source://prism//lib/prism/node.rb#466
+ # foo => bar | baz
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#499
sig { returns(Prism::Location) }
def operator_loc; end
- # attr_reader right: Prism::node
+ # Represents the right side of the expression.
+ #
+ # foo => bar | baz
+ # ^^^
#
- # source://prism//lib/prism/node.rb#463
+ # source://prism//lib/prism/node.rb#493
sig { returns(Prism::Node) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#496
+ # source://prism//lib/prism/node.rb#516
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#506
+ # source://prism//lib/prism/node.rb#521
def type; end
end
end
@@ -609,77 +625,81 @@ end
# left and right
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#524
+# source://prism//lib/prism/node.rb#539
class Prism::AndNode < ::Prism::Node
- # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void
+ # Initialize a new AndNode node.
#
# @return [AndNode] a new instance of AndNode
#
- # source://prism//lib/prism/node.rb#526
+ # source://prism//lib/prism/node.rb#541
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, left, right, operator_loc, location); end
+ def initialize(source, node_id, location, flags, left, right, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#636
+ # source://prism//lib/prism/node.rb#634
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#536
+ # source://prism//lib/prism/node.rb#552
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#541
+ # source://prism//lib/prism/node.rb#557
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#551
+ # source://prism//lib/prism/node.rb#567
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#546
+ # source://prism//lib/prism/node.rb#562
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AndNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> AndNode
#
- # source://prism//lib/prism/node.rb#556
+ # source://prism//lib/prism/node.rb#572
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::AndNode)
end
- def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#541
+ # source://prism//lib/prism/node.rb#557
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#564
+ # source://prism//lib/prism/node.rb#580
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -688,7 +708,7 @@ class Prism::AndNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#602
+ # source://prism//lib/prism/node.rb#618
sig { override.returns(String) }
def inspect; end
@@ -700,13 +720,13 @@ class Prism::AndNode < ::Prism::Node
# 1 && 2
# ^
#
- # source://prism//lib/prism/node.rb#575
+ # source://prism//lib/prism/node.rb#591
sig { returns(Prism::Node) }
def left; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#597
+ # source://prism//lib/prism/node.rb#613
sig { returns(String) }
def operator; end
@@ -715,11 +735,11 @@ class Prism::AndNode < ::Prism::Node
# left and right
# ^^^
#
- # source://prism//lib/prism/node.rb#590
+ # source://prism//lib/prism/node.rb#606
sig { returns(Prism::Location) }
def operator_loc; end
- # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
+ # Represents the right side of the expression.
#
# left && right
# ^^^^^
@@ -727,38 +747,20 @@ class Prism::AndNode < ::Prism::Node
# 1 and 2
# ^
#
- # source://prism//lib/prism/node.rb#584
+ # source://prism//lib/prism/node.rb#600
sig { returns(Prism::Node) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#620
+ # source://prism//lib/prism/node.rb#623
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#630
+ # source://prism//lib/prism/node.rb#628
def type; end
end
end
@@ -768,64 +770,73 @@ end
# return foo, bar, baz
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#648
+# source://prism//lib/prism/node.rb#646
class Prism::ArgumentsNode < ::Prism::Node
- # def initialize: (Integer flags, Array[Prism::node] arguments, Location location) -> void
+ # Initialize a new ArgumentsNode node.
#
# @return [ArgumentsNode] a new instance of ArgumentsNode
#
- # source://prism//lib/prism/node.rb#650
+ # source://prism//lib/prism/node.rb#648
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- arguments: T::Array[Prism::Node],
- location: Prism::Location
+ arguments: T::Array[Prism::Node]
).void
end
- def initialize(source, flags, arguments, location); end
+ def initialize(source, node_id, location, flags, arguments); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#743
+ # source://prism//lib/prism/node.rb#734
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#659
+ # source://prism//lib/prism/node.rb#657
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#696
+ # source://prism//lib/prism/node.rb#715
sig { returns(T::Array[Prism::Node]) }
def arguments; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#664
+ # source://prism//lib/prism/node.rb#662
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#674
+ # source://prism//lib/prism/node.rb#672
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#669
+ # source://prism//lib/prism/node.rb#667
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
+ # def contains_forwarding?: () -> bool
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#690
+ sig { returns(T::Boolean) }
+ def contains_forwarding?; end
+
# def contains_keyword_splat?: () -> bool
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#704
+ # source://prism//lib/prism/node.rb#700
sig { returns(T::Boolean) }
def contains_keyword_splat?; end
@@ -833,32 +844,49 @@ class Prism::ArgumentsNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#699
+ # source://prism//lib/prism/node.rb#695
sig { returns(T::Boolean) }
def contains_keywords?; end
- # def copy: (?flags: Integer, ?arguments: Array[Prism::node], ?location: Location) -> ArgumentsNode
+ # def contains_multiple_splats?: () -> bool
#
- # source://prism//lib/prism/node.rb#679
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#710
+ sig { returns(T::Boolean) }
+ def contains_multiple_splats?; end
+
+ # def contains_splat?: () -> bool
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#705
+ sig { returns(T::Boolean) }
+ def contains_splat?; end
+
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) -> ArgumentsNode
+ #
+ # source://prism//lib/prism/node.rb#677
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- arguments: T::Array[Prism::Node],
- location: Prism::Location
+ arguments: T::Array[Prism::Node]
).returns(Prism::ArgumentsNode)
end
- def copy(flags: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#664
+ # source://prism//lib/prism/node.rb#662
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Prism::node], location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: Array[Prism::node] }
#
- # source://prism//lib/prism/node.rb#687
+ # source://prism//lib/prism/node.rb#685
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -867,110 +895,100 @@ class Prism::ArgumentsNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#709
+ # source://prism//lib/prism/node.rb#718
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#727
+ # source://prism//lib/prism/node.rb#723
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#692
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#737
+ # source://prism//lib/prism/node.rb#728
def type; end
end
end
# Flags for arguments nodes.
#
-# source://prism//lib/prism/node.rb#19202
+# source://prism//lib/prism/node.rb#16684
module Prism::ArgumentsNodeFlags; end
-# if arguments contain keywords
+# if the arguments contain forwarding
#
-# source://prism//lib/prism/node.rb#19204
+# source://prism//lib/prism/node.rb#16686
+Prism::ArgumentsNodeFlags::CONTAINS_FORWARDING = T.let(T.unsafe(nil), Integer)
+
+# if the arguments contain keywords
+#
+# source://prism//lib/prism/node.rb#16689
Prism::ArgumentsNodeFlags::CONTAINS_KEYWORDS = T.let(T.unsafe(nil), Integer)
-# if arguments contain keyword splat
+# if the arguments contain a keyword splat
#
-# source://prism//lib/prism/node.rb#19207
+# source://prism//lib/prism/node.rb#16692
Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer)
+# if the arguments contain multiple splats
+#
+# source://prism//lib/prism/node.rb#16698
+Prism::ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS = T.let(T.unsafe(nil), Integer)
+
+# if the arguments contain a splat
+#
+# source://prism//lib/prism/node.rb#16695
+Prism::ArgumentsNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer)
+
# Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
#
# [1, 2, 3]
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#755
+# source://prism//lib/prism/node.rb#746
class Prism::ArrayNode < ::Prism::Node
- # def initialize: (Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void
+ # Initialize a new ArrayNode node.
#
# @return [ArrayNode] a new instance of ArrayNode
#
- # source://prism//lib/prism/node.rb#757
+ # source://prism//lib/prism/node.rb#748
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
elements: T::Array[Prism::Node],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, flags, elements, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, elements, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#893
+ # source://prism//lib/prism/node.rb#862
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#768
+ # source://prism//lib/prism/node.rb#759
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#773
+ # source://prism//lib/prism/node.rb#764
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#854
+ # source://prism//lib/prism/node.rb#841
sig { returns(T.nilable(String)) }
def closing; end
@@ -981,19 +999,19 @@ class Prism::ArrayNode < ::Prism::Node
# %I(apple orange banana) # ")"
# foo = 1, 2, 3 # nil
#
- # source://prism//lib/prism/node.rb#831
+ # source://prism//lib/prism/node.rb#823
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#783
+ # source://prism//lib/prism/node.rb#774
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#778
+ # source://prism//lib/prism/node.rb#769
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
@@ -1001,40 +1019,41 @@ class Prism::ArrayNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#844
+ # source://prism//lib/prism/node.rb#792
sig { returns(T::Boolean) }
def contains_splat?; end
- # def copy: (?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayNode
#
- # source://prism//lib/prism/node.rb#788
+ # source://prism//lib/prism/node.rb#779
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
elements: T::Array[Prism::Node],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::ArrayNode)
end
- def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#773
+ # source://prism//lib/prism/node.rb#764
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#796
+ # source://prism//lib/prism/node.rb#787
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# Represent the list of zero or more [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression) within the array.
#
- # source://prism//lib/prism/node.rb#805
+ # source://prism//lib/prism/node.rb#797
sig { returns(T::Array[Prism::Node]) }
def elements; end
@@ -1043,13 +1062,13 @@ class Prism::ArrayNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#859
+ # source://prism//lib/prism/node.rb#846
sig { override.returns(String) }
def inspect; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#849
+ # source://prism//lib/prism/node.rb#836
sig { returns(T.nilable(String)) }
def opening; end
@@ -1060,58 +1079,32 @@ class Prism::ArrayNode < ::Prism::Node
# %I(apple orange banana) # "%I("
# foo = 1, 2, 3 # nil
#
- # source://prism//lib/prism/node.rb#813
+ # source://prism//lib/prism/node.rb#805
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#877
+ # source://prism//lib/prism/node.rb#851
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#801
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#887
+ # source://prism//lib/prism/node.rb#856
def type; end
end
end
# Flags for array nodes.
#
-# source://prism//lib/prism/node.rb#19211
+# source://prism//lib/prism/node.rb#16702
module Prism::ArrayNodeFlags; end
# if array contains splat nodes
#
-# source://prism//lib/prism/node.rb#19213
+# source://prism//lib/prism/node.rb#16704
Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer)
# Represents an array pattern in pattern matching.
@@ -1131,101 +1124,105 @@ Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer)
# foo in Bar[1, 2, 3]
# ^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#919
+# source://prism//lib/prism/node.rb#888
class Prism::ArrayPatternNode < ::Prism::Node
- # def initialize: (Prism::node? constant, Array[Prism::node] requireds, Prism::node? rest, Array[Prism::node] posts, Location? opening_loc, Location? closing_loc, Location location) -> void
+ # Initialize a new ArrayPatternNode node.
#
# @return [ArrayPatternNode] a new instance of ArrayPatternNode
#
- # source://prism//lib/prism/node.rb#921
+ # source://prism//lib/prism/node.rb#890
sig do
params(
source: Prism::Source,
- constant: T.nilable(Prism::Node),
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
requireds: T::Array[Prism::Node],
rest: T.nilable(Prism::Node),
posts: T::Array[Prism::Node],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, constant, requireds, rest, posts, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1054
+ # source://prism//lib/prism/node.rb#1006
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#934
+ # source://prism//lib/prism/node.rb#904
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#939
+ # source://prism//lib/prism/node.rb#909
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#1015
+ # source://prism//lib/prism/node.rb#985
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#997
+ # source://prism//lib/prism/node.rb#967
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#954
+ # source://prism//lib/prism/node.rb#924
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#944
+ # source://prism//lib/prism/node.rb#914
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader constant: Prism::node?
+ # attr_reader constant: ConstantReadNode | ConstantPathNode | nil
#
- # source://prism//lib/prism/node.rb#972
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#942
+ sig { returns(T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode))) }
def constant; end
- # def copy: (?constant: Prism::node?, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayPatternNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?requireds: Array[Prism::node], ?rest: Prism::node?, ?posts: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?) -> ArrayPatternNode
#
- # source://prism//lib/prism/node.rb#959
+ # source://prism//lib/prism/node.rb#929
sig do
params(
- constant: T.nilable(Prism::Node),
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
requireds: T::Array[Prism::Node],
rest: T.nilable(Prism::Node),
posts: T::Array[Prism::Node],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::ArrayPatternNode)
end
- def copy(constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#939
+ # source://prism//lib/prism/node.rb#909
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, requireds: Array[Prism::node], rest: Prism::node?, posts: Array[Prism::node], opening_loc: Location?, closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#967
+ # source://prism//lib/prism/node.rb#937
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -1234,68 +1231,50 @@ class Prism::ArrayPatternNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1020
+ # source://prism//lib/prism/node.rb#990
sig { override.returns(String) }
def inspect; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#1010
+ # source://prism//lib/prism/node.rb#980
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#984
+ # source://prism//lib/prism/node.rb#954
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader posts: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#981
+ # source://prism//lib/prism/node.rb#951
sig { returns(T::Array[Prism::Node]) }
def posts; end
# attr_reader requireds: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#975
+ # source://prism//lib/prism/node.rb#945
sig { returns(T::Array[Prism::Node]) }
def requireds; end
# attr_reader rest: Prism::node?
#
- # source://prism//lib/prism/node.rb#978
+ # source://prism//lib/prism/node.rb#948
sig { returns(T.nilable(Prism::Node)) }
def rest; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#1038
+ # source://prism//lib/prism/node.rb#995
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1048
+ # source://prism//lib/prism/node.rb#1000
def type; end
end
end
@@ -1305,77 +1284,81 @@ end
# { a => b }
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#1071
+# source://prism//lib/prism/node.rb#1023
class Prism::AssocNode < ::Prism::Node
- # def initialize: (Prism::node key, Prism::node value, Location? operator_loc, Location location) -> void
+ # Initialize a new AssocNode node.
#
# @return [AssocNode] a new instance of AssocNode
#
- # source://prism//lib/prism/node.rb#1073
+ # source://prism//lib/prism/node.rb#1025
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
key: Prism::Node,
value: Prism::Node,
- operator_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ operator_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, key, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, key, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1192
+ # source://prism//lib/prism/node.rb#1127
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1083
+ # source://prism//lib/prism/node.rb#1036
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1088
+ # source://prism//lib/prism/node.rb#1041
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1098
+ # source://prism//lib/prism/node.rb#1051
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1093
+ # source://prism//lib/prism/node.rb#1046
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?, ?location: Location) -> AssocNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?) -> AssocNode
#
- # source://prism//lib/prism/node.rb#1103
+ # source://prism//lib/prism/node.rb#1056
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
key: Prism::Node,
value: Prism::Node,
- operator_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ operator_loc: T.nilable(Prism::Location)
).returns(Prism::AssocNode)
end
- def copy(key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1088
+ # source://prism//lib/prism/node.rb#1041
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { key: Prism::node, value: Prism::node, operator_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, key: Prism::node, value: Prism::node, operator_loc: Location? }
#
- # source://prism//lib/prism/node.rb#1111
+ # source://prism//lib/prism/node.rb#1064
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -1384,7 +1367,7 @@ class Prism::AssocNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1158
+ # source://prism//lib/prism/node.rb#1111
sig { override.returns(String) }
def inspect; end
@@ -1399,13 +1382,13 @@ class Prism::AssocNode < ::Prism::Node
# { def a; end => 1 }
# ^^^^^^^^^^
#
- # source://prism//lib/prism/node.rb#1125
+ # source://prism//lib/prism/node.rb#1078
sig { returns(Prism::Node) }
def key; end
# def operator: () -> String?
#
- # source://prism//lib/prism/node.rb#1153
+ # source://prism//lib/prism/node.rb#1106
sig { returns(T.nilable(String)) }
def operator; end
@@ -1414,26 +1397,13 @@ class Prism::AssocNode < ::Prism::Node
# { foo => bar }
# ^^
#
- # source://prism//lib/prism/node.rb#1140
+ # source://prism//lib/prism/node.rb#1093
sig { returns(T.nilable(Prism::Location)) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1176
+ # source://prism//lib/prism/node.rb#1116
sig { override.returns(Symbol) }
def type; end
@@ -1445,19 +1415,14 @@ class Prism::AssocNode < ::Prism::Node
# { x: 1 }
# ^
#
- # source://prism//lib/prism/node.rb#1134
+ # source://prism//lib/prism/node.rb#1087
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1186
+ # source://prism//lib/prism/node.rb#1121
def type; end
end
end
@@ -1467,75 +1432,79 @@ end
# { **foo }
# ^^^^^
#
-# source://prism//lib/prism/node.rb#1204
+# source://prism//lib/prism/node.rb#1139
class Prism::AssocSplatNode < ::Prism::Node
- # def initialize: (Prism::node? value, Location operator_loc, Location location) -> void
+ # Initialize a new AssocSplatNode node.
#
# @return [AssocSplatNode] a new instance of AssocSplatNode
#
- # source://prism//lib/prism/node.rb#1206
+ # source://prism//lib/prism/node.rb#1141
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1305
+ # source://prism//lib/prism/node.rb#1223
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1215
+ # source://prism//lib/prism/node.rb#1151
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1220
+ # source://prism//lib/prism/node.rb#1156
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1232
+ # source://prism//lib/prism/node.rb#1168
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1225
+ # source://prism//lib/prism/node.rb#1161
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Prism::node?, ?operator_loc: Location, ?location: Location) -> AssocSplatNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node?, ?operator_loc: Location) -> AssocSplatNode
#
- # source://prism//lib/prism/node.rb#1237
+ # source://prism//lib/prism/node.rb#1173
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::AssocSplatNode)
end
- def copy(value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1220
+ # source://prism//lib/prism/node.rb#1156
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#1245
+ # source://prism//lib/prism/node.rb#1181
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -1544,13 +1513,13 @@ class Prism::AssocSplatNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1271
+ # source://prism//lib/prism/node.rb#1207
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#1266
+ # source://prism//lib/prism/node.rb#1202
sig { returns(String) }
def operator; end
@@ -1559,26 +1528,13 @@ class Prism::AssocSplatNode < ::Prism::Node
# { **x }
# ^^
#
- # source://prism//lib/prism/node.rb#1259
+ # source://prism//lib/prism/node.rb#1195
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1289
+ # source://prism//lib/prism/node.rb#1212
sig { override.returns(Symbol) }
def type; end
@@ -1587,26 +1543,21 @@ class Prism::AssocSplatNode < ::Prism::Node
# { **foo }
# ^^^
#
- # source://prism//lib/prism/node.rb#1253
+ # source://prism//lib/prism/node.rb#1189
sig { returns(T.nilable(Prism::Node)) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#1299
+ # source://prism//lib/prism/node.rb#1217
def type; end
end
end
# The FFI backend is used on other Ruby implementations.
#
-# source://prism//lib/prism.rb#85
+# source://prism//lib/prism.rb#81
Prism::BACKEND = T.let(T.unsafe(nil), Symbol)
# Represents reading a reference to a field in the previous match.
@@ -1614,62 +1565,69 @@ Prism::BACKEND = T.let(T.unsafe(nil), Symbol)
# $'
# ^^
#
-# source://prism//lib/prism/node.rb#1316
+# source://prism//lib/prism/node.rb#1234
class Prism::BackReferenceReadNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new BackReferenceReadNode node.
#
# @return [BackReferenceReadNode] a new instance of BackReferenceReadNode
#
- # source://prism//lib/prism/node.rb#1318
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#1236
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1400
+ # source://prism//lib/prism/node.rb#1301
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1326
+ # source://prism//lib/prism/node.rb#1245
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1331
+ # source://prism//lib/prism/node.rb#1250
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1341
+ # source://prism//lib/prism/node.rb#1260
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1336
+ # source://prism//lib/prism/node.rb#1255
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> BackReferenceReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BackReferenceReadNode
#
- # source://prism//lib/prism/node.rb#1346
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::BackReferenceReadNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#1265
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::BackReferenceReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1331
+ # source://prism//lib/prism/node.rb#1250
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#1354
+ # source://prism//lib/prism/node.rb#1273
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -1678,7 +1636,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1366
+ # source://prism//lib/prism/node.rb#1285
sig { override.returns(String) }
def inspect; end
@@ -1688,38 +1646,20 @@ class Prism::BackReferenceReadNode < ::Prism::Node
#
# $+ # name `:$+`
#
- # source://prism//lib/prism/node.rb#1363
+ # source://prism//lib/prism/node.rb#1282
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1384
+ # source://prism//lib/prism/node.rb#1290
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#1394
+ # source://prism//lib/prism/node.rb#1295
def type; end
end
end
@@ -1758,119 +1698,123 @@ end
# end
# ^^^^^
#
-# source://prism//lib/prism/node.rb#1412
+# source://prism//lib/prism/node.rb#1313
class Prism::BeginNode < ::Prism::Node
- # def initialize: (Location? begin_keyword_loc, StatementsNode? statements, RescueNode? rescue_clause, ElseNode? else_clause, EnsureNode? ensure_clause, Location? end_keyword_loc, Location location) -> void
+ # Initialize a new BeginNode node.
#
# @return [BeginNode] a new instance of BeginNode
#
- # source://prism//lib/prism/node.rb#1414
+ # source://prism//lib/prism/node.rb#1315
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
begin_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
rescue_clause: T.nilable(Prism::RescueNode),
else_clause: T.nilable(Prism::ElseNode),
ensure_clause: T.nilable(Prism::EnsureNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ end_keyword_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1551
+ # source://prism//lib/prism/node.rb#1431
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1427
+ # source://prism//lib/prism/node.rb#1329
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def begin_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#1507
+ # source://prism//lib/prism/node.rb#1405
sig { returns(T.nilable(String)) }
def begin_keyword; end
# attr_reader begin_keyword_loc: Location?
#
- # source://prism//lib/prism/node.rb#1469
+ # source://prism//lib/prism/node.rb#1367
sig { returns(T.nilable(Prism::Location)) }
def begin_keyword_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1436
+ # source://prism//lib/prism/node.rb#1334
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1451
+ # source://prism//lib/prism/node.rb#1349
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1441
+ # source://prism//lib/prism/node.rb#1339
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?, ?location: Location) -> BeginNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?) -> BeginNode
#
- # source://prism//lib/prism/node.rb#1456
+ # source://prism//lib/prism/node.rb#1354
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
begin_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
rescue_clause: T.nilable(Prism::RescueNode),
else_clause: T.nilable(Prism::ElseNode),
ensure_clause: T.nilable(Prism::EnsureNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ end_keyword_loc: T.nilable(Prism::Location)
).returns(Prism::BeginNode)
end
- def copy(begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1436
+ # source://prism//lib/prism/node.rb#1334
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, begin_keyword_loc: Location?, statements: StatementsNode?, rescue_clause: RescueNode?, else_clause: ElseNode?, ensure_clause: EnsureNode?, end_keyword_loc: Location? }
#
- # source://prism//lib/prism/node.rb#1464
+ # source://prism//lib/prism/node.rb#1362
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader else_clause: ElseNode?
#
- # source://prism//lib/prism/node.rb#1488
+ # source://prism//lib/prism/node.rb#1386
sig { returns(T.nilable(Prism::ElseNode)) }
def else_clause; end
# def end_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#1512
+ # source://prism//lib/prism/node.rb#1410
sig { returns(T.nilable(String)) }
def end_keyword; end
# attr_reader end_keyword_loc: Location?
#
- # source://prism//lib/prism/node.rb#1494
+ # source://prism//lib/prism/node.rb#1392
sig { returns(T.nilable(Prism::Location)) }
def end_keyword_loc; end
# attr_reader ensure_clause: EnsureNode?
#
- # source://prism//lib/prism/node.rb#1491
+ # source://prism//lib/prism/node.rb#1389
sig { returns(T.nilable(Prism::EnsureNode)) }
def ensure_clause; end
@@ -1879,137 +1823,123 @@ class Prism::BeginNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1517
+ # source://prism//lib/prism/node.rb#1415
sig { override.returns(String) }
def inspect; end
+ # source://prism//lib/prism/parse_result/newlines.rb#79
+ def newline_flag!(lines); end
+
# attr_reader rescue_clause: RescueNode?
#
- # source://prism//lib/prism/node.rb#1485
+ # source://prism//lib/prism/node.rb#1383
sig { returns(T.nilable(Prism::RescueNode)) }
def rescue_clause; end
- # source://prism//lib/prism/node.rb#1431
- def set_newline_flag(newline_marked); end
-
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#1482
+ # source://prism//lib/prism/node.rb#1380
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#1535
+ # source://prism//lib/prism/node.rb#1420
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1545
+ # source://prism//lib/prism/node.rb#1425
def type; end
end
end
-# Represents block method arguments.
+# Represents a block argument using `&`.
#
# bar(&args)
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#1566
+# source://prism//lib/prism/node.rb#1446
class Prism::BlockArgumentNode < ::Prism::Node
- # def initialize: (Prism::node? expression, Location operator_loc, Location location) -> void
+ # Initialize a new BlockArgumentNode node.
#
# @return [BlockArgumentNode] a new instance of BlockArgumentNode
#
- # source://prism//lib/prism/node.rb#1568
+ # source://prism//lib/prism/node.rb#1448
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, expression, operator_loc, location); end
+ def initialize(source, node_id, location, flags, expression, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1661
+ # source://prism//lib/prism/node.rb#1524
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1577
+ # source://prism//lib/prism/node.rb#1458
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1582
+ # source://prism//lib/prism/node.rb#1463
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1594
+ # source://prism//lib/prism/node.rb#1475
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1587
+ # source://prism//lib/prism/node.rb#1468
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?expression: Prism::node?, ?operator_loc: Location, ?location: Location) -> BlockArgumentNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node?, ?operator_loc: Location) -> BlockArgumentNode
#
- # source://prism//lib/prism/node.rb#1599
+ # source://prism//lib/prism/node.rb#1480
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::BlockArgumentNode)
end
- def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1582
+ # source://prism//lib/prism/node.rb#1463
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#1607
+ # source://prism//lib/prism/node.rb#1488
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader expression: Prism::node?
#
- # source://prism//lib/prism/node.rb#1612
+ # source://prism//lib/prism/node.rb#1493
sig { returns(T.nilable(Prism::Node)) }
def expression; end
@@ -2018,50 +1948,32 @@ class Prism::BlockArgumentNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1627
+ # source://prism//lib/prism/node.rb#1508
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#1622
+ # source://prism//lib/prism/node.rb#1503
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#1615
+ # source://prism//lib/prism/node.rb#1496
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#1645
+ # source://prism//lib/prism/node.rb#1513
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1655
+ # source://prism//lib/prism/node.rb#1518
def type; end
end
end
@@ -2071,62 +1983,69 @@ end
# a { |; b| }
# ^
#
-# source://prism//lib/prism/node.rb#1672
+# source://prism//lib/prism/node.rb#1535
class Prism::BlockLocalVariableNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol name, Location location) -> void
+ # Initialize a new BlockLocalVariableNode node.
#
# @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode
#
- # source://prism//lib/prism/node.rb#1674
- sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void }
- def initialize(source, flags, name, location); end
+ # source://prism//lib/prism/node.rb#1537
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1762
+ # source://prism//lib/prism/node.rb#1603
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1683
+ # source://prism//lib/prism/node.rb#1546
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1688
+ # source://prism//lib/prism/node.rb#1551
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1698
+ # source://prism//lib/prism/node.rb#1561
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1693
+ # source://prism//lib/prism/node.rb#1556
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> BlockLocalVariableNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> BlockLocalVariableNode
#
- # source://prism//lib/prism/node.rb#1703
- sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::BlockLocalVariableNode) }
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#1566
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::BlockLocalVariableNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1688
+ # source://prism//lib/prism/node.rb#1551
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#1711
+ # source://prism//lib/prism/node.rb#1574
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2135,13 +2054,13 @@ class Prism::BlockLocalVariableNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1728
+ # source://prism//lib/prism/node.rb#1587
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#1720
+ # source://prism//lib/prism/node.rb#1584
sig { returns(Symbol) }
def name; end
@@ -2149,46 +2068,20 @@ class Prism::BlockLocalVariableNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#1723
+ # source://prism//lib/prism/node.rb#1579
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1746
+ # source://prism//lib/prism/node.rb#1592
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#1716
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#1756
+ # source://prism//lib/prism/node.rb#1597
def type; end
end
end
@@ -2198,99 +2091,103 @@ end
# [1, 2, 3].each { |i| puts x }
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#1773
+# source://prism//lib/prism/node.rb#1614
class Prism::BlockNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, Prism::node? parameters, Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void
+ # Initialize a new BlockNode node.
#
# @return [BlockNode] a new instance of BlockNode
#
- # source://prism//lib/prism/node.rb#1775
+ # source://prism//lib/prism/node.rb#1616
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
- parameters: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, locals, parameters, body, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#1890
+ # source://prism//lib/prism/node.rb#1714
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1787
+ # source://prism//lib/prism/node.rb#1629
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
- # attr_reader body: Prism::node?
+ # attr_reader body: StatementsNode | BeginNode | nil
#
- # source://prism//lib/prism/node.rb#1829
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#1671
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1792
+ # source://prism//lib/prism/node.rb#1634
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#1851
+ # source://prism//lib/prism/node.rb#1693
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#1839
+ # source://prism//lib/prism/node.rb#1681
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1805
+ # source://prism//lib/prism/node.rb#1647
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1797
+ # source://prism//lib/prism/node.rb#1639
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?locals: Array[Symbol], ?parameters: Prism::node?, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> BlockNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil, ?opening_loc: Location, ?closing_loc: Location) -> BlockNode
#
- # source://prism//lib/prism/node.rb#1810
+ # source://prism//lib/prism/node.rb#1652
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
- parameters: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::BlockNode)
end
- def copy(locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1792
+ # source://prism//lib/prism/node.rb#1634
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Prism::node?, body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil, opening_loc: Location, closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#1818
+ # source://prism//lib/prism/node.rb#1660
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2299,145 +2196,129 @@ class Prism::BlockNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1856
+ # source://prism//lib/prism/node.rb#1698
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#1823
+ # source://prism//lib/prism/node.rb#1665
sig { returns(T::Array[Symbol]) }
def locals; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#1846
+ # source://prism//lib/prism/node.rb#1688
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#1832
+ # source://prism//lib/prism/node.rb#1674
sig { returns(Prism::Location) }
def opening_loc; end
- # attr_reader parameters: Prism::node?
+ # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
#
- # source://prism//lib/prism/node.rb#1826
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#1668
+ sig { returns(T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode))) }
def parameters; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#1874
+ # source://prism//lib/prism/node.rb#1703
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#1884
+ # source://prism//lib/prism/node.rb#1708
def type; end
end
end
-# Represents a block parameter to a method, block, or lambda definition.
+# Represents a block parameter of a method, block, or lambda definition.
#
# def a(&b)
# ^^
# end
#
-# source://prism//lib/prism/node.rb#1906
+# source://prism//lib/prism/node.rb#1730
class Prism::BlockParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void
+ # Initialize a new BlockParameterNode node.
#
# @return [BlockParameterNode] a new instance of BlockParameterNode
#
- # source://prism//lib/prism/node.rb#1908
+ # source://prism//lib/prism/node.rb#1732
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, flags, name, name_loc, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2023
+ # source://prism//lib/prism/node.rb#1825
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#1919
+ # source://prism//lib/prism/node.rb#1743
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1924
+ # source://prism//lib/prism/node.rb#1748
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#1934
+ # source://prism//lib/prism/node.rb#1758
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#1929
+ # source://prism//lib/prism/node.rb#1753
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> BlockParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> BlockParameterNode
#
- # source://prism//lib/prism/node.rb#1939
+ # source://prism//lib/prism/node.rb#1763
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::BlockParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#1924
+ # source://prism//lib/prism/node.rb#1748
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#1947
+ # source://prism//lib/prism/node.rb#1771
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2446,31 +2327,31 @@ class Prism::BlockParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#1989
+ # source://prism//lib/prism/node.rb#1809
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol?
#
- # source://prism//lib/prism/node.rb#1956
+ # source://prism//lib/prism/node.rb#1781
sig { returns(T.nilable(Symbol)) }
def name; end
# attr_reader name_loc: Location?
#
- # source://prism//lib/prism/node.rb#1959
+ # source://prism//lib/prism/node.rb#1784
sig { returns(T.nilable(Prism::Location)) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#1984
+ # source://prism//lib/prism/node.rb#1804
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#1972
+ # source://prism//lib/prism/node.rb#1797
sig { returns(Prism::Location) }
def operator_loc; end
@@ -2478,46 +2359,20 @@ class Prism::BlockParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#1979
+ # source://prism//lib/prism/node.rb#1776
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#2007
+ # source://prism//lib/prism/node.rb#1814
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#1952
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#2017
+ # source://prism//lib/prism/node.rb#1819
def type; end
end
end
@@ -2531,91 +2386,95 @@ end
# ^^^^^^^^^^^^^^^^^
# end
#
-# source://prism//lib/prism/node.rb#2040
+# source://prism//lib/prism/node.rb#1842
class Prism::BlockParametersNode < ::Prism::Node
- # def initialize: (ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc, Location location) -> void
+ # Initialize a new BlockParametersNode node.
#
# @return [BlockParametersNode] a new instance of BlockParametersNode
#
- # source://prism//lib/prism/node.rb#2042
+ # source://prism//lib/prism/node.rb#1844
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parameters: T.nilable(Prism::ParametersNode),
locals: T::Array[Prism::BlockLocalVariableNode],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, parameters, locals, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2165
+ # source://prism//lib/prism/node.rb#1950
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2053
+ # source://prism//lib/prism/node.rb#1856
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2058
+ # source://prism//lib/prism/node.rb#1861
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#2126
+ # source://prism//lib/prism/node.rb#1929
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#2108
+ # source://prism//lib/prism/node.rb#1911
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2071
+ # source://prism//lib/prism/node.rb#1874
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2063
+ # source://prism//lib/prism/node.rb#1866
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> BlockParametersNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?) -> BlockParametersNode
#
- # source://prism//lib/prism/node.rb#2076
+ # source://prism//lib/prism/node.rb#1879
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parameters: T.nilable(Prism::ParametersNode),
locals: T::Array[Prism::BlockLocalVariableNode],
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::BlockParametersNode)
end
- def copy(parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2058
+ # source://prism//lib/prism/node.rb#1861
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#2084
+ # source://prism//lib/prism/node.rb#1887
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2624,62 +2483,44 @@ class Prism::BlockParametersNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#2131
+ # source://prism//lib/prism/node.rb#1934
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[BlockLocalVariableNode]
#
- # source://prism//lib/prism/node.rb#2092
+ # source://prism//lib/prism/node.rb#1895
sig { returns(T::Array[Prism::BlockLocalVariableNode]) }
def locals; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#2121
+ # source://prism//lib/prism/node.rb#1924
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#2095
+ # source://prism//lib/prism/node.rb#1898
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader parameters: ParametersNode?
#
- # source://prism//lib/prism/node.rb#2089
+ # source://prism//lib/prism/node.rb#1892
sig { returns(T.nilable(Prism::ParametersNode)) }
def parameters; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#2149
+ # source://prism//lib/prism/node.rb#1939
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#2159
+ # source://prism//lib/prism/node.rb#1944
def type; end
end
end
@@ -2689,32 +2530,34 @@ end
# break foo
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#2179
+# source://prism//lib/prism/node.rb#1964
class Prism::BreakNode < ::Prism::Node
- # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void
+ # Initialize a new BreakNode node.
#
# @return [BreakNode] a new instance of BreakNode
#
- # source://prism//lib/prism/node.rb#2181
+ # source://prism//lib/prism/node.rb#1966
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
arguments: T.nilable(Prism::ArgumentsNode),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, arguments, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, arguments, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2280
+ # source://prism//lib/prism/node.rb#2048
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2190
+ # source://prism//lib/prism/node.rb#1976
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -2723,50 +2566,52 @@ class Prism::BreakNode < ::Prism::Node
# break foo
# ^^^
#
- # source://prism//lib/prism/node.rb#2228
+ # source://prism//lib/prism/node.rb#2014
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2195
+ # source://prism//lib/prism/node.rb#1981
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2207
+ # source://prism//lib/prism/node.rb#1993
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2200
+ # source://prism//lib/prism/node.rb#1986
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> BreakNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> BreakNode
#
- # source://prism//lib/prism/node.rb#2212
+ # source://prism//lib/prism/node.rb#1998
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
arguments: T.nilable(Prism::ArgumentsNode),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).returns(Prism::BreakNode)
end
- def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2195
+ # source://prism//lib/prism/node.rb#1981
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#2220
+ # source://prism//lib/prism/node.rb#2006
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2775,13 +2620,13 @@ class Prism::BreakNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#2246
+ # source://prism//lib/prism/node.rb#2032
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#2241
+ # source://prism//lib/prism/node.rb#2027
sig { returns(String) }
def keyword; end
@@ -2790,38 +2635,20 @@ class Prism::BreakNode < ::Prism::Node
# break foo
# ^^^^^
#
- # source://prism//lib/prism/node.rb#2234
+ # source://prism//lib/prism/node.rb#2020
sig { returns(Prism::Location) }
def keyword_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#2264
+ # source://prism//lib/prism/node.rb#2037
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#2274
+ # source://prism//lib/prism/node.rb#2042
def type; end
end
end
@@ -2831,16 +2658,18 @@ end
# foo.bar &&= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#2291
+# source://prism//lib/prism/node.rb#2059
class Prism::CallAndWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new CallAndWriteNode node.
#
# @return [CallAndWriteNode] a new instance of CallAndWriteNode
#
- # source://prism//lib/prism/node.rb#2293
+ # source://prism//lib/prism/node.rb#2061
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -2848,21 +2677,20 @@ class Prism::CallAndWriteNode < ::Prism::Node
read_name: Symbol,
write_name: Symbol,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2462
+ # source://prism//lib/prism/node.rb#2208
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2308
+ # source://prism//lib/prism/node.rb#2076
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -2870,45 +2698,47 @@ class Prism::CallAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2403
+ # source://prism//lib/prism/node.rb#2122
sig { returns(T::Boolean) }
def attribute_write?; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#2413
+ # source://prism//lib/prism/node.rb#2177
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#2351
+ # source://prism//lib/prism/node.rb#2135
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2313
+ # source://prism//lib/prism/node.rb#2081
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2326
+ # source://prism//lib/prism/node.rb#2094
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2318
+ # source://prism//lib/prism/node.rb#2086
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallAndWriteNode
#
- # source://prism//lib/prism/node.rb#2331
+ # source://prism//lib/prism/node.rb#2099
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -2916,22 +2746,21 @@ class Prism::CallAndWriteNode < ::Prism::Node
read_name: Symbol,
write_name: Symbol,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::CallAndWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2313
+ # source://prism//lib/prism/node.rb#2081
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#2339
+ # source://prism//lib/prism/node.rb#2107
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -2942,49 +2771,49 @@ class Prism::CallAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2408
+ # source://prism//lib/prism/node.rb#2127
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#2428
+ # source://prism//lib/prism/node.rb#2192
sig { override.returns(String) }
def inspect; end
# def message: () -> String?
#
- # source://prism//lib/prism/node.rb#2418
+ # source://prism//lib/prism/node.rb#2182
sig { returns(T.nilable(String)) }
def message; end
# attr_reader message_loc: Location?
#
- # source://prism//lib/prism/node.rb#2364
+ # source://prism//lib/prism/node.rb#2148
sig { returns(T.nilable(Prism::Location)) }
def message_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#2423
+ # source://prism//lib/prism/node.rb#2187
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#2383
+ # source://prism//lib/prism/node.rb#2167
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader read_name: Symbol
#
- # source://prism//lib/prism/node.rb#2377
+ # source://prism//lib/prism/node.rb#2161
sig { returns(Symbol) }
def read_name; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#2348
+ # source://prism//lib/prism/node.rb#2132
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -2992,32 +2821,19 @@ class Prism::CallAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2393
+ # source://prism//lib/prism/node.rb#2112
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#2446
+ # source://prism//lib/prism/node.rb#2197
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#2390
+ # source://prism//lib/prism/node.rb#2174
sig { returns(Prism::Node) }
def value; end
@@ -3025,33 +2841,20 @@ class Prism::CallAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2398
+ # source://prism//lib/prism/node.rb#2117
sig { returns(T::Boolean) }
def variable_call?; end
# attr_reader write_name: Symbol
#
- # source://prism//lib/prism/node.rb#2380
+ # source://prism//lib/prism/node.rb#2164
sig { returns(Symbol) }
def write_name; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#2344
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#2456
+ # source://prism//lib/prism/node.rb#2202
def type; end
end
end
@@ -3076,16 +2879,18 @@ end
# foo&.bar
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#2494
+# source://prism//lib/prism/node.rb#2240
class Prism::CallNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Prism::node? block, Location location) -> void
+ # Initialize a new CallNode node.
#
# @return [CallNode] a new instance of CallNode
#
- # source://prism//lib/prism/node.rb#2496
+ # source://prism//lib/prism/node.rb#2242
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3094,27 +2899,26 @@ class Prism::CallNode < ::Prism::Node
opening_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: T.nilable(Prism::Location),
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
).void
end
- def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2700
+ # source://prism//lib/prism/node.rb#2424
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2512
+ # source://prism//lib/prism/node.rb#2258
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#2607
+ # source://prism//lib/prism/node.rb#2369
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
@@ -3122,63 +2926,65 @@ class Prism::CallNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2636
+ # source://prism//lib/prism/node.rb#2305
sig { returns(T::Boolean) }
def attribute_write?; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockNode | BlockArgumentNode | nil
#
- # source://prism//lib/prism/node.rb#2623
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#2385
+ sig { returns(T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))) }
def block; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#2646
+ # source://prism//lib/prism/node.rb#2388
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#2565
+ # source://prism//lib/prism/node.rb#2327
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2517
+ # source://prism//lib/prism/node.rb#2263
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#2661
+ # source://prism//lib/prism/node.rb#2403
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#2610
+ # source://prism//lib/prism/node.rb#2372
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2531
+ # source://prism//lib/prism/node.rb#2277
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2522
+ # source://prism//lib/prism/node.rb#2268
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: Prism::node?, ?location: Location) -> CallNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?name: Symbol, ?message_loc: Location?, ?opening_loc: Location?, ?arguments: ArgumentsNode?, ?closing_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> CallNode
#
- # source://prism//lib/prism/node.rb#2536
+ # source://prism//lib/prism/node.rb#2282
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3187,22 +2993,21 @@ class Prism::CallNode < ::Prism::Node
opening_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: T.nilable(Prism::Location),
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
).returns(Prism::CallNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2517
+ # source://prism//lib/prism/node.rb#2263
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Prism::node?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: BlockNode | BlockArgumentNode | nil }
#
- # source://prism//lib/prism/node.rb#2544
+ # source://prism//lib/prism/node.rb#2290
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -3219,7 +3024,7 @@ class Prism::CallNode < ::Prism::Node
# sometimes you want the location of the full message including the inner
# space and the = sign. This method provides that.
#
- # source://prism//lib/prism/node_ext.rb#299
+ # source://prism//lib/prism/node_ext.rb#331
sig { returns(T.nilable(Prism::Location)) }
def full_message_loc; end
@@ -3227,43 +3032,43 @@ class Prism::CallNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2641
+ # source://prism//lib/prism/node.rb#2310
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#2666
+ # source://prism//lib/prism/node.rb#2408
sig { override.returns(String) }
def inspect; end
# def message: () -> String?
#
- # source://prism//lib/prism/node.rb#2651
+ # source://prism//lib/prism/node.rb#2393
sig { returns(T.nilable(String)) }
def message; end
# attr_reader message_loc: Location?
#
- # source://prism//lib/prism/node.rb#2581
+ # source://prism//lib/prism/node.rb#2343
sig { returns(T.nilable(Prism::Location)) }
def message_loc; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#2578
+ # source://prism//lib/prism/node.rb#2340
sig { returns(Symbol) }
def name; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#2656
+ # source://prism//lib/prism/node.rb#2398
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#2594
+ # source://prism//lib/prism/node.rb#2356
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
@@ -3278,7 +3083,7 @@ class Prism::CallNode < ::Prism::Node
# foo + bar
# ^^^
#
- # source://prism//lib/prism/node.rb#2562
+ # source://prism//lib/prism/node.rb#2324
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -3286,26 +3091,13 @@ class Prism::CallNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2626
+ # source://prism//lib/prism/node.rb#2295
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#2684
+ # source://prism//lib/prism/node.rb#2413
sig { override.returns(Symbol) }
def type; end
@@ -3313,54 +3105,41 @@ class Prism::CallNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2631
+ # source://prism//lib/prism/node.rb#2300
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#2549
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#2694
+ # source://prism//lib/prism/node.rb#2418
def type; end
end
end
# Flags for call nodes.
#
-# source://prism//lib/prism/node.rb#19217
+# source://prism//lib/prism/node.rb#16708
module Prism::CallNodeFlags; end
# a call that is an attribute write, so the value being written should be returned
#
-# source://prism//lib/prism/node.rb#19225
+# source://prism//lib/prism/node.rb#16716
Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer)
# a call that ignores method visibility
#
-# source://prism//lib/prism/node.rb#19228
+# source://prism//lib/prism/node.rb#16719
Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer)
# &. operator
#
-# source://prism//lib/prism/node.rb#19219
+# source://prism//lib/prism/node.rb#16710
Prism::CallNodeFlags::SAFE_NAVIGATION = T.let(T.unsafe(nil), Integer)
# a call that could have been a local variable
#
-# source://prism//lib/prism/node.rb#19222
+# source://prism//lib/prism/node.rb#16713
Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer)
# Represents the use of an assignment operator on a call.
@@ -3368,16 +3147,18 @@ Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer)
# foo.bar += baz
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#2718
+# source://prism//lib/prism/node.rb#2442
class Prism::CallOperatorWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new CallOperatorWriteNode node.
#
# @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#2720
+ # source://prism//lib/prism/node.rb#2444
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3386,21 +3167,20 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
write_name: Symbol,
binary_operator: Symbol,
binary_operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#2888
+ # source://prism//lib/prism/node.rb#2590
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2736
+ # source://prism//lib/prism/node.rb#2460
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -3408,57 +3188,59 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2834
+ # source://prism//lib/prism/node.rb#2506
sig { returns(T::Boolean) }
def attribute_write?; end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#2811
+ # source://prism//lib/prism/node.rb#2551
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#2814
+ # source://prism//lib/prism/node.rb#2554
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#2844
+ # source://prism//lib/prism/node.rb#2564
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#2779
+ # source://prism//lib/prism/node.rb#2519
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2741
+ # source://prism//lib/prism/node.rb#2465
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2754
+ # source://prism//lib/prism/node.rb#2478
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2746
+ # source://prism//lib/prism/node.rb#2470
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> CallOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#2759
+ # source://prism//lib/prism/node.rb#2483
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3467,22 +3249,21 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
write_name: Symbol,
binary_operator: Symbol,
binary_operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::CallOperatorWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2741
+ # source://prism//lib/prism/node.rb#2465
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#2767
+ # source://prism//lib/prism/node.rb#2491
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -3493,49 +3274,49 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2839
+ # source://prism//lib/prism/node.rb#2511
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#2854
+ # source://prism//lib/prism/node.rb#2574
sig { override.returns(String) }
def inspect; end
# def message: () -> String?
#
- # source://prism//lib/prism/node.rb#2849
+ # source://prism//lib/prism/node.rb#2569
sig { returns(T.nilable(String)) }
def message; end
# attr_reader message_loc: Location?
#
- # source://prism//lib/prism/node.rb#2792
+ # source://prism//lib/prism/node.rb#2532
sig { returns(T.nilable(Prism::Location)) }
def message_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#307
+ # source://prism//lib/prism/node_ext.rb#339
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#314
+ # source://prism//lib/prism/node_ext.rb#346
def operator_loc; end
# attr_reader read_name: Symbol
#
- # source://prism//lib/prism/node.rb#2805
+ # source://prism//lib/prism/node.rb#2545
sig { returns(Symbol) }
def read_name; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#2776
+ # source://prism//lib/prism/node.rb#2516
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -3543,32 +3324,19 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2824
+ # source://prism//lib/prism/node.rb#2496
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#2872
+ # source://prism//lib/prism/node.rb#2579
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#2821
+ # source://prism//lib/prism/node.rb#2561
sig { returns(Prism::Node) }
def value; end
@@ -3576,33 +3344,20 @@ class Prism::CallOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#2829
+ # source://prism//lib/prism/node.rb#2501
sig { returns(T::Boolean) }
def variable_call?; end
# attr_reader write_name: Symbol
#
- # source://prism//lib/prism/node.rb#2808
+ # source://prism//lib/prism/node.rb#2548
sig { returns(Symbol) }
def write_name; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#2772
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#2882
+ # source://prism//lib/prism/node.rb#2584
def type; end
end
end
@@ -3612,16 +3367,18 @@ end
# foo.bar ||= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#2906
+# source://prism//lib/prism/node.rb#2608
class Prism::CallOrWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new CallOrWriteNode node.
#
# @return [CallOrWriteNode] a new instance of CallOrWriteNode
#
- # source://prism//lib/prism/node.rb#2908
+ # source://prism//lib/prism/node.rb#2610
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3629,21 +3386,20 @@ class Prism::CallOrWriteNode < ::Prism::Node
read_name: Symbol,
write_name: Symbol,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3077
+ # source://prism//lib/prism/node.rb#2757
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#2923
+ # source://prism//lib/prism/node.rb#2625
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -3651,45 +3407,47 @@ class Prism::CallOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3018
+ # source://prism//lib/prism/node.rb#2671
sig { returns(T::Boolean) }
def attribute_write?; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#3028
+ # source://prism//lib/prism/node.rb#2726
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#2966
+ # source://prism//lib/prism/node.rb#2684
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2928
+ # source://prism//lib/prism/node.rb#2630
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#2941
+ # source://prism//lib/prism/node.rb#2643
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#2933
+ # source://prism//lib/prism/node.rb#2635
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator_loc: Location, ?value: Prism::node) -> CallOrWriteNode
#
- # source://prism//lib/prism/node.rb#2946
+ # source://prism//lib/prism/node.rb#2648
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
@@ -3697,22 +3455,21 @@ class Prism::CallOrWriteNode < ::Prism::Node
read_name: Symbol,
write_name: Symbol,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::CallOrWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#2928
+ # source://prism//lib/prism/node.rb#2630
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#2954
+ # source://prism//lib/prism/node.rb#2656
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -3723,49 +3480,49 @@ class Prism::CallOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3023
+ # source://prism//lib/prism/node.rb#2676
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3043
+ # source://prism//lib/prism/node.rb#2741
sig { override.returns(String) }
def inspect; end
# def message: () -> String?
#
- # source://prism//lib/prism/node.rb#3033
+ # source://prism//lib/prism/node.rb#2731
sig { returns(T.nilable(String)) }
def message; end
# attr_reader message_loc: Location?
#
- # source://prism//lib/prism/node.rb#2979
+ # source://prism//lib/prism/node.rb#2697
sig { returns(T.nilable(Prism::Location)) }
def message_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#3038
+ # source://prism//lib/prism/node.rb#2736
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#2998
+ # source://prism//lib/prism/node.rb#2716
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader read_name: Symbol
#
- # source://prism//lib/prism/node.rb#2992
+ # source://prism//lib/prism/node.rb#2710
sig { returns(Symbol) }
def read_name; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#2963
+ # source://prism//lib/prism/node.rb#2681
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -3773,32 +3530,19 @@ class Prism::CallOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3008
+ # source://prism//lib/prism/node.rb#2661
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#3061
+ # source://prism//lib/prism/node.rb#2746
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#3005
+ # source://prism//lib/prism/node.rb#2723
sig { returns(Prism::Node) }
def value; end
@@ -3806,33 +3550,20 @@ class Prism::CallOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3013
+ # source://prism//lib/prism/node.rb#2666
sig { returns(T::Boolean) }
def variable_call?; end
# attr_reader write_name: Symbol
#
- # source://prism//lib/prism/node.rb#2995
+ # source://prism//lib/prism/node.rb#2713
sig { returns(Symbol) }
def write_name; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#2959
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3071
+ # source://prism//lib/prism/node.rb#2751
def type; end
end
end
@@ -3850,35 +3581,36 @@ end
# for foo.bar in baz do end
# ^^^^^^^
#
-# source://prism//lib/prism/node.rb#3102
+# source://prism//lib/prism/node.rb#2782
class Prism::CallTargetNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void
+ # Initialize a new CallTargetNode node.
#
# @return [CallTargetNode] a new instance of CallTargetNode
#
- # source://prism//lib/prism/node.rb#3104
+ # source://prism//lib/prism/node.rb#2784
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: Prism::Node,
call_operator_loc: Prism::Location,
name: Symbol,
- message_loc: Prism::Location,
- location: Prism::Location
+ message_loc: Prism::Location
).void
end
- def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3237
+ # source://prism//lib/prism/node.rb#2895
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3116
+ # source://prism//lib/prism/node.rb#2796
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -3886,65 +3618,66 @@ class Prism::CallTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3183
+ # source://prism//lib/prism/node.rb#2839
sig { returns(T::Boolean) }
def attribute_write?; end
# def call_operator: () -> String
#
- # source://prism//lib/prism/node.rb#3193
+ # source://prism//lib/prism/node.rb#2869
sig { returns(String) }
def call_operator; end
# attr_reader call_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#3156
+ # source://prism//lib/prism/node.rb#2852
sig { returns(Prism::Location) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3121
+ # source://prism//lib/prism/node.rb#2801
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3131
+ # source://prism//lib/prism/node.rb#2811
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3126
+ # source://prism//lib/prism/node.rb#2806
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location, ?location: Location) -> CallTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location) -> CallTargetNode
#
- # source://prism//lib/prism/node.rb#3136
+ # source://prism//lib/prism/node.rb#2816
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: Prism::Node,
call_operator_loc: Prism::Location,
name: Symbol,
- message_loc: Prism::Location,
- location: Prism::Location
+ message_loc: Prism::Location
).returns(Prism::CallTargetNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3121
+ # source://prism//lib/prism/node.rb#2801
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location }
#
- # source://prism//lib/prism/node.rb#3144
+ # source://prism//lib/prism/node.rb#2824
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -3955,37 +3688,37 @@ class Prism::CallTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3188
+ # source://prism//lib/prism/node.rb#2844
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3203
+ # source://prism//lib/prism/node.rb#2879
sig { override.returns(String) }
def inspect; end
# def message: () -> String
#
- # source://prism//lib/prism/node.rb#3198
+ # source://prism//lib/prism/node.rb#2874
sig { returns(String) }
def message; end
# attr_reader message_loc: Location
#
- # source://prism//lib/prism/node.rb#3166
+ # source://prism//lib/prism/node.rb#2862
sig { returns(Prism::Location) }
def message_loc; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#3163
+ # source://prism//lib/prism/node.rb#2859
sig { returns(Symbol) }
def name; end
# attr_reader receiver: Prism::node
#
- # source://prism//lib/prism/node.rb#3153
+ # source://prism//lib/prism/node.rb#2849
sig { returns(Prism::Node) }
def receiver; end
@@ -3993,26 +3726,13 @@ class Prism::CallTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3173
+ # source://prism//lib/prism/node.rb#2829
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3221
+ # source://prism//lib/prism/node.rb#2884
sig { override.returns(Symbol) }
def type; end
@@ -4020,27 +3740,14 @@ class Prism::CallTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#3178
+ # source://prism//lib/prism/node.rb#2834
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#3149
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3231
+ # source://prism//lib/prism/node.rb#2889
def type; end
end
end
@@ -4050,77 +3757,81 @@ end
# foo => [bar => baz]
# ^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3251
+# source://prism//lib/prism/node.rb#2909
class Prism::CapturePatternNode < ::Prism::Node
- # def initialize: (Prism::node value, Prism::node target, Location operator_loc, Location location) -> void
+ # Initialize a new CapturePatternNode node.
#
# @return [CapturePatternNode] a new instance of CapturePatternNode
#
- # source://prism//lib/prism/node.rb#3253
+ # source://prism//lib/prism/node.rb#2911
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
- target: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ target: Prism::LocalVariableTargetNode,
+ operator_loc: Prism::Location
).void
end
- def initialize(source, value, target, operator_loc, location); end
+ def initialize(source, node_id, location, flags, value, target, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3348
+ # source://prism//lib/prism/node.rb#2989
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3263
+ # source://prism//lib/prism/node.rb#2922
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3268
+ # source://prism//lib/prism/node.rb#2927
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3278
+ # source://prism//lib/prism/node.rb#2937
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3273
+ # source://prism//lib/prism/node.rb#2932
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Prism::node, ?target: Prism::node, ?operator_loc: Location, ?location: Location) -> CapturePatternNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?target: LocalVariableTargetNode, ?operator_loc: Location) -> CapturePatternNode
#
- # source://prism//lib/prism/node.rb#3283
+ # source://prism//lib/prism/node.rb#2942
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
- target: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ target: Prism::LocalVariableTargetNode,
+ operator_loc: Prism::Location
).returns(Prism::CapturePatternNode)
end
- def copy(value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3268
+ # source://prism//lib/prism/node.rb#2927
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, target: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, target: LocalVariableTargetNode, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#3291
+ # source://prism//lib/prism/node.rb#2950
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -4129,62 +3840,44 @@ class Prism::CapturePatternNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3314
+ # source://prism//lib/prism/node.rb#2973
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#3309
+ # source://prism//lib/prism/node.rb#2968
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#3302
+ # source://prism//lib/prism/node.rb#2961
sig { returns(Prism::Location) }
def operator_loc; end
- # attr_reader target: Prism::node
+ # attr_reader target: LocalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#3299
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#2958
+ sig { returns(Prism::LocalVariableTargetNode) }
def target; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#3332
+ # source://prism//lib/prism/node.rb#2978
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#3296
+ # source://prism//lib/prism/node.rb#2955
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3342
+ # source://prism//lib/prism/node.rb#2983
def type; end
end
end
@@ -4196,117 +3889,127 @@ end
# end
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3362
+# source://prism//lib/prism/node.rb#3003
class Prism::CaseMatchNode < ::Prism::Node
- # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void
+ # Initialize a new CaseMatchNode node.
#
# @return [CaseMatchNode] a new instance of CaseMatchNode
#
- # source://prism//lib/prism/node.rb#3364
+ # source://prism//lib/prism/node.rb#3005
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
predicate: T.nilable(Prism::Node),
- conditions: T::Array[Prism::Node],
- consequent: T.nilable(Prism::ElseNode),
+ conditions: T::Array[Prism::InNode],
+ else_clause: T.nilable(Prism::ElseNode),
case_keyword_loc: Prism::Location,
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).void
end
- def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3480
+ # source://prism//lib/prism/node.rb#3104
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3376
+ # source://prism//lib/prism/node.rb#3018
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def case_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3436
+ # source://prism//lib/prism/node.rb#3078
sig { returns(String) }
def case_keyword; end
# attr_reader case_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3422
+ # source://prism//lib/prism/node.rb#3064
sig { returns(Prism::Location) }
def case_keyword_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3381
+ # source://prism//lib/prism/node.rb#3023
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3395
+ # source://prism//lib/prism/node.rb#3037
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3386
+ # source://prism//lib/prism/node.rb#3028
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader conditions: Array[Prism::node]
+ # attr_reader conditions: Array[InNode]
#
- # source://prism//lib/prism/node.rb#3416
- sig { returns(T::Array[Prism::Node]) }
+ # source://prism//lib/prism/node.rb#3058
+ sig { returns(T::Array[Prism::InNode]) }
def conditions; end
- # attr_reader consequent: ElseNode?
+ # Returns the else clause of the case match node. This method is deprecated
+ # in favor of #else_clause.
#
- # source://prism//lib/prism/node.rb#3419
- sig { returns(T.nilable(Prism::ElseNode)) }
+ # source://prism//lib/prism/node_ext.rb#467
def consequent; end
- # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseMatchNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[InNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseMatchNode
#
- # source://prism//lib/prism/node.rb#3400
+ # source://prism//lib/prism/node.rb#3042
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
predicate: T.nilable(Prism::Node),
- conditions: T::Array[Prism::Node],
- consequent: T.nilable(Prism::ElseNode),
+ conditions: T::Array[Prism::InNode],
+ else_clause: T.nilable(Prism::ElseNode),
case_keyword_loc: Prism::Location,
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).returns(Prism::CaseMatchNode)
end
- def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3381
+ # source://prism//lib/prism/node.rb#3023
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[InNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#3408
+ # source://prism//lib/prism/node.rb#3050
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
+ # attr_reader else_clause: ElseNode?
+ #
+ # source://prism//lib/prism/node.rb#3061
+ sig { returns(T.nilable(Prism::ElseNode)) }
+ def else_clause; end
+
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3441
+ # source://prism//lib/prism/node.rb#3083
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3429
+ # source://prism//lib/prism/node.rb#3071
sig { returns(Prism::Location) }
def end_keyword_loc; end
@@ -4315,44 +4018,26 @@ class Prism::CaseMatchNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3446
+ # source://prism//lib/prism/node.rb#3088
sig { override.returns(String) }
def inspect; end
# attr_reader predicate: Prism::node?
#
- # source://prism//lib/prism/node.rb#3413
+ # source://prism//lib/prism/node.rb#3055
sig { returns(T.nilable(Prism::Node)) }
def predicate; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3464
+ # source://prism//lib/prism/node.rb#3093
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#3474
+ # source://prism//lib/prism/node.rb#3098
def type; end
end
end
@@ -4364,117 +4049,127 @@ end
# end
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3497
+# source://prism//lib/prism/node.rb#3121
class Prism::CaseNode < ::Prism::Node
- # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void
+ # Initialize a new CaseNode node.
#
# @return [CaseNode] a new instance of CaseNode
#
- # source://prism//lib/prism/node.rb#3499
+ # source://prism//lib/prism/node.rb#3123
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
predicate: T.nilable(Prism::Node),
- conditions: T::Array[Prism::Node],
- consequent: T.nilable(Prism::ElseNode),
+ conditions: T::Array[Prism::WhenNode],
+ else_clause: T.nilable(Prism::ElseNode),
case_keyword_loc: Prism::Location,
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).void
end
- def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3615
+ # source://prism//lib/prism/node.rb#3222
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3511
+ # source://prism//lib/prism/node.rb#3136
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def case_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3571
+ # source://prism//lib/prism/node.rb#3196
sig { returns(String) }
def case_keyword; end
# attr_reader case_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3557
+ # source://prism//lib/prism/node.rb#3182
sig { returns(Prism::Location) }
def case_keyword_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3516
+ # source://prism//lib/prism/node.rb#3141
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3530
+ # source://prism//lib/prism/node.rb#3155
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3521
+ # source://prism//lib/prism/node.rb#3146
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader conditions: Array[Prism::node]
+ # attr_reader conditions: Array[WhenNode]
#
- # source://prism//lib/prism/node.rb#3551
- sig { returns(T::Array[Prism::Node]) }
+ # source://prism//lib/prism/node.rb#3176
+ sig { returns(T::Array[Prism::WhenNode]) }
def conditions; end
- # attr_reader consequent: ElseNode?
+ # Returns the else clause of the case node. This method is deprecated in
+ # favor of #else_clause.
#
- # source://prism//lib/prism/node.rb#3554
- sig { returns(T.nilable(Prism::ElseNode)) }
+ # source://prism//lib/prism/node_ext.rb#476
def consequent; end
- # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?predicate: Prism::node?, ?conditions: Array[WhenNode], ?else_clause: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location) -> CaseNode
#
- # source://prism//lib/prism/node.rb#3535
+ # source://prism//lib/prism/node.rb#3160
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
predicate: T.nilable(Prism::Node),
- conditions: T::Array[Prism::Node],
- consequent: T.nilable(Prism::ElseNode),
+ conditions: T::Array[Prism::WhenNode],
+ else_clause: T.nilable(Prism::ElseNode),
case_keyword_loc: Prism::Location,
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).returns(Prism::CaseNode)
end
- def copy(predicate: T.unsafe(nil), conditions: T.unsafe(nil), consequent: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3516
+ # source://prism//lib/prism/node.rb#3141
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Prism::node?, conditions: Array[Prism::node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, predicate: Prism::node?, conditions: Array[WhenNode], else_clause: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#3543
+ # source://prism//lib/prism/node.rb#3168
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
+ # attr_reader else_clause: ElseNode?
+ #
+ # source://prism//lib/prism/node.rb#3179
+ sig { returns(T.nilable(Prism::ElseNode)) }
+ def else_clause; end
+
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3576
+ # source://prism//lib/prism/node.rb#3201
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3564
+ # source://prism//lib/prism/node.rb#3189
sig { returns(Prism::Location) }
def end_keyword_loc; end
@@ -4483,44 +4178,26 @@ class Prism::CaseNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3581
+ # source://prism//lib/prism/node.rb#3206
sig { override.returns(String) }
def inspect; end
# attr_reader predicate: Prism::node?
#
- # source://prism//lib/prism/node.rb#3548
+ # source://prism//lib/prism/node.rb#3173
sig { returns(T.nilable(Prism::Node)) }
def predicate; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#3599
+ # source://prism//lib/prism/node.rb#3211
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#3609
+ # source://prism//lib/prism/node.rb#3216
def type; end
end
end
@@ -4530,123 +4207,127 @@ end
# class Foo end
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3630
+# source://prism//lib/prism/node.rb#3237
class Prism::ClassNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Prism::node constant_path, Location? inheritance_operator_loc, Prism::node? superclass, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void
+ # Initialize a new ClassNode node.
#
# @return [ClassNode] a new instance of ClassNode
#
- # source://prism//lib/prism/node.rb#3632
+ # source://prism//lib/prism/node.rb#3239
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
class_keyword_loc: Prism::Location,
- constant_path: Prism::Node,
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode),
inheritance_operator_loc: T.nilable(Prism::Location),
superclass: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
end_keyword_loc: Prism::Location,
- name: Symbol,
- location: Prism::Location
+ name: Symbol
).void
end
- def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end
+ def initialize(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3775
+ # source://prism//lib/prism/node.rb#3365
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3647
+ # source://prism//lib/prism/node.rb#3255
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
- # attr_reader body: Prism::node?
+ # attr_reader body: StatementsNode | BeginNode | nil
#
- # source://prism//lib/prism/node.rb#3713
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#3321
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3652
+ # source://prism//lib/prism/node.rb#3260
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def class_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3726
+ # source://prism//lib/prism/node.rb#3334
sig { returns(String) }
def class_keyword; end
# attr_reader class_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3687
+ # source://prism//lib/prism/node.rb#3295
sig { returns(Prism::Location) }
def class_keyword_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3666
+ # source://prism//lib/prism/node.rb#3274
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3657
+ # source://prism//lib/prism/node.rb#3265
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader constant_path: Prism::node
+ # attr_reader constant_path: ConstantReadNode | ConstantPathNode | CallNode
#
- # source://prism//lib/prism/node.rb#3694
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#3302
+ sig { returns(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode)) }
def constant_path; end
- # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: Prism::node, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ClassNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | CallNode, ?inheritance_operator_loc: Location?, ?superclass: Prism::node?, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ClassNode
#
- # source://prism//lib/prism/node.rb#3671
+ # source://prism//lib/prism/node.rb#3279
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
class_keyword_loc: Prism::Location,
- constant_path: Prism::Node,
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode),
inheritance_operator_loc: T.nilable(Prism::Location),
superclass: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
end_keyword_loc: Prism::Location,
- name: Symbol,
- location: Prism::Location
+ name: Symbol
).returns(Prism::ClassNode)
end
- def copy(locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3652
+ # source://prism//lib/prism/node.rb#3260
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, constant_path: Prism::node, inheritance_operator_loc: Location?, superclass: Prism::node?, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode | CallNode, inheritance_operator_loc: Location?, superclass: Prism::node?, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#3679
+ # source://prism//lib/prism/node.rb#3287
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#3736
+ # source://prism//lib/prism/node.rb#3344
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#3716
+ # source://prism//lib/prism/node.rb#3324
sig { returns(Prism::Location) }
def end_keyword_loc; end
@@ -4655,68 +4336,50 @@ class Prism::ClassNode < ::Prism::Node
# def inheritance_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#3731
+ # source://prism//lib/prism/node.rb#3339
sig { returns(T.nilable(String)) }
def inheritance_operator; end
# attr_reader inheritance_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#3697
+ # source://prism//lib/prism/node.rb#3305
sig { returns(T.nilable(Prism::Location)) }
def inheritance_operator_loc; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3741
+ # source://prism//lib/prism/node.rb#3349
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#3684
+ # source://prism//lib/prism/node.rb#3292
sig { returns(T::Array[Symbol]) }
def locals; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#3723
+ # source://prism//lib/prism/node.rb#3331
sig { returns(Symbol) }
def name; end
# attr_reader superclass: Prism::node?
#
- # source://prism//lib/prism/node.rb#3710
+ # source://prism//lib/prism/node.rb#3318
sig { returns(T.nilable(Prism::Node)) }
def superclass; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#3759
+ # source://prism//lib/prism/node.rb#3354
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3769
+ # source://prism//lib/prism/node.rb#3359
def type; end
end
end
@@ -4726,83 +4389,87 @@ end
# @@target &&= value
# ^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3793
+# source://prism//lib/prism/node.rb#3383
class Prism::ClassVariableAndWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ClassVariableAndWriteNode node.
#
# @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#3795
+ # source://prism//lib/prism/node.rb#3385
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#3898
+ # source://prism//lib/prism/node.rb#3471
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3806
+ # source://prism//lib/prism/node.rb#3397
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3811
+ # source://prism//lib/prism/node.rb#3402
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3821
+ # source://prism//lib/prism/node.rb#3412
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3816
+ # source://prism//lib/prism/node.rb#3407
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#3826
+ # source://prism//lib/prism/node.rb#3417
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ClassVariableAndWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3811
+ # source://prism//lib/prism/node.rb#3402
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#3834
+ # source://prism//lib/prism/node.rb#3425
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#127
+ # source://prism//lib/prism/desugar_compiler.rb#164
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -4810,68 +4477,50 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3864
+ # source://prism//lib/prism/node.rb#3455
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#3839
+ # source://prism//lib/prism/node.rb#3430
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#3842
+ # source://prism//lib/prism/node.rb#3433
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#3859
+ # source://prism//lib/prism/node.rb#3450
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#3849
+ # source://prism//lib/prism/node.rb#3440
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3882
+ # source://prism//lib/prism/node.rb#3460
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#3856
+ # source://prism//lib/prism/node.rb#3447
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#3892
+ # source://prism//lib/prism/node.rb#3465
def type; end
end
end
@@ -4881,97 +4530,101 @@ end
# @@target += value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#3911
+# source://prism//lib/prism/node.rb#3484
class Prism::ClassVariableOperatorWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
+ # Initialize a new ClassVariableOperatorWriteNode node.
#
# @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#3913
+ # source://prism//lib/prism/node.rb#3486
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).void
end
- def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4015
+ # source://prism//lib/prism/node.rb#3571
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#3925
+ # source://prism//lib/prism/node.rb#3499
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#3978
+ # source://prism//lib/prism/node.rb#3552
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#3968
+ # source://prism//lib/prism/node.rb#3542
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3930
+ # source://prism//lib/prism/node.rb#3504
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#3940
+ # source://prism//lib/prism/node.rb#3514
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#3935
+ # source://prism//lib/prism/node.rb#3509
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ClassVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#3945
+ # source://prism//lib/prism/node.rb#3519
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).returns(Prism::ClassVariableOperatorWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#3930
+ # source://prism//lib/prism/node.rb#3504
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
#
- # source://prism//lib/prism/node.rb#3953
+ # source://prism//lib/prism/node.rb#3527
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#139
+ # source://prism//lib/prism/desugar_compiler.rb#176
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -4979,68 +4632,50 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#3981
+ # source://prism//lib/prism/node.rb#3555
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#3958
+ # source://prism//lib/prism/node.rb#3532
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#3961
+ # source://prism//lib/prism/node.rb#3535
sig { returns(Prism::Location) }
def name_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#323
+ # source://prism//lib/prism/node_ext.rb#355
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#330
+ # source://prism//lib/prism/node_ext.rb#362
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#3999
+ # source://prism//lib/prism/node.rb#3560
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#3975
+ # source://prism//lib/prism/node.rb#3549
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#4009
+ # source://prism//lib/prism/node.rb#3565
def type; end
end
end
@@ -5050,83 +4685,87 @@ end
# @@target ||= value
# ^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4029
+# source://prism//lib/prism/node.rb#3585
class Prism::ClassVariableOrWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ClassVariableOrWriteNode node.
#
# @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#4031
+ # source://prism//lib/prism/node.rb#3587
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4134
+ # source://prism//lib/prism/node.rb#3673
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4042
+ # source://prism//lib/prism/node.rb#3599
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4047
+ # source://prism//lib/prism/node.rb#3604
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4057
+ # source://prism//lib/prism/node.rb#3614
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4052
+ # source://prism//lib/prism/node.rb#3609
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ClassVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#4062
+ # source://prism//lib/prism/node.rb#3619
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ClassVariableOrWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4047
+ # source://prism//lib/prism/node.rb#3604
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#4070
+ # source://prism//lib/prism/node.rb#3627
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#133
+ # source://prism//lib/prism/desugar_compiler.rb#170
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -5134,68 +4773,50 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4100
+ # source://prism//lib/prism/node.rb#3657
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#4075
+ # source://prism//lib/prism/node.rb#3632
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#4078
+ # source://prism//lib/prism/node.rb#3635
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#4095
+ # source://prism//lib/prism/node.rb#3652
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#4085
+ # source://prism//lib/prism/node.rb#3642
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#4118
+ # source://prism//lib/prism/node.rb#3662
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#4092
+ # source://prism//lib/prism/node.rb#3649
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4128
+ # source://prism//lib/prism/node.rb#3667
def type; end
end
end
@@ -5205,62 +4826,69 @@ end
# @@foo
# ^^^^^
#
-# source://prism//lib/prism/node.rb#4147
+# source://prism//lib/prism/node.rb#3686
class Prism::ClassVariableReadNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new ClassVariableReadNode node.
#
# @return [ClassVariableReadNode] a new instance of ClassVariableReadNode
#
- # source://prism//lib/prism/node.rb#4149
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#3688
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4231
+ # source://prism//lib/prism/node.rb#3753
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4157
+ # source://prism//lib/prism/node.rb#3697
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4162
+ # source://prism//lib/prism/node.rb#3702
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4172
+ # source://prism//lib/prism/node.rb#3712
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4167
+ # source://prism//lib/prism/node.rb#3707
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> ClassVariableReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableReadNode
#
- # source://prism//lib/prism/node.rb#4177
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableReadNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#3717
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ClassVariableReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4162
+ # source://prism//lib/prism/node.rb#3702
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#4185
+ # source://prism//lib/prism/node.rb#3725
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -5269,7 +4897,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4197
+ # source://prism//lib/prism/node.rb#3737
sig { override.returns(String) }
def inspect; end
@@ -5279,38 +4907,20 @@ class Prism::ClassVariableReadNode < ::Prism::Node
#
# @@_test # name `:@@_test`
#
- # source://prism//lib/prism/node.rb#4194
+ # source://prism//lib/prism/node.rb#3734
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4215
+ # source://prism//lib/prism/node.rb#3742
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#4225
+ # source://prism//lib/prism/node.rb#3747
def type; end
end
end
@@ -5320,62 +4930,69 @@ end
# @@foo, @@bar = baz
# ^^^^^ ^^^^^
#
-# source://prism//lib/prism/node.rb#4241
+# source://prism//lib/prism/node.rb#3763
class Prism::ClassVariableTargetNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new ClassVariableTargetNode node.
#
# @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode
#
- # source://prism//lib/prism/node.rb#4243
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#3765
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4321
+ # source://prism//lib/prism/node.rb#3826
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4251
+ # source://prism//lib/prism/node.rb#3774
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4256
+ # source://prism//lib/prism/node.rb#3779
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4266
+ # source://prism//lib/prism/node.rb#3789
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4261
+ # source://prism//lib/prism/node.rb#3784
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> ClassVariableTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ClassVariableTargetNode
#
- # source://prism//lib/prism/node.rb#4271
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableTargetNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#3794
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ClassVariableTargetNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4256
+ # source://prism//lib/prism/node.rb#3779
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#4279
+ # source://prism//lib/prism/node.rb#3802
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -5384,44 +5001,26 @@ class Prism::ClassVariableTargetNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4287
+ # source://prism//lib/prism/node.rb#3810
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#4284
+ # source://prism//lib/prism/node.rb#3807
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4305
+ # source://prism//lib/prism/node.rb#3815
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4315
+ # source://prism//lib/prism/node.rb#3820
def type; end
end
end
@@ -5431,79 +5030,83 @@ end
# @@foo = 1
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4331
+# source://prism//lib/prism/node.rb#3836
class Prism::ClassVariableWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void
+ # Initialize a new ClassVariableWriteNode node.
#
# @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode
#
- # source://prism//lib/prism/node.rb#4333
+ # source://prism//lib/prism/node.rb#3838
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, name, name_loc, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4452
+ # source://prism//lib/prism/node.rb#3940
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4344
+ # source://prism//lib/prism/node.rb#3850
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4349
+ # source://prism//lib/prism/node.rb#3855
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4359
+ # source://prism//lib/prism/node.rb#3865
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4354
+ # source://prism//lib/prism/node.rb#3860
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ClassVariableWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ClassVariableWriteNode
#
- # source://prism//lib/prism/node.rb#4364
+ # source://prism//lib/prism/node.rb#3870
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::ClassVariableWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4349
+ # source://prism//lib/prism/node.rb#3855
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#4372
+ # source://prism//lib/prism/node.rb#3878
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -5512,7 +5115,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4418
+ # source://prism//lib/prism/node.rb#3924
sig { override.returns(String) }
def inspect; end
@@ -5522,7 +5125,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node
#
# @@_test = :test # name `@@_test`
#
- # source://prism//lib/prism/node.rb#4381
+ # source://prism//lib/prism/node.rb#3887
sig { returns(Symbol) }
def name; end
@@ -5531,13 +5134,13 @@ class Prism::ClassVariableWriteNode < ::Prism::Node
# @@foo = :bar
# ^^^^^
#
- # source://prism//lib/prism/node.rb#4387
+ # source://prism//lib/prism/node.rb#3893
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#4413
+ # source://prism//lib/prism/node.rb#3919
sig { returns(String) }
def operator; end
@@ -5546,26 +5149,13 @@ class Prism::ClassVariableWriteNode < ::Prism::Node
# @@foo = :bar
# ^
#
- # source://prism//lib/prism/node.rb#4406
+ # source://prism//lib/prism/node.rb#3912
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#4436
+ # source://prism//lib/prism/node.rb#3929
sig { override.returns(Symbol) }
def type; end
@@ -5577,27 +5167,75 @@ class Prism::ClassVariableWriteNode < ::Prism::Node
# @@_xyz = 123
# ^^^
#
- # source://prism//lib/prism/node.rb#4400
+ # source://prism//lib/prism/node.rb#3906
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4446
+ # source://prism//lib/prism/node.rb#3934
def type; end
end
end
+# A cache that can be used to quickly compute code unit offsets from byte
+# offsets. It purposefully provides only a single #[] method to access the
+# cache in order to minimize surface area.
+#
+# Note that there are some known issues here that may or may not be addressed
+# in the future:
+#
+# * The first is that there are issues when the cache computes values that are
+# not on character boundaries. This can result in subsequent computations
+# being off by one or more code units.
+# * The second is that this cache is currently unbounded. In theory we could
+# introduce some kind of LRU cache to limit the number of entries, but this
+# has not yet been implemented.
+#
+# source://prism//lib/prism/parse_result.rb#172
+class Prism::CodeUnitsCache
+ # Initialize a new cache with the given source and encoding.
+ #
+ # @return [CodeUnitsCache] a new instance of CodeUnitsCache
+ #
+ # source://prism//lib/prism/parse_result.rb#198
+ sig { params(source: String, encoding: Encoding).void }
+ def initialize(source, encoding); end
+
+ # Retrieve the code units offset from the given byte offset.
+ #
+ # source://prism//lib/prism/parse_result.rb#212
+ sig { params(byte_offset: Integer).returns(Integer) }
+ def [](byte_offset); end
+end
+
+# source://prism//lib/prism/parse_result.rb#184
+class Prism::CodeUnitsCache::LengthCounter
+ # @return [LengthCounter] a new instance of LengthCounter
+ #
+ # source://prism//lib/prism/parse_result.rb#185
+ def initialize(source, encoding); end
+
+ # source://prism//lib/prism/parse_result.rb#190
+ def count(byte_offset, byte_length); end
+end
+
+# source://prism//lib/prism/parse_result.rb#173
+class Prism::CodeUnitsCache::UTF16Counter
+ # @return [UTF16Counter] a new instance of UTF16Counter
+ #
+ # source://prism//lib/prism/parse_result.rb#174
+ def initialize(source, encoding); end
+
+ # source://prism//lib/prism/parse_result.rb#179
+ def count(byte_offset, byte_length); end
+end
+
# This represents a comment that was encountered during parsing. It is the
# base class for all comment types.
#
-# source://prism//lib/prism/parse_result.rb#366
+# source://prism//lib/prism/parse_result.rb#507
class Prism::Comment
abstract!
@@ -5605,25 +5243,25 @@ class Prism::Comment
#
# @return [Comment] a new instance of Comment
#
- # source://prism//lib/prism/parse_result.rb#371
+ # source://prism//lib/prism/parse_result.rb#512
sig { params(location: Prism::Location).void }
def initialize(location); end
# Implement the hash pattern matching interface for Comment.
#
- # source://prism//lib/prism/parse_result.rb#376
+ # source://prism//lib/prism/parse_result.rb#517
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# The location of this comment in the source.
#
- # source://prism//lib/prism/parse_result.rb#368
+ # source://prism//lib/prism/parse_result.rb#509
sig { returns(Prism::Location) }
def location; end
# Returns the content of the comment by slicing it from the source code.
#
- # source://prism//lib/prism/parse_result.rb#381
+ # source://prism//lib/prism/parse_result.rb#522
sig { returns(String) }
def slice; end
@@ -6190,6 +5828,12 @@ class Prism::Compiler < ::Prism::Visitor
# source://prism//lib/prism/compiler.rb#39
def visit_interpolated_x_string_node(node); end
+ # Visit the child nodes of the given node.
+ # Compile a ItLocalVariableReadNode node
+ #
+ # source://prism//lib/prism/compiler.rb#39
+ def visit_it_local_variable_read_node(node); end
+
# Visit the child nodes of the given node.
# Compile a ItParametersNode node
#
@@ -6574,83 +6218,87 @@ end
# Target &&= value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4465
+# source://prism//lib/prism/node.rb#3953
class Prism::ConstantAndWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ConstantAndWriteNode node.
#
# @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode
#
- # source://prism//lib/prism/node.rb#4467
+ # source://prism//lib/prism/node.rb#3955
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4570
+ # source://prism//lib/prism/node.rb#4041
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4478
+ # source://prism//lib/prism/node.rb#3967
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4483
+ # source://prism//lib/prism/node.rb#3972
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4493
+ # source://prism//lib/prism/node.rb#3982
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4488
+ # source://prism//lib/prism/node.rb#3977
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantAndWriteNode
#
- # source://prism//lib/prism/node.rb#4498
+ # source://prism//lib/prism/node.rb#3987
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ConstantAndWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4483
+ # source://prism//lib/prism/node.rb#3972
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#4506
+ # source://prism//lib/prism/node.rb#3995
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#145
+ # source://prism//lib/prism/desugar_compiler.rb#182
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -6658,68 +6306,50 @@ class Prism::ConstantAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4536
+ # source://prism//lib/prism/node.rb#4025
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#4511
+ # source://prism//lib/prism/node.rb#4000
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#4514
+ # source://prism//lib/prism/node.rb#4003
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#4531
+ # source://prism//lib/prism/node.rb#4020
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#4521
+ # source://prism//lib/prism/node.rb#4010
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4554
+ # source://prism//lib/prism/node.rb#4030
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#4528
+ # source://prism//lib/prism/node.rb#4017
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#4564
+ # source://prism//lib/prism/node.rb#4035
def type; end
end
end
@@ -6729,97 +6359,101 @@ end
# Target += value
# ^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4583
+# source://prism//lib/prism/node.rb#4054
class Prism::ConstantOperatorWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
+ # Initialize a new ConstantOperatorWriteNode node.
#
# @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#4585
+ # source://prism//lib/prism/node.rb#4056
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).void
end
- def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4687
+ # source://prism//lib/prism/node.rb#4141
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4597
+ # source://prism//lib/prism/node.rb#4069
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#4650
+ # source://prism//lib/prism/node.rb#4122
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#4640
+ # source://prism//lib/prism/node.rb#4112
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4602
+ # source://prism//lib/prism/node.rb#4074
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4612
+ # source://prism//lib/prism/node.rb#4084
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4607
+ # source://prism//lib/prism/node.rb#4079
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#4617
+ # source://prism//lib/prism/node.rb#4089
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).returns(Prism::ConstantOperatorWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4602
+ # source://prism//lib/prism/node.rb#4074
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
#
- # source://prism//lib/prism/node.rb#4625
+ # source://prism//lib/prism/node.rb#4097
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#157
+ # source://prism//lib/prism/desugar_compiler.rb#194
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -6827,68 +6461,50 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4653
+ # source://prism//lib/prism/node.rb#4125
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#4630
+ # source://prism//lib/prism/node.rb#4102
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#4633
+ # source://prism//lib/prism/node.rb#4105
sig { returns(Prism::Location) }
def name_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#339
+ # source://prism//lib/prism/node_ext.rb#371
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#346
+ # source://prism//lib/prism/node_ext.rb#378
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#4671
+ # source://prism//lib/prism/node.rb#4130
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#4647
+ # source://prism//lib/prism/node.rb#4119
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4681
+ # source://prism//lib/prism/node.rb#4135
def type; end
end
end
@@ -6898,83 +6514,87 @@ end
# Target ||= value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4701
+# source://prism//lib/prism/node.rb#4155
class Prism::ConstantOrWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ConstantOrWriteNode node.
#
# @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode
#
- # source://prism//lib/prism/node.rb#4703
+ # source://prism//lib/prism/node.rb#4157
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4806
+ # source://prism//lib/prism/node.rb#4243
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4714
+ # source://prism//lib/prism/node.rb#4169
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4719
+ # source://prism//lib/prism/node.rb#4174
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4729
+ # source://prism//lib/prism/node.rb#4184
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4724
+ # source://prism//lib/prism/node.rb#4179
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> ConstantOrWriteNode
#
- # source://prism//lib/prism/node.rb#4734
+ # source://prism//lib/prism/node.rb#4189
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ConstantOrWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4719
+ # source://prism//lib/prism/node.rb#4174
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#4742
+ # source://prism//lib/prism/node.rb#4197
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#151
+ # source://prism//lib/prism/desugar_compiler.rb#188
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -6982,68 +6602,50 @@ class Prism::ConstantOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4772
+ # source://prism//lib/prism/node.rb#4227
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#4747
+ # source://prism//lib/prism/node.rb#4202
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#4750
+ # source://prism//lib/prism/node.rb#4205
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#4767
+ # source://prism//lib/prism/node.rb#4222
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#4757
+ # source://prism//lib/prism/node.rb#4212
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#4790
+ # source://prism//lib/prism/node.rb#4232
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#4764
+ # source://prism//lib/prism/node.rb#4219
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#4800
+ # source://prism//lib/prism/node.rb#4237
def type; end
end
end
@@ -7053,77 +6655,81 @@ end
# Parent::Child &&= value
# ^^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4819
+# source://prism//lib/prism/node.rb#4256
class Prism::ConstantPathAndWriteNode < ::Prism::Node
- # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ConstantPathAndWriteNode node.
#
# @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode
#
- # source://prism//lib/prism/node.rb#4821
+ # source://prism//lib/prism/node.rb#4258
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, target, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, target, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#4916
+ # source://prism//lib/prism/node.rb#4336
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4831
+ # source://prism//lib/prism/node.rb#4269
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4836
+ # source://prism//lib/prism/node.rb#4274
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4846
+ # source://prism//lib/prism/node.rb#4284
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4841
+ # source://prism//lib/prism/node.rb#4279
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathAndWriteNode
#
- # source://prism//lib/prism/node.rb#4851
+ # source://prism//lib/prism/node.rb#4289
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ConstantPathAndWriteNode)
end
- def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4836
+ # source://prism//lib/prism/node.rb#4274
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#4859
+ # source://prism//lib/prism/node.rb#4297
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -7132,62 +6738,44 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#4882
+ # source://prism//lib/prism/node.rb#4320
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#4877
+ # source://prism//lib/prism/node.rb#4315
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#4867
+ # source://prism//lib/prism/node.rb#4305
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader target: ConstantPathNode
#
- # source://prism//lib/prism/node.rb#4864
+ # source://prism//lib/prism/node.rb#4302
sig { returns(Prism::ConstantPathNode) }
def target; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#4900
+ # source://prism//lib/prism/node.rb#4325
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#4874
+ # source://prism//lib/prism/node.rb#4312
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#4910
+ # source://prism//lib/prism/node.rb#4330
def type; end
end
end
@@ -7197,34 +6785,36 @@ end
# Foo::Bar
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#4928
+# source://prism//lib/prism/node.rb#4348
class Prism::ConstantPathNode < ::Prism::Node
- # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void
+ # Initialize a new ConstantPathNode node.
#
# @return [ConstantPathNode] a new instance of ConstantPathNode
#
- # source://prism//lib/prism/node.rb#4930
+ # source://prism//lib/prism/node.rb#4350
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parent: T.nilable(Prism::Node),
name: T.nilable(Symbol),
delimiter_loc: Prism::Location,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).void
end
- def initialize(source, parent, name, delimiter_loc, name_loc, location); end
+ def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5056
+ # source://prism//lib/prism/node.rb#4459
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#4941
+ # source://prism//lib/prism/node.rb#4362
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -7232,57 +6822,59 @@ class Prism::ConstantPathNode < ::Prism::Node
# constant read or a missing node. To not cause a breaking change, we
# continue to supply that API.
#
- # source://prism//lib/prism/node_ext.rb#181
+ # source://prism//lib/prism/node_ext.rb#202
def child; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4946
+ # source://prism//lib/prism/node.rb#4367
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#4958
+ # source://prism//lib/prism/node.rb#4379
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#4951
+ # source://prism//lib/prism/node.rb#4372
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathNode
#
- # source://prism//lib/prism/node.rb#4963
+ # source://prism//lib/prism/node.rb#4384
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parent: T.nilable(Prism::Node),
name: T.nilable(Symbol),
delimiter_loc: Prism::Location,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).returns(Prism::ConstantPathNode)
end
- def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#4946
+ # source://prism//lib/prism/node.rb#4367
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location }
#
- # source://prism//lib/prism/node.rb#4971
+ # source://prism//lib/prism/node.rb#4392
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def delimiter: () -> String
#
- # source://prism//lib/prism/node.rb#5017
+ # source://prism//lib/prism/node.rb#4438
sig { returns(String) }
def delimiter; end
@@ -7294,7 +6886,7 @@ class Prism::ConstantPathNode < ::Prism::Node
# One::Two
# ^^
#
- # source://prism//lib/prism/node.rb#4997
+ # source://prism//lib/prism/node.rb#4418
sig { returns(Prism::Location) }
def delimiter_loc; end
@@ -7303,26 +6895,26 @@ class Prism::ConstantPathNode < ::Prism::Node
# Returns the full name of this constant path. For example: "Foo::Bar"
#
- # source://prism//lib/prism/node_ext.rb#174
+ # source://prism//lib/prism/node_ext.rb#195
sig { returns(String) }
def full_name; end
# Returns the list of parts for the full name of this constant path.
# For example: [:Foo, :Bar]
#
- # source://prism//lib/prism/node_ext.rb#152
+ # source://prism//lib/prism/node_ext.rb#173
sig { returns(T::Array[Symbol]) }
def full_name_parts; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5022
+ # source://prism//lib/prism/node.rb#4443
sig { override.returns(String) }
def inspect; end
# The name of the constant being accessed. This could be `nil` in the event of a syntax error.
#
- # source://prism//lib/prism/node.rb#4988
+ # source://prism//lib/prism/node.rb#4409
sig { returns(T.nilable(Symbol)) }
def name; end
@@ -7334,7 +6926,7 @@ class Prism::ConstantPathNode < ::Prism::Node
# One::Two
# ^^^
#
- # source://prism//lib/prism/node.rb#5010
+ # source://prism//lib/prism/node.rb#4431
sig { returns(Prism::Location) }
def name_loc; end
@@ -7349,38 +6941,20 @@ class Prism::ConstantPathNode < ::Prism::Node
# a.b::C
# ^^^
#
- # source://prism//lib/prism/node.rb#4985
+ # source://prism//lib/prism/node.rb#4406
sig { returns(T.nilable(Prism::Node)) }
def parent; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#5040
+ # source://prism//lib/prism/node.rb#4448
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5050
+ # source://prism//lib/prism/node.rb#4453
def type; end
end
end
@@ -7392,14 +6966,14 @@ end
# var::Bar::Baz -> raises because the first part of the constant path is a
# local variable
#
-# source://prism//lib/prism/node_ext.rb#143
+# source://prism//lib/prism/node_ext.rb#164
class Prism::ConstantPathNode::DynamicPartsInConstantPathError < ::StandardError; end
# An error class raised when missing nodes are found while computing a
# constant path's full name. For example:
# Foo:: -> raises because the constant path is missing the last part
#
-# source://prism//lib/prism/node_ext.rb#148
+# source://prism//lib/prism/node_ext.rb#169
class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError; end
# Represents assigning to a constant path using an operator that isn't `=`.
@@ -7407,91 +6981,95 @@ class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError
# Parent::Child += value
# ^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#5069
+# source://prism//lib/prism/node.rb#4472
class Prism::ConstantPathOperatorWriteNode < ::Prism::Node
- # def initialize: (ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
+ # Initialize a new ConstantPathOperatorWriteNode node.
#
# @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#5071
+ # source://prism//lib/prism/node.rb#4474
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).void
end
- def initialize(source, target, binary_operator_loc, value, binary_operator, location); end
+ def initialize(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5165
+ # source://prism//lib/prism/node.rb#4551
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5082
+ # source://prism//lib/prism/node.rb#4486
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#5128
+ # source://prism//lib/prism/node.rb#4532
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#5118
+ # source://prism//lib/prism/node.rb#4522
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5087
+ # source://prism//lib/prism/node.rb#4491
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5097
+ # source://prism//lib/prism/node.rb#4501
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5092
+ # source://prism//lib/prism/node.rb#4496
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantPathOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#5102
+ # source://prism//lib/prism/node.rb#4506
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).returns(Prism::ConstantPathOperatorWriteNode)
end
- def copy(target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5087
+ # source://prism//lib/prism/node.rb#4491
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
#
- # source://prism//lib/prism/node.rb#5110
+ # source://prism//lib/prism/node.rb#4514
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -7500,62 +7078,44 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5131
+ # source://prism//lib/prism/node.rb#4535
sig { override.returns(String) }
def inspect; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#355
+ # source://prism//lib/prism/node_ext.rb#387
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#362
+ # source://prism//lib/prism/node_ext.rb#394
def operator_loc; end
# attr_reader target: ConstantPathNode
#
- # source://prism//lib/prism/node.rb#5115
+ # source://prism//lib/prism/node.rb#4519
sig { returns(Prism::ConstantPathNode) }
def target; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5149
+ # source://prism//lib/prism/node.rb#4540
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#5125
+ # source://prism//lib/prism/node.rb#4529
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#5159
+ # source://prism//lib/prism/node.rb#4545
def type; end
end
end
@@ -7565,77 +7125,81 @@ end
# Parent::Child ||= value
# ^^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#5178
+# source://prism//lib/prism/node.rb#4564
class Prism::ConstantPathOrWriteNode < ::Prism::Node
- # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ConstantPathOrWriteNode node.
#
# @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode
#
- # source://prism//lib/prism/node.rb#5180
+ # source://prism//lib/prism/node.rb#4566
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, target, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, target, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5275
+ # source://prism//lib/prism/node.rb#4644
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5190
+ # source://prism//lib/prism/node.rb#4577
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5195
+ # source://prism//lib/prism/node.rb#4582
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5205
+ # source://prism//lib/prism/node.rb#4592
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5200
+ # source://prism//lib/prism/node.rb#4587
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathOrWriteNode
#
- # source://prism//lib/prism/node.rb#5210
+ # source://prism//lib/prism/node.rb#4597
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ConstantPathOrWriteNode)
end
- def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5195
+ # source://prism//lib/prism/node.rb#4582
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#5218
+ # source://prism//lib/prism/node.rb#4605
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -7644,62 +7208,44 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5241
+ # source://prism//lib/prism/node.rb#4628
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#5236
+ # source://prism//lib/prism/node.rb#4623
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#5226
+ # source://prism//lib/prism/node.rb#4613
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader target: ConstantPathNode
#
- # source://prism//lib/prism/node.rb#5223
+ # source://prism//lib/prism/node.rb#4610
sig { returns(Prism::ConstantPathNode) }
def target; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5259
+ # source://prism//lib/prism/node.rb#4633
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#5233
+ # source://prism//lib/prism/node.rb#4620
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5269
+ # source://prism//lib/prism/node.rb#4638
def type; end
end
end
@@ -7709,34 +7255,36 @@ end
# Foo::Foo, Bar::Bar = baz
# ^^^^^^^^ ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#5287
+# source://prism//lib/prism/node.rb#4656
class Prism::ConstantPathTargetNode < ::Prism::Node
- # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void
+ # Initialize a new ConstantPathTargetNode node.
#
# @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode
#
- # source://prism//lib/prism/node.rb#5289
+ # source://prism//lib/prism/node.rb#4658
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parent: T.nilable(Prism::Node),
name: T.nilable(Symbol),
delimiter_loc: Prism::Location,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).void
end
- def initialize(source, parent, name, delimiter_loc, name_loc, location); end
+ def initialize(source, node_id, location, flags, parent, name, delimiter_loc, name_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5394
+ # source://prism//lib/prism/node.rb#4746
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5300
+ # source://prism//lib/prism/node.rb#4670
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -7744,63 +7292,65 @@ class Prism::ConstantPathTargetNode < ::Prism::Node
# constant read or a missing node. To not cause a breaking change, we
# continue to supply that API.
#
- # source://prism//lib/prism/node_ext.rb#217
+ # source://prism//lib/prism/node_ext.rb#243
def child; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5305
+ # source://prism//lib/prism/node.rb#4675
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5317
+ # source://prism//lib/prism/node.rb#4687
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5310
+ # source://prism//lib/prism/node.rb#4680
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode
#
- # source://prism//lib/prism/node.rb#5322
+ # source://prism//lib/prism/node.rb#4692
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
parent: T.nilable(Prism::Node),
name: T.nilable(Symbol),
delimiter_loc: Prism::Location,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).returns(Prism::ConstantPathTargetNode)
end
- def copy(parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5305
+ # source://prism//lib/prism/node.rb#4675
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location }
#
- # source://prism//lib/prism/node.rb#5330
+ # source://prism//lib/prism/node.rb#4700
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def delimiter: () -> String
#
- # source://prism//lib/prism/node.rb#5355
+ # source://prism//lib/prism/node.rb#4725
sig { returns(String) }
def delimiter; end
# attr_reader delimiter_loc: Location
#
- # source://prism//lib/prism/node.rb#5341
+ # source://prism//lib/prism/node.rb#4711
sig { returns(Prism::Location) }
def delimiter_loc; end
@@ -7809,69 +7359,51 @@ class Prism::ConstantPathTargetNode < ::Prism::Node
# Returns the full name of this constant path. For example: "Foo::Bar"
#
- # source://prism//lib/prism/node_ext.rb#210
+ # source://prism//lib/prism/node_ext.rb#236
sig { returns(String) }
def full_name; end
# Returns the list of parts for the full name of this constant path.
# For example: [:Foo, :Bar]
#
- # source://prism//lib/prism/node_ext.rb#190
+ # source://prism//lib/prism/node_ext.rb#216
sig { returns(T::Array[Symbol]) }
def full_name_parts; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5360
+ # source://prism//lib/prism/node.rb#4730
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol?
#
- # source://prism//lib/prism/node.rb#5338
+ # source://prism//lib/prism/node.rb#4708
sig { returns(T.nilable(Symbol)) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#5348
+ # source://prism//lib/prism/node.rb#4718
sig { returns(Prism::Location) }
def name_loc; end
# attr_reader parent: Prism::node?
#
- # source://prism//lib/prism/node.rb#5335
+ # source://prism//lib/prism/node.rb#4705
sig { returns(T.nilable(Prism::Node)) }
def parent; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#5378
+ # source://prism//lib/prism/node.rb#4735
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5388
+ # source://prism//lib/prism/node.rb#4740
def type; end
end
end
@@ -7887,77 +7419,81 @@ end
# ::Foo::Bar = 1
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#5413
+# source://prism//lib/prism/node.rb#4765
class Prism::ConstantPathWriteNode < ::Prism::Node
- # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new ConstantPathWriteNode node.
#
# @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode
#
- # source://prism//lib/prism/node.rb#5415
+ # source://prism//lib/prism/node.rb#4767
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, target, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, target, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5522
+ # source://prism//lib/prism/node.rb#4857
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5425
+ # source://prism//lib/prism/node.rb#4778
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5430
+ # source://prism//lib/prism/node.rb#4783
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5440
+ # source://prism//lib/prism/node.rb#4793
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5435
+ # source://prism//lib/prism/node.rb#4788
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node) -> ConstantPathWriteNode
#
- # source://prism//lib/prism/node.rb#5445
+ # source://prism//lib/prism/node.rb#4798
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
target: Prism::ConstantPathNode,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::ConstantPathWriteNode)
end
- def copy(target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5430
+ # source://prism//lib/prism/node.rb#4783
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, target: ConstantPathNode, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#5453
+ # source://prism//lib/prism/node.rb#4806
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -7966,13 +7502,13 @@ class Prism::ConstantPathWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5488
+ # source://prism//lib/prism/node.rb#4841
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#5483
+ # source://prism//lib/prism/node.rb#4836
sig { returns(String) }
def operator; end
@@ -7981,7 +7517,7 @@ class Prism::ConstantPathWriteNode < ::Prism::Node
# ::ABC = 123
# ^
#
- # source://prism//lib/prism/node.rb#5470
+ # source://prism//lib/prism/node.rb#4823
sig { returns(Prism::Location) }
def operator_loc; end
@@ -7993,26 +7529,13 @@ class Prism::ConstantPathWriteNode < ::Prism::Node
# ::Foo = :abc
# ^^^^^
#
- # source://prism//lib/prism/node.rb#5464
+ # source://prism//lib/prism/node.rb#4817
sig { returns(Prism::ConstantPathNode) }
def target; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#5506
+ # source://prism//lib/prism/node.rb#4846
sig { override.returns(Symbol) }
def type; end
@@ -8021,19 +7544,14 @@ class Prism::ConstantPathWriteNode < ::Prism::Node
# FOO::BAR = :abc
# ^^^^
#
- # source://prism//lib/prism/node.rb#5480
+ # source://prism//lib/prism/node.rb#4833
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#5516
+ # source://prism//lib/prism/node.rb#4851
def type; end
end
end
@@ -8043,62 +7561,69 @@ end
# Foo
# ^^^
#
-# source://prism//lib/prism/node.rb#5534
+# source://prism//lib/prism/node.rb#4869
class Prism::ConstantReadNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new ConstantReadNode node.
#
# @return [ConstantReadNode] a new instance of ConstantReadNode
#
- # source://prism//lib/prism/node.rb#5536
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#4871
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5618
+ # source://prism//lib/prism/node.rb#4936
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5544
+ # source://prism//lib/prism/node.rb#4880
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5549
+ # source://prism//lib/prism/node.rb#4885
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5559
+ # source://prism//lib/prism/node.rb#4895
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5554
+ # source://prism//lib/prism/node.rb#4890
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> ConstantReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantReadNode
#
- # source://prism//lib/prism/node.rb#5564
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantReadNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#4900
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ConstantReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5549
+ # source://prism//lib/prism/node.rb#4885
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#5572
+ # source://prism//lib/prism/node.rb#4908
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -8107,20 +7632,20 @@ class Prism::ConstantReadNode < ::Prism::Node
# Returns the full name of this constant. For example: "Foo"
#
- # source://prism//lib/prism/node_ext.rb#118
+ # source://prism//lib/prism/node_ext.rb#139
sig { returns(String) }
def full_name; end
# Returns the list of parts for the full name of this constant.
# For example: [:Foo]
#
- # source://prism//lib/prism/node_ext.rb#113
+ # source://prism//lib/prism/node_ext.rb#134
sig { returns(T::Array[Symbol]) }
def full_name_parts; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5584
+ # source://prism//lib/prism/node.rb#4920
sig { override.returns(String) }
def inspect; end
@@ -8130,38 +7655,20 @@ class Prism::ConstantReadNode < ::Prism::Node
#
# SOME_CONSTANT # name `:SOME_CONSTANT`
#
- # source://prism//lib/prism/node.rb#5581
+ # source://prism//lib/prism/node.rb#4917
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5602
+ # source://prism//lib/prism/node.rb#4925
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5612
+ # source://prism//lib/prism/node.rb#4930
def type; end
end
end
@@ -8171,62 +7678,69 @@ end
# Foo, Bar = baz
# ^^^ ^^^
#
-# source://prism//lib/prism/node.rb#5628
+# source://prism//lib/prism/node.rb#4946
class Prism::ConstantTargetNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new ConstantTargetNode node.
#
# @return [ConstantTargetNode] a new instance of ConstantTargetNode
#
- # source://prism//lib/prism/node.rb#5630
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#4948
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5708
+ # source://prism//lib/prism/node.rb#5009
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5638
+ # source://prism//lib/prism/node.rb#4957
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5643
+ # source://prism//lib/prism/node.rb#4962
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5653
+ # source://prism//lib/prism/node.rb#4972
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5648
+ # source://prism//lib/prism/node.rb#4967
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> ConstantTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> ConstantTargetNode
#
- # source://prism//lib/prism/node.rb#5658
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantTargetNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#4977
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ConstantTargetNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5643
+ # source://prism//lib/prism/node.rb#4962
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#5666
+ # source://prism//lib/prism/node.rb#4985
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -8235,57 +7749,39 @@ class Prism::ConstantTargetNode < ::Prism::Node
# Returns the full name of this constant. For example: "Foo"
#
- # source://prism//lib/prism/node_ext.rb#231
+ # source://prism//lib/prism/node_ext.rb#262
sig { returns(String) }
def full_name; end
# Returns the list of parts for the full name of this constant.
# For example: [:Foo]
#
- # source://prism//lib/prism/node_ext.rb#226
+ # source://prism//lib/prism/node_ext.rb#257
sig { returns(T::Array[Symbol]) }
def full_name_parts; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5674
+ # source://prism//lib/prism/node.rb#4993
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#5671
+ # source://prism//lib/prism/node.rb#4990
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#5692
+ # source://prism//lib/prism/node.rb#4998
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#5702
+ # source://prism//lib/prism/node.rb#5003
def type; end
end
end
@@ -8295,79 +7791,83 @@ end
# Foo = 1
# ^^^^^^^
#
-# source://prism//lib/prism/node.rb#5718
+# source://prism//lib/prism/node.rb#5019
class Prism::ConstantWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void
+ # Initialize a new ConstantWriteNode node.
#
# @return [ConstantWriteNode] a new instance of ConstantWriteNode
#
- # source://prism//lib/prism/node.rb#5720
+ # source://prism//lib/prism/node.rb#5021
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, name, name_loc, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#5839
+ # source://prism//lib/prism/node.rb#5123
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#5731
+ # source://prism//lib/prism/node.rb#5033
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5736
+ # source://prism//lib/prism/node.rb#5038
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#5746
+ # source://prism//lib/prism/node.rb#5048
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#5741
+ # source://prism//lib/prism/node.rb#5043
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ConstantWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> ConstantWriteNode
#
- # source://prism//lib/prism/node.rb#5751
+ # source://prism//lib/prism/node.rb#5053
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::ConstantWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5736
+ # source://prism//lib/prism/node.rb#5038
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#5759
+ # source://prism//lib/prism/node.rb#5061
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -8376,20 +7876,20 @@ class Prism::ConstantWriteNode < ::Prism::Node
# Returns the full name of this constant. For example: "Foo"
#
- # source://prism//lib/prism/node_ext.rb#131
+ # source://prism//lib/prism/node_ext.rb#152
sig { returns(String) }
def full_name; end
# Returns the list of parts for the full name of this constant.
# For example: [:Foo]
#
- # source://prism//lib/prism/node_ext.rb#126
+ # source://prism//lib/prism/node_ext.rb#147
sig { returns(T::Array[Symbol]) }
def full_name_parts; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#5805
+ # source://prism//lib/prism/node.rb#5107
sig { override.returns(String) }
def inspect; end
@@ -8399,7 +7899,7 @@ class Prism::ConstantWriteNode < ::Prism::Node
#
# XYZ = 1 # name `:XYZ`
#
- # source://prism//lib/prism/node.rb#5768
+ # source://prism//lib/prism/node.rb#5070
sig { returns(Symbol) }
def name; end
@@ -8408,13 +7908,13 @@ class Prism::ConstantWriteNode < ::Prism::Node
# FOO = 1
# ^^^
#
- # source://prism//lib/prism/node.rb#5774
+ # source://prism//lib/prism/node.rb#5076
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#5800
+ # source://prism//lib/prism/node.rb#5102
sig { returns(String) }
def operator; end
@@ -8423,26 +7923,13 @@ class Prism::ConstantWriteNode < ::Prism::Node
# FOO = :bar
# ^
#
- # source://prism//lib/prism/node.rb#5793
+ # source://prism//lib/prism/node.rb#5095
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#5823
+ # source://prism//lib/prism/node.rb#5112
sig { override.returns(Symbol) }
def type; end
@@ -8454,19 +7941,14 @@ class Prism::ConstantWriteNode < ::Prism::Node
# MyClass = Class.new
# ^^^^^^^^^
#
- # source://prism//lib/prism/node.rb#5787
+ # source://prism//lib/prism/node.rb#5089
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#5833
+ # source://prism//lib/prism/node.rb#5117
def type; end
end
end
@@ -8477,1072 +7959,2779 @@ end
# source = Prism::Source.for("[1]")
#
# Prism::ArrayNode.new(
+# source,
+# 0,
+# Prism::Location.new(source, 0, 3),
+# 0,
# [
# Prism::IntegerNode.new(
-# Prism::IntegerBaseFlags::DECIMAL,
-# 1,
+# source,
+# 0,
# Prism::Location.new(source, 1, 1),
-# source
+# Prism::IntegerBaseFlags::DECIMAL,
+# 1
# )
# ],
# Prism::Location.new(source, 0, 1),
-# Prism::Location.new(source, 2, 1),
-# source
+# Prism::Location.new(source, 2, 1)
# )
#
# you could instead write:
#
-# source = Prism::Source.for("[1]")
+# class Builder
+# include Prism::DSL
#
-# ArrayNode(
-# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source),
-# Location(source, 0, 1),
-# Location(source, 2, 1),
-# source
-# )
+# attr_reader :default_source
+#
+# def initialize
+# @default_source = source("[1]")
+# end
#
-# This is mostly helpful in the context of writing tests, but can also be used
-# to generate trees programmatically.
+# def build
+# array_node(
+# location: location(start_offset: 0, length: 3),
+# elements: [
+# integer_node(
+# location: location(start_offset: 1, length: 1),
+# flags: integer_base_flag(:decimal),
+# value: 1
+# )
+# ],
+# opening_loc: location(start_offset: 0, length: 1),
+# closing_loc: location(start_offset: 2, length: 1)
+# )
+# end
+# end
+#
+# This is mostly helpful in the context of generating trees programmatically.
#
-# source://prism//lib/prism/dsl.rb#42
+# source://prism//lib/prism/dsl.rb#61
module Prism::DSL
- private
+ extend ::Prism::DSL
- # Create a new AliasGlobalVariableNode node
+ # Create a new AliasGlobalVariableNode node.
#
- # source://prism//lib/prism/dsl.rb#51
- def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#77
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode),
+ old_name: T.any(Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::SymbolNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
+ ).returns(Prism::AliasGlobalVariableNode)
+ end
+ def alias_global_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new AliasMethodNode node
+ # Create a new AliasMethodNode node.
#
- # source://prism//lib/prism/dsl.rb#56
- def AliasMethodNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#82
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ new_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode),
+ old_name: T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode, Prism::GlobalVariableReadNode, Prism::MissingNode),
+ keyword_loc: Prism::Location
+ ).returns(Prism::AliasMethodNode)
+ end
+ def alias_method_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), new_name: T.unsafe(nil), old_name: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new AlternationPatternNode node
+ # Create a new AlternationPatternNode node.
#
- # source://prism//lib/prism/dsl.rb#61
- def AlternationPatternNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#87
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ left: Prism::Node,
+ right: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::AlternationPatternNode)
+ end
+ def alternation_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new AndNode node
+ # Create a new AndNode node.
#
- # source://prism//lib/prism/dsl.rb#66
- def AndNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#92
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ left: Prism::Node,
+ right: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::AndNode)
+ end
+ def and_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new ArgumentsNode node
+ # Create a new ArgumentsNode node.
#
- # source://prism//lib/prism/dsl.rb#71
- def ArgumentsNode(flags, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#97
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ arguments: T::Array[Prism::Node]
+ ).returns(Prism::ArgumentsNode)
+ end
+ def arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil)); end
- # Create a new ArrayNode node
+ # Retrieve the value of one of the ArgumentsNodeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#76
- def ArrayNode(flags, elements, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#832
+ sig { params(name: Symbol).returns(Integer) }
+ def arguments_node_flag(name); end
- # Create a new ArrayPatternNode node
+ # Create a new ArrayNode node.
#
- # source://prism//lib/prism/dsl.rb#81
- def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#102
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ elements: T::Array[Prism::Node],
+ opening_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::ArrayNode)
+ end
+ def array_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new AssocNode node
+ # Retrieve the value of one of the ArrayNodeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#86
- def AssocNode(key, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#844
+ sig { params(name: Symbol).returns(Integer) }
+ def array_node_flag(name); end
- # Create a new AssocSplatNode node
+ # Create a new ArrayPatternNode node.
#
- # source://prism//lib/prism/dsl.rb#91
- def AssocSplatNode(value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#107
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
+ requireds: T::Array[Prism::Node],
+ rest: T.nilable(Prism::Node),
+ posts: T::Array[Prism::Node],
+ opening_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::ArrayPatternNode)
+ end
+ def array_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), requireds: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new BackReferenceReadNode node
+ # Create a new AssocNode node.
#
- # source://prism//lib/prism/dsl.rb#96
- def BackReferenceReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#112
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ key: Prism::Node,
+ value: Prism::Node,
+ operator_loc: T.nilable(Prism::Location)
+ ).returns(Prism::AssocNode)
+ end
+ def assoc_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), key: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new BeginNode node
+ # Create a new AssocSplatNode node.
#
- # source://prism//lib/prism/dsl.rb#101
- def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#117
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: T.nilable(Prism::Node),
+ operator_loc: Prism::Location
+ ).returns(Prism::AssocSplatNode)
+ end
+ def assoc_splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new BlockArgumentNode node
+ # Create a new BackReferenceReadNode node.
#
- # source://prism//lib/prism/dsl.rb#106
- def BlockArgumentNode(expression, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#122
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::BackReferenceReadNode)
+ end
+ def back_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new BlockLocalVariableNode node
+ # Create a new BeginNode node.
#
- # source://prism//lib/prism/dsl.rb#111
- def BlockLocalVariableNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#127
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ begin_keyword_loc: T.nilable(Prism::Location),
+ statements: T.nilable(Prism::StatementsNode),
+ rescue_clause: T.nilable(Prism::RescueNode),
+ else_clause: T.nilable(Prism::ElseNode),
+ ensure_clause: T.nilable(Prism::EnsureNode),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).returns(Prism::BeginNode)
+ end
+ def begin_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), begin_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), rescue_clause: T.unsafe(nil), else_clause: T.unsafe(nil), ensure_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new BlockNode node
+ # Create a new BlockArgumentNode node.
#
- # source://prism//lib/prism/dsl.rb#116
- def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#132
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ expression: T.nilable(Prism::Node),
+ operator_loc: Prism::Location
+ ).returns(Prism::BlockArgumentNode)
+ end
+ def block_argument_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new BlockParameterNode node
+ # Create a new BlockLocalVariableNode node.
#
- # source://prism//lib/prism/dsl.rb#121
- def BlockParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#137
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::BlockLocalVariableNode)
+ end
+ def block_local_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new BlockParametersNode node
+ # Create a new BlockNode node.
#
- # source://prism//lib/prism/dsl.rb#126
- def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#142
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ opening_loc: Prism::Location,
+ closing_loc: Prism::Location
+ ).returns(Prism::BlockNode)
+ end
+ def block_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new BreakNode node
+ # Create a new BlockParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#131
- def BreakNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#147
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: T.nilable(Symbol),
+ name_loc: T.nilable(Prism::Location),
+ operator_loc: Prism::Location
+ ).returns(Prism::BlockParameterNode)
+ end
+ def block_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new CallAndWriteNode node
+ # Create a new BlockParametersNode node.
#
- # source://prism//lib/prism/dsl.rb#136
- def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#152
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ parameters: T.nilable(Prism::ParametersNode),
+ locals: T::Array[Prism::BlockLocalVariableNode],
+ opening_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::BlockParametersNode)
+ end
+ def block_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parameters: T.unsafe(nil), locals: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new CallNode node
+ # Create a new BreakNode node.
#
- # source://prism//lib/prism/dsl.rb#141
- def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#157
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ keyword_loc: Prism::Location
+ ).returns(Prism::BreakNode)
+ end
+ def break_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new CallOperatorWriteNode node
+ # Create a new CallAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#146
- def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#162
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ message_loc: T.nilable(Prism::Location),
+ read_name: Symbol,
+ write_name: Symbol,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::CallAndWriteNode)
+ end
+ def call_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new CallOrWriteNode node
+ # Create a new CallNode node.
#
- # source://prism//lib/prism/dsl.rb#151
- def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#167
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ name: Symbol,
+ message_loc: T.nilable(Prism::Location),
+ opening_loc: T.nilable(Prism::Location),
+ arguments: T.nilable(Prism::ArgumentsNode),
+ closing_loc: T.nilable(Prism::Location),
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
+ ).returns(Prism::CallNode)
+ end
+ def call_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end
- # Create a new CallTargetNode node
+ # Retrieve the value of one of the CallNodeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#156
- def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#852
+ sig { params(name: Symbol).returns(Integer) }
+ def call_node_flag(name); end
- # Create a new CapturePatternNode node
+ # Create a new CallOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#161
- def CapturePatternNode(value, target, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#172
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ message_loc: T.nilable(Prism::Location),
+ read_name: Symbol,
+ write_name: Symbol,
+ binary_operator: Symbol,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::CallOperatorWriteNode)
+ end
+ def call_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new CaseMatchNode node
+ # Create a new CallOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#166
- def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#177
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ message_loc: T.nilable(Prism::Location),
+ read_name: Symbol,
+ write_name: Symbol,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::CallOrWriteNode)
+ end
+ def call_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), message_loc: T.unsafe(nil), read_name: T.unsafe(nil), write_name: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new CaseNode node
+ # Create a new CallTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#171
- def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#182
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: Prism::Node,
+ call_operator_loc: Prism::Location,
+ name: Symbol,
+ message_loc: Prism::Location
+ ).returns(Prism::CallTargetNode)
+ end
+ def call_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), name: T.unsafe(nil), message_loc: T.unsafe(nil)); end
- # Create a new ClassNode node
+ # Create a new CapturePatternNode node.
#
- # source://prism//lib/prism/dsl.rb#176
- def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new ClassVariableAndWriteNode node
- #
- # source://prism//lib/prism/dsl.rb#181
- def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new ClassVariableOperatorWriteNode node
- #
- # source://prism//lib/prism/dsl.rb#186
- def ClassVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new ClassVariableOrWriteNode node
- #
- # source://prism//lib/prism/dsl.rb#191
- def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new ClassVariableReadNode node
- #
- # source://prism//lib/prism/dsl.rb#196
- def ClassVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#187
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Prism::Node,
+ target: Prism::LocalVariableTargetNode,
+ operator_loc: Prism::Location
+ ).returns(Prism::CapturePatternNode)
+ end
+ def capture_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new ClassVariableTargetNode node
+ # Create a new CaseMatchNode node.
#
- # source://prism//lib/prism/dsl.rb#201
- def ClassVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#192
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ predicate: T.nilable(Prism::Node),
+ conditions: T::Array[Prism::InNode],
+ else_clause: T.nilable(Prism::ElseNode),
+ case_keyword_loc: Prism::Location,
+ end_keyword_loc: Prism::Location
+ ).returns(Prism::CaseMatchNode)
+ end
+ def case_match_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new ClassVariableWriteNode node
+ # Create a new CaseNode node.
#
- # source://prism//lib/prism/dsl.rb#206
- def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#197
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ predicate: T.nilable(Prism::Node),
+ conditions: T::Array[Prism::WhenNode],
+ else_clause: T.nilable(Prism::ElseNode),
+ case_keyword_loc: Prism::Location,
+ end_keyword_loc: Prism::Location
+ ).returns(Prism::CaseNode)
+ end
+ def case_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), predicate: T.unsafe(nil), conditions: T.unsafe(nil), else_clause: T.unsafe(nil), case_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new ConstantAndWriteNode node
+ # Create a new ClassNode node.
#
- # source://prism//lib/prism/dsl.rb#211
- def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#202
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ class_keyword_loc: Prism::Location,
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::CallNode),
+ inheritance_operator_loc: T.nilable(Prism::Location),
+ superclass: T.nilable(Prism::Node),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ end_keyword_loc: Prism::Location,
+ name: Symbol
+ ).returns(Prism::ClassNode)
+ end
+ def class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), inheritance_operator_loc: T.unsafe(nil), superclass: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new ConstantOperatorWriteNode node
+ # Create a new ClassVariableAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#216
- def ConstantOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#207
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ClassVariableAndWriteNode)
+ end
+ def class_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ConstantOrWriteNode node
+ # Create a new ClassVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#221
- def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#212
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ binary_operator: Symbol
+ ).returns(Prism::ClassVariableOperatorWriteNode)
+ end
+ def class_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
- # Create a new ConstantPathAndWriteNode node
+ # Create a new ClassVariableOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#226
- def ConstantPathAndWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#217
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ClassVariableOrWriteNode)
+ end
+ def class_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ConstantPathNode node
+ # Create a new ClassVariableReadNode node.
#
- # source://prism//lib/prism/dsl.rb#231
- def ConstantPathNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#222
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ClassVariableReadNode)
+ end
+ def class_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new ConstantPathOperatorWriteNode node
+ # Create a new ClassVariableTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#236
- def ConstantPathOperatorWriteNode(target, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#227
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ClassVariableTargetNode)
+ end
+ def class_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new ConstantPathOrWriteNode node
+ # Create a new ClassVariableWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#241
- def ConstantPathOrWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#232
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ value: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::ClassVariableWriteNode)
+ end
+ def class_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new ConstantPathTargetNode node
+ # Create a new ConstantAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#246
- def ConstantPathTargetNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#237
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ConstantAndWriteNode)
+ end
+ def constant_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ConstantPathWriteNode node
+ # Create a new ConstantOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#251
- def ConstantPathWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#242
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ binary_operator: Symbol
+ ).returns(Prism::ConstantOperatorWriteNode)
+ end
+ def constant_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
- # Create a new ConstantReadNode node
+ # Create a new ConstantOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#256
- def ConstantReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#247
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ConstantOrWriteNode)
+ end
+ def constant_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ConstantTargetNode node
+ # Create a new ConstantPathAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#261
- def ConstantTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#252
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ target: Prism::ConstantPathNode,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ConstantPathAndWriteNode)
+ end
+ def constant_path_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ConstantWriteNode node
+ # Create a new ConstantPathNode node.
#
- # source://prism//lib/prism/dsl.rb#266
- def ConstantWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#257
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ parent: T.nilable(Prism::Node),
+ name: T.nilable(Symbol),
+ delimiter_loc: Prism::Location,
+ name_loc: Prism::Location
+ ).returns(Prism::ConstantPathNode)
+ end
+ def constant_path_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end
- # Create a new DefNode node
+ # Create a new ConstantPathOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#271
- def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#262
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ target: Prism::ConstantPathNode,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ binary_operator: Symbol
+ ).returns(Prism::ConstantPathOperatorWriteNode)
+ end
+ def constant_path_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
- # Create a new DefinedNode node
+ # Create a new ConstantPathOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#276
- def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#267
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ target: Prism::ConstantPathNode,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ConstantPathOrWriteNode)
+ end
+ def constant_path_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ElseNode node
+ # Create a new ConstantPathTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#281
- def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#272
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ parent: T.nilable(Prism::Node),
+ name: T.nilable(Symbol),
+ delimiter_loc: Prism::Location,
+ name_loc: Prism::Location
+ ).returns(Prism::ConstantPathTargetNode)
+ end
+ def constant_path_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), parent: T.unsafe(nil), name: T.unsafe(nil), delimiter_loc: T.unsafe(nil), name_loc: T.unsafe(nil)); end
- # Create a new EmbeddedStatementsNode node
+ # Create a new ConstantPathWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#286
- def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#277
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ target: Prism::ConstantPathNode,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::ConstantPathWriteNode)
+ end
+ def constant_path_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), target: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new EmbeddedVariableNode node
+ # Create a new ConstantReadNode node.
#
- # source://prism//lib/prism/dsl.rb#291
- def EmbeddedVariableNode(operator_loc, variable, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#282
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ConstantReadNode)
+ end
+ def constant_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new EnsureNode node
+ # Create a new ConstantTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#296
- def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#287
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::ConstantTargetNode)
+ end
+ def constant_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new FalseNode node
+ # Create a new ConstantWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#301
- def FalseNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#292
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ value: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::ConstantWriteNode)
+ end
+ def constant_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new FindPatternNode node
+ # Create a new DefNode node.
#
- # source://prism//lib/prism/dsl.rb#306
- def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#297
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ receiver: T.nilable(Prism::Node),
+ parameters: T.nilable(Prism::ParametersNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ locals: T::Array[Symbol],
+ def_keyword_loc: Prism::Location,
+ operator_loc: T.nilable(Prism::Location),
+ lparen_loc: T.nilable(Prism::Location),
+ rparen_loc: T.nilable(Prism::Location),
+ equal_loc: T.nilable(Prism::Location),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).returns(Prism::DefNode)
+ end
+ def def_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new FlipFlopNode node
+ # Create a new DefinedNode node.
#
- # source://prism//lib/prism/dsl.rb#311
- def FlipFlopNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#302
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ lparen_loc: T.nilable(Prism::Location),
+ value: Prism::Node,
+ rparen_loc: T.nilable(Prism::Location),
+ keyword_loc: Prism::Location
+ ).returns(Prism::DefinedNode)
+ end
+ def defined_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new FloatNode node
+ # Create a new ElseNode node.
#
- # source://prism//lib/prism/dsl.rb#316
- def FloatNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#307
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ else_keyword_loc: Prism::Location,
+ statements: T.nilable(Prism::StatementsNode),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).returns(Prism::ElseNode)
+ end
+ def else_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new ForNode node
+ # Create a new EmbeddedStatementsNode node.
#
- # source://prism//lib/prism/dsl.rb#321
- def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#312
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ statements: T.nilable(Prism::StatementsNode),
+ closing_loc: Prism::Location
+ ).returns(Prism::EmbeddedStatementsNode)
+ end
+ def embedded_statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new ForwardingArgumentsNode node
+ # Create a new EmbeddedVariableNode node.
#
- # source://prism//lib/prism/dsl.rb#326
- def ForwardingArgumentsNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#317
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ operator_loc: Prism::Location,
+ variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)
+ ).returns(Prism::EmbeddedVariableNode)
+ end
+ def embedded_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end
- # Create a new ForwardingParameterNode node
+ # Retrieve the value of one of the EncodingFlags flags.
#
- # source://prism//lib/prism/dsl.rb#331
- def ForwardingParameterNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#863
+ sig { params(name: Symbol).returns(Integer) }
+ def encoding_flag(name); end
- # Create a new ForwardingSuperNode node
+ # Create a new EnsureNode node.
#
- # source://prism//lib/prism/dsl.rb#336
- def ForwardingSuperNode(block, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#322
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ ensure_keyword_loc: Prism::Location,
+ statements: T.nilable(Prism::StatementsNode),
+ end_keyword_loc: Prism::Location
+ ).returns(Prism::EnsureNode)
+ end
+ def ensure_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new GlobalVariableAndWriteNode node
+ # Create a new FalseNode node.
#
- # source://prism//lib/prism/dsl.rb#341
- def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#327
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::FalseNode)
+ end
+ def false_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new GlobalVariableOperatorWriteNode node
+ # Create a new FindPatternNode node.
#
- # source://prism//lib/prism/dsl.rb#346
- def GlobalVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#332
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
+ left: Prism::SplatNode,
+ requireds: T::Array[Prism::Node],
+ right: T.any(Prism::SplatNode, Prism::MissingNode),
+ opening_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::FindPatternNode)
+ end
+ def find_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new GlobalVariableOrWriteNode node
+ # Create a new FlipFlopNode node.
#
- # source://prism//lib/prism/dsl.rb#351
- def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new GlobalVariableReadNode node
- #
- # source://prism//lib/prism/dsl.rb#356
- def GlobalVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new GlobalVariableTargetNode node
- #
- # source://prism//lib/prism/dsl.rb#361
- def GlobalVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new GlobalVariableWriteNode node
- #
- # source://prism//lib/prism/dsl.rb#366
- def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#337
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ left: T.nilable(Prism::Node),
+ right: T.nilable(Prism::Node),
+ operator_loc: Prism::Location
+ ).returns(Prism::FlipFlopNode)
+ end
+ def flip_flop_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new HashNode node
+ # Create a new FloatNode node.
#
- # source://prism//lib/prism/dsl.rb#371
- def HashNode(opening_loc, elements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#342
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Float
+ ).returns(Prism::FloatNode)
+ end
+ def float_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new HashPatternNode node
+ # Create a new ForNode node.
#
- # source://prism//lib/prism/dsl.rb#376
- def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#347
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode),
+ collection: Prism::Node,
+ statements: T.nilable(Prism::StatementsNode),
+ for_keyword_loc: Prism::Location,
+ in_keyword_loc: Prism::Location,
+ do_keyword_loc: T.nilable(Prism::Location),
+ end_keyword_loc: Prism::Location
+ ).returns(Prism::ForNode)
+ end
+ def for_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new IfNode node
+ # Create a new ForwardingArgumentsNode node.
#
- # source://prism//lib/prism/dsl.rb#381
- def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#352
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::ForwardingArgumentsNode)
+ end
+ def forwarding_arguments_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new ImaginaryNode node
+ # Create a new ForwardingParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#386
- def ImaginaryNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#357
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::ForwardingParameterNode)
+ end
+ def forwarding_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new ImplicitNode node
+ # Create a new ForwardingSuperNode node.
#
- # source://prism//lib/prism/dsl.rb#391
- def ImplicitNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#362
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ block: T.nilable(Prism::BlockNode)
+ ).returns(Prism::ForwardingSuperNode)
+ end
+ def forwarding_super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end
- # Create a new ImplicitRestNode node
+ # Create a new GlobalVariableAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#396
- def ImplicitRestNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#367
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::GlobalVariableAndWriteNode)
+ end
+ def global_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new InNode node
+ # Create a new GlobalVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#401
- def InNode(pattern, statements, in_loc, then_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#372
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ binary_operator: Symbol
+ ).returns(Prism::GlobalVariableOperatorWriteNode)
+ end
+ def global_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
- # Create a new IndexAndWriteNode node
+ # Create a new GlobalVariableOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#406
- def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#377
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::GlobalVariableOrWriteNode)
+ end
+ def global_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new IndexOperatorWriteNode node
+ # Create a new GlobalVariableReadNode node.
#
- # source://prism//lib/prism/dsl.rb#411
- def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#382
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::GlobalVariableReadNode)
+ end
+ def global_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new IndexOrWriteNode node
+ # Create a new GlobalVariableTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#416
- def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#387
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::GlobalVariableTargetNode)
+ end
+ def global_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new IndexTargetNode node
+ # Create a new GlobalVariableWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#421
- def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#392
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ value: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::GlobalVariableWriteNode)
+ end
+ def global_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new InstanceVariableAndWriteNode node
+ # Create a new HashNode node.
#
- # source://prism//lib/prism/dsl.rb#426
- def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#397
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)],
+ closing_loc: Prism::Location
+ ).returns(Prism::HashNode)
+ end
+ def hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new InstanceVariableOperatorWriteNode node
+ # Create a new HashPatternNode node.
#
- # source://prism//lib/prism/dsl.rb#431
- def InstanceVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#402
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
+ elements: T::Array[Prism::AssocNode],
+ rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)),
+ opening_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::HashPatternNode)
+ end
+ def hash_pattern_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new InstanceVariableOrWriteNode node
+ # Create a new IfNode node.
#
- # source://prism//lib/prism/dsl.rb#436
- def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#407
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ if_keyword_loc: T.nilable(Prism::Location),
+ predicate: Prism::Node,
+ then_keyword_loc: T.nilable(Prism::Location),
+ statements: T.nilable(Prism::StatementsNode),
+ subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).returns(Prism::IfNode)
+ end
+ def if_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Create a new InstanceVariableReadNode node
+ # Create a new ImaginaryNode node.
#
- # source://prism//lib/prism/dsl.rb#441
- def InstanceVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#412
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)
+ ).returns(Prism::ImaginaryNode)
+ end
+ def imaginary_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end
- # Create a new InstanceVariableTargetNode node
+ # Create a new ImplicitNode node.
#
- # source://prism//lib/prism/dsl.rb#446
- def InstanceVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#417
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode)
+ ).returns(Prism::ImplicitNode)
+ end
+ def implicit_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new InstanceVariableWriteNode node
+ # Create a new ImplicitRestNode node.
#
- # source://prism//lib/prism/dsl.rb#451
- def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#422
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::ImplicitRestNode)
+ end
+ def implicit_rest_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new IntegerNode node
+ # Create a new InNode node.
#
- # source://prism//lib/prism/dsl.rb#456
- def IntegerNode(flags, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#427
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ pattern: Prism::Node,
+ statements: T.nilable(Prism::StatementsNode),
+ in_loc: Prism::Location,
+ then_loc: T.nilable(Prism::Location)
+ ).returns(Prism::InNode)
+ end
+ def in_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end
- # Create a new InterpolatedMatchLastLineNode node
+ # Create a new IndexAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#461
- def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#432
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ opening_loc: Prism::Location,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ closing_loc: Prism::Location,
+ block: T.nilable(Prism::BlockArgumentNode),
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::IndexAndWriteNode)
+ end
+ def index_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new InterpolatedRegularExpressionNode node
+ # Create a new IndexOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#466
- def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#437
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ opening_loc: Prism::Location,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ closing_loc: Prism::Location,
+ block: T.nilable(Prism::BlockArgumentNode),
+ binary_operator: Symbol,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::IndexOperatorWriteNode)
+ end
+ def index_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new InterpolatedStringNode node
+ # Create a new IndexOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#471
- def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#442
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: T.nilable(Prism::Node),
+ call_operator_loc: T.nilable(Prism::Location),
+ opening_loc: Prism::Location,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ closing_loc: Prism::Location,
+ block: T.nilable(Prism::BlockArgumentNode),
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::IndexOrWriteNode)
+ end
+ def index_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new InterpolatedSymbolNode node
+ # Create a new IndexTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#476
- def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#447
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ receiver: Prism::Node,
+ opening_loc: Prism::Location,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ closing_loc: Prism::Location,
+ block: T.nilable(Prism::BlockArgumentNode)
+ ).returns(Prism::IndexTargetNode)
+ end
+ def index_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end
- # Create a new InterpolatedXStringNode node
+ # Create a new InstanceVariableAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#481
- def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#452
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::InstanceVariableAndWriteNode)
+ end
+ def instance_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new ItParametersNode node
+ # Create a new InstanceVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#486
- def ItParametersNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#457
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ binary_operator: Symbol
+ ).returns(Prism::InstanceVariableOperatorWriteNode)
+ end
+ def instance_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
- # Create a new KeywordHashNode node
+ # Create a new InstanceVariableOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#491
- def KeywordHashNode(flags, elements, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#462
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::InstanceVariableOrWriteNode)
+ end
+ def instance_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new KeywordRestParameterNode node
+ # Create a new InstanceVariableReadNode node.
#
- # source://prism//lib/prism/dsl.rb#496
- def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#467
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::InstanceVariableReadNode)
+ end
+ def instance_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new LambdaNode node
+ # Create a new InstanceVariableTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#501
- def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#472
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::InstanceVariableTargetNode)
+ end
+ def instance_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new LocalVariableAndWriteNode node
+ # Create a new InstanceVariableWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#506
- def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#477
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ value: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::InstanceVariableWriteNode)
+ end
+ def instance_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new LocalVariableOperatorWriteNode node
+ # Retrieve the value of one of the IntegerBaseFlags flags.
#
- # source://prism//lib/prism/dsl.rb#511
- def LocalVariableOperatorWriteNode(name_loc, binary_operator_loc, value, name, binary_operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#872
+ sig { params(name: Symbol).returns(Integer) }
+ def integer_base_flag(name); end
- # Create a new LocalVariableOrWriteNode node
+ # Create a new IntegerNode node.
#
- # source://prism//lib/prism/dsl.rb#516
- def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#482
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Integer
+ ).returns(Prism::IntegerNode)
+ end
+ def integer_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new LocalVariableReadNode node
+ # Create a new InterpolatedMatchLastLineNode node.
#
- # source://prism//lib/prism/dsl.rb#521
- def LocalVariableReadNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#487
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
+ closing_loc: Prism::Location
+ ).returns(Prism::InterpolatedMatchLastLineNode)
+ end
+ def interpolated_match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new LocalVariableTargetNode node
+ # Create a new InterpolatedRegularExpressionNode node.
#
- # source://prism//lib/prism/dsl.rb#526
- def LocalVariableTargetNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#492
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
+ closing_loc: Prism::Location
+ ).returns(Prism::InterpolatedRegularExpressionNode)
+ end
+ def interpolated_regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new LocalVariableWriteNode node
+ # Create a new InterpolatedStringNode node.
#
- # source://prism//lib/prism/dsl.rb#531
- def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
-
- # Create a new Location object
- #
- # source://prism//lib/prism/dsl.rb#46
- def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#497
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: T.nilable(Prism::Location),
+ parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)],
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::InterpolatedStringNode)
+ end
+ def interpolated_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new MatchLastLineNode node
+ # Retrieve the value of one of the InterpolatedStringNodeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#536
- def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#883
+ sig { params(name: Symbol).returns(Integer) }
+ def interpolated_string_node_flag(name); end
- # Create a new MatchPredicateNode node
+ # Create a new InterpolatedSymbolNode node.
#
- # source://prism//lib/prism/dsl.rb#541
- def MatchPredicateNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#502
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: T.nilable(Prism::Location),
+ parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
+ closing_loc: T.nilable(Prism::Location)
+ ).returns(Prism::InterpolatedSymbolNode)
+ end
+ def interpolated_symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new MatchRequiredNode node
+ # Create a new InterpolatedXStringNode node.
#
- # source://prism//lib/prism/dsl.rb#546
- def MatchRequiredNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#507
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
+ closing_loc: Prism::Location
+ ).returns(Prism::InterpolatedXStringNode)
+ end
+ def interpolated_x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new MatchWriteNode node
+ # Create a new ItLocalVariableReadNode node.
#
- # source://prism//lib/prism/dsl.rb#551
- def MatchWriteNode(call, targets, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#512
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::ItLocalVariableReadNode)
+ end
+ def it_local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new MissingNode node
+ # Create a new ItParametersNode node.
#
- # source://prism//lib/prism/dsl.rb#556
- def MissingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#517
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::ItParametersNode)
+ end
+ def it_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new ModuleNode node
+ # Create a new KeywordHashNode node.
#
- # source://prism//lib/prism/dsl.rb#561
- def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#522
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]
+ ).returns(Prism::KeywordHashNode)
+ end
+ def keyword_hash_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end
- # Create a new MultiTargetNode node
+ # Retrieve the value of one of the KeywordHashNodeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#566
- def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#892
+ sig { params(name: Symbol).returns(Integer) }
+ def keyword_hash_node_flag(name); end
- # Create a new MultiWriteNode node
+ # Create a new KeywordRestParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#571
- def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#527
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: T.nilable(Symbol),
+ name_loc: T.nilable(Prism::Location),
+ operator_loc: Prism::Location
+ ).returns(Prism::KeywordRestParameterNode)
+ end
+ def keyword_rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new NextNode node
+ # Create a new LambdaNode node.
#
- # source://prism//lib/prism/dsl.rb#576
- def NextNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#532
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ operator_loc: Prism::Location,
+ opening_loc: Prism::Location,
+ closing_loc: Prism::Location,
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))
+ ).returns(Prism::LambdaNode)
+ end
+ def lambda_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end
- # Create a new NilNode node
+ # Create a new LocalVariableAndWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#581
- def NilNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#537
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableAndWriteNode)
+ end
+ def local_variable_and_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
- # Create a new NoKeywordsParameterNode node
+ # Create a new LocalVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#586
- def NoKeywordsParameterNode(operator_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#542
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name_loc: Prism::Location,
+ binary_operator_loc: Prism::Location,
+ value: Prism::Node,
+ name: Symbol,
+ binary_operator: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableOperatorWriteNode)
+ end
+ def local_variable_operator_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end
- # Create a new NumberedParametersNode node
+ # Create a new LocalVariableOrWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#591
- def NumberedParametersNode(maximum, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#547
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableOrWriteNode)
+ end
+ def local_variable_or_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
- # Create a new NumberedReferenceReadNode node
+ # Create a new LocalVariableReadNode node.
#
- # source://prism//lib/prism/dsl.rb#596
- def NumberedReferenceReadNode(number, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#552
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableReadNode)
+ end
+ def local_variable_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
- # Create a new OptionalKeywordParameterNode node
+ # Create a new LocalVariableTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#601
- def OptionalKeywordParameterNode(flags, name, name_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#557
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableTargetNode)
+ end
+ def local_variable_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
- # Create a new OptionalParameterNode node
+ # Create a new LocalVariableWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#606
- def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#562
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer,
+ name_loc: Prism::Location,
+ value: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::LocalVariableWriteNode)
+ end
+ def local_variable_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new OrNode node
+ # Create a new Location object.
#
- # source://prism//lib/prism/dsl.rb#611
- def OrNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#72
+ sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) }
+ def location(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end
- # Create a new ParametersNode node
+ # Retrieve the value of one of the LoopFlags flags.
#
- # source://prism//lib/prism/dsl.rb#616
- def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#900
+ sig { params(name: Symbol).returns(Integer) }
+ def loop_flag(name); end
- # Create a new ParenthesesNode node
+ # Create a new MatchLastLineNode node.
#
- # source://prism//lib/prism/dsl.rb#621
- def ParenthesesNode(body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#567
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ content_loc: Prism::Location,
+ closing_loc: Prism::Location,
+ unescaped: String
+ ).returns(Prism::MatchLastLineNode)
+ end
+ def match_last_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
- # Create a new PinnedExpressionNode node
+ # Create a new MatchPredicateNode node.
#
- # source://prism//lib/prism/dsl.rb#626
- def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#572
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Prism::Node,
+ pattern: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::MatchPredicateNode)
+ end
+ def match_predicate_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new PinnedVariableNode node
+ # Create a new MatchRequiredNode node.
#
- # source://prism//lib/prism/dsl.rb#631
- def PinnedVariableNode(variable, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#577
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Prism::Node,
+ pattern: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::MatchRequiredNode)
+ end
+ def match_required_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new PostExecutionNode node
+ # Create a new MatchWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#636
- def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#582
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ call: Prism::CallNode,
+ targets: T::Array[Prism::LocalVariableTargetNode]
+ ).returns(Prism::MatchWriteNode)
+ end
+ def match_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end
- # Create a new PreExecutionNode node
+ # Create a new MissingNode node.
#
- # source://prism//lib/prism/dsl.rb#641
- def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#587
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::MissingNode)
+ end
+ def missing_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new ProgramNode node
+ # Create a new ModuleNode node.
#
- # source://prism//lib/prism/dsl.rb#646
- def ProgramNode(locals, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#592
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ module_keyword_loc: Prism::Location,
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ end_keyword_loc: Prism::Location,
+ name: Symbol
+ ).returns(Prism::ModuleNode)
+ end
+ def module_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new RangeNode node
+ # Create a new MultiTargetNode node.
#
- # source://prism//lib/prism/dsl.rb#651
- def RangeNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#597
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ lparen_loc: T.nilable(Prism::Location),
+ rparen_loc: T.nilable(Prism::Location)
+ ).returns(Prism::MultiTargetNode)
+ end
+ def multi_target_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
- # Create a new RationalNode node
+ # Create a new MultiWriteNode node.
#
- # source://prism//lib/prism/dsl.rb#656
- def RationalNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#602
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ lparen_loc: T.nilable(Prism::Location),
+ rparen_loc: T.nilable(Prism::Location),
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::MultiWriteNode)
+ end
+ def multi_write_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new RedoNode node
+ # Create a new NextNode node.
#
- # source://prism//lib/prism/dsl.rb#661
- def RedoNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#607
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ arguments: T.nilable(Prism::ArgumentsNode),
+ keyword_loc: Prism::Location
+ ).returns(Prism::NextNode)
+ end
+ def next_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new RegularExpressionNode node
+ # Create a new NilNode node.
#
- # source://prism//lib/prism/dsl.rb#666
- def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#612
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::NilNode)
+ end
+ def nil_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new RequiredKeywordParameterNode node
+ # Create a new NoKeywordsParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#671
- def RequiredKeywordParameterNode(flags, name, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#617
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ operator_loc: Prism::Location,
+ keyword_loc: Prism::Location
+ ).returns(Prism::NoKeywordsParameterNode)
+ end
+ def no_keywords_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
- # Create a new RequiredParameterNode node
+ # Create a new NumberedParametersNode node.
#
- # source://prism//lib/prism/dsl.rb#676
- def RequiredParameterNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#622
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ maximum: Integer
+ ).returns(Prism::NumberedParametersNode)
+ end
+ def numbered_parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end
- # Create a new RescueModifierNode node
+ # Create a new NumberedReferenceReadNode node.
#
- # source://prism//lib/prism/dsl.rb#681
- def RescueModifierNode(expression, keyword_loc, rescue_expression, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#627
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ number: Integer
+ ).returns(Prism::NumberedReferenceReadNode)
+ end
+ def numbered_reference_read_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end
- # Create a new RescueNode node
+ # Create a new OptionalKeywordParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#686
- def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#632
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::OptionalKeywordParameterNode)
+ end
+ def optional_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new RestParameterNode node
+ # Create a new OptionalParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#691
- def RestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#637
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ value: Prism::Node
+ ).returns(Prism::OptionalParameterNode)
+ end
+ def optional_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
- # Create a new RetryNode node
+ # Create a new OrNode node.
#
- # source://prism//lib/prism/dsl.rb#696
- def RetryNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#642
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ left: Prism::Node,
+ right: Prism::Node,
+ operator_loc: Prism::Location
+ ).returns(Prism::OrNode)
+ end
+ def or_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new ReturnNode node
+ # Retrieve the value of one of the ParameterFlags flags.
#
- # source://prism//lib/prism/dsl.rb#701
- def ReturnNode(flags, keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#908
+ sig { params(name: Symbol).returns(Integer) }
+ def parameter_flag(name); end
- # Create a new SelfNode node
+ # Create a new ParametersNode node.
#
- # source://prism//lib/prism/dsl.rb#706
- def SelfNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#647
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)],
+ optionals: T::Array[Prism::OptionalParameterNode],
+ rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)),
+ posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)],
+ keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)],
+ keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)),
+ block: T.nilable(Prism::BlockParameterNode)
+ ).returns(Prism::ParametersNode)
+ end
+ def parameters_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil)); end
- # Create a new ShareableConstantNode node
+ # Create a new ParenthesesNode node.
#
- # source://prism//lib/prism/dsl.rb#711
- def ShareableConstantNode(flags, write, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#652
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ body: T.nilable(Prism::Node),
+ opening_loc: Prism::Location,
+ closing_loc: Prism::Location
+ ).returns(Prism::ParenthesesNode)
+ end
+ def parentheses_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new SingletonClassNode node
+ # Create a new PinnedExpressionNode node.
#
- # source://prism//lib/prism/dsl.rb#716
- def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#657
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ expression: Prism::Node,
+ operator_loc: Prism::Location,
+ lparen_loc: Prism::Location,
+ rparen_loc: Prism::Location
+ ).returns(Prism::PinnedExpressionNode)
+ end
+ def pinned_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
- # Create a new SourceEncodingNode node
+ # Create a new PinnedVariableNode node.
#
- # source://prism//lib/prism/dsl.rb#721
- def SourceEncodingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#662
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode),
+ operator_loc: Prism::Location
+ ).returns(Prism::PinnedVariableNode)
+ end
+ def pinned_variable_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new SourceFileNode node
+ # Create a new PostExecutionNode node.
#
- # source://prism//lib/prism/dsl.rb#726
- def SourceFileNode(flags, filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#667
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ statements: T.nilable(Prism::StatementsNode),
+ keyword_loc: Prism::Location,
+ opening_loc: Prism::Location,
+ closing_loc: Prism::Location
+ ).returns(Prism::PostExecutionNode)
+ end
+ def post_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new SourceLineNode node
+ # Create a new PreExecutionNode node.
#
- # source://prism//lib/prism/dsl.rb#731
- def SourceLineNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#672
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ statements: T.nilable(Prism::StatementsNode),
+ keyword_loc: Prism::Location,
+ opening_loc: Prism::Location,
+ closing_loc: Prism::Location
+ ).returns(Prism::PreExecutionNode)
+ end
+ def pre_execution_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
- # Create a new SplatNode node
+ # Create a new ProgramNode node.
#
- # source://prism//lib/prism/dsl.rb#736
- def SplatNode(operator_loc, expression, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#677
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ statements: Prism::StatementsNode
+ ).returns(Prism::ProgramNode)
+ end
+ def program_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end
- # Create a new StatementsNode node
+ # Retrieve the value of one of the RangeFlags flags.
#
- # source://prism//lib/prism/dsl.rb#741
- def StatementsNode(body, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#916
+ sig { params(name: Symbol).returns(Integer) }
+ def range_flag(name); end
- # Create a new StringNode node
+ # Create a new RangeNode node.
#
- # source://prism//lib/prism/dsl.rb#746
- def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#682
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ left: T.nilable(Prism::Node),
+ right: T.nilable(Prism::Node),
+ operator_loc: Prism::Location
+ ).returns(Prism::RangeNode)
+ end
+ def range_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new SuperNode node
+ # Create a new RationalNode node.
#
- # source://prism//lib/prism/dsl.rb#751
- def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#687
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numerator: Integer,
+ denominator: Integer
+ ).returns(Prism::RationalNode)
+ end
+ def rational_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end
- # Create a new SymbolNode node
+ # Create a new RedoNode node.
#
- # source://prism//lib/prism/dsl.rb#756
- def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#692
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::RedoNode)
+ end
+ def redo_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Create a new TrueNode node
+ # Retrieve the value of one of the RegularExpressionFlags flags.
#
- # source://prism//lib/prism/dsl.rb#761
- def TrueNode(source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#924
+ sig { params(name: Symbol).returns(Integer) }
+ def regular_expression_flag(name); end
- # Create a new UndefNode node
+ # Create a new RegularExpressionNode node.
#
- # source://prism//lib/prism/dsl.rb#766
- def UndefNode(names, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#697
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ content_loc: Prism::Location,
+ closing_loc: Prism::Location,
+ unescaped: String
+ ).returns(Prism::RegularExpressionNode)
+ end
+ def regular_expression_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
- # Create a new UnlessNode node
+ # Create a new RequiredKeywordParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#771
- def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#702
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location
+ ).returns(Prism::RequiredKeywordParameterNode)
+ end
+ def required_keyword_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end
- # Create a new UntilNode node
+ # Create a new RequiredParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#776
- def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#707
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::RequiredParameterNode)
+ end
+ def required_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
- # Create a new WhenNode node
+ # Create a new RescueModifierNode node.
#
- # source://prism//lib/prism/dsl.rb#781
- def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#712
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ expression: Prism::Node,
+ keyword_loc: Prism::Location,
+ rescue_expression: Prism::Node
+ ).returns(Prism::RescueModifierNode)
+ end
+ def rescue_modifier_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end
- # Create a new WhileNode node
+ # Create a new RescueNode node.
#
- # source://prism//lib/prism/dsl.rb#786
- def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#717
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ exceptions: T::Array[Prism::Node],
+ operator_loc: T.nilable(Prism::Location),
+ reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)),
+ statements: T.nilable(Prism::StatementsNode),
+ subsequent: T.nilable(Prism::RescueNode)
+ ).returns(Prism::RescueNode)
+ end
+ def rescue_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end
- # Create a new XStringNode node
+ # Create a new RestParameterNode node.
#
- # source://prism//lib/prism/dsl.rb#791
- def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end
+ # source://prism//lib/prism/dsl.rb#722
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: T.nilable(Symbol),
+ name_loc: T.nilable(Prism::Location),
+ operator_loc: Prism::Location
+ ).returns(Prism::RestParameterNode)
+ end
+ def rest_parameter_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
- # Create a new YieldNode node
+ # Create a new RetryNode node.
#
- # source://prism//lib/prism/dsl.rb#796
- def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end
-end
-
-# This module is used for testing and debugging and is not meant to be used by
-# consumers of this library.
-#
-# source://prism//lib/prism/debug.rb#6
-module Prism::Debug
- class << self
- # :call-seq:
- # Debug::cruby_locals(source) -> Array
- #
- # For the given source, compiles with CRuby and returns a list of all of the
- # sets of local variables that were encountered.
- #
- # source://prism//lib/prism/debug.rb#54
- def cruby_locals(source); end
-
- def format_errors(_arg0, _arg1); end
- def inspect_node(_arg0); end
- def integer_parse(_arg0); end
- def memsize(_arg0); end
- def named_captures(_arg0); end
-
- # :call-seq:
- # Debug::newlines(source) -> Array
- #
- # For the given source string, return the byte offsets of every newline in
- # the source.
- #
- # source://prism//lib/prism/debug.rb#202
- def newlines(source); end
-
- # :call-seq:
- # Debug::prism_locals(source) -> Array
- #
- # For the given source, parses with prism and returns a list of all of the
- # sets of local variables that were encountered.
- #
- # source://prism//lib/prism/debug.rb#98
- def prism_locals(source); end
-
- def profile_file(_arg0); end
- def static_inspect(*_arg0); end
+ # source://prism//lib/prism/dsl.rb#727
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::RetryNode)
end
-end
+ def retry_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
-# Used to hold the place of a local that will be in the local table but
-# cannot be accessed directly from the source code. For example, the
-# iteration variable in a for loop or the positional parameter on a method
-# definition that is destructured.
-#
-# source://prism//lib/prism/debug.rb#90
-Prism::Debug::AnonymousLocal = T.let(T.unsafe(nil), Object)
-
-# A wrapping around prism's internal encoding data structures. This is used
-# for reflection and debugging purposes.
-#
-# source://prism//lib/prism/debug.rb#208
-class Prism::Debug::Encoding
- # Initialize a new encoding with the given name and whether or not it is
- # a multibyte encoding.
- #
- # @return [Encoding] a new instance of Encoding
+ # Create a new ReturnNode node.
#
- # source://prism//lib/prism/debug.rb#214
- def initialize(name, multibyte); end
+ # source://prism//lib/prism/dsl.rb#732
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ arguments: T.nilable(Prism::ArgumentsNode)
+ ).returns(Prism::ReturnNode)
+ end
+ def return_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end
- # Returns true if the first character in the source string is a valid
- # alphanumeric character for the encoding.
- #
- # @return [Boolean]
+ # Create a new SelfNode node.
#
- # source://prism//lib/prism/debug.rb#232
- def alnum?(source); end
+ # source://prism//lib/prism/dsl.rb#737
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::SelfNode)
+ end
+ def self_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Returns true if the first character in the source string is a valid
- # alphabetic character for the encoding.
- #
- # @return [Boolean]
+ # Create a new ShareableConstantNode node.
#
- # source://prism//lib/prism/debug.rb#238
- def alpha?(source); end
+ # source://prism//lib/prism/dsl.rb#742
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode)
+ ).returns(Prism::ShareableConstantNode)
+ end
+ def shareable_constant_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end
- # Whether or not the encoding is a multibyte encoding.
- #
- # @return [Boolean]
+ # Retrieve the value of one of the ShareableConstantNodeFlags flags.
#
- # source://prism//lib/prism/debug.rb#220
- def multibyte?; end
+ # source://prism//lib/prism/dsl.rb#942
+ sig { params(name: Symbol).returns(Integer) }
+ def shareable_constant_node_flag(name); end
- # The name of the encoding, that can be passed to Encoding.find.
+ # Create a new SingletonClassNode node.
#
- # source://prism//lib/prism/debug.rb#210
- def name; end
+ # source://prism//lib/prism/dsl.rb#747
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ locals: T::Array[Symbol],
+ class_keyword_loc: Prism::Location,
+ operator_loc: Prism::Location,
+ expression: Prism::Node,
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ end_keyword_loc: Prism::Location
+ ).returns(Prism::SingletonClassNode)
+ end
+ def singleton_class_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
- # Returns true if the first character in the source string is a valid
- # uppercase character for the encoding.
- #
- # @return [Boolean]
+ # Create a new Source object.
#
- # source://prism//lib/prism/debug.rb#244
- def upper?(source); end
+ # source://prism//lib/prism/dsl.rb#67
+ sig { params(string: String).returns(Prism::Source) }
+ def source(string); end
- # Returns the number of bytes of the first character in the source string,
- # if it is valid for the encoding. Otherwise, returns 0.
+ # Create a new SourceEncodingNode node.
#
- # source://prism//lib/prism/debug.rb#226
- def width(source); end
-
- class << self
- def _alnum?(_arg0, _arg1); end
- def _alpha?(_arg0, _arg1); end
- def _upper?(_arg0, _arg1); end
- def _width(_arg0, _arg1); end
- def all; end
+ # source://prism//lib/prism/dsl.rb#752
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::SourceEncodingNode)
end
-end
+ def source_encoding_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
-# A wrapper around a RubyVM::InstructionSequence that provides a more
-# convenient interface for accessing parts of the iseq.
-#
-# source://prism//lib/prism/debug.rb#9
-class Prism::Debug::ISeq
- # @return [ISeq] a new instance of ISeq
+ # Create a new SourceFileNode node.
#
- # source://prism//lib/prism/debug.rb#12
- def initialize(parts); end
-
- # source://prism//lib/prism/debug.rb#28
- def each_child; end
-
- # source://prism//lib/prism/debug.rb#24
- def instructions; end
-
- # source://prism//lib/prism/debug.rb#20
- def local_table; end
-
- # source://prism//lib/prism/debug.rb#10
- def parts; end
-
- # source://prism//lib/prism/debug.rb#16
- def type; end
-end
+ # source://prism//lib/prism/dsl.rb#757
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ filepath: String
+ ).returns(Prism::SourceFileNode)
+ end
+ def source_file_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end
-# Represents a method definition.
-#
-# def method
-# end
-# ^^^^^^^^^^
-#
-# source://prism//lib/prism/node.rb#5853
-class Prism::DefNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Prism::node? receiver, ParametersNode? parameters, Prism::node? body, Array[Symbol] locals, Location def_keyword_loc, Location? operator_loc, Location? lparen_loc, Location? rparen_loc, Location? equal_loc, Location? end_keyword_loc, Location location) -> void
- #
- # @return [DefNode] a new instance of DefNode
+ # Create a new SourceLineNode node.
#
- # source://prism//lib/prism/node.rb#5855
+ # source://prism//lib/prism/dsl.rb#762
sig do
params(
source: Prism::Source,
- name: Symbol,
- name_loc: Prism::Location,
- receiver: T.nilable(Prism::Node),
- parameters: T.nilable(Prism::ParametersNode),
- body: T.nilable(Prism::Node),
- locals: T::Array[Symbol],
- def_keyword_loc: Prism::Location,
- operator_loc: T.nilable(Prism::Location),
- lparen_loc: T.nilable(Prism::Location),
- rparen_loc: T.nilable(Prism::Location),
- equal_loc: T.nilable(Prism::Location),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
- ).void
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::SourceLineNode)
end
- def initialize(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end
+ def source_line_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
- # Implements case-equality for the node. This is effectively == but without
- # comparing the value of locations. Locations are checked only for presence.
+ # Create a new SplatNode node.
#
- # source://prism//lib/prism/node.rb#6069
- def ===(other); end
+ # source://prism//lib/prism/dsl.rb#767
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ operator_loc: Prism::Location,
+ expression: T.nilable(Prism::Node)
+ ).returns(Prism::SplatNode)
+ end
+ def splat_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end
- # def accept: (Visitor visitor) -> void
+ # Create a new StatementsNode node.
#
- # source://prism//lib/prism/node.rb#5874
- sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
- def accept(visitor); end
+ # source://prism//lib/prism/dsl.rb#772
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ body: T::Array[Prism::Node]
+ ).returns(Prism::StatementsNode)
+ end
+ def statements_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end
- # attr_reader body: Prism::node?
+ # Retrieve the value of one of the StringFlags flags.
#
- # source://prism//lib/prism/node.rb#5927
- sig { returns(T.nilable(Prism::Node)) }
- def body; end
+ # source://prism//lib/prism/dsl.rb#952
+ sig { params(name: Symbol).returns(Integer) }
+ def string_flag(name); end
- # def child_nodes: () -> Array[nil | Node]
+ # Create a new StringNode node.
#
- # source://prism//lib/prism/node.rb#5879
- sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
- def child_nodes; end
+ # source://prism//lib/prism/dsl.rb#777
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: T.nilable(Prism::Location),
+ content_loc: Prism::Location,
+ closing_loc: T.nilable(Prism::Location),
+ unescaped: String
+ ).returns(Prism::StringNode)
+ end
+ def string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
- # def comment_targets: () -> Array[Node | Location]
+ # Create a new SuperNode node.
#
- # source://prism//lib/prism/node.rb#5893
- sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
- def comment_targets; end
+ # source://prism//lib/prism/dsl.rb#782
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ lparen_loc: T.nilable(Prism::Location),
+ arguments: T.nilable(Prism::ArgumentsNode),
+ rparen_loc: T.nilable(Prism::Location),
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
+ ).returns(Prism::SuperNode)
+ end
+ def super_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end
- # def compact_child_nodes: () -> Array[Node]
+ # Retrieve the value of one of the SymbolFlags flags.
#
- # source://prism//lib/prism/node.rb#5884
- sig { override.returns(T::Array[Prism::Node]) }
- def compact_child_nodes; end
+ # source://prism//lib/prism/dsl.rb#963
+ sig { params(name: Symbol).returns(Integer) }
+ def symbol_flag(name); end
- # def copy: (?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: Prism::node?, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?, ?location: Location) -> DefNode
+ # Create a new SymbolNode node.
#
- # source://prism//lib/prism/node.rb#5898
+ # source://prism//lib/prism/dsl.rb#787
sig do
params(
- name: Symbol,
- name_loc: Prism::Location,
- receiver: T.nilable(Prism::Node),
- parameters: T.nilable(Prism::ParametersNode),
- body: T.nilable(Prism::Node),
- locals: T::Array[Symbol],
- def_keyword_loc: Prism::Location,
- operator_loc: T.nilable(Prism::Location),
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: T.nilable(Prism::Location),
+ value_loc: T.nilable(Prism::Location),
+ closing_loc: T.nilable(Prism::Location),
+ unescaped: String
+ ).returns(Prism::SymbolNode)
+ end
+ def symbol_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
+
+ # Create a new TrueNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#792
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer
+ ).returns(Prism::TrueNode)
+ end
+ def true_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
+
+ # Create a new UndefNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#797
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)],
+ keyword_loc: Prism::Location
+ ).returns(Prism::UndefNode)
+ end
+ def undef_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
+
+ # Create a new UnlessNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#802
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ predicate: Prism::Node,
+ then_keyword_loc: T.nilable(Prism::Location),
+ statements: T.nilable(Prism::StatementsNode),
+ else_clause: T.nilable(Prism::ElseNode),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).returns(Prism::UnlessNode)
+ end
+ def unless_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
+
+ # Create a new UntilNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#807
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ closing_loc: T.nilable(Prism::Location),
+ predicate: Prism::Node,
+ statements: T.nilable(Prism::StatementsNode)
+ ).returns(Prism::UntilNode)
+ end
+ def until_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end
+
+ # Create a new WhenNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#812
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ conditions: T::Array[Prism::Node],
+ then_keyword_loc: T.nilable(Prism::Location),
+ statements: T.nilable(Prism::StatementsNode)
+ ).returns(Prism::WhenNode)
+ end
+ def when_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end
+
+ # Create a new WhileNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#817
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ closing_loc: T.nilable(Prism::Location),
+ predicate: Prism::Node,
+ statements: T.nilable(Prism::StatementsNode)
+ ).returns(Prism::WhileNode)
+ end
+ def while_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end
+
+ # Create a new XStringNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#822
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ opening_loc: Prism::Location,
+ content_loc: Prism::Location,
+ closing_loc: Prism::Location,
+ unescaped: String
+ ).returns(Prism::XStringNode)
+ end
+ def x_string_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
+
+ # Create a new YieldNode node.
+ #
+ # source://prism//lib/prism/dsl.rb#827
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ keyword_loc: Prism::Location,
+ lparen_loc: T.nilable(Prism::Location),
+ arguments: T.nilable(Prism::ArgumentsNode),
+ rparen_loc: T.nilable(Prism::Location)
+ ).returns(Prism::YieldNode)
+ end
+ def yield_node(source: T.unsafe(nil), node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
+
+ private
+
+ # The default location object that gets attached to nodes if no location is
+ # specified, which uses the given source.
+ #
+ # source://prism//lib/prism/dsl.rb#982
+ sig { returns(Prism::Location) }
+ def default_location; end
+
+ # The default node that gets attached to nodes if no node is specified for a
+ # required node field.
+ #
+ # source://prism//lib/prism/dsl.rb#988
+ sig { params(source: Prism::Source, location: Prism::Location).returns(Prism::Node) }
+ def default_node(source, location); end
+
+ # The default source object that gets attached to nodes and locations if no
+ # source is specified.
+ #
+ # source://prism//lib/prism/dsl.rb#976
+ sig { returns(Prism::Source) }
+ def default_source; end
+end
+
+# Represents a method definition.
+#
+# def method
+# end
+# ^^^^^^^^^^
+#
+# source://prism//lib/prism/node.rb#5137
+class Prism::DefNode < ::Prism::Node
+ # Initialize a new DefNode node.
+ #
+ # @return [DefNode] a new instance of DefNode
+ #
+ # source://prism//lib/prism/node.rb#5139
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ receiver: T.nilable(Prism::Node),
+ parameters: T.nilable(Prism::ParametersNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ locals: T::Array[Symbol],
+ def_keyword_loc: Prism::Location,
+ operator_loc: T.nilable(Prism::Location),
+ lparen_loc: T.nilable(Prism::Location),
+ rparen_loc: T.nilable(Prism::Location),
+ equal_loc: T.nilable(Prism::Location),
+ end_keyword_loc: T.nilable(Prism::Location)
+ ).void
+ end
+ def initialize(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc); end
+
+ # Implements case-equality for the node. This is effectively == but without
+ # comparing the value of locations. Locations are checked only for presence.
+ #
+ # source://prism//lib/prism/node.rb#5336
+ def ===(other); end
+
+ # def accept: (Visitor visitor) -> void
+ #
+ # source://prism//lib/prism/node.rb#5159
+ sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
+ def accept(visitor); end
+
+ # attr_reader body: StatementsNode | BeginNode | nil
+ #
+ # source://prism//lib/prism/node.rb#5212
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
+ def body; end
+
+ # def child_nodes: () -> Array[nil | Node]
+ #
+ # source://prism//lib/prism/node.rb#5164
+ sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
+ def child_nodes; end
+
+ # def comment_targets: () -> Array[Node | Location]
+ #
+ # source://prism//lib/prism/node.rb#5178
+ sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
+ def comment_targets; end
+
+ # def compact_child_nodes: () -> Array[Node]
+ #
+ # source://prism//lib/prism/node.rb#5169
+ sig { override.returns(T::Array[Prism::Node]) }
+ def compact_child_nodes; end
+
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?receiver: Prism::node?, ?parameters: ParametersNode?, ?body: StatementsNode | BeginNode | nil, ?locals: Array[Symbol], ?def_keyword_loc: Location, ?operator_loc: Location?, ?lparen_loc: Location?, ?rparen_loc: Location?, ?equal_loc: Location?, ?end_keyword_loc: Location?) -> DefNode
+ #
+ # source://prism//lib/prism/node.rb#5183
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ name_loc: Prism::Location,
+ receiver: T.nilable(Prism::Node),
+ parameters: T.nilable(Prism::ParametersNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ locals: T::Array[Symbol],
+ def_keyword_loc: Prism::Location,
+ operator_loc: T.nilable(Prism::Location),
lparen_loc: T.nilable(Prism::Location),
rparen_loc: T.nilable(Prism::Location),
equal_loc: T.nilable(Prism::Location),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ end_keyword_loc: T.nilable(Prism::Location)
).returns(Prism::DefNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), receiver: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), locals: T.unsafe(nil), def_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), equal_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#5879
+ # source://prism//lib/prism/node.rb#5164
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: Prism::node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, receiver: Prism::node?, parameters: ParametersNode?, body: StatementsNode | BeginNode | nil, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location? }
#
- # source://prism//lib/prism/node.rb#5906
+ # source://prism//lib/prism/node.rb#5191
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def def_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#6005
+ # source://prism//lib/prism/node.rb#5290
sig { returns(String) }
def def_keyword; end
# attr_reader def_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#5933
+ # source://prism//lib/prism/node.rb#5218
sig { returns(Prism::Location) }
def def_keyword_loc; end
# def end_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#6030
+ # source://prism//lib/prism/node.rb#5315
sig { returns(T.nilable(String)) }
def end_keyword; end
# attr_reader end_keyword_loc: Location?
#
- # source://prism//lib/prism/node.rb#5992
+ # source://prism//lib/prism/node.rb#5277
sig { returns(T.nilable(Prism::Location)) }
def end_keyword_loc; end
# def equal: () -> String?
#
- # source://prism//lib/prism/node.rb#6025
+ # source://prism//lib/prism/node.rb#5310
sig { returns(T.nilable(String)) }
def equal; end
# attr_reader equal_loc: Location?
#
- # source://prism//lib/prism/node.rb#5979
+ # source://prism//lib/prism/node.rb#5264
sig { returns(T.nilable(Prism::Location)) }
def equal_loc; end
@@ -9551,104 +10740,86 @@ class Prism::DefNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6035
+ # source://prism//lib/prism/node.rb#5320
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#5930
+ # source://prism//lib/prism/node.rb#5215
sig { returns(T::Array[Symbol]) }
def locals; end
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#6015
+ # source://prism//lib/prism/node.rb#5300
sig { returns(T.nilable(String)) }
def lparen; end
# attr_reader lparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#5953
+ # source://prism//lib/prism/node.rb#5238
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#5911
+ # source://prism//lib/prism/node.rb#5196
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#5914
+ # source://prism//lib/prism/node.rb#5199
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String?
#
- # source://prism//lib/prism/node.rb#6010
+ # source://prism//lib/prism/node.rb#5295
sig { returns(T.nilable(String)) }
def operator; end
# attr_reader operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#5940
+ # source://prism//lib/prism/node.rb#5225
sig { returns(T.nilable(Prism::Location)) }
def operator_loc; end
# attr_reader parameters: ParametersNode?
#
- # source://prism//lib/prism/node.rb#5924
+ # source://prism//lib/prism/node.rb#5209
sig { returns(T.nilable(Prism::ParametersNode)) }
def parameters; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#5921
+ # source://prism//lib/prism/node.rb#5206
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#6020
+ # source://prism//lib/prism/node.rb#5305
sig { returns(T.nilable(String)) }
def rparen; end
# attr_reader rparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#5966
+ # source://prism//lib/prism/node.rb#5251
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#6053
+ # source://prism//lib/prism/node.rb#5325
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6063
+ # source://prism//lib/prism/node.rb#5330
def type; end
end
end
@@ -9658,79 +10829,83 @@ end
# defined?(a)
# ^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#6091
+# source://prism//lib/prism/node.rb#5358
class Prism::DefinedNode < ::Prism::Node
- # def initialize: (Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc, Location location) -> void
+ # Initialize a new DefinedNode node.
#
# @return [DefinedNode] a new instance of DefinedNode
#
- # source://prism//lib/prism/node.rb#6093
+ # source://prism//lib/prism/node.rb#5360
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
lparen_loc: T.nilable(Prism::Location),
value: Prism::Node,
rparen_loc: T.nilable(Prism::Location),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, lparen_loc, value, rparen_loc, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6222
+ # source://prism//lib/prism/node.rb#5472
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6104
+ # source://prism//lib/prism/node.rb#5372
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6109
+ # source://prism//lib/prism/node.rb#5377
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6119
+ # source://prism//lib/prism/node.rb#5387
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6114
+ # source://prism//lib/prism/node.rb#5382
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location, ?location: Location) -> DefinedNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location) -> DefinedNode
#
- # source://prism//lib/prism/node.rb#6124
+ # source://prism//lib/prism/node.rb#5392
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
lparen_loc: T.nilable(Prism::Location),
value: Prism::Node,
rparen_loc: T.nilable(Prism::Location),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).returns(Prism::DefinedNode)
end
- def copy(lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lparen_loc: T.unsafe(nil), value: T.unsafe(nil), rparen_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6109
+ # source://prism//lib/prism/node.rb#5377
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#6132
+ # source://prism//lib/prism/node.rb#5400
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -9739,126 +10914,110 @@ class Prism::DefinedNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6188
+ # source://prism//lib/prism/node.rb#5456
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#6183
+ # source://prism//lib/prism/node.rb#5451
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#6166
+ # source://prism//lib/prism/node.rb#5434
sig { returns(Prism::Location) }
def keyword_loc; end
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#6173
+ # source://prism//lib/prism/node.rb#5441
sig { returns(T.nilable(String)) }
def lparen; end
# attr_reader lparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#6137
+ # source://prism//lib/prism/node.rb#5405
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#6178
+ # source://prism//lib/prism/node.rb#5446
sig { returns(T.nilable(String)) }
def rparen; end
# attr_reader rparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#6153
+ # source://prism//lib/prism/node.rb#5421
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6206
+ # source://prism//lib/prism/node.rb#5461
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#6150
+ # source://prism//lib/prism/node.rb#5418
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#6216
+ # source://prism//lib/prism/node.rb#5466
def type; end
end
end
# source://prism//lib/prism/desugar_compiler.rb#4
class Prism::DesugarAndWriteNode
+ include ::Prism::DSL
+
# @return [DesugarAndWriteNode] a new instance of DesugarAndWriteNode
#
- # source://prism//lib/prism/desugar_compiler.rb#7
- def initialize(node, source, read_class, write_class, *arguments); end
+ # source://prism//lib/prism/desugar_compiler.rb#9
+ def initialize(node, default_source, read_class, write_class, **arguments); end
# Returns the value of attribute arguments.
#
- # source://prism//lib/prism/desugar_compiler.rb#5
+ # source://prism//lib/prism/desugar_compiler.rb#7
def arguments; end
# Desugar `x &&= y` to `x && x = y`
#
- # source://prism//lib/prism/desugar_compiler.rb#16
+ # source://prism//lib/prism/desugar_compiler.rb#18
def compile; end
+ # Returns the value of attribute default_source.
+ #
+ # source://prism//lib/prism/desugar_compiler.rb#7
+ def default_source; end
+
# Returns the value of attribute node.
#
- # source://prism//lib/prism/desugar_compiler.rb#5
+ # source://prism//lib/prism/desugar_compiler.rb#7
def node; end
# Returns the value of attribute read_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#5
+ # source://prism//lib/prism/desugar_compiler.rb#7
def read_class; end
- # Returns the value of attribute source.
- #
- # source://prism//lib/prism/desugar_compiler.rb#5
- def source; end
-
# Returns the value of attribute write_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#5
+ # source://prism//lib/prism/desugar_compiler.rb#7
def write_class; end
end
# DesugarCompiler is a compiler that desugars Ruby code into a more primitive
# form. This is useful for consumers that want to deal with fewer node types.
#
-# source://prism//lib/prism/desugar_compiler.rb#218
+# source://prism//lib/prism/desugar_compiler.rb#255
class Prism::DesugarCompiler < ::Prism::MutationCompiler
# @@foo &&= bar
#
@@ -9866,7 +11025,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# @@foo && @@foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#224
+ # source://prism//lib/prism/desugar_compiler.rb#261
def visit_class_variable_and_write_node(node); end
# @@foo += bar
@@ -9875,7 +11034,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# @@foo = @@foo + bar
#
- # source://prism//lib/prism/desugar_compiler.rb#242
+ # source://prism//lib/prism/desugar_compiler.rb#279
def visit_class_variable_operator_write_node(node); end
# @@foo ||= bar
@@ -9884,7 +11043,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# defined?(@@foo) ? @@foo : @@foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#233
+ # source://prism//lib/prism/desugar_compiler.rb#270
def visit_class_variable_or_write_node(node); end
# Foo &&= bar
@@ -9893,7 +11052,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# Foo && Foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#251
+ # source://prism//lib/prism/desugar_compiler.rb#288
def visit_constant_and_write_node(node); end
# Foo += bar
@@ -9902,7 +11061,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# Foo = Foo + bar
#
- # source://prism//lib/prism/desugar_compiler.rb#269
+ # source://prism//lib/prism/desugar_compiler.rb#306
def visit_constant_operator_write_node(node); end
# Foo ||= bar
@@ -9911,7 +11070,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# defined?(Foo) ? Foo : Foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#260
+ # source://prism//lib/prism/desugar_compiler.rb#297
def visit_constant_or_write_node(node); end
# $foo &&= bar
@@ -9920,7 +11079,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# $foo && $foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#278
+ # source://prism//lib/prism/desugar_compiler.rb#315
def visit_global_variable_and_write_node(node); end
# $foo += bar
@@ -9929,7 +11088,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# $foo = $foo + bar
#
- # source://prism//lib/prism/desugar_compiler.rb#296
+ # source://prism//lib/prism/desugar_compiler.rb#333
def visit_global_variable_operator_write_node(node); end
# $foo ||= bar
@@ -9938,22 +11097,22 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# defined?($foo) ? $foo : $foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#287
+ # source://prism//lib/prism/desugar_compiler.rb#324
def visit_global_variable_or_write_node(node); end
# becomes
#
- # source://prism//lib/prism/desugar_compiler.rb#305
+ # source://prism//lib/prism/desugar_compiler.rb#342
def visit_instance_variable_and_write_node(node); end
# becomes
#
- # source://prism//lib/prism/desugar_compiler.rb#323
+ # source://prism//lib/prism/desugar_compiler.rb#360
def visit_instance_variable_operator_write_node(node); end
# becomes
#
- # source://prism//lib/prism/desugar_compiler.rb#314
+ # source://prism//lib/prism/desugar_compiler.rb#351
def visit_instance_variable_or_write_node(node); end
# foo &&= bar
@@ -9962,7 +11121,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# foo && foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#332
+ # source://prism//lib/prism/desugar_compiler.rb#369
def visit_local_variable_and_write_node(node); end
# foo += bar
@@ -9971,7 +11130,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# foo = foo + bar
#
- # source://prism//lib/prism/desugar_compiler.rb#350
+ # source://prism//lib/prism/desugar_compiler.rb#387
def visit_local_variable_operator_write_node(node); end
# foo ||= bar
@@ -9980,121 +11139,127 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler
#
# foo || foo = bar
#
- # source://prism//lib/prism/desugar_compiler.rb#341
+ # source://prism//lib/prism/desugar_compiler.rb#378
def visit_local_variable_or_write_node(node); end
end
-# source://prism//lib/prism/desugar_compiler.rb#63
+# source://prism//lib/prism/desugar_compiler.rb#86
class Prism::DesugarOperatorWriteNode
+ include ::Prism::DSL
+
# @return [DesugarOperatorWriteNode] a new instance of DesugarOperatorWriteNode
#
- # source://prism//lib/prism/desugar_compiler.rb#66
- def initialize(node, source, read_class, write_class, *arguments); end
+ # source://prism//lib/prism/desugar_compiler.rb#91
+ def initialize(node, default_source, read_class, write_class, **arguments); end
# Returns the value of attribute arguments.
#
- # source://prism//lib/prism/desugar_compiler.rb#64
+ # source://prism//lib/prism/desugar_compiler.rb#89
def arguments; end
# Desugar `x += y` to `x = x + y`
#
- # source://prism//lib/prism/desugar_compiler.rb#75
+ # source://prism//lib/prism/desugar_compiler.rb#100
def compile; end
+ # Returns the value of attribute default_source.
+ #
+ # source://prism//lib/prism/desugar_compiler.rb#89
+ def default_source; end
+
# Returns the value of attribute node.
#
- # source://prism//lib/prism/desugar_compiler.rb#64
+ # source://prism//lib/prism/desugar_compiler.rb#89
def node; end
# Returns the value of attribute read_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#64
+ # source://prism//lib/prism/desugar_compiler.rb#89
def read_class; end
- # Returns the value of attribute source.
- #
- # source://prism//lib/prism/desugar_compiler.rb#64
- def source; end
-
# Returns the value of attribute write_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#64
+ # source://prism//lib/prism/desugar_compiler.rb#89
def write_class; end
end
-# source://prism//lib/prism/desugar_compiler.rb#27
+# source://prism//lib/prism/desugar_compiler.rb#35
class Prism::DesugarOrWriteDefinedNode
+ include ::Prism::DSL
+
# @return [DesugarOrWriteDefinedNode] a new instance of DesugarOrWriteDefinedNode
#
- # source://prism//lib/prism/desugar_compiler.rb#30
- def initialize(node, source, read_class, write_class, *arguments); end
+ # source://prism//lib/prism/desugar_compiler.rb#40
+ def initialize(node, default_source, read_class, write_class, **arguments); end
# Returns the value of attribute arguments.
#
- # source://prism//lib/prism/desugar_compiler.rb#28
+ # source://prism//lib/prism/desugar_compiler.rb#38
def arguments; end
# Desugar `x ||= y` to `defined?(x) ? x : x = y`
#
- # source://prism//lib/prism/desugar_compiler.rb#39
+ # source://prism//lib/prism/desugar_compiler.rb#49
def compile; end
+ # Returns the value of attribute default_source.
+ #
+ # source://prism//lib/prism/desugar_compiler.rb#38
+ def default_source; end
+
# Returns the value of attribute node.
#
- # source://prism//lib/prism/desugar_compiler.rb#28
+ # source://prism//lib/prism/desugar_compiler.rb#38
def node; end
# Returns the value of attribute read_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#28
+ # source://prism//lib/prism/desugar_compiler.rb#38
def read_class; end
- # Returns the value of attribute source.
- #
- # source://prism//lib/prism/desugar_compiler.rb#28
- def source; end
-
# Returns the value of attribute write_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#28
+ # source://prism//lib/prism/desugar_compiler.rb#38
def write_class; end
end
-# source://prism//lib/prism/desugar_compiler.rb#101
+# source://prism//lib/prism/desugar_compiler.rb#130
class Prism::DesugarOrWriteNode
+ include ::Prism::DSL
+
# @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode
#
- # source://prism//lib/prism/desugar_compiler.rb#104
- def initialize(node, source, read_class, write_class, *arguments); end
+ # source://prism//lib/prism/desugar_compiler.rb#135
+ def initialize(node, default_source, read_class, write_class, **arguments); end
# Returns the value of attribute arguments.
#
- # source://prism//lib/prism/desugar_compiler.rb#102
+ # source://prism//lib/prism/desugar_compiler.rb#133
def arguments; end
# Desugar `x ||= y` to `x || x = y`
#
- # source://prism//lib/prism/desugar_compiler.rb#113
+ # source://prism//lib/prism/desugar_compiler.rb#144
def compile; end
+ # Returns the value of attribute default_source.
+ #
+ # source://prism//lib/prism/desugar_compiler.rb#133
+ def default_source; end
+
# Returns the value of attribute node.
#
- # source://prism//lib/prism/desugar_compiler.rb#102
+ # source://prism//lib/prism/desugar_compiler.rb#133
def node; end
# Returns the value of attribute read_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#102
+ # source://prism//lib/prism/desugar_compiler.rb#133
def read_class; end
- # Returns the value of attribute source.
- #
- # source://prism//lib/prism/desugar_compiler.rb#102
- def source; end
-
# Returns the value of attribute write_class.
#
- # source://prism//lib/prism/desugar_compiler.rb#102
+ # source://prism//lib/prism/desugar_compiler.rb#133
def write_class; end
end
@@ -10113,7 +11278,8 @@ end
# end
# end
#
-# dispatcher = Dispatcher.new
+# listener = OctalListener.new
+# dispatcher = Prism::Dispatcher.new
# dispatcher.register(listener, :on_integer_node_enter)
#
# Then, you can walk any number of trees and dispatch events to the listeners:
@@ -10129,13 +11295,13 @@ end
# integer = result.value.statements.body.first.receiver.receiver
# dispatcher.dispatch_once(integer)
#
-# source://prism//lib/prism/dispatcher.rb#41
+# source://prism//lib/prism/dispatcher.rb#42
class Prism::Dispatcher < ::Prism::Visitor
# Initialize a new dispatcher.
#
# @return [Dispatcher] a new instance of Dispatcher
#
- # source://prism//lib/prism/dispatcher.rb#46
+ # source://prism//lib/prism/dispatcher.rb#47
def initialize; end
# Walks `root` dispatching events to all registered listeners.
@@ -10149,1682 +11315,1693 @@ class Prism::Dispatcher < ::Prism::Visitor
#
# def dispatch_once: (Node) -> void
#
- # source://prism//lib/prism/dispatcher.rb#65
+ # source://prism//lib/prism/dispatcher.rb#66
def dispatch_once(node); end
# attr_reader listeners: Hash[Symbol, Array[Listener]]
#
- # source://prism//lib/prism/dispatcher.rb#43
+ # source://prism//lib/prism/dispatcher.rb#44
def listeners; end
# Register a listener for one or more events.
#
# def register: (Listener, *Symbol) -> void
#
- # source://prism//lib/prism/dispatcher.rb#53
+ # source://prism//lib/prism/dispatcher.rb#54
def register(listener, *events); end
# Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#71
+ # source://prism//lib/prism/dispatcher.rb#72
def visit_alias_global_variable_node(node); end
# Dispatch enter and leave events for AliasMethodNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#79
+ # source://prism//lib/prism/dispatcher.rb#80
def visit_alias_method_node(node); end
# Dispatch enter and leave events for AlternationPatternNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#87
+ # source://prism//lib/prism/dispatcher.rb#88
def visit_alternation_pattern_node(node); end
# Dispatch enter and leave events for AndNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#95
+ # source://prism//lib/prism/dispatcher.rb#96
def visit_and_node(node); end
# Dispatch enter and leave events for ArgumentsNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#103
+ # source://prism//lib/prism/dispatcher.rb#104
def visit_arguments_node(node); end
# Dispatch enter and leave events for ArrayNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#111
+ # source://prism//lib/prism/dispatcher.rb#112
def visit_array_node(node); end
# Dispatch enter and leave events for ArrayPatternNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#119
+ # source://prism//lib/prism/dispatcher.rb#120
def visit_array_pattern_node(node); end
# Dispatch enter and leave events for AssocNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#127
+ # source://prism//lib/prism/dispatcher.rb#128
def visit_assoc_node(node); end
# Dispatch enter and leave events for AssocSplatNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#135
+ # source://prism//lib/prism/dispatcher.rb#136
def visit_assoc_splat_node(node); end
# Dispatch enter and leave events for BackReferenceReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#143
+ # source://prism//lib/prism/dispatcher.rb#144
def visit_back_reference_read_node(node); end
# Dispatch enter and leave events for BeginNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#151
+ # source://prism//lib/prism/dispatcher.rb#152
def visit_begin_node(node); end
# Dispatch enter and leave events for BlockArgumentNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#159
+ # source://prism//lib/prism/dispatcher.rb#160
def visit_block_argument_node(node); end
# Dispatch enter and leave events for BlockLocalVariableNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#167
+ # source://prism//lib/prism/dispatcher.rb#168
def visit_block_local_variable_node(node); end
# Dispatch enter and leave events for BlockNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#175
+ # source://prism//lib/prism/dispatcher.rb#176
def visit_block_node(node); end
# Dispatch enter and leave events for BlockParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#183
+ # source://prism//lib/prism/dispatcher.rb#184
def visit_block_parameter_node(node); end
# Dispatch enter and leave events for BlockParametersNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#191
+ # source://prism//lib/prism/dispatcher.rb#192
def visit_block_parameters_node(node); end
# Dispatch enter and leave events for BreakNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#199
+ # source://prism//lib/prism/dispatcher.rb#200
def visit_break_node(node); end
# Dispatch enter and leave events for CallAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#207
+ # source://prism//lib/prism/dispatcher.rb#208
def visit_call_and_write_node(node); end
# Dispatch enter and leave events for CallNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#215
+ # source://prism//lib/prism/dispatcher.rb#216
def visit_call_node(node); end
# Dispatch enter and leave events for CallOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#223
+ # source://prism//lib/prism/dispatcher.rb#224
def visit_call_operator_write_node(node); end
# Dispatch enter and leave events for CallOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#231
+ # source://prism//lib/prism/dispatcher.rb#232
def visit_call_or_write_node(node); end
# Dispatch enter and leave events for CallTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#239
+ # source://prism//lib/prism/dispatcher.rb#240
def visit_call_target_node(node); end
# Dispatch enter and leave events for CapturePatternNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#247
+ # source://prism//lib/prism/dispatcher.rb#248
def visit_capture_pattern_node(node); end
# Dispatch enter and leave events for CaseMatchNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#255
+ # source://prism//lib/prism/dispatcher.rb#256
def visit_case_match_node(node); end
# Dispatch enter and leave events for CaseNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#263
+ # source://prism//lib/prism/dispatcher.rb#264
def visit_case_node(node); end
# Dispatch enter and leave events for ClassNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#271
+ # source://prism//lib/prism/dispatcher.rb#272
def visit_class_node(node); end
# Dispatch enter and leave events for ClassVariableAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#279
+ # source://prism//lib/prism/dispatcher.rb#280
def visit_class_variable_and_write_node(node); end
# Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#287
+ # source://prism//lib/prism/dispatcher.rb#288
def visit_class_variable_operator_write_node(node); end
# Dispatch enter and leave events for ClassVariableOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#295
+ # source://prism//lib/prism/dispatcher.rb#296
def visit_class_variable_or_write_node(node); end
# Dispatch enter and leave events for ClassVariableReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#303
+ # source://prism//lib/prism/dispatcher.rb#304
def visit_class_variable_read_node(node); end
# Dispatch enter and leave events for ClassVariableTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#311
+ # source://prism//lib/prism/dispatcher.rb#312
def visit_class_variable_target_node(node); end
# Dispatch enter and leave events for ClassVariableWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#319
+ # source://prism//lib/prism/dispatcher.rb#320
def visit_class_variable_write_node(node); end
# Dispatch enter and leave events for ConstantAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#327
+ # source://prism//lib/prism/dispatcher.rb#328
def visit_constant_and_write_node(node); end
# Dispatch enter and leave events for ConstantOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#335
+ # source://prism//lib/prism/dispatcher.rb#336
def visit_constant_operator_write_node(node); end
# Dispatch enter and leave events for ConstantOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#343
+ # source://prism//lib/prism/dispatcher.rb#344
def visit_constant_or_write_node(node); end
# Dispatch enter and leave events for ConstantPathAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#351
+ # source://prism//lib/prism/dispatcher.rb#352
def visit_constant_path_and_write_node(node); end
# Dispatch enter and leave events for ConstantPathNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#359
+ # source://prism//lib/prism/dispatcher.rb#360
def visit_constant_path_node(node); end
# Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#367
+ # source://prism//lib/prism/dispatcher.rb#368
def visit_constant_path_operator_write_node(node); end
# Dispatch enter and leave events for ConstantPathOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#375
+ # source://prism//lib/prism/dispatcher.rb#376
def visit_constant_path_or_write_node(node); end
# Dispatch enter and leave events for ConstantPathTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#383
+ # source://prism//lib/prism/dispatcher.rb#384
def visit_constant_path_target_node(node); end
# Dispatch enter and leave events for ConstantPathWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#391
+ # source://prism//lib/prism/dispatcher.rb#392
def visit_constant_path_write_node(node); end
# Dispatch enter and leave events for ConstantReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#399
+ # source://prism//lib/prism/dispatcher.rb#400
def visit_constant_read_node(node); end
# Dispatch enter and leave events for ConstantTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#407
+ # source://prism//lib/prism/dispatcher.rb#408
def visit_constant_target_node(node); end
# Dispatch enter and leave events for ConstantWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#415
+ # source://prism//lib/prism/dispatcher.rb#416
def visit_constant_write_node(node); end
# Dispatch enter and leave events for DefNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#423
+ # source://prism//lib/prism/dispatcher.rb#424
def visit_def_node(node); end
# Dispatch enter and leave events for DefinedNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#431
+ # source://prism//lib/prism/dispatcher.rb#432
def visit_defined_node(node); end
# Dispatch enter and leave events for ElseNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#439
+ # source://prism//lib/prism/dispatcher.rb#440
def visit_else_node(node); end
# Dispatch enter and leave events for EmbeddedStatementsNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#447
+ # source://prism//lib/prism/dispatcher.rb#448
def visit_embedded_statements_node(node); end
# Dispatch enter and leave events for EmbeddedVariableNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#455
+ # source://prism//lib/prism/dispatcher.rb#456
def visit_embedded_variable_node(node); end
# Dispatch enter and leave events for EnsureNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#463
+ # source://prism//lib/prism/dispatcher.rb#464
def visit_ensure_node(node); end
# Dispatch enter and leave events for FalseNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#471
+ # source://prism//lib/prism/dispatcher.rb#472
def visit_false_node(node); end
# Dispatch enter and leave events for FindPatternNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#479
+ # source://prism//lib/prism/dispatcher.rb#480
def visit_find_pattern_node(node); end
# Dispatch enter and leave events for FlipFlopNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#487
+ # source://prism//lib/prism/dispatcher.rb#488
def visit_flip_flop_node(node); end
# Dispatch enter and leave events for FloatNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#495
+ # source://prism//lib/prism/dispatcher.rb#496
def visit_float_node(node); end
# Dispatch enter and leave events for ForNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#503
+ # source://prism//lib/prism/dispatcher.rb#504
def visit_for_node(node); end
# Dispatch enter and leave events for ForwardingArgumentsNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#511
+ # source://prism//lib/prism/dispatcher.rb#512
def visit_forwarding_arguments_node(node); end
# Dispatch enter and leave events for ForwardingParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#519
+ # source://prism//lib/prism/dispatcher.rb#520
def visit_forwarding_parameter_node(node); end
# Dispatch enter and leave events for ForwardingSuperNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#527
+ # source://prism//lib/prism/dispatcher.rb#528
def visit_forwarding_super_node(node); end
# Dispatch enter and leave events for GlobalVariableAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#535
+ # source://prism//lib/prism/dispatcher.rb#536
def visit_global_variable_and_write_node(node); end
# Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#543
+ # source://prism//lib/prism/dispatcher.rb#544
def visit_global_variable_operator_write_node(node); end
# Dispatch enter and leave events for GlobalVariableOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#551
+ # source://prism//lib/prism/dispatcher.rb#552
def visit_global_variable_or_write_node(node); end
# Dispatch enter and leave events for GlobalVariableReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#559
+ # source://prism//lib/prism/dispatcher.rb#560
def visit_global_variable_read_node(node); end
# Dispatch enter and leave events for GlobalVariableTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#567
+ # source://prism//lib/prism/dispatcher.rb#568
def visit_global_variable_target_node(node); end
# Dispatch enter and leave events for GlobalVariableWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#575
+ # source://prism//lib/prism/dispatcher.rb#576
def visit_global_variable_write_node(node); end
# Dispatch enter and leave events for HashNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#583
+ # source://prism//lib/prism/dispatcher.rb#584
def visit_hash_node(node); end
# Dispatch enter and leave events for HashPatternNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#591
+ # source://prism//lib/prism/dispatcher.rb#592
def visit_hash_pattern_node(node); end
# Dispatch enter and leave events for IfNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#599
+ # source://prism//lib/prism/dispatcher.rb#600
def visit_if_node(node); end
# Dispatch enter and leave events for ImaginaryNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#607
+ # source://prism//lib/prism/dispatcher.rb#608
def visit_imaginary_node(node); end
# Dispatch enter and leave events for ImplicitNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#615
+ # source://prism//lib/prism/dispatcher.rb#616
def visit_implicit_node(node); end
# Dispatch enter and leave events for ImplicitRestNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#623
+ # source://prism//lib/prism/dispatcher.rb#624
def visit_implicit_rest_node(node); end
# Dispatch enter and leave events for InNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#631
+ # source://prism//lib/prism/dispatcher.rb#632
def visit_in_node(node); end
# Dispatch enter and leave events for IndexAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#639
+ # source://prism//lib/prism/dispatcher.rb#640
def visit_index_and_write_node(node); end
# Dispatch enter and leave events for IndexOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#647
+ # source://prism//lib/prism/dispatcher.rb#648
def visit_index_operator_write_node(node); end
# Dispatch enter and leave events for IndexOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#655
+ # source://prism//lib/prism/dispatcher.rb#656
def visit_index_or_write_node(node); end
# Dispatch enter and leave events for IndexTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#663
+ # source://prism//lib/prism/dispatcher.rb#664
def visit_index_target_node(node); end
# Dispatch enter and leave events for InstanceVariableAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#671
+ # source://prism//lib/prism/dispatcher.rb#672
def visit_instance_variable_and_write_node(node); end
# Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#679
+ # source://prism//lib/prism/dispatcher.rb#680
def visit_instance_variable_operator_write_node(node); end
# Dispatch enter and leave events for InstanceVariableOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#687
+ # source://prism//lib/prism/dispatcher.rb#688
def visit_instance_variable_or_write_node(node); end
# Dispatch enter and leave events for InstanceVariableReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#695
+ # source://prism//lib/prism/dispatcher.rb#696
def visit_instance_variable_read_node(node); end
# Dispatch enter and leave events for InstanceVariableTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#703
+ # source://prism//lib/prism/dispatcher.rb#704
def visit_instance_variable_target_node(node); end
# Dispatch enter and leave events for InstanceVariableWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#711
+ # source://prism//lib/prism/dispatcher.rb#712
def visit_instance_variable_write_node(node); end
# Dispatch enter and leave events for IntegerNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#719
+ # source://prism//lib/prism/dispatcher.rb#720
def visit_integer_node(node); end
# Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#727
+ # source://prism//lib/prism/dispatcher.rb#728
def visit_interpolated_match_last_line_node(node); end
# Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#735
+ # source://prism//lib/prism/dispatcher.rb#736
def visit_interpolated_regular_expression_node(node); end
# Dispatch enter and leave events for InterpolatedStringNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#743
+ # source://prism//lib/prism/dispatcher.rb#744
def visit_interpolated_string_node(node); end
# Dispatch enter and leave events for InterpolatedSymbolNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#751
+ # source://prism//lib/prism/dispatcher.rb#752
def visit_interpolated_symbol_node(node); end
# Dispatch enter and leave events for InterpolatedXStringNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#759
+ # source://prism//lib/prism/dispatcher.rb#760
def visit_interpolated_x_string_node(node); end
+ # Dispatch enter and leave events for ItLocalVariableReadNode nodes and continue
+ # walking the tree.
+ #
+ # source://prism//lib/prism/dispatcher.rb#768
+ def visit_it_local_variable_read_node(node); end
+
# Dispatch enter and leave events for ItParametersNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#767
+ # source://prism//lib/prism/dispatcher.rb#776
def visit_it_parameters_node(node); end
# Dispatch enter and leave events for KeywordHashNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#775
+ # source://prism//lib/prism/dispatcher.rb#784
def visit_keyword_hash_node(node); end
# Dispatch enter and leave events for KeywordRestParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#783
+ # source://prism//lib/prism/dispatcher.rb#792
def visit_keyword_rest_parameter_node(node); end
# Dispatch enter and leave events for LambdaNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#791
+ # source://prism//lib/prism/dispatcher.rb#800
def visit_lambda_node(node); end
# Dispatch enter and leave events for LocalVariableAndWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#799
+ # source://prism//lib/prism/dispatcher.rb#808
def visit_local_variable_and_write_node(node); end
# Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#807
+ # source://prism//lib/prism/dispatcher.rb#816
def visit_local_variable_operator_write_node(node); end
# Dispatch enter and leave events for LocalVariableOrWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#815
+ # source://prism//lib/prism/dispatcher.rb#824
def visit_local_variable_or_write_node(node); end
# Dispatch enter and leave events for LocalVariableReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#823
+ # source://prism//lib/prism/dispatcher.rb#832
def visit_local_variable_read_node(node); end
# Dispatch enter and leave events for LocalVariableTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#831
+ # source://prism//lib/prism/dispatcher.rb#840
def visit_local_variable_target_node(node); end
# Dispatch enter and leave events for LocalVariableWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#839
+ # source://prism//lib/prism/dispatcher.rb#848
def visit_local_variable_write_node(node); end
# Dispatch enter and leave events for MatchLastLineNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#847
+ # source://prism//lib/prism/dispatcher.rb#856
def visit_match_last_line_node(node); end
# Dispatch enter and leave events for MatchPredicateNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#855
+ # source://prism//lib/prism/dispatcher.rb#864
def visit_match_predicate_node(node); end
# Dispatch enter and leave events for MatchRequiredNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#863
+ # source://prism//lib/prism/dispatcher.rb#872
def visit_match_required_node(node); end
# Dispatch enter and leave events for MatchWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#871
+ # source://prism//lib/prism/dispatcher.rb#880
def visit_match_write_node(node); end
# Dispatch enter and leave events for MissingNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#879
+ # source://prism//lib/prism/dispatcher.rb#888
def visit_missing_node(node); end
# Dispatch enter and leave events for ModuleNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#887
+ # source://prism//lib/prism/dispatcher.rb#896
def visit_module_node(node); end
# Dispatch enter and leave events for MultiTargetNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#895
+ # source://prism//lib/prism/dispatcher.rb#904
def visit_multi_target_node(node); end
# Dispatch enter and leave events for MultiWriteNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#903
+ # source://prism//lib/prism/dispatcher.rb#912
def visit_multi_write_node(node); end
# Dispatch enter and leave events for NextNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#911
+ # source://prism//lib/prism/dispatcher.rb#920
def visit_next_node(node); end
# Dispatch enter and leave events for NilNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#919
+ # source://prism//lib/prism/dispatcher.rb#928
def visit_nil_node(node); end
# Dispatch enter and leave events for NoKeywordsParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#927
+ # source://prism//lib/prism/dispatcher.rb#936
def visit_no_keywords_parameter_node(node); end
# Dispatch enter and leave events for NumberedParametersNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#935
+ # source://prism//lib/prism/dispatcher.rb#944
def visit_numbered_parameters_node(node); end
# Dispatch enter and leave events for NumberedReferenceReadNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#943
+ # source://prism//lib/prism/dispatcher.rb#952
def visit_numbered_reference_read_node(node); end
# Dispatch enter and leave events for OptionalKeywordParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#951
+ # source://prism//lib/prism/dispatcher.rb#960
def visit_optional_keyword_parameter_node(node); end
# Dispatch enter and leave events for OptionalParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#959
+ # source://prism//lib/prism/dispatcher.rb#968
def visit_optional_parameter_node(node); end
# Dispatch enter and leave events for OrNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#967
+ # source://prism//lib/prism/dispatcher.rb#976
def visit_or_node(node); end
# Dispatch enter and leave events for ParametersNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#975
+ # source://prism//lib/prism/dispatcher.rb#984
def visit_parameters_node(node); end
# Dispatch enter and leave events for ParenthesesNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#983
+ # source://prism//lib/prism/dispatcher.rb#992
def visit_parentheses_node(node); end
# Dispatch enter and leave events for PinnedExpressionNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#991
+ # source://prism//lib/prism/dispatcher.rb#1000
def visit_pinned_expression_node(node); end
# Dispatch enter and leave events for PinnedVariableNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#999
+ # source://prism//lib/prism/dispatcher.rb#1008
def visit_pinned_variable_node(node); end
# Dispatch enter and leave events for PostExecutionNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1007
+ # source://prism//lib/prism/dispatcher.rb#1016
def visit_post_execution_node(node); end
# Dispatch enter and leave events for PreExecutionNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1015
+ # source://prism//lib/prism/dispatcher.rb#1024
def visit_pre_execution_node(node); end
# Dispatch enter and leave events for ProgramNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1023
+ # source://prism//lib/prism/dispatcher.rb#1032
def visit_program_node(node); end
# Dispatch enter and leave events for RangeNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1031
+ # source://prism//lib/prism/dispatcher.rb#1040
def visit_range_node(node); end
# Dispatch enter and leave events for RationalNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1039
+ # source://prism//lib/prism/dispatcher.rb#1048
def visit_rational_node(node); end
# Dispatch enter and leave events for RedoNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1047
+ # source://prism//lib/prism/dispatcher.rb#1056
def visit_redo_node(node); end
# Dispatch enter and leave events for RegularExpressionNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1055
+ # source://prism//lib/prism/dispatcher.rb#1064
def visit_regular_expression_node(node); end
# Dispatch enter and leave events for RequiredKeywordParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1063
+ # source://prism//lib/prism/dispatcher.rb#1072
def visit_required_keyword_parameter_node(node); end
# Dispatch enter and leave events for RequiredParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1071
+ # source://prism//lib/prism/dispatcher.rb#1080
def visit_required_parameter_node(node); end
# Dispatch enter and leave events for RescueModifierNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1079
+ # source://prism//lib/prism/dispatcher.rb#1088
def visit_rescue_modifier_node(node); end
# Dispatch enter and leave events for RescueNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1087
+ # source://prism//lib/prism/dispatcher.rb#1096
def visit_rescue_node(node); end
# Dispatch enter and leave events for RestParameterNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1095
+ # source://prism//lib/prism/dispatcher.rb#1104
def visit_rest_parameter_node(node); end
# Dispatch enter and leave events for RetryNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1103
+ # source://prism//lib/prism/dispatcher.rb#1112
def visit_retry_node(node); end
# Dispatch enter and leave events for ReturnNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1111
+ # source://prism//lib/prism/dispatcher.rb#1120
def visit_return_node(node); end
# Dispatch enter and leave events for SelfNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1119
+ # source://prism//lib/prism/dispatcher.rb#1128
def visit_self_node(node); end
# Dispatch enter and leave events for ShareableConstantNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1127
+ # source://prism//lib/prism/dispatcher.rb#1136
def visit_shareable_constant_node(node); end
# Dispatch enter and leave events for SingletonClassNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1135
+ # source://prism//lib/prism/dispatcher.rb#1144
def visit_singleton_class_node(node); end
# Dispatch enter and leave events for SourceEncodingNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1143
+ # source://prism//lib/prism/dispatcher.rb#1152
def visit_source_encoding_node(node); end
# Dispatch enter and leave events for SourceFileNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1151
+ # source://prism//lib/prism/dispatcher.rb#1160
def visit_source_file_node(node); end
# Dispatch enter and leave events for SourceLineNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1159
+ # source://prism//lib/prism/dispatcher.rb#1168
def visit_source_line_node(node); end
# Dispatch enter and leave events for SplatNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1167
+ # source://prism//lib/prism/dispatcher.rb#1176
def visit_splat_node(node); end
# Dispatch enter and leave events for StatementsNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1175
+ # source://prism//lib/prism/dispatcher.rb#1184
def visit_statements_node(node); end
# Dispatch enter and leave events for StringNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1183
+ # source://prism//lib/prism/dispatcher.rb#1192
def visit_string_node(node); end
# Dispatch enter and leave events for SuperNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1191
+ # source://prism//lib/prism/dispatcher.rb#1200
def visit_super_node(node); end
# Dispatch enter and leave events for SymbolNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1199
+ # source://prism//lib/prism/dispatcher.rb#1208
def visit_symbol_node(node); end
# Dispatch enter and leave events for TrueNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1207
+ # source://prism//lib/prism/dispatcher.rb#1216
def visit_true_node(node); end
# Dispatch enter and leave events for UndefNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1215
+ # source://prism//lib/prism/dispatcher.rb#1224
def visit_undef_node(node); end
# Dispatch enter and leave events for UnlessNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1223
+ # source://prism//lib/prism/dispatcher.rb#1232
def visit_unless_node(node); end
# Dispatch enter and leave events for UntilNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1231
+ # source://prism//lib/prism/dispatcher.rb#1240
def visit_until_node(node); end
# Dispatch enter and leave events for WhenNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1239
+ # source://prism//lib/prism/dispatcher.rb#1248
def visit_when_node(node); end
# Dispatch enter and leave events for WhileNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1247
+ # source://prism//lib/prism/dispatcher.rb#1256
def visit_while_node(node); end
# Dispatch enter and leave events for XStringNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1255
+ # source://prism//lib/prism/dispatcher.rb#1264
def visit_x_string_node(node); end
# Dispatch enter and leave events for YieldNode nodes and continue
# walking the tree.
#
- # source://prism//lib/prism/dispatcher.rb#1263
+ # source://prism//lib/prism/dispatcher.rb#1272
def visit_yield_node(node); end
end
-# source://prism//lib/prism/dispatcher.rb#1269
+# source://prism//lib/prism/dispatcher.rb#1278
class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor
# @return [DispatchOnce] a new instance of DispatchOnce
#
- # source://prism//lib/prism/dispatcher.rb#1272
+ # source://prism//lib/prism/dispatcher.rb#1281
def initialize(listeners); end
# Returns the value of attribute listeners.
#
- # source://prism//lib/prism/dispatcher.rb#1270
+ # source://prism//lib/prism/dispatcher.rb#1279
def listeners; end
# Dispatch enter and leave events for AliasGlobalVariableNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1277
+ # source://prism//lib/prism/dispatcher.rb#1286
def visit_alias_global_variable_node(node); end
# Dispatch enter and leave events for AliasMethodNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1283
+ # source://prism//lib/prism/dispatcher.rb#1292
def visit_alias_method_node(node); end
# Dispatch enter and leave events for AlternationPatternNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1289
+ # source://prism//lib/prism/dispatcher.rb#1298
def visit_alternation_pattern_node(node); end
# Dispatch enter and leave events for AndNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1295
+ # source://prism//lib/prism/dispatcher.rb#1304
def visit_and_node(node); end
# Dispatch enter and leave events for ArgumentsNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1301
+ # source://prism//lib/prism/dispatcher.rb#1310
def visit_arguments_node(node); end
# Dispatch enter and leave events for ArrayNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1307
+ # source://prism//lib/prism/dispatcher.rb#1316
def visit_array_node(node); end
# Dispatch enter and leave events for ArrayPatternNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1313
+ # source://prism//lib/prism/dispatcher.rb#1322
def visit_array_pattern_node(node); end
# Dispatch enter and leave events for AssocNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1319
+ # source://prism//lib/prism/dispatcher.rb#1328
def visit_assoc_node(node); end
# Dispatch enter and leave events for AssocSplatNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1325
+ # source://prism//lib/prism/dispatcher.rb#1334
def visit_assoc_splat_node(node); end
# Dispatch enter and leave events for BackReferenceReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1331
+ # source://prism//lib/prism/dispatcher.rb#1340
def visit_back_reference_read_node(node); end
# Dispatch enter and leave events for BeginNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1337
+ # source://prism//lib/prism/dispatcher.rb#1346
def visit_begin_node(node); end
# Dispatch enter and leave events for BlockArgumentNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1343
+ # source://prism//lib/prism/dispatcher.rb#1352
def visit_block_argument_node(node); end
# Dispatch enter and leave events for BlockLocalVariableNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1349
+ # source://prism//lib/prism/dispatcher.rb#1358
def visit_block_local_variable_node(node); end
# Dispatch enter and leave events for BlockNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1355
+ # source://prism//lib/prism/dispatcher.rb#1364
def visit_block_node(node); end
# Dispatch enter and leave events for BlockParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1361
+ # source://prism//lib/prism/dispatcher.rb#1370
def visit_block_parameter_node(node); end
# Dispatch enter and leave events for BlockParametersNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1367
+ # source://prism//lib/prism/dispatcher.rb#1376
def visit_block_parameters_node(node); end
# Dispatch enter and leave events for BreakNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1373
+ # source://prism//lib/prism/dispatcher.rb#1382
def visit_break_node(node); end
# Dispatch enter and leave events for CallAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1379
+ # source://prism//lib/prism/dispatcher.rb#1388
def visit_call_and_write_node(node); end
# Dispatch enter and leave events for CallNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1385
+ # source://prism//lib/prism/dispatcher.rb#1394
def visit_call_node(node); end
# Dispatch enter and leave events for CallOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1391
+ # source://prism//lib/prism/dispatcher.rb#1400
def visit_call_operator_write_node(node); end
# Dispatch enter and leave events for CallOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1397
+ # source://prism//lib/prism/dispatcher.rb#1406
def visit_call_or_write_node(node); end
# Dispatch enter and leave events for CallTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1403
+ # source://prism//lib/prism/dispatcher.rb#1412
def visit_call_target_node(node); end
# Dispatch enter and leave events for CapturePatternNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1409
+ # source://prism//lib/prism/dispatcher.rb#1418
def visit_capture_pattern_node(node); end
# Dispatch enter and leave events for CaseMatchNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1415
+ # source://prism//lib/prism/dispatcher.rb#1424
def visit_case_match_node(node); end
# Dispatch enter and leave events for CaseNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1421
+ # source://prism//lib/prism/dispatcher.rb#1430
def visit_case_node(node); end
# Dispatch enter and leave events for ClassNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1427
+ # source://prism//lib/prism/dispatcher.rb#1436
def visit_class_node(node); end
# Dispatch enter and leave events for ClassVariableAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1433
+ # source://prism//lib/prism/dispatcher.rb#1442
def visit_class_variable_and_write_node(node); end
# Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1439
+ # source://prism//lib/prism/dispatcher.rb#1448
def visit_class_variable_operator_write_node(node); end
# Dispatch enter and leave events for ClassVariableOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1445
+ # source://prism//lib/prism/dispatcher.rb#1454
def visit_class_variable_or_write_node(node); end
# Dispatch enter and leave events for ClassVariableReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1451
+ # source://prism//lib/prism/dispatcher.rb#1460
def visit_class_variable_read_node(node); end
# Dispatch enter and leave events for ClassVariableTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1457
+ # source://prism//lib/prism/dispatcher.rb#1466
def visit_class_variable_target_node(node); end
# Dispatch enter and leave events for ClassVariableWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1463
+ # source://prism//lib/prism/dispatcher.rb#1472
def visit_class_variable_write_node(node); end
# Dispatch enter and leave events for ConstantAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1469
+ # source://prism//lib/prism/dispatcher.rb#1478
def visit_constant_and_write_node(node); end
# Dispatch enter and leave events for ConstantOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1475
+ # source://prism//lib/prism/dispatcher.rb#1484
def visit_constant_operator_write_node(node); end
# Dispatch enter and leave events for ConstantOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1481
+ # source://prism//lib/prism/dispatcher.rb#1490
def visit_constant_or_write_node(node); end
# Dispatch enter and leave events for ConstantPathAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1487
+ # source://prism//lib/prism/dispatcher.rb#1496
def visit_constant_path_and_write_node(node); end
# Dispatch enter and leave events for ConstantPathNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1493
+ # source://prism//lib/prism/dispatcher.rb#1502
def visit_constant_path_node(node); end
# Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1499
+ # source://prism//lib/prism/dispatcher.rb#1508
def visit_constant_path_operator_write_node(node); end
# Dispatch enter and leave events for ConstantPathOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1505
+ # source://prism//lib/prism/dispatcher.rb#1514
def visit_constant_path_or_write_node(node); end
# Dispatch enter and leave events for ConstantPathTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1511
+ # source://prism//lib/prism/dispatcher.rb#1520
def visit_constant_path_target_node(node); end
# Dispatch enter and leave events for ConstantPathWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1517
+ # source://prism//lib/prism/dispatcher.rb#1526
def visit_constant_path_write_node(node); end
# Dispatch enter and leave events for ConstantReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1523
+ # source://prism//lib/prism/dispatcher.rb#1532
def visit_constant_read_node(node); end
# Dispatch enter and leave events for ConstantTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1529
+ # source://prism//lib/prism/dispatcher.rb#1538
def visit_constant_target_node(node); end
# Dispatch enter and leave events for ConstantWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1535
+ # source://prism//lib/prism/dispatcher.rb#1544
def visit_constant_write_node(node); end
# Dispatch enter and leave events for DefNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1541
+ # source://prism//lib/prism/dispatcher.rb#1550
def visit_def_node(node); end
# Dispatch enter and leave events for DefinedNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1547
+ # source://prism//lib/prism/dispatcher.rb#1556
def visit_defined_node(node); end
# Dispatch enter and leave events for ElseNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1553
+ # source://prism//lib/prism/dispatcher.rb#1562
def visit_else_node(node); end
# Dispatch enter and leave events for EmbeddedStatementsNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1559
+ # source://prism//lib/prism/dispatcher.rb#1568
def visit_embedded_statements_node(node); end
# Dispatch enter and leave events for EmbeddedVariableNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1565
+ # source://prism//lib/prism/dispatcher.rb#1574
def visit_embedded_variable_node(node); end
# Dispatch enter and leave events for EnsureNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1571
+ # source://prism//lib/prism/dispatcher.rb#1580
def visit_ensure_node(node); end
# Dispatch enter and leave events for FalseNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1577
+ # source://prism//lib/prism/dispatcher.rb#1586
def visit_false_node(node); end
# Dispatch enter and leave events for FindPatternNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1583
+ # source://prism//lib/prism/dispatcher.rb#1592
def visit_find_pattern_node(node); end
# Dispatch enter and leave events for FlipFlopNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1589
+ # source://prism//lib/prism/dispatcher.rb#1598
def visit_flip_flop_node(node); end
# Dispatch enter and leave events for FloatNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1595
+ # source://prism//lib/prism/dispatcher.rb#1604
def visit_float_node(node); end
# Dispatch enter and leave events for ForNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1601
+ # source://prism//lib/prism/dispatcher.rb#1610
def visit_for_node(node); end
# Dispatch enter and leave events for ForwardingArgumentsNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1607
+ # source://prism//lib/prism/dispatcher.rb#1616
def visit_forwarding_arguments_node(node); end
# Dispatch enter and leave events for ForwardingParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1613
+ # source://prism//lib/prism/dispatcher.rb#1622
def visit_forwarding_parameter_node(node); end
# Dispatch enter and leave events for ForwardingSuperNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1619
+ # source://prism//lib/prism/dispatcher.rb#1628
def visit_forwarding_super_node(node); end
# Dispatch enter and leave events for GlobalVariableAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1625
+ # source://prism//lib/prism/dispatcher.rb#1634
def visit_global_variable_and_write_node(node); end
# Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1631
+ # source://prism//lib/prism/dispatcher.rb#1640
def visit_global_variable_operator_write_node(node); end
# Dispatch enter and leave events for GlobalVariableOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1637
+ # source://prism//lib/prism/dispatcher.rb#1646
def visit_global_variable_or_write_node(node); end
# Dispatch enter and leave events for GlobalVariableReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1643
+ # source://prism//lib/prism/dispatcher.rb#1652
def visit_global_variable_read_node(node); end
# Dispatch enter and leave events for GlobalVariableTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1649
+ # source://prism//lib/prism/dispatcher.rb#1658
def visit_global_variable_target_node(node); end
# Dispatch enter and leave events for GlobalVariableWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1655
+ # source://prism//lib/prism/dispatcher.rb#1664
def visit_global_variable_write_node(node); end
# Dispatch enter and leave events for HashNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1661
+ # source://prism//lib/prism/dispatcher.rb#1670
def visit_hash_node(node); end
# Dispatch enter and leave events for HashPatternNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1667
+ # source://prism//lib/prism/dispatcher.rb#1676
def visit_hash_pattern_node(node); end
# Dispatch enter and leave events for IfNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1673
+ # source://prism//lib/prism/dispatcher.rb#1682
def visit_if_node(node); end
# Dispatch enter and leave events for ImaginaryNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1679
+ # source://prism//lib/prism/dispatcher.rb#1688
def visit_imaginary_node(node); end
# Dispatch enter and leave events for ImplicitNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1685
+ # source://prism//lib/prism/dispatcher.rb#1694
def visit_implicit_node(node); end
# Dispatch enter and leave events for ImplicitRestNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1691
+ # source://prism//lib/prism/dispatcher.rb#1700
def visit_implicit_rest_node(node); end
# Dispatch enter and leave events for InNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1697
+ # source://prism//lib/prism/dispatcher.rb#1706
def visit_in_node(node); end
# Dispatch enter and leave events for IndexAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1703
+ # source://prism//lib/prism/dispatcher.rb#1712
def visit_index_and_write_node(node); end
# Dispatch enter and leave events for IndexOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1709
+ # source://prism//lib/prism/dispatcher.rb#1718
def visit_index_operator_write_node(node); end
# Dispatch enter and leave events for IndexOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1715
+ # source://prism//lib/prism/dispatcher.rb#1724
def visit_index_or_write_node(node); end
# Dispatch enter and leave events for IndexTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1721
+ # source://prism//lib/prism/dispatcher.rb#1730
def visit_index_target_node(node); end
# Dispatch enter and leave events for InstanceVariableAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1727
+ # source://prism//lib/prism/dispatcher.rb#1736
def visit_instance_variable_and_write_node(node); end
# Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1733
+ # source://prism//lib/prism/dispatcher.rb#1742
def visit_instance_variable_operator_write_node(node); end
# Dispatch enter and leave events for InstanceVariableOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1739
+ # source://prism//lib/prism/dispatcher.rb#1748
def visit_instance_variable_or_write_node(node); end
# Dispatch enter and leave events for InstanceVariableReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1745
+ # source://prism//lib/prism/dispatcher.rb#1754
def visit_instance_variable_read_node(node); end
# Dispatch enter and leave events for InstanceVariableTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1751
+ # source://prism//lib/prism/dispatcher.rb#1760
def visit_instance_variable_target_node(node); end
# Dispatch enter and leave events for InstanceVariableWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1757
+ # source://prism//lib/prism/dispatcher.rb#1766
def visit_instance_variable_write_node(node); end
# Dispatch enter and leave events for IntegerNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1763
+ # source://prism//lib/prism/dispatcher.rb#1772
def visit_integer_node(node); end
# Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1769
+ # source://prism//lib/prism/dispatcher.rb#1778
def visit_interpolated_match_last_line_node(node); end
# Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1775
+ # source://prism//lib/prism/dispatcher.rb#1784
def visit_interpolated_regular_expression_node(node); end
# Dispatch enter and leave events for InterpolatedStringNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1781
+ # source://prism//lib/prism/dispatcher.rb#1790
def visit_interpolated_string_node(node); end
# Dispatch enter and leave events for InterpolatedSymbolNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1787
+ # source://prism//lib/prism/dispatcher.rb#1796
def visit_interpolated_symbol_node(node); end
# Dispatch enter and leave events for InterpolatedXStringNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1793
+ # source://prism//lib/prism/dispatcher.rb#1802
def visit_interpolated_x_string_node(node); end
+ # Dispatch enter and leave events for ItLocalVariableReadNode nodes.
+ #
+ # source://prism//lib/prism/dispatcher.rb#1808
+ def visit_it_local_variable_read_node(node); end
+
# Dispatch enter and leave events for ItParametersNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1799
+ # source://prism//lib/prism/dispatcher.rb#1814
def visit_it_parameters_node(node); end
# Dispatch enter and leave events for KeywordHashNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1805
+ # source://prism//lib/prism/dispatcher.rb#1820
def visit_keyword_hash_node(node); end
# Dispatch enter and leave events for KeywordRestParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1811
+ # source://prism//lib/prism/dispatcher.rb#1826
def visit_keyword_rest_parameter_node(node); end
# Dispatch enter and leave events for LambdaNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1817
+ # source://prism//lib/prism/dispatcher.rb#1832
def visit_lambda_node(node); end
# Dispatch enter and leave events for LocalVariableAndWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1823
+ # source://prism//lib/prism/dispatcher.rb#1838
def visit_local_variable_and_write_node(node); end
# Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1829
+ # source://prism//lib/prism/dispatcher.rb#1844
def visit_local_variable_operator_write_node(node); end
# Dispatch enter and leave events for LocalVariableOrWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1835
+ # source://prism//lib/prism/dispatcher.rb#1850
def visit_local_variable_or_write_node(node); end
# Dispatch enter and leave events for LocalVariableReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1841
+ # source://prism//lib/prism/dispatcher.rb#1856
def visit_local_variable_read_node(node); end
# Dispatch enter and leave events for LocalVariableTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1847
+ # source://prism//lib/prism/dispatcher.rb#1862
def visit_local_variable_target_node(node); end
# Dispatch enter and leave events for LocalVariableWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1853
+ # source://prism//lib/prism/dispatcher.rb#1868
def visit_local_variable_write_node(node); end
# Dispatch enter and leave events for MatchLastLineNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1859
+ # source://prism//lib/prism/dispatcher.rb#1874
def visit_match_last_line_node(node); end
# Dispatch enter and leave events for MatchPredicateNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1865
+ # source://prism//lib/prism/dispatcher.rb#1880
def visit_match_predicate_node(node); end
# Dispatch enter and leave events for MatchRequiredNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1871
+ # source://prism//lib/prism/dispatcher.rb#1886
def visit_match_required_node(node); end
# Dispatch enter and leave events for MatchWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1877
+ # source://prism//lib/prism/dispatcher.rb#1892
def visit_match_write_node(node); end
# Dispatch enter and leave events for MissingNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1883
+ # source://prism//lib/prism/dispatcher.rb#1898
def visit_missing_node(node); end
# Dispatch enter and leave events for ModuleNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1889
+ # source://prism//lib/prism/dispatcher.rb#1904
def visit_module_node(node); end
# Dispatch enter and leave events for MultiTargetNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1895
+ # source://prism//lib/prism/dispatcher.rb#1910
def visit_multi_target_node(node); end
# Dispatch enter and leave events for MultiWriteNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1901
+ # source://prism//lib/prism/dispatcher.rb#1916
def visit_multi_write_node(node); end
# Dispatch enter and leave events for NextNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1907
+ # source://prism//lib/prism/dispatcher.rb#1922
def visit_next_node(node); end
# Dispatch enter and leave events for NilNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1913
+ # source://prism//lib/prism/dispatcher.rb#1928
def visit_nil_node(node); end
# Dispatch enter and leave events for NoKeywordsParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1919
+ # source://prism//lib/prism/dispatcher.rb#1934
def visit_no_keywords_parameter_node(node); end
# Dispatch enter and leave events for NumberedParametersNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1925
+ # source://prism//lib/prism/dispatcher.rb#1940
def visit_numbered_parameters_node(node); end
# Dispatch enter and leave events for NumberedReferenceReadNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1931
+ # source://prism//lib/prism/dispatcher.rb#1946
def visit_numbered_reference_read_node(node); end
# Dispatch enter and leave events for OptionalKeywordParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1937
+ # source://prism//lib/prism/dispatcher.rb#1952
def visit_optional_keyword_parameter_node(node); end
# Dispatch enter and leave events for OptionalParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1943
+ # source://prism//lib/prism/dispatcher.rb#1958
def visit_optional_parameter_node(node); end
# Dispatch enter and leave events for OrNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1949
+ # source://prism//lib/prism/dispatcher.rb#1964
def visit_or_node(node); end
# Dispatch enter and leave events for ParametersNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1955
+ # source://prism//lib/prism/dispatcher.rb#1970
def visit_parameters_node(node); end
# Dispatch enter and leave events for ParenthesesNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1961
+ # source://prism//lib/prism/dispatcher.rb#1976
def visit_parentheses_node(node); end
# Dispatch enter and leave events for PinnedExpressionNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1967
+ # source://prism//lib/prism/dispatcher.rb#1982
def visit_pinned_expression_node(node); end
# Dispatch enter and leave events for PinnedVariableNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1973
+ # source://prism//lib/prism/dispatcher.rb#1988
def visit_pinned_variable_node(node); end
# Dispatch enter and leave events for PostExecutionNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1979
+ # source://prism//lib/prism/dispatcher.rb#1994
def visit_post_execution_node(node); end
# Dispatch enter and leave events for PreExecutionNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1985
+ # source://prism//lib/prism/dispatcher.rb#2000
def visit_pre_execution_node(node); end
# Dispatch enter and leave events for ProgramNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1991
+ # source://prism//lib/prism/dispatcher.rb#2006
def visit_program_node(node); end
# Dispatch enter and leave events for RangeNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#1997
+ # source://prism//lib/prism/dispatcher.rb#2012
def visit_range_node(node); end
# Dispatch enter and leave events for RationalNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2003
+ # source://prism//lib/prism/dispatcher.rb#2018
def visit_rational_node(node); end
# Dispatch enter and leave events for RedoNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2009
+ # source://prism//lib/prism/dispatcher.rb#2024
def visit_redo_node(node); end
# Dispatch enter and leave events for RegularExpressionNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2015
+ # source://prism//lib/prism/dispatcher.rb#2030
def visit_regular_expression_node(node); end
# Dispatch enter and leave events for RequiredKeywordParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2021
+ # source://prism//lib/prism/dispatcher.rb#2036
def visit_required_keyword_parameter_node(node); end
# Dispatch enter and leave events for RequiredParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2027
+ # source://prism//lib/prism/dispatcher.rb#2042
def visit_required_parameter_node(node); end
# Dispatch enter and leave events for RescueModifierNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2033
+ # source://prism//lib/prism/dispatcher.rb#2048
def visit_rescue_modifier_node(node); end
# Dispatch enter and leave events for RescueNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2039
+ # source://prism//lib/prism/dispatcher.rb#2054
def visit_rescue_node(node); end
# Dispatch enter and leave events for RestParameterNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2045
+ # source://prism//lib/prism/dispatcher.rb#2060
def visit_rest_parameter_node(node); end
# Dispatch enter and leave events for RetryNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2051
+ # source://prism//lib/prism/dispatcher.rb#2066
def visit_retry_node(node); end
# Dispatch enter and leave events for ReturnNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2057
+ # source://prism//lib/prism/dispatcher.rb#2072
def visit_return_node(node); end
# Dispatch enter and leave events for SelfNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2063
+ # source://prism//lib/prism/dispatcher.rb#2078
def visit_self_node(node); end
# Dispatch enter and leave events for ShareableConstantNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2069
+ # source://prism//lib/prism/dispatcher.rb#2084
def visit_shareable_constant_node(node); end
# Dispatch enter and leave events for SingletonClassNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2075
+ # source://prism//lib/prism/dispatcher.rb#2090
def visit_singleton_class_node(node); end
# Dispatch enter and leave events for SourceEncodingNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2081
+ # source://prism//lib/prism/dispatcher.rb#2096
def visit_source_encoding_node(node); end
# Dispatch enter and leave events for SourceFileNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2087
+ # source://prism//lib/prism/dispatcher.rb#2102
def visit_source_file_node(node); end
# Dispatch enter and leave events for SourceLineNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2093
+ # source://prism//lib/prism/dispatcher.rb#2108
def visit_source_line_node(node); end
# Dispatch enter and leave events for SplatNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2099
+ # source://prism//lib/prism/dispatcher.rb#2114
def visit_splat_node(node); end
# Dispatch enter and leave events for StatementsNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2105
+ # source://prism//lib/prism/dispatcher.rb#2120
def visit_statements_node(node); end
# Dispatch enter and leave events for StringNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2111
+ # source://prism//lib/prism/dispatcher.rb#2126
def visit_string_node(node); end
# Dispatch enter and leave events for SuperNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2117
+ # source://prism//lib/prism/dispatcher.rb#2132
def visit_super_node(node); end
# Dispatch enter and leave events for SymbolNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2123
+ # source://prism//lib/prism/dispatcher.rb#2138
def visit_symbol_node(node); end
# Dispatch enter and leave events for TrueNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2129
+ # source://prism//lib/prism/dispatcher.rb#2144
def visit_true_node(node); end
# Dispatch enter and leave events for UndefNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2135
+ # source://prism//lib/prism/dispatcher.rb#2150
def visit_undef_node(node); end
# Dispatch enter and leave events for UnlessNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2141
+ # source://prism//lib/prism/dispatcher.rb#2156
def visit_unless_node(node); end
# Dispatch enter and leave events for UntilNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2147
+ # source://prism//lib/prism/dispatcher.rb#2162
def visit_until_node(node); end
# Dispatch enter and leave events for WhenNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2153
+ # source://prism//lib/prism/dispatcher.rb#2168
def visit_when_node(node); end
# Dispatch enter and leave events for WhileNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2159
+ # source://prism//lib/prism/dispatcher.rb#2174
def visit_while_node(node); end
# Dispatch enter and leave events for XStringNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2165
+ # source://prism//lib/prism/dispatcher.rb#2180
def visit_x_string_node(node); end
# Dispatch enter and leave events for YieldNode nodes.
#
- # source://prism//lib/prism/dispatcher.rb#2171
+ # source://prism//lib/prism/dispatcher.rb#2186
def visit_yield_node(node); end
end
@@ -12285,319 +13462,324 @@ class Prism::DotVisitor < ::Prism::Visitor
# source://prism//lib/prism/dot_visitor.rb#2751
def visit_interpolated_x_string_node(node); end
- # Visit a ItParametersNode node.
+ # Visit a ItLocalVariableReadNode node.
#
# source://prism//lib/prism/dot_visitor.rb#2784
+ def visit_it_local_variable_read_node(node); end
+
+ # Visit a ItParametersNode node.
+ #
+ # source://prism//lib/prism/dot_visitor.rb#2798
def visit_it_parameters_node(node); end
# Visit a KeywordHashNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2798
+ # source://prism//lib/prism/dot_visitor.rb#2812
def visit_keyword_hash_node(node); end
# Visit a KeywordRestParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2828
+ # source://prism//lib/prism/dot_visitor.rb#2842
def visit_keyword_rest_parameter_node(node); end
# Visit a LambdaNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2856
+ # source://prism//lib/prism/dot_visitor.rb#2870
def visit_lambda_node(node); end
# Visit a LocalVariableAndWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2894
+ # source://prism//lib/prism/dot_visitor.rb#2908
def visit_local_variable_and_write_node(node); end
# Visit a LocalVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2924
+ # source://prism//lib/prism/dot_visitor.rb#2938
def visit_local_variable_operator_write_node(node); end
# Visit a LocalVariableOrWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2957
+ # source://prism//lib/prism/dot_visitor.rb#2971
def visit_local_variable_or_write_node(node); end
# Visit a LocalVariableReadNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#2987
+ # source://prism//lib/prism/dot_visitor.rb#3001
def visit_local_variable_read_node(node); end
# Visit a LocalVariableTargetNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3007
+ # source://prism//lib/prism/dot_visitor.rb#3021
def visit_local_variable_target_node(node); end
# Visit a LocalVariableWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3027
+ # source://prism//lib/prism/dot_visitor.rb#3041
def visit_local_variable_write_node(node); end
# Visit a MatchLastLineNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3057
+ # source://prism//lib/prism/dot_visitor.rb#3071
def visit_match_last_line_node(node); end
# Visit a MatchPredicateNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3086
+ # source://prism//lib/prism/dot_visitor.rb#3100
def visit_match_predicate_node(node); end
# Visit a MatchRequiredNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3111
+ # source://prism//lib/prism/dot_visitor.rb#3125
def visit_match_required_node(node); end
# Visit a MatchWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3136
+ # source://prism//lib/prism/dot_visitor.rb#3150
def visit_match_write_node(node); end
# Visit a MissingNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3167
+ # source://prism//lib/prism/dot_visitor.rb#3181
def visit_missing_node(node); end
# Visit a ModuleNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3181
+ # source://prism//lib/prism/dot_visitor.rb#3195
def visit_module_node(node); end
# Visit a MultiTargetNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3217
+ # source://prism//lib/prism/dot_visitor.rb#3231
def visit_multi_target_node(node); end
# Visit a MultiWriteNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3273
+ # source://prism//lib/prism/dot_visitor.rb#3287
def visit_multi_write_node(node); end
# Visit a NextNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3336
+ # source://prism//lib/prism/dot_visitor.rb#3350
def visit_next_node(node); end
# Visit a NilNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3359
+ # source://prism//lib/prism/dot_visitor.rb#3373
def visit_nil_node(node); end
# Visit a NoKeywordsParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3373
+ # source://prism//lib/prism/dot_visitor.rb#3387
def visit_no_keywords_parameter_node(node); end
# Visit a NumberedParametersNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3393
+ # source://prism//lib/prism/dot_visitor.rb#3407
def visit_numbered_parameters_node(node); end
# Visit a NumberedReferenceReadNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3410
+ # source://prism//lib/prism/dot_visitor.rb#3424
def visit_numbered_reference_read_node(node); end
# Visit a OptionalKeywordParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3427
+ # source://prism//lib/prism/dot_visitor.rb#3441
def visit_optional_keyword_parameter_node(node); end
# Visit a OptionalParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3454
+ # source://prism//lib/prism/dot_visitor.rb#3468
def visit_optional_parameter_node(node); end
# Visit a OrNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3484
+ # source://prism//lib/prism/dot_visitor.rb#3498
def visit_or_node(node); end
# Visit a ParametersNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3509
+ # source://prism//lib/prism/dot_visitor.rb#3523
def visit_parameters_node(node); end
# Visit a ParenthesesNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3593
+ # source://prism//lib/prism/dot_visitor.rb#3607
def visit_parentheses_node(node); end
# Visit a PinnedExpressionNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3619
+ # source://prism//lib/prism/dot_visitor.rb#3633
def visit_pinned_expression_node(node); end
# Visit a PinnedVariableNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3646
+ # source://prism//lib/prism/dot_visitor.rb#3660
def visit_pinned_variable_node(node); end
# Visit a PostExecutionNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3667
+ # source://prism//lib/prism/dot_visitor.rb#3681
def visit_post_execution_node(node); end
# Visit a PreExecutionNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3696
+ # source://prism//lib/prism/dot_visitor.rb#3710
def visit_pre_execution_node(node); end
# Visit a ProgramNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3725
+ # source://prism//lib/prism/dot_visitor.rb#3739
def visit_program_node(node); end
# Visit a RangeNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3746
+ # source://prism//lib/prism/dot_visitor.rb#3760
def visit_range_node(node); end
# Visit a RationalNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3778
+ # source://prism//lib/prism/dot_visitor.rb#3792
def visit_rational_node(node); end
# Visit a RedoNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3796
+ # source://prism//lib/prism/dot_visitor.rb#3815
def visit_redo_node(node); end
# Visit a RegularExpressionNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3810
+ # source://prism//lib/prism/dot_visitor.rb#3829
def visit_regular_expression_node(node); end
# Visit a RequiredKeywordParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3839
+ # source://prism//lib/prism/dot_visitor.rb#3858
def visit_required_keyword_parameter_node(node); end
# Visit a RequiredParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3862
+ # source://prism//lib/prism/dot_visitor.rb#3881
def visit_required_parameter_node(node); end
# Visit a RescueModifierNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3882
+ # source://prism//lib/prism/dot_visitor.rb#3901
def visit_rescue_modifier_node(node); end
# Visit a RescueNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3907
+ # source://prism//lib/prism/dot_visitor.rb#3926
def visit_rescue_node(node); end
# Visit a RestParameterNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3960
+ # source://prism//lib/prism/dot_visitor.rb#3979
def visit_rest_parameter_node(node); end
# Visit a RetryNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#3988
+ # source://prism//lib/prism/dot_visitor.rb#4007
def visit_retry_node(node); end
# Visit a ReturnNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4002
+ # source://prism//lib/prism/dot_visitor.rb#4021
def visit_return_node(node); end
# Visit a SelfNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4028
+ # source://prism//lib/prism/dot_visitor.rb#4044
def visit_self_node(node); end
# Visit a ShareableConstantNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4042
+ # source://prism//lib/prism/dot_visitor.rb#4058
def visit_shareable_constant_node(node); end
# Visit a SingletonClassNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4063
+ # source://prism//lib/prism/dot_visitor.rb#4079
def visit_singleton_class_node(node); end
# Visit a SourceEncodingNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4099
+ # source://prism//lib/prism/dot_visitor.rb#4115
def visit_source_encoding_node(node); end
# Visit a SourceFileNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4113
+ # source://prism//lib/prism/dot_visitor.rb#4129
def visit_source_file_node(node); end
# Visit a SourceLineNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4133
+ # source://prism//lib/prism/dot_visitor.rb#4149
def visit_source_line_node(node); end
# Visit a SplatNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4147
+ # source://prism//lib/prism/dot_visitor.rb#4163
def visit_splat_node(node); end
# Visit a StatementsNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4170
+ # source://prism//lib/prism/dot_visitor.rb#4186
def visit_statements_node(node); end
# Visit a StringNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4197
+ # source://prism//lib/prism/dot_visitor.rb#4213
def visit_string_node(node); end
# Visit a SuperNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4230
+ # source://prism//lib/prism/dot_visitor.rb#4246
def visit_super_node(node); end
# Visit a SymbolNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4269
+ # source://prism//lib/prism/dot_visitor.rb#4285
def visit_symbol_node(node); end
# Visit a TrueNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4304
+ # source://prism//lib/prism/dot_visitor.rb#4320
def visit_true_node(node); end
# Visit a UndefNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4318
+ # source://prism//lib/prism/dot_visitor.rb#4334
def visit_undef_node(node); end
# Visit a UnlessNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4348
+ # source://prism//lib/prism/dot_visitor.rb#4364
def visit_unless_node(node); end
# Visit a UntilNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4391
+ # source://prism//lib/prism/dot_visitor.rb#4407
def visit_until_node(node); end
# Visit a WhenNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4426
+ # source://prism//lib/prism/dot_visitor.rb#4442
def visit_when_node(node); end
# Visit a WhileNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4467
+ # source://prism//lib/prism/dot_visitor.rb#4483
def visit_while_node(node); end
# Visit a XStringNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4502
+ # source://prism//lib/prism/dot_visitor.rb#4518
def visit_x_string_node(node); end
# Visit a YieldNode node.
#
- # source://prism//lib/prism/dot_visitor.rb#4531
+ # source://prism//lib/prism/dot_visitor.rb#4547
def visit_yield_node(node); end
private
@@ -12605,101 +13787,95 @@ class Prism::DotVisitor < ::Prism::Visitor
# Inspect a node that has arguments_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4577
+ # source://prism//lib/prism/dot_visitor.rb#4593
def arguments_node_flags_inspect(node); end
# Inspect a node that has array_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4586
+ # source://prism//lib/prism/dot_visitor.rb#4605
def array_node_flags_inspect(node); end
# Inspect a node that has call_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4594
+ # source://prism//lib/prism/dot_visitor.rb#4613
def call_node_flags_inspect(node); end
# Inspect a node that has encoding_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4605
+ # source://prism//lib/prism/dot_visitor.rb#4624
def encoding_flags_inspect(node); end
# Inspect a node that has integer_base_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4614
+ # source://prism//lib/prism/dot_visitor.rb#4633
def integer_base_flags_inspect(node); end
# Inspect a node that has interpolated_string_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4625
+ # source://prism//lib/prism/dot_visitor.rb#4644
def interpolated_string_node_flags_inspect(node); end
# Inspect a node that has keyword_hash_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4634
+ # source://prism//lib/prism/dot_visitor.rb#4653
def keyword_hash_node_flags_inspect(node); end
# Inspect a location to display the start and end line and column numbers.
#
- # source://prism//lib/prism/dot_visitor.rb#4571
+ # source://prism//lib/prism/dot_visitor.rb#4587
def location_inspect(location); end
# Inspect a node that has loop_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4642
+ # source://prism//lib/prism/dot_visitor.rb#4661
def loop_flags_inspect(node); end
# Generate a unique node ID for a node throughout the digraph.
#
- # source://prism//lib/prism/dot_visitor.rb#4566
+ # source://prism//lib/prism/dot_visitor.rb#4582
def node_id(node); end
# Inspect a node that has parameter_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4650
+ # source://prism//lib/prism/dot_visitor.rb#4669
def parameter_flags_inspect(node); end
# Inspect a node that has range_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4658
+ # source://prism//lib/prism/dot_visitor.rb#4677
def range_flags_inspect(node); end
# Inspect a node that has regular_expression_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4666
+ # source://prism//lib/prism/dot_visitor.rb#4685
def regular_expression_flags_inspect(node); end
- # Inspect a node that has return_node_flags flags to display the flags as a
- # comma-separated list.
- #
- # source://prism//lib/prism/dot_visitor.rb#4684
- def return_node_flags_inspect(node); end
-
# Inspect a node that has shareable_constant_node_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4692
+ # source://prism//lib/prism/dot_visitor.rb#4703
def shareable_constant_node_flags_inspect(node); end
# Inspect a node that has string_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4702
+ # source://prism//lib/prism/dot_visitor.rb#4713
def string_flags_inspect(node); end
# Inspect a node that has symbol_flags flags to display the flags as a
# comma-separated list.
#
- # source://prism//lib/prism/dot_visitor.rb#4713
+ # source://prism//lib/prism/dot_visitor.rb#4724
def symbol_flags_inspect(node); end
end
@@ -12793,101 +13969,105 @@ end
# if a then b else c end
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#6235
+# source://prism//lib/prism/node.rb#5485
class Prism::ElseNode < ::Prism::Node
- # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void
+ # Initialize a new ElseNode node.
#
# @return [ElseNode] a new instance of ElseNode
#
- # source://prism//lib/prism/node.rb#6237
+ # source://prism//lib/prism/node.rb#5487
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
else_keyword_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ end_keyword_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, else_keyword_loc, statements, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6349
+ # source://prism//lib/prism/node.rb#5582
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6247
+ # source://prism//lib/prism/node.rb#5498
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6252
+ # source://prism//lib/prism/node.rb#5503
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6264
+ # source://prism//lib/prism/node.rb#5515
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6257
+ # source://prism//lib/prism/node.rb#5508
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?, ?location: Location) -> ElseNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?) -> ElseNode
#
- # source://prism//lib/prism/node.rb#6269
+ # source://prism//lib/prism/node.rb#5520
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
else_keyword_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ end_keyword_loc: T.nilable(Prism::Location)
).returns(Prism::ElseNode)
end
- def copy(else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), else_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6252
+ # source://prism//lib/prism/node.rb#5503
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, else_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location? }
#
- # source://prism//lib/prism/node.rb#6277
+ # source://prism//lib/prism/node.rb#5528
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def else_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#6305
+ # source://prism//lib/prism/node.rb#5556
sig { returns(String) }
def else_keyword; end
# attr_reader else_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#6282
+ # source://prism//lib/prism/node.rb#5533
sig { returns(Prism::Location) }
def else_keyword_loc; end
# def end_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#6310
+ # source://prism//lib/prism/node.rb#5561
sig { returns(T.nilable(String)) }
def end_keyword; end
# attr_reader end_keyword_loc: Location?
#
- # source://prism//lib/prism/node.rb#6292
+ # source://prism//lib/prism/node.rb#5543
sig { returns(T.nilable(Prism::Location)) }
def end_keyword_loc; end
@@ -12896,44 +14076,26 @@ class Prism::ElseNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6315
+ # source://prism//lib/prism/node.rb#5566
sig { override.returns(String) }
def inspect; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#6289
+ # source://prism//lib/prism/node.rb#5540
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6333
+ # source://prism//lib/prism/node.rb#5571
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#6343
+ # source://prism//lib/prism/node.rb#5576
def type; end
end
end
@@ -12941,11 +14103,11 @@ end
# EmbDocComment objects correspond to comments that are surrounded by =begin
# and =end.
#
-# source://prism//lib/prism/parse_result.rb#403
+# source://prism//lib/prism/parse_result.rb#544
class Prism::EmbDocComment < ::Prism::Comment
# Returns a string representation of this comment.
#
- # source://prism//lib/prism/parse_result.rb#410
+ # source://prism//lib/prism/parse_result.rb#551
sig { returns(String) }
def inspect; end
@@ -12953,7 +14115,7 @@ class Prism::EmbDocComment < ::Prism::Comment
#
# @return [Boolean]
#
- # source://prism//lib/prism/parse_result.rb#405
+ # source://prism//lib/prism/parse_result.rb#546
sig { override.returns(T::Boolean) }
def trailing?; end
end
@@ -12963,89 +14125,93 @@ end
# "foo #{bar}"
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#6361
+# source://prism//lib/prism/node.rb#5594
class Prism::EmbeddedStatementsNode < ::Prism::Node
- # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void
+ # Initialize a new EmbeddedStatementsNode node.
#
# @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode
#
- # source://prism//lib/prism/node.rb#6363
+ # source://prism//lib/prism/node.rb#5596
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, opening_loc, statements, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, statements, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6469
+ # source://prism//lib/prism/node.rb#5685
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6373
+ # source://prism//lib/prism/node.rb#5607
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6378
+ # source://prism//lib/prism/node.rb#5612
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#6430
+ # source://prism//lib/prism/node.rb#5664
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#6418
+ # source://prism//lib/prism/node.rb#5652
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6390
+ # source://prism//lib/prism/node.rb#5624
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6383
+ # source://prism//lib/prism/node.rb#5617
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location, ?location: Location) -> EmbeddedStatementsNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location) -> EmbeddedStatementsNode
#
- # source://prism//lib/prism/node.rb#6395
+ # source://prism//lib/prism/node.rb#5629
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::EmbeddedStatementsNode)
end
- def copy(opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), statements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6378
+ # source://prism//lib/prism/node.rb#5612
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, statements: StatementsNode?, closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#6403
+ # source://prism//lib/prism/node.rb#5637
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13054,56 +14220,38 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6435
+ # source://prism//lib/prism/node.rb#5669
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#6425
+ # source://prism//lib/prism/node.rb#5659
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#6408
+ # source://prism//lib/prism/node.rb#5642
sig { returns(Prism::Location) }
def opening_loc; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#6415
+ # source://prism//lib/prism/node.rb#5649
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#6453
+ # source://prism//lib/prism/node.rb#5674
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#6463
+ # source://prism//lib/prism/node.rb#5679
def type; end
end
end
@@ -13113,75 +14261,79 @@ end
# "foo #@bar"
# ^^^^^
#
-# source://prism//lib/prism/node.rb#6481
+# source://prism//lib/prism/node.rb#5697
class Prism::EmbeddedVariableNode < ::Prism::Node
- # def initialize: (Location operator_loc, Prism::node variable, Location location) -> void
+ # Initialize a new EmbeddedVariableNode node.
#
# @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode
#
- # source://prism//lib/prism/node.rb#6483
+ # source://prism//lib/prism/node.rb#5699
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- variable: Prism::Node,
- location: Prism::Location
+ variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)
).void
end
- def initialize(source, operator_loc, variable, location); end
+ def initialize(source, node_id, location, flags, operator_loc, variable); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6574
+ # source://prism//lib/prism/node.rb#5773
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6492
+ # source://prism//lib/prism/node.rb#5709
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6497
+ # source://prism//lib/prism/node.rb#5714
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6507
+ # source://prism//lib/prism/node.rb#5724
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6502
+ # source://prism//lib/prism/node.rb#5719
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?operator_loc: Location, ?variable: Prism::node, ?location: Location) -> EmbeddedVariableNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode) -> EmbeddedVariableNode
#
- # source://prism//lib/prism/node.rb#6512
+ # source://prism//lib/prism/node.rb#5729
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- variable: Prism::Node,
- location: Prism::Location
+ variable: T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)
).returns(Prism::EmbeddedVariableNode)
end
- def copy(operator_loc: T.unsafe(nil), variable: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), variable: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6497
+ # source://prism//lib/prism/node.rb#5714
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode }
#
- # source://prism//lib/prism/node.rb#6520
+ # source://prism//lib/prism/node.rb#5737
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13190,73 +14342,57 @@ class Prism::EmbeddedVariableNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6540
+ # source://prism//lib/prism/node.rb#5757
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#6535
+ # source://prism//lib/prism/node.rb#5752
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#6525
+ # source://prism//lib/prism/node.rb#5742
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6558
+ # source://prism//lib/prism/node.rb#5762
sig { override.returns(Symbol) }
def type; end
- # attr_reader variable: Prism::node
+ # attr_reader variable: InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode
#
- # source://prism//lib/prism/node.rb#6532
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#5749
+ sig do
+ returns(T.any(Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode))
+ end
def variable; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6568
+ # source://prism//lib/prism/node.rb#5767
def type; end
end
end
# Flags for nodes that have unescaped content.
#
-# source://prism//lib/prism/node.rb#19232
+# source://prism//lib/prism/node.rb#16723
module Prism::EncodingFlags; end
# internal bytes forced the encoding to binary
#
-# source://prism//lib/prism/node.rb#19237
+# source://prism//lib/prism/node.rb#16728
Prism::EncodingFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to UTF-8
#
-# source://prism//lib/prism/node.rb#19234
+# source://prism//lib/prism/node.rb#16725
Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
# Represents an `ensure` clause in a `begin` statement.
@@ -13268,101 +14404,105 @@ Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
# bar
# end
#
-# source://prism//lib/prism/node.rb#6589
+# source://prism//lib/prism/node.rb#5788
class Prism::EnsureNode < ::Prism::Node
- # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void
+ # Initialize a new EnsureNode node.
#
# @return [EnsureNode] a new instance of EnsureNode
#
- # source://prism//lib/prism/node.rb#6591
+ # source://prism//lib/prism/node.rb#5790
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
ensure_keyword_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).void
end
- def initialize(source, ensure_keyword_loc, statements, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6697
+ # source://prism//lib/prism/node.rb#5879
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6601
+ # source://prism//lib/prism/node.rb#5801
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6606
+ # source://prism//lib/prism/node.rb#5806
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6618
+ # source://prism//lib/prism/node.rb#5818
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6611
+ # source://prism//lib/prism/node.rb#5811
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location, ?location: Location) -> EnsureNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location) -> EnsureNode
#
- # source://prism//lib/prism/node.rb#6623
+ # source://prism//lib/prism/node.rb#5823
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
ensure_keyword_loc: Prism::Location,
statements: T.nilable(Prism::StatementsNode),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).returns(Prism::EnsureNode)
end
- def copy(ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), ensure_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6606
+ # source://prism//lib/prism/node.rb#5806
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, ensure_keyword_loc: Location, statements: StatementsNode?, end_keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#6631
+ # source://prism//lib/prism/node.rb#5831
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#6658
+ # source://prism//lib/prism/node.rb#5858
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#6646
+ # source://prism//lib/prism/node.rb#5846
sig { returns(Prism::Location) }
def end_keyword_loc; end
# def ensure_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#6653
+ # source://prism//lib/prism/node.rb#5853
sig { returns(String) }
def ensure_keyword; end
# attr_reader ensure_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#6636
+ # source://prism//lib/prism/node.rb#5836
sig { returns(Prism::Location) }
def ensure_keyword_loc; end
@@ -13371,44 +14511,26 @@ class Prism::EnsureNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6663
+ # source://prism//lib/prism/node.rb#5863
sig { override.returns(String) }
def inspect; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#6643
+ # source://prism//lib/prism/node.rb#5843
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#6681
+ # source://prism//lib/prism/node.rb#5868
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6691
+ # source://prism//lib/prism/node.rb#5873
def type; end
end
end
@@ -13418,62 +14540,62 @@ end
# false
# ^^^^^
#
-# source://prism//lib/prism/node.rb#6709
+# source://prism//lib/prism/node.rb#5891
class Prism::FalseNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new FalseNode node.
#
# @return [FalseNode] a new instance of FalseNode
#
- # source://prism//lib/prism/node.rb#6711
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#5893
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6785
+ # source://prism//lib/prism/node.rb#5950
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6718
+ # source://prism//lib/prism/node.rb#5901
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6723
+ # source://prism//lib/prism/node.rb#5906
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6733
+ # source://prism//lib/prism/node.rb#5916
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6728
+ # source://prism//lib/prism/node.rb#5911
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> FalseNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> FalseNode
#
- # source://prism//lib/prism/node.rb#6738
- sig { params(location: Prism::Location).returns(Prism::FalseNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#5921
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::FalseNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6723
+ # source://prism//lib/prism/node.rb#5906
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#6746
+ # source://prism//lib/prism/node.rb#5929
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13482,38 +14604,20 @@ class Prism::FalseNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6751
+ # source://prism//lib/prism/node.rb#5934
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#6769
+ # source://prism//lib/prism/node.rb#5939
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6779
+ # source://prism//lib/prism/node.rb#5944
def type; end
end
end
@@ -13529,101 +14633,105 @@ end
# foo in Foo(*bar, baz, *qux)
# ^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#6800
+# source://prism//lib/prism/node.rb#5965
class Prism::FindPatternNode < ::Prism::Node
- # def initialize: (Prism::node? constant, Prism::node left, Array[Prism::node] requireds, Prism::node right, Location? opening_loc, Location? closing_loc, Location location) -> void
+ # Initialize a new FindPatternNode node.
#
# @return [FindPatternNode] a new instance of FindPatternNode
#
- # source://prism//lib/prism/node.rb#6802
+ # source://prism//lib/prism/node.rb#5967
sig do
params(
source: Prism::Source,
- constant: T.nilable(Prism::Node),
- left: Prism::Node,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
+ left: Prism::SplatNode,
requireds: T::Array[Prism::Node],
- right: Prism::Node,
+ right: T.any(Prism::SplatNode, Prism::MissingNode),
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, constant, left, requireds, right, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#6935
+ # source://prism//lib/prism/node.rb#6083
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6815
+ # source://prism//lib/prism/node.rb#5981
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6820
+ # source://prism//lib/prism/node.rb#5986
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#6896
+ # source://prism//lib/prism/node.rb#6062
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#6878
+ # source://prism//lib/prism/node.rb#6044
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6835
+ # source://prism//lib/prism/node.rb#6001
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6825
+ # source://prism//lib/prism/node.rb#5991
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader constant: Prism::node?
+ # attr_reader constant: ConstantReadNode | ConstantPathNode | nil
#
- # source://prism//lib/prism/node.rb#6853
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#6019
+ sig { returns(T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode))) }
def constant; end
- # def copy: (?constant: Prism::node?, ?left: Prism::node, ?requireds: Array[Prism::node], ?right: Prism::node, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> FindPatternNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?left: SplatNode, ?requireds: Array[Prism::node], ?right: SplatNode | MissingNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode
#
- # source://prism//lib/prism/node.rb#6840
+ # source://prism//lib/prism/node.rb#6006
sig do
params(
- constant: T.nilable(Prism::Node),
- left: Prism::Node,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
+ left: Prism::SplatNode,
requireds: T::Array[Prism::Node],
- right: Prism::Node,
+ right: T.any(Prism::SplatNode, Prism::MissingNode),
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::FindPatternNode)
end
- def copy(constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), left: T.unsafe(nil), requireds: T.unsafe(nil), right: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6820
+ # source://prism//lib/prism/node.rb#5986
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, left: Prism::node, requireds: Array[Prism::node], right: Prism::node, opening_loc: Location?, closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, left: SplatNode, requireds: Array[Prism::node], right: SplatNode | MissingNode, opening_loc: Location?, closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#6848
+ # source://prism//lib/prism/node.rb#6014
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13632,68 +14740,50 @@ class Prism::FindPatternNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#6901
+ # source://prism//lib/prism/node.rb#6067
sig { override.returns(String) }
def inspect; end
- # attr_reader left: Prism::node
+ # attr_reader left: SplatNode
#
- # source://prism//lib/prism/node.rb#6856
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#6022
+ sig { returns(Prism::SplatNode) }
def left; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#6891
+ # source://prism//lib/prism/node.rb#6057
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#6865
+ # source://prism//lib/prism/node.rb#6031
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader requireds: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#6859
+ # source://prism//lib/prism/node.rb#6025
sig { returns(T::Array[Prism::Node]) }
def requireds; end
- # attr_reader right: Prism::node
+ # attr_reader right: SplatNode | MissingNode
#
- # source://prism//lib/prism/node.rb#6862
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#6028
+ sig { returns(T.any(Prism::SplatNode, Prism::MissingNode)) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#6919
+ # source://prism//lib/prism/node.rb#6072
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#6929
+ # source://prism//lib/prism/node.rb#6077
def type; end
end
end
@@ -13703,79 +14793,81 @@ end
# baz if foo .. bar
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#6951
+# source://prism//lib/prism/node.rb#6099
class Prism::FlipFlopNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void
+ # Initialize a new FlipFlopNode node.
#
# @return [FlipFlopNode] a new instance of FlipFlopNode
#
- # source://prism//lib/prism/node.rb#6953
+ # source://prism//lib/prism/node.rb#6101
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
left: T.nilable(Prism::Node),
right: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, flags, left, right, operator_loc, location); end
+ def initialize(source, node_id, location, flags, left, right, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7061
+ # source://prism//lib/prism/node.rb#6187
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#6964
+ # source://prism//lib/prism/node.rb#6112
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6969
+ # source://prism//lib/prism/node.rb#6117
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#6982
+ # source://prism//lib/prism/node.rb#6130
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#6974
+ # source://prism//lib/prism/node.rb#6122
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> FlipFlopNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> FlipFlopNode
#
- # source://prism//lib/prism/node.rb#6987
+ # source://prism//lib/prism/node.rb#6135
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
left: T.nilable(Prism::Node),
right: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::FlipFlopNode)
end
- def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#6969
+ # source://prism//lib/prism/node.rb#6117
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#6995
+ # source://prism//lib/prism/node.rb#6143
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13783,7 +14875,7 @@ class Prism::FlipFlopNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#7017
+ # source://prism//lib/prism/node.rb#6148
sig { returns(T::Boolean) }
def exclude_end?; end
@@ -13792,70 +14884,44 @@ class Prism::FlipFlopNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7027
+ # source://prism//lib/prism/node.rb#6171
sig { override.returns(String) }
def inspect; end
# attr_reader left: Prism::node?
#
- # source://prism//lib/prism/node.rb#7004
+ # source://prism//lib/prism/node.rb#6153
sig { returns(T.nilable(Prism::Node)) }
def left; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#7022
+ # source://prism//lib/prism/node.rb#6166
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#7010
+ # source://prism//lib/prism/node.rb#6159
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader right: Prism::node?
#
- # source://prism//lib/prism/node.rb#7007
+ # source://prism//lib/prism/node.rb#6156
sig { returns(T.nilable(Prism::Node)) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7045
+ # source://prism//lib/prism/node.rb#6176
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#7000
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#7055
+ # source://prism//lib/prism/node.rb#6181
def type; end
end
end
@@ -13865,62 +14931,62 @@ end
# 1.0
# ^^^
#
-# source://prism//lib/prism/node.rb#7074
+# source://prism//lib/prism/node.rb#6200
class Prism::FloatNode < ::Prism::Node
- # def initialize: (Float value, Location location) -> void
+ # Initialize a new FloatNode node.
#
# @return [FloatNode] a new instance of FloatNode
#
- # source://prism//lib/prism/node.rb#7076
- sig { params(source: Prism::Source, value: Float, location: Prism::Location).void }
- def initialize(source, value, location); end
+ # source://prism//lib/prism/node.rb#6202
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, value: Float).void }
+ def initialize(source, node_id, location, flags, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7154
+ # source://prism//lib/prism/node.rb#6263
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7084
+ # source://prism//lib/prism/node.rb#6211
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7089
+ # source://prism//lib/prism/node.rb#6216
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7099
+ # source://prism//lib/prism/node.rb#6226
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7094
+ # source://prism//lib/prism/node.rb#6221
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Float, ?location: Location) -> FloatNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Float) -> FloatNode
#
- # source://prism//lib/prism/node.rb#7104
- sig { params(value: Float, location: Prism::Location).returns(Prism::FloatNode) }
- def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#6231
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, value: Float).returns(Prism::FloatNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7089
+ # source://prism//lib/prism/node.rb#6216
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Float, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Float }
#
- # source://prism//lib/prism/node.rb#7112
+ # source://prism//lib/prism/node.rb#6239
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -13929,44 +14995,26 @@ class Prism::FloatNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7120
+ # source://prism//lib/prism/node.rb#6247
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7138
+ # source://prism//lib/prism/node.rb#6252
sig { override.returns(Symbol) }
def type; end
# The value of the floating point number as a Float.
#
- # source://prism//lib/prism/node.rb#7117
+ # source://prism//lib/prism/node.rb#6244
sig { returns(Float) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7148
+ # source://prism//lib/prism/node.rb#6257
def type; end
end
end
@@ -13976,115 +15024,128 @@ end
# for i in a end
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#7164
+# source://prism//lib/prism/node.rb#6273
class Prism::ForNode < ::Prism::Node
- # def initialize: (Prism::node index, Prism::node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc, Location location) -> void
+ # Initialize a new ForNode node.
#
# @return [ForNode] a new instance of ForNode
#
- # source://prism//lib/prism/node.rb#7166
+ # source://prism//lib/prism/node.rb#6275
sig do
params(
source: Prism::Source,
- index: Prism::Node,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode),
collection: Prism::Node,
statements: T.nilable(Prism::StatementsNode),
for_keyword_loc: Prism::Location,
in_keyword_loc: Prism::Location,
do_keyword_loc: T.nilable(Prism::Location),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).void
end
- def initialize(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7314
+ # source://prism//lib/prism/node.rb#6429
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7180
+ # source://prism//lib/prism/node.rb#6290
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7185
+ # source://prism//lib/prism/node.rb#6295
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
- # attr_reader collection: Prism::node
+ # The collection to iterate over.
#
- # source://prism//lib/prism/node.rb#7220
+ # for i in a end
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#6336
sig { returns(Prism::Node) }
def collection; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7199
+ # source://prism//lib/prism/node.rb#6309
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7190
+ # source://prism//lib/prism/node.rb#6300
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?index: Prism::node, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location, ?location: Location) -> ForNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, ?collection: Prism::node, ?statements: StatementsNode?, ?for_keyword_loc: Location, ?in_keyword_loc: Location, ?do_keyword_loc: Location?, ?end_keyword_loc: Location) -> ForNode
#
- # source://prism//lib/prism/node.rb#7204
+ # source://prism//lib/prism/node.rb#6314
sig do
params(
- index: Prism::Node,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ index: T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode),
collection: Prism::Node,
statements: T.nilable(Prism::StatementsNode),
for_keyword_loc: Prism::Location,
in_keyword_loc: Prism::Location,
do_keyword_loc: T.nilable(Prism::Location),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ end_keyword_loc: Prism::Location
).returns(Prism::ForNode)
end
- def copy(index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), index: T.unsafe(nil), collection: T.unsafe(nil), statements: T.unsafe(nil), for_keyword_loc: T.unsafe(nil), in_keyword_loc: T.unsafe(nil), do_keyword_loc: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7185
+ # source://prism//lib/prism/node.rb#6295
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { index: Prism::node, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, index: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode, collection: Prism::node, statements: StatementsNode?, for_keyword_loc: Location, in_keyword_loc: Location, do_keyword_loc: Location?, end_keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#7212
+ # source://prism//lib/prism/node.rb#6322
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def do_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#7270
+ # source://prism//lib/prism/node.rb#6403
sig { returns(T.nilable(String)) }
def do_keyword; end
- # attr_reader do_keyword_loc: Location?
+ # The location of the `do` keyword, if present.
#
- # source://prism//lib/prism/node.rb#7240
+ # for i in a do end
+ # ^^
+ #
+ # source://prism//lib/prism/node.rb#6370
sig { returns(T.nilable(Prism::Location)) }
def do_keyword_loc; end
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#7275
+ # source://prism//lib/prism/node.rb#6408
sig { returns(String) }
def end_keyword; end
- # attr_reader end_keyword_loc: Location
+ # The location of the `end` keyword.
+ #
+ # for i in a end
+ # ^^^
#
- # source://prism//lib/prism/node.rb#7253
+ # source://prism//lib/prism/node.rb#6386
sig { returns(Prism::Location) }
def end_keyword_loc; end
@@ -14093,74 +15154,72 @@ class Prism::ForNode < ::Prism::Node
# def for_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#7260
+ # source://prism//lib/prism/node.rb#6393
sig { returns(String) }
def for_keyword; end
- # attr_reader for_keyword_loc: Location
+ # The location of the `for` keyword.
+ #
+ # for i in a end
+ # ^^^
#
- # source://prism//lib/prism/node.rb#7226
+ # source://prism//lib/prism/node.rb#6350
sig { returns(Prism::Location) }
def for_keyword_loc; end
# def in_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#7265
+ # source://prism//lib/prism/node.rb#6398
sig { returns(String) }
def in_keyword; end
- # attr_reader in_keyword_loc: Location
+ # The location of the `in` keyword.
#
- # source://prism//lib/prism/node.rb#7233
+ # for i in a end
+ # ^^
+ #
+ # source://prism//lib/prism/node.rb#6360
sig { returns(Prism::Location) }
def in_keyword_loc; end
- # attr_reader index: Prism::node
+ # The index expression for `for` loops.
#
- # source://prism//lib/prism/node.rb#7217
- sig { returns(Prism::Node) }
+ # for i in a end
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#6330
+ sig do
+ returns(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode))
+ end
def index; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7280
+ # source://prism//lib/prism/node.rb#6413
sig { override.returns(String) }
def inspect; end
- # attr_reader statements: StatementsNode?
+ # Represents the body of statements to execute for each iteration of the loop.
#
- # source://prism//lib/prism/node.rb#7223
+ # for i in a
+ # foo(i)
+ # ^^^^^^
+ # end
+ #
+ # source://prism//lib/prism/node.rb#6344
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7298
+ # source://prism//lib/prism/node.rb#6418
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7308
+ # source://prism//lib/prism/node.rb#6423
def type; end
end
end
@@ -14172,62 +15231,62 @@ end
# ^^^
# end
#
-# source://prism//lib/prism/node.rb#7332
+# source://prism//lib/prism/node.rb#6447
class Prism::ForwardingArgumentsNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new ForwardingArgumentsNode node.
#
# @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode
#
- # source://prism//lib/prism/node.rb#7334
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#6449
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7408
+ # source://prism//lib/prism/node.rb#6506
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7341
+ # source://prism//lib/prism/node.rb#6457
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7346
+ # source://prism//lib/prism/node.rb#6462
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7356
+ # source://prism//lib/prism/node.rb#6472
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7351
+ # source://prism//lib/prism/node.rb#6467
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> ForwardingArgumentsNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingArgumentsNode
#
- # source://prism//lib/prism/node.rb#7361
- sig { params(location: Prism::Location).returns(Prism::ForwardingArgumentsNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#6477
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ForwardingArgumentsNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7346
+ # source://prism//lib/prism/node.rb#6462
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#7369
+ # source://prism//lib/prism/node.rb#6485
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -14236,38 +15295,20 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7374
+ # source://prism//lib/prism/node.rb#6490
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7392
+ # source://prism//lib/prism/node.rb#6495
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#7402
+ # source://prism//lib/prism/node.rb#6500
def type; end
end
end
@@ -14278,62 +15319,62 @@ end
# ^^^
# end
#
-# source://prism//lib/prism/node.rb#7418
+# source://prism//lib/prism/node.rb#6516
class Prism::ForwardingParameterNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new ForwardingParameterNode node.
#
# @return [ForwardingParameterNode] a new instance of ForwardingParameterNode
#
- # source://prism//lib/prism/node.rb#7420
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#6518
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7494
+ # source://prism//lib/prism/node.rb#6575
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7427
+ # source://prism//lib/prism/node.rb#6526
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7432
+ # source://prism//lib/prism/node.rb#6531
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7442
+ # source://prism//lib/prism/node.rb#6541
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7437
+ # source://prism//lib/prism/node.rb#6536
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> ForwardingParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ForwardingParameterNode
#
- # source://prism//lib/prism/node.rb#7447
- sig { params(location: Prism::Location).returns(Prism::ForwardingParameterNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#6546
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ForwardingParameterNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7432
+ # source://prism//lib/prism/node.rb#6531
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#7455
+ # source://prism//lib/prism/node.rb#6554
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -14342,38 +15383,20 @@ class Prism::ForwardingParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7460
+ # source://prism//lib/prism/node.rb#6559
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#7478
+ # source://prism//lib/prism/node.rb#6564
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7488
+ # source://prism//lib/prism/node.rb#6569
def type; end
end
end
@@ -14383,68 +15406,83 @@ end
# super
# ^^^^^
#
-# source://prism//lib/prism/node.rb#7503
+# source://prism//lib/prism/node.rb#6584
class Prism::ForwardingSuperNode < ::Prism::Node
- # def initialize: (BlockNode? block, Location location) -> void
+ # Initialize a new ForwardingSuperNode node.
#
# @return [ForwardingSuperNode] a new instance of ForwardingSuperNode
#
- # source://prism//lib/prism/node.rb#7505
- sig { params(source: Prism::Source, block: T.nilable(Prism::BlockNode), location: Prism::Location).void }
- def initialize(source, block, location); end
+ # source://prism//lib/prism/node.rb#6586
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ block: T.nilable(Prism::BlockNode)
+ ).void
+ end
+ def initialize(source, node_id, location, flags, block); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7585
+ # source://prism//lib/prism/node.rb#6649
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7513
+ # source://prism//lib/prism/node.rb#6595
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader block: BlockNode?
#
- # source://prism//lib/prism/node.rb#7548
+ # source://prism//lib/prism/node.rb#6630
sig { returns(T.nilable(Prism::BlockNode)) }
def block; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7518
+ # source://prism//lib/prism/node.rb#6600
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7530
+ # source://prism//lib/prism/node.rb#6612
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7523
+ # source://prism//lib/prism/node.rb#6605
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?block: BlockNode?, ?location: Location) -> ForwardingSuperNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?block: BlockNode?) -> ForwardingSuperNode
#
- # source://prism//lib/prism/node.rb#7535
- sig { params(block: T.nilable(Prism::BlockNode), location: Prism::Location).returns(Prism::ForwardingSuperNode) }
- def copy(block: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#6617
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ block: T.nilable(Prism::BlockNode)
+ ).returns(Prism::ForwardingSuperNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), block: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7518
+ # source://prism//lib/prism/node.rb#6600
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, block: BlockNode? }
#
- # source://prism//lib/prism/node.rb#7543
+ # source://prism//lib/prism/node.rb#6625
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -14453,38 +15491,20 @@ class Prism::ForwardingSuperNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7551
+ # source://prism//lib/prism/node.rb#6633
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#7569
+ # source://prism//lib/prism/node.rb#6638
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7579
+ # source://prism//lib/prism/node.rb#6643
def type; end
end
end
@@ -14494,83 +15514,87 @@ end
# $target &&= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#7595
+# source://prism//lib/prism/node.rb#6659
class Prism::GlobalVariableAndWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new GlobalVariableAndWriteNode node.
#
# @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#7597
+ # source://prism//lib/prism/node.rb#6661
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7700
+ # source://prism//lib/prism/node.rb#6747
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7608
+ # source://prism//lib/prism/node.rb#6673
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7613
+ # source://prism//lib/prism/node.rb#6678
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7623
+ # source://prism//lib/prism/node.rb#6688
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7618
+ # source://prism//lib/prism/node.rb#6683
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#7628
+ # source://prism//lib/prism/node.rb#6693
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::GlobalVariableAndWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7613
+ # source://prism//lib/prism/node.rb#6678
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#7636
+ # source://prism//lib/prism/node.rb#6701
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#163
+ # source://prism//lib/prism/desugar_compiler.rb#200
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -14578,68 +15602,50 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7666
+ # source://prism//lib/prism/node.rb#6731
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#7641
+ # source://prism//lib/prism/node.rb#6706
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#7644
+ # source://prism//lib/prism/node.rb#6709
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#7661
+ # source://prism//lib/prism/node.rb#6726
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#7651
+ # source://prism//lib/prism/node.rb#6716
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#7684
+ # source://prism//lib/prism/node.rb#6736
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#7658
+ # source://prism//lib/prism/node.rb#6723
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#7694
+ # source://prism//lib/prism/node.rb#6741
def type; end
end
end
@@ -14649,97 +15655,101 @@ end
# $target += value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#7713
+# source://prism//lib/prism/node.rb#6760
class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
+ # Initialize a new GlobalVariableOperatorWriteNode node.
#
# @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#7715
+ # source://prism//lib/prism/node.rb#6762
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).void
end
- def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7817
+ # source://prism//lib/prism/node.rb#6847
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7727
+ # source://prism//lib/prism/node.rb#6775
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#7780
+ # source://prism//lib/prism/node.rb#6828
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#7770
+ # source://prism//lib/prism/node.rb#6818
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7732
+ # source://prism//lib/prism/node.rb#6780
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7742
+ # source://prism//lib/prism/node.rb#6790
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7737
+ # source://prism//lib/prism/node.rb#6785
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> GlobalVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#7747
+ # source://prism//lib/prism/node.rb#6795
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).returns(Prism::GlobalVariableOperatorWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7732
+ # source://prism//lib/prism/node.rb#6780
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
#
- # source://prism//lib/prism/node.rb#7755
+ # source://prism//lib/prism/node.rb#6803
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#175
+ # source://prism//lib/prism/desugar_compiler.rb#212
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -14747,68 +15757,50 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7783
+ # source://prism//lib/prism/node.rb#6831
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#7760
+ # source://prism//lib/prism/node.rb#6808
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#7763
+ # source://prism//lib/prism/node.rb#6811
sig { returns(Prism::Location) }
def name_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#371
+ # source://prism//lib/prism/node_ext.rb#403
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#378
+ # source://prism//lib/prism/node_ext.rb#410
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#7801
+ # source://prism//lib/prism/node.rb#6836
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#7777
+ # source://prism//lib/prism/node.rb#6825
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#7811
+ # source://prism//lib/prism/node.rb#6841
def type; end
end
end
@@ -14818,83 +15810,87 @@ end
# $target ||= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#7831
+# source://prism//lib/prism/node.rb#6861
class Prism::GlobalVariableOrWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new GlobalVariableOrWriteNode node.
#
# @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#7833
+ # source://prism//lib/prism/node.rb#6863
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#7936
+ # source://prism//lib/prism/node.rb#6949
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7844
+ # source://prism//lib/prism/node.rb#6875
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7849
+ # source://prism//lib/prism/node.rb#6880
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7859
+ # source://prism//lib/prism/node.rb#6890
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7854
+ # source://prism//lib/prism/node.rb#6885
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> GlobalVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#7864
+ # source://prism//lib/prism/node.rb#6895
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::GlobalVariableOrWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7849
+ # source://prism//lib/prism/node.rb#6880
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#7872
+ # source://prism//lib/prism/node.rb#6903
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#169
+ # source://prism//lib/prism/desugar_compiler.rb#206
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -14902,68 +15898,50 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7902
+ # source://prism//lib/prism/node.rb#6933
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#7877
+ # source://prism//lib/prism/node.rb#6908
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#7880
+ # source://prism//lib/prism/node.rb#6911
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#7897
+ # source://prism//lib/prism/node.rb#6928
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#7887
+ # source://prism//lib/prism/node.rb#6918
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#7920
+ # source://prism//lib/prism/node.rb#6938
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#7894
+ # source://prism//lib/prism/node.rb#6925
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#7930
+ # source://prism//lib/prism/node.rb#6943
def type; end
end
end
@@ -14973,62 +15951,69 @@ end
# $foo
# ^^^^
#
-# source://prism//lib/prism/node.rb#7949
+# source://prism//lib/prism/node.rb#6962
class Prism::GlobalVariableReadNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new GlobalVariableReadNode node.
#
# @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode
#
- # source://prism//lib/prism/node.rb#7951
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#6964
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8033
+ # source://prism//lib/prism/node.rb#7029
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#7959
+ # source://prism//lib/prism/node.rb#6973
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7964
+ # source://prism//lib/prism/node.rb#6978
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#7974
+ # source://prism//lib/prism/node.rb#6988
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#7969
+ # source://prism//lib/prism/node.rb#6983
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableReadNode
#
- # source://prism//lib/prism/node.rb#7979
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableReadNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#6993
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::GlobalVariableReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#7964
+ # source://prism//lib/prism/node.rb#6978
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#7987
+ # source://prism//lib/prism/node.rb#7001
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -15037,7 +16022,7 @@ class Prism::GlobalVariableReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#7999
+ # source://prism//lib/prism/node.rb#7013
sig { override.returns(String) }
def inspect; end
@@ -15047,38 +16032,20 @@ class Prism::GlobalVariableReadNode < ::Prism::Node
#
# $_Test # name `:$_Test`
#
- # source://prism//lib/prism/node.rb#7996
+ # source://prism//lib/prism/node.rb#7010
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8017
+ # source://prism//lib/prism/node.rb#7018
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#8027
+ # source://prism//lib/prism/node.rb#7023
def type; end
end
end
@@ -15088,62 +16055,69 @@ end
# $foo, $bar = baz
# ^^^^ ^^^^
#
-# source://prism//lib/prism/node.rb#8043
+# source://prism//lib/prism/node.rb#7039
class Prism::GlobalVariableTargetNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new GlobalVariableTargetNode node.
#
# @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#8045
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#7041
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8123
+ # source://prism//lib/prism/node.rb#7102
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8053
+ # source://prism//lib/prism/node.rb#7050
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8058
+ # source://prism//lib/prism/node.rb#7055
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8068
+ # source://prism//lib/prism/node.rb#7065
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8063
+ # source://prism//lib/prism/node.rb#7060
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> GlobalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#8073
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableTargetNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#7070
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::GlobalVariableTargetNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8058
+ # source://prism//lib/prism/node.rb#7055
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#8081
+ # source://prism//lib/prism/node.rb#7078
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -15152,44 +16126,26 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8089
+ # source://prism//lib/prism/node.rb#7086
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#8086
+ # source://prism//lib/prism/node.rb#7083
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#8107
+ # source://prism//lib/prism/node.rb#7091
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8117
+ # source://prism//lib/prism/node.rb#7096
def type; end
end
end
@@ -15199,79 +16155,83 @@ end
# $foo = 1
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#8133
+# source://prism//lib/prism/node.rb#7112
class Prism::GlobalVariableWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void
+ # Initialize a new GlobalVariableWriteNode node.
#
# @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode
#
- # source://prism//lib/prism/node.rb#8135
+ # source://prism//lib/prism/node.rb#7114
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, name, name_loc, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8254
+ # source://prism//lib/prism/node.rb#7216
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8146
+ # source://prism//lib/prism/node.rb#7126
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8151
+ # source://prism//lib/prism/node.rb#7131
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8161
+ # source://prism//lib/prism/node.rb#7141
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8156
+ # source://prism//lib/prism/node.rb#7136
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> GlobalVariableWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> GlobalVariableWriteNode
#
- # source://prism//lib/prism/node.rb#8166
+ # source://prism//lib/prism/node.rb#7146
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::GlobalVariableWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8151
+ # source://prism//lib/prism/node.rb#7131
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#8174
+ # source://prism//lib/prism/node.rb#7154
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -15280,7 +16240,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8220
+ # source://prism//lib/prism/node.rb#7200
sig { override.returns(String) }
def inspect; end
@@ -15290,7 +16250,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node
#
# $_Test = 123 # name `:$_Test`
#
- # source://prism//lib/prism/node.rb#8183
+ # source://prism//lib/prism/node.rb#7163
sig { returns(Symbol) }
def name; end
@@ -15299,13 +16259,13 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node
# $foo = :bar
# ^^^^
#
- # source://prism//lib/prism/node.rb#8189
+ # source://prism//lib/prism/node.rb#7169
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#8215
+ # source://prism//lib/prism/node.rb#7195
sig { returns(String) }
def operator; end
@@ -15314,26 +16274,13 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node
# $foo = :bar
# ^
#
- # source://prism//lib/prism/node.rb#8208
+ # source://prism//lib/prism/node.rb#7188
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8238
+ # source://prism//lib/prism/node.rb#7205
sig { override.returns(Symbol) }
def type; end
@@ -15345,19 +16292,14 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node
# $-xyz = 123
# ^^^
#
- # source://prism//lib/prism/node.rb#8202
+ # source://prism//lib/prism/node.rb#7182
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#8248
+ # source://prism//lib/prism/node.rb#7210
def type; end
end
end
@@ -15367,45 +16309,47 @@ end
# { a => b }
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#8267
+# source://prism//lib/prism/node.rb#7229
class Prism::HashNode < ::Prism::Node
- # def initialize: (Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc, Location location) -> void
+ # Initialize a new HashNode node.
#
# @return [HashNode] a new instance of HashNode
#
- # source://prism//lib/prism/node.rb#8269
+ # source://prism//lib/prism/node.rb#7231
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, opening_loc, elements, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, elements, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8385
+ # source://prism//lib/prism/node.rb#7330
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8279
+ # source://prism//lib/prism/node.rb#7242
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8284
+ # source://prism//lib/prism/node.rb#7247
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#8346
+ # source://prism//lib/prism/node.rb#7309
sig { returns(String) }
def closing; end
@@ -15414,45 +16358,47 @@ class Prism::HashNode < ::Prism::Node
# { a => b }
# ^
#
- # source://prism//lib/prism/node.rb#8334
+ # source://prism//lib/prism/node.rb#7297
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8294
+ # source://prism//lib/prism/node.rb#7257
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8289
+ # source://prism//lib/prism/node.rb#7252
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location, ?location: Location) -> HashNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location) -> HashNode
#
- # source://prism//lib/prism/node.rb#8299
+ # source://prism//lib/prism/node.rb#7262
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::HashNode)
end
- def copy(opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), elements: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8284
+ # source://prism//lib/prism/node.rb#7247
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#8307
+ # source://prism//lib/prism/node.rb#7270
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -15464,7 +16410,7 @@ class Prism::HashNode < ::Prism::Node
# { **foo }
# ^^^^^
#
- # source://prism//lib/prism/node.rb#8328
+ # source://prism//lib/prism/node.rb#7291
sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) }
def elements; end
@@ -15473,13 +16419,13 @@ class Prism::HashNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8351
+ # source://prism//lib/prism/node.rb#7314
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#8341
+ # source://prism//lib/prism/node.rb#7304
sig { returns(String) }
def opening; end
@@ -15488,38 +16434,20 @@ class Prism::HashNode < ::Prism::Node
# { a => b }
# ^
#
- # source://prism//lib/prism/node.rb#8315
+ # source://prism//lib/prism/node.rb#7278
sig { returns(Prism::Location) }
def opening_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#8369
+ # source://prism//lib/prism/node.rb#7319
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8379
+ # source://prism//lib/prism/node.rb#7324
def type; end
end
end
@@ -15532,105 +16460,109 @@ end
# foo => { a: 1, b: 2, **c }
# ^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#8401
+# source://prism//lib/prism/node.rb#7346
class Prism::HashPatternNode < ::Prism::Node
- # def initialize: (Prism::node? constant, Array[AssocNode] elements, AssocSplatNode | NoKeywordsParameterNode | nil rest, Location? opening_loc, Location? closing_loc, Location location) -> void
+ # Initialize a new HashPatternNode node.
#
# @return [HashPatternNode] a new instance of HashPatternNode
#
- # source://prism//lib/prism/node.rb#8403
+ # source://prism//lib/prism/node.rb#7348
sig do
params(
source: Prism::Source,
- constant: T.nilable(Prism::Node),
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
elements: T::Array[Prism::AssocNode],
rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)),
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, constant, elements, rest, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8531
+ # source://prism//lib/prism/node.rb#7459
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8415
+ # source://prism//lib/prism/node.rb#7361
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8420
+ # source://prism//lib/prism/node.rb#7366
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#8492
+ # source://prism//lib/prism/node.rb#7438
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#8474
+ # source://prism//lib/prism/node.rb#7420
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8434
+ # source://prism//lib/prism/node.rb#7380
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8425
+ # source://prism//lib/prism/node.rb#7371
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader constant: Prism::node?
+ # attr_reader constant: ConstantReadNode | ConstantPathNode | nil
#
- # source://prism//lib/prism/node.rb#8452
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#7398
+ sig { returns(T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode))) }
def constant; end
- # def copy: (?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> HashPatternNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantReadNode | ConstantPathNode | nil, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?) -> HashPatternNode
#
- # source://prism//lib/prism/node.rb#8439
+ # source://prism//lib/prism/node.rb#7385
sig do
params(
- constant: T.nilable(Prism::Node),
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ constant: T.nilable(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode)),
elements: T::Array[Prism::AssocNode],
rest: T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode)),
opening_loc: T.nilable(Prism::Location),
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::HashPatternNode)
end
- def copy(constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), constant: T.unsafe(nil), elements: T.unsafe(nil), rest: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8420
+ # source://prism//lib/prism/node.rb#7366
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, constant: ConstantReadNode | ConstantPathNode | nil, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#8447
+ # source://prism//lib/prism/node.rb#7393
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader elements: Array[AssocNode]
#
- # source://prism//lib/prism/node.rb#8455
+ # source://prism//lib/prism/node.rb#7401
sig { returns(T::Array[Prism::AssocNode]) }
def elements; end
@@ -15639,67 +16571,49 @@ class Prism::HashPatternNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8497
+ # source://prism//lib/prism/node.rb#7443
sig { override.returns(String) }
def inspect; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#8487
+ # source://prism//lib/prism/node.rb#7433
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#8461
+ # source://prism//lib/prism/node.rb#7407
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil
#
- # source://prism//lib/prism/node.rb#8458
+ # source://prism//lib/prism/node.rb#7404
sig { returns(T.nilable(T.any(Prism::AssocSplatNode, Prism::NoKeywordsParameterNode))) }
def rest; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8515
+ # source://prism//lib/prism/node.rb#7448
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#8525
+ # source://prism//lib/prism/node.rb#7453
def type; end
end
end
-# source://prism//lib/prism/node_ext.rb#46
+# source://prism//lib/prism/node_ext.rb#52
module Prism::HeredocQuery
# Returns true if this node was represented as a heredoc in the source code.
#
# @return [Boolean]
#
- # source://prism//lib/prism/node_ext.rb#48
+ # source://prism//lib/prism/node_ext.rb#54
def heredoc?; end
end
@@ -15714,107 +16628,99 @@ end
# foo ? bar : baz
# ^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#8552
+# source://prism//lib/prism/node.rb#7480
class Prism::IfNode < ::Prism::Node
- # def initialize: (Location? if_keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, Prism::node? consequent, Location? end_keyword_loc, Location location) -> void
+ # Initialize a new IfNode node.
#
# @return [IfNode] a new instance of IfNode
#
- # source://prism//lib/prism/node.rb#8554
+ # source://prism//lib/prism/node.rb#7482
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
if_keyword_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
then_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::Node),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)),
+ end_keyword_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8751
+ # source://prism//lib/prism/node.rb#7658
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8567
+ # source://prism//lib/prism/node.rb#7496
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8576
+ # source://prism//lib/prism/node.rb#7501
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8590
+ # source://prism//lib/prism/node.rb#7515
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8581
+ # source://prism//lib/prism/node.rb#7506
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement.
- #
- # if foo
- # bar
- # elsif baz
- # ^^^^^^^^^
- # qux
- # ^^^
- # end
- # ^^^
- #
- # if foo then bar else baz end
- # ^^^^^^^^^^^^
+ # Returns the subsequent if/elsif/else clause of the if node. This method is
+ # deprecated in favor of #subsequent.
#
- # source://prism//lib/prism/node.rb#8681
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node_ext.rb#485
def consequent; end
- # def copy: (?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: Prism::node?, ?end_keyword_loc: Location?, ?location: Location) -> IfNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?if_keyword_loc: Location?, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?subsequent: ElseNode | IfNode | nil, ?end_keyword_loc: Location?) -> IfNode
#
- # source://prism//lib/prism/node.rb#8595
+ # source://prism//lib/prism/node.rb#7520
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
if_keyword_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
then_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::Node),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ subsequent: T.nilable(T.any(Prism::ElseNode, Prism::IfNode)),
+ end_keyword_loc: T.nilable(Prism::Location)
).returns(Prism::IfNode)
end
- def copy(if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), if_keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8576
+ # source://prism//lib/prism/node.rb#7501
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Prism::node?, end_keyword_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, if_keyword_loc: Location?, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, subsequent: ElseNode | IfNode | nil, end_keyword_loc: Location? }
#
- # source://prism//lib/prism/node.rb#8603
+ # source://prism//lib/prism/node.rb#7528
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def end_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#8712
+ # source://prism//lib/prism/node.rb#7637
sig { returns(T.nilable(String)) }
def end_keyword; end
@@ -15825,7 +16731,7 @@ class Prism::IfNode < ::Prism::Node
# end
# ^^^
#
- # source://prism//lib/prism/node.rb#8689
+ # source://prism//lib/prism/node.rb#7614
sig { returns(T.nilable(Prism::Location)) }
def end_keyword_loc; end
@@ -15834,7 +16740,7 @@ class Prism::IfNode < ::Prism::Node
# def if_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#8702
+ # source://prism//lib/prism/node.rb#7627
sig { returns(T.nilable(String)) }
def if_keyword; end
@@ -15845,16 +16751,19 @@ class Prism::IfNode < ::Prism::Node
#
# The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression.
#
- # source://prism//lib/prism/node.rb#8613
+ # source://prism//lib/prism/node.rb#7538
sig { returns(T.nilable(Prism::Location)) }
def if_keyword_loc; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8717
+ # source://prism//lib/prism/node.rb#7642
sig { override.returns(String) }
def inspect; end
+ # source://prism//lib/prism/parse_result/newlines.rb#91
+ def newline_flag!(lines); end
+
# The node for the condition the `IfNode` is testing.
#
# if foo
@@ -15868,13 +16777,10 @@ class Prism::IfNode < ::Prism::Node
# foo ? bar : baz
# ^^^
#
- # source://prism//lib/prism/node.rb#8637
+ # source://prism//lib/prism/node.rb#7562
sig { returns(Prism::Node) }
def predicate; end
- # source://prism//lib/prism/node.rb#8571
- def set_newline_flag(newline_marked); end
-
# Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be `nil` when no body is provided.
#
# if foo
@@ -15884,13 +16790,31 @@ class Prism::IfNode < ::Prism::Node
# ^^^
# end
#
- # source://prism//lib/prism/node.rb#8666
+ # source://prism//lib/prism/node.rb#7591
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
+ # Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement.
+ #
+ # if foo
+ # bar
+ # elsif baz
+ # ^^^^^^^^^
+ # qux
+ # ^^^
+ # end
+ # ^^^
+ #
+ # if foo then bar else baz end
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/node.rb#7606
+ sig { returns(T.nilable(T.any(Prism::ElseNode, Prism::IfNode))) }
+ def subsequent; end
+
# def then_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#8707
+ # source://prism//lib/prism/node.rb#7632
sig { returns(T.nilable(String)) }
def then_keyword; end
@@ -15902,38 +16826,20 @@ class Prism::IfNode < ::Prism::Node
# a ? b : c
# ^
#
- # source://prism//lib/prism/node.rb#8646
+ # source://prism//lib/prism/node.rb#7571
sig { returns(T.nilable(Prism::Location)) }
def then_keyword_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8735
+ # source://prism//lib/prism/node.rb#7647
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#8745
+ # source://prism//lib/prism/node.rb#7652
def type; end
end
end
@@ -15943,73 +16849,77 @@ end
# 1.0i
# ^^^^
#
-# source://prism//lib/prism/node.rb#8766
+# source://prism//lib/prism/node.rb#7673
class Prism::ImaginaryNode < ::Prism::Node
- # def initialize: (FloatNode | IntegerNode | RationalNode numeric, Location location) -> void
+ # Initialize a new ImaginaryNode node.
#
# @return [ImaginaryNode] a new instance of ImaginaryNode
#
- # source://prism//lib/prism/node.rb#8768
+ # source://prism//lib/prism/node.rb#7675
sig do
params(
source: Prism::Source,
- numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode),
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)
).void
end
- def initialize(source, numeric, location); end
+ def initialize(source, node_id, location, flags, numeric); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8846
+ # source://prism//lib/prism/node.rb#7736
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8776
+ # source://prism//lib/prism/node.rb#7684
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8781
+ # source://prism//lib/prism/node.rb#7689
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8791
+ # source://prism//lib/prism/node.rb#7699
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8786
+ # source://prism//lib/prism/node.rb#7694
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?numeric: FloatNode | IntegerNode | RationalNode, ?location: Location) -> ImaginaryNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numeric: FloatNode | IntegerNode | RationalNode) -> ImaginaryNode
#
- # source://prism//lib/prism/node.rb#8796
+ # source://prism//lib/prism/node.rb#7704
sig do
params(
- numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode),
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)
).returns(Prism::ImaginaryNode)
end
- def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numeric: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8781
+ # source://prism//lib/prism/node.rb#7689
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: FloatNode | IntegerNode | RationalNode, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numeric: FloatNode | IntegerNode | RationalNode }
#
- # source://prism//lib/prism/node.rb#8804
+ # source://prism//lib/prism/node.rb#7712
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16018,50 +16928,32 @@ class Prism::ImaginaryNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8812
+ # source://prism//lib/prism/node.rb#7720
sig { override.returns(String) }
def inspect; end
# attr_reader numeric: FloatNode | IntegerNode | RationalNode
#
- # source://prism//lib/prism/node.rb#8809
+ # source://prism//lib/prism/node.rb#7717
sig { returns(T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode)) }
def numeric; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#8830
+ # source://prism//lib/prism/node.rb#7725
sig { override.returns(Symbol) }
def type; end
# Returns the value of the node as a Ruby Complex.
#
- # source://prism//lib/prism/node_ext.rb#98
+ # source://prism//lib/prism/node_ext.rb#107
sig { returns(Complex) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#8840
+ # source://prism//lib/prism/node.rb#7730
def type; end
end
end
@@ -16077,62 +16969,77 @@ end
# foo in { bar: }
# ^^^^
#
-# source://prism//lib/prism/node.rb#8862
+# source://prism//lib/prism/node.rb#7752
class Prism::ImplicitNode < ::Prism::Node
- # def initialize: (Prism::node value, Location location) -> void
+ # Initialize a new ImplicitNode node.
#
# @return [ImplicitNode] a new instance of ImplicitNode
#
- # source://prism//lib/prism/node.rb#8864
- sig { params(source: Prism::Source, value: Prism::Node, location: Prism::Location).void }
- def initialize(source, value, location); end
+ # source://prism//lib/prism/node.rb#7754
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode)
+ ).void
+ end
+ def initialize(source, node_id, location, flags, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#8942
+ # source://prism//lib/prism/node.rb#7815
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8872
+ # source://prism//lib/prism/node.rb#7763
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8877
+ # source://prism//lib/prism/node.rb#7768
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8887
+ # source://prism//lib/prism/node.rb#7778
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8882
+ # source://prism//lib/prism/node.rb#7773
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Prism::node, ?location: Location) -> ImplicitNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode) -> ImplicitNode
#
- # source://prism//lib/prism/node.rb#8892
- sig { params(value: Prism::Node, location: Prism::Location).returns(Prism::ImplicitNode) }
- def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#7783
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode)
+ ).returns(Prism::ImplicitNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8877
+ # source://prism//lib/prism/node.rb#7768
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode }
#
- # source://prism//lib/prism/node.rb#8900
+ # source://prism//lib/prism/node.rb#7791
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16141,44 +17048,28 @@ class Prism::ImplicitNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#8908
+ # source://prism//lib/prism/node.rb#7799
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#8926
+ # source://prism//lib/prism/node.rb#7804
sig { override.returns(Symbol) }
def type; end
- # attr_reader value: Prism::node
+ # attr_reader value: LocalVariableReadNode | CallNode | ConstantReadNode | LocalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#8905
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#7796
+ sig do
+ returns(T.any(Prism::LocalVariableReadNode, Prism::CallNode, Prism::ConstantReadNode, Prism::LocalVariableTargetNode))
+ end
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#8936
+ # source://prism//lib/prism/node.rb#7809
def type; end
end
end
@@ -16197,62 +17088,62 @@ end
# foo, = bar
# ^
#
-# source://prism//lib/prism/node.rb#8961
+# source://prism//lib/prism/node.rb#7834
class Prism::ImplicitRestNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new ImplicitRestNode node.
#
# @return [ImplicitRestNode] a new instance of ImplicitRestNode
#
- # source://prism//lib/prism/node.rb#8963
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#7836
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9037
+ # source://prism//lib/prism/node.rb#7893
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#8970
+ # source://prism//lib/prism/node.rb#7844
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8975
+ # source://prism//lib/prism/node.rb#7849
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#8985
+ # source://prism//lib/prism/node.rb#7859
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#8980
+ # source://prism//lib/prism/node.rb#7854
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> ImplicitRestNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ImplicitRestNode
#
- # source://prism//lib/prism/node.rb#8990
- sig { params(location: Prism::Location).returns(Prism::ImplicitRestNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#7864
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ImplicitRestNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#8975
+ # source://prism//lib/prism/node.rb#7849
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#8998
+ # source://prism//lib/prism/node.rb#7872
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16261,38 +17152,20 @@ class Prism::ImplicitRestNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9003
+ # source://prism//lib/prism/node.rb#7877
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#9021
+ # source://prism//lib/prism/node.rb#7882
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#9031
+ # source://prism//lib/prism/node.rb#7887
def type; end
end
end
@@ -16302,79 +17175,83 @@ end
# case a; in b then c end
# ^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9046
+# source://prism//lib/prism/node.rb#7902
class Prism::InNode < ::Prism::Node
- # def initialize: (Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void
+ # Initialize a new InNode node.
#
# @return [InNode] a new instance of InNode
#
- # source://prism//lib/prism/node.rb#9048
+ # source://prism//lib/prism/node.rb#7904
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
pattern: Prism::Node,
statements: T.nilable(Prism::StatementsNode),
in_loc: Prism::Location,
- then_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ then_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, pattern, statements, in_loc, then_loc, location); end
+ def initialize(source, node_id, location, flags, pattern, statements, in_loc, then_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9165
+ # source://prism//lib/prism/node.rb#8004
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9059
+ # source://prism//lib/prism/node.rb#7916
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9064
+ # source://prism//lib/prism/node.rb#7921
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9077
+ # source://prism//lib/prism/node.rb#7934
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9069
+ # source://prism//lib/prism/node.rb#7926
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?, ?location: Location) -> InNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?) -> InNode
#
- # source://prism//lib/prism/node.rb#9082
+ # source://prism//lib/prism/node.rb#7939
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
pattern: Prism::Node,
statements: T.nilable(Prism::StatementsNode),
in_loc: Prism::Location,
- then_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ then_loc: T.nilable(Prism::Location)
).returns(Prism::InNode)
end
- def copy(pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), pattern: T.unsafe(nil), statements: T.unsafe(nil), in_loc: T.unsafe(nil), then_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9064
+ # source://prism//lib/prism/node.rb#7921
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location? }
#
- # source://prism//lib/prism/node.rb#9090
+ # source://prism//lib/prism/node.rb#7947
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16383,74 +17260,56 @@ class Prism::InNode < ::Prism::Node
# def in: () -> String
#
- # source://prism//lib/prism/node.rb#9121
+ # source://prism//lib/prism/node.rb#7978
sig { returns(String) }
def in; end
# attr_reader in_loc: Location
#
- # source://prism//lib/prism/node.rb#9101
+ # source://prism//lib/prism/node.rb#7958
sig { returns(Prism::Location) }
def in_loc; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9131
+ # source://prism//lib/prism/node.rb#7988
sig { override.returns(String) }
def inspect; end
# attr_reader pattern: Prism::node
#
- # source://prism//lib/prism/node.rb#9095
+ # source://prism//lib/prism/node.rb#7952
sig { returns(Prism::Node) }
def pattern; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#9098
+ # source://prism//lib/prism/node.rb#7955
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
# def then: () -> String?
#
- # source://prism//lib/prism/node.rb#9126
+ # source://prism//lib/prism/node.rb#7983
sig { returns(T.nilable(String)) }
def then; end
# attr_reader then_loc: Location?
#
- # source://prism//lib/prism/node.rb#9108
+ # source://prism//lib/prism/node.rb#7965
sig { returns(T.nilable(Prism::Location)) }
def then_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#9149
+ # source://prism//lib/prism/node.rb#7993
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#9159
+ # source://prism//lib/prism/node.rb#7998
def type; end
end
end
@@ -16460,45 +17319,46 @@ end
# foo.bar[baz] &&= value
# ^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9178
+# source://prism//lib/prism/node.rb#8017
class Prism::IndexAndWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new IndexAndWriteNode node.
#
# @return [IndexAndWriteNode] a new instance of IndexAndWriteNode
#
- # source://prism//lib/prism/node.rb#9180
+ # source://prism//lib/prism/node.rb#8019
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9358
+ # source://prism//lib/prism/node.rb#8175
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9196
+ # source://prism//lib/prism/node.rb#8035
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#9261
+ # source://prism//lib/prism/node.rb#8116
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
@@ -16506,87 +17366,88 @@ class Prism::IndexAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9294
+ # source://prism//lib/prism/node.rb#8083
sig { returns(T::Boolean) }
def attribute_write?; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockArgumentNode?
#
- # source://prism//lib/prism/node.rb#9271
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#8126
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
def block; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#9304
+ # source://prism//lib/prism/node.rb#8139
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#9241
+ # source://prism//lib/prism/node.rb#8096
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9201
+ # source://prism//lib/prism/node.rb#8040
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#9314
+ # source://prism//lib/prism/node.rb#8149
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#9264
+ # source://prism//lib/prism/node.rb#8119
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9216
+ # source://prism//lib/prism/node.rb#8055
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9206
+ # source://prism//lib/prism/node.rb#8045
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexAndWriteNode
#
- # source://prism//lib/prism/node.rb#9221
+ # source://prism//lib/prism/node.rb#8060
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::IndexAndWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9201
+ # source://prism//lib/prism/node.rb#8040
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#9229
+ # source://prism//lib/prism/node.rb#8068
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16597,43 +17458,43 @@ class Prism::IndexAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9299
+ # source://prism//lib/prism/node.rb#8088
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9324
+ # source://prism//lib/prism/node.rb#8159
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#9309
+ # source://prism//lib/prism/node.rb#8144
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#9254
+ # source://prism//lib/prism/node.rb#8109
sig { returns(Prism::Location) }
def opening_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#9319
+ # source://prism//lib/prism/node.rb#8154
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#9274
+ # source://prism//lib/prism/node.rb#8129
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#9238
+ # source://prism//lib/prism/node.rb#8093
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -16641,32 +17502,19 @@ class Prism::IndexAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9284
+ # source://prism//lib/prism/node.rb#8073
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#9342
+ # source://prism//lib/prism/node.rb#8164
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#9281
+ # source://prism//lib/prism/node.rb#8136
sig { returns(Prism::Node) }
def value; end
@@ -16674,27 +17522,14 @@ class Prism::IndexAndWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9289
+ # source://prism//lib/prism/node.rb#8078
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#9234
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#9352
+ # source://prism//lib/prism/node.rb#8169
def type; end
end
end
@@ -16704,46 +17539,47 @@ end
# foo.bar[baz] += value
# ^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9376
+# source://prism//lib/prism/node.rb#8193
class Prism::IndexOperatorWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new IndexOperatorWriteNode node.
#
# @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#9378
+ # source://prism//lib/prism/node.rb#8195
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
binary_operator: Symbol,
binary_operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9555
+ # source://prism//lib/prism/node.rb#8350
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9395
+ # source://prism//lib/prism/node.rb#8212
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#9460
+ # source://prism//lib/prism/node.rb#8293
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
@@ -16751,100 +17587,101 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9496
+ # source://prism//lib/prism/node.rb#8260
sig { returns(T::Boolean) }
def attribute_write?; end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#9473
+ # source://prism//lib/prism/node.rb#8306
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#9476
+ # source://prism//lib/prism/node.rb#8309
sig { returns(Prism::Location) }
def binary_operator_loc; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockArgumentNode?
#
- # source://prism//lib/prism/node.rb#9470
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#8303
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
def block; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#9506
+ # source://prism//lib/prism/node.rb#8319
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#9440
+ # source://prism//lib/prism/node.rb#8273
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9400
+ # source://prism//lib/prism/node.rb#8217
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#9516
+ # source://prism//lib/prism/node.rb#8329
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#9463
+ # source://prism//lib/prism/node.rb#8296
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9415
+ # source://prism//lib/prism/node.rb#8232
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9405
+ # source://prism//lib/prism/node.rb#8222
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node) -> IndexOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#9420
+ # source://prism//lib/prism/node.rb#8237
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
binary_operator: Symbol,
binary_operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::IndexOperatorWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), binary_operator: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9400
+ # source://prism//lib/prism/node.rb#8217
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#9428
+ # source://prism//lib/prism/node.rb#8245
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -16855,43 +17692,43 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9501
+ # source://prism//lib/prism/node.rb#8265
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9521
+ # source://prism//lib/prism/node.rb#8334
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#9511
+ # source://prism//lib/prism/node.rb#8324
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#9453
+ # source://prism//lib/prism/node.rb#8286
sig { returns(Prism::Location) }
def opening_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#387
+ # source://prism//lib/prism/node_ext.rb#419
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#394
+ # source://prism//lib/prism/node_ext.rb#426
def operator_loc; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#9437
+ # source://prism//lib/prism/node.rb#8270
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -16899,32 +17736,19 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9486
+ # source://prism//lib/prism/node.rb#8250
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#9539
+ # source://prism//lib/prism/node.rb#8339
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#9483
+ # source://prism//lib/prism/node.rb#8316
sig { returns(Prism::Node) }
def value; end
@@ -16932,27 +17756,14 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9491
+ # source://prism//lib/prism/node.rb#8255
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#9433
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#9549
+ # source://prism//lib/prism/node.rb#8344
def type; end
end
end
@@ -16962,45 +17773,46 @@ end
# foo.bar[baz] ||= value
# ^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9574
+# source://prism//lib/prism/node.rb#8369
class Prism::IndexOrWriteNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new IndexOrWriteNode node.
#
# @return [IndexOrWriteNode] a new instance of IndexOrWriteNode
#
- # source://prism//lib/prism/node.rb#9576
+ # source://prism//lib/prism/node.rb#8371
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9754
+ # source://prism//lib/prism/node.rb#8527
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9592
+ # source://prism//lib/prism/node.rb#8387
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#9657
+ # source://prism//lib/prism/node.rb#8468
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
@@ -17008,87 +17820,88 @@ class Prism::IndexOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9690
+ # source://prism//lib/prism/node.rb#8435
sig { returns(T::Boolean) }
def attribute_write?; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockArgumentNode?
#
- # source://prism//lib/prism/node.rb#9667
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#8478
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
def block; end
# def call_operator: () -> String?
#
- # source://prism//lib/prism/node.rb#9700
+ # source://prism//lib/prism/node.rb#8491
sig { returns(T.nilable(String)) }
def call_operator; end
# attr_reader call_operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#9637
+ # source://prism//lib/prism/node.rb#8448
sig { returns(T.nilable(Prism::Location)) }
def call_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9597
+ # source://prism//lib/prism/node.rb#8392
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#9710
+ # source://prism//lib/prism/node.rb#8501
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#9660
+ # source://prism//lib/prism/node.rb#8471
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9612
+ # source://prism//lib/prism/node.rb#8407
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9602
+ # source://prism//lib/prism/node.rb#8397
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?, ?operator_loc: Location, ?value: Prism::node) -> IndexOrWriteNode
#
- # source://prism//lib/prism/node.rb#9617
+ # source://prism//lib/prism/node.rb#8412
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: T.nilable(Prism::Node),
call_operator_loc: T.nilable(Prism::Location),
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
+ block: T.nilable(Prism::BlockArgumentNode),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::IndexOrWriteNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), call_operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9597
+ # source://prism//lib/prism/node.rb#8392
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode?, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#9625
+ # source://prism//lib/prism/node.rb#8420
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -17099,43 +17912,43 @@ class Prism::IndexOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9695
+ # source://prism//lib/prism/node.rb#8440
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9720
+ # source://prism//lib/prism/node.rb#8511
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#9705
+ # source://prism//lib/prism/node.rb#8496
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#9650
+ # source://prism//lib/prism/node.rb#8461
sig { returns(Prism::Location) }
def opening_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#9715
+ # source://prism//lib/prism/node.rb#8506
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#9670
+ # source://prism//lib/prism/node.rb#8481
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader receiver: Prism::node?
#
- # source://prism//lib/prism/node.rb#9634
+ # source://prism//lib/prism/node.rb#8445
sig { returns(T.nilable(Prism::Node)) }
def receiver; end
@@ -17143,32 +17956,19 @@ class Prism::IndexOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9680
+ # source://prism//lib/prism/node.rb#8425
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#9738
+ # source://prism//lib/prism/node.rb#8516
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#9677
+ # source://prism//lib/prism/node.rb#8488
sig { returns(Prism::Node) }
def value; end
@@ -17176,27 +17976,14 @@ class Prism::IndexOrWriteNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9685
+ # source://prism//lib/prism/node.rb#8430
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#9630
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#9748
+ # source://prism//lib/prism/node.rb#8521
def type; end
end
end
@@ -17214,42 +18001,43 @@ end
# for foo[bar] in baz do end
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9780
+# source://prism//lib/prism/node.rb#8553
class Prism::IndexTargetNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location location) -> void
+ # Initialize a new IndexTargetNode node.
#
# @return [IndexTargetNode] a new instance of IndexTargetNode
#
- # source://prism//lib/prism/node.rb#9782
+ # source://prism//lib/prism/node.rb#8555
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: Prism::Node,
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(Prism::BlockArgumentNode)
).void
end
- def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); end
+ def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#9923
+ # source://prism//lib/prism/node.rb#8674
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9795
+ # source://prism//lib/prism/node.rb#8568
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#9846
+ # source://prism//lib/prism/node.rb#8635
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
@@ -17257,72 +18045,73 @@ class Prism::IndexTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9869
+ # source://prism//lib/prism/node.rb#8615
sig { returns(T::Boolean) }
def attribute_write?; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockArgumentNode?
#
- # source://prism//lib/prism/node.rb#9856
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#8645
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
def block; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9800
+ # source://prism//lib/prism/node.rb#8573
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#9884
+ # source://prism//lib/prism/node.rb#8653
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#9849
+ # source://prism//lib/prism/node.rb#8638
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9814
+ # source://prism//lib/prism/node.rb#8587
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9805
+ # source://prism//lib/prism/node.rb#8578
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?location: Location) -> IndexTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode
#
- # source://prism//lib/prism/node.rb#9819
+ # source://prism//lib/prism/node.rb#8592
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
receiver: Prism::Node,
opening_loc: Prism::Location,
arguments: T.nilable(Prism::ArgumentsNode),
closing_loc: Prism::Location,
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(Prism::BlockArgumentNode)
).returns(Prism::IndexTargetNode)
end
- def copy(flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), receiver: T.unsafe(nil), opening_loc: T.unsafe(nil), arguments: T.unsafe(nil), closing_loc: T.unsafe(nil), block: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9800
+ # source://prism//lib/prism/node.rb#8573
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode? }
#
- # source://prism//lib/prism/node.rb#9827
+ # source://prism//lib/prism/node.rb#8600
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -17333,31 +18122,31 @@ class Prism::IndexTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9874
+ # source://prism//lib/prism/node.rb#8620
sig { returns(T::Boolean) }
def ignore_visibility?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#9889
+ # source://prism//lib/prism/node.rb#8658
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#9879
+ # source://prism//lib/prism/node.rb#8648
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#9839
+ # source://prism//lib/prism/node.rb#8628
sig { returns(Prism::Location) }
def opening_loc; end
# attr_reader receiver: Prism::node
#
- # source://prism//lib/prism/node.rb#9836
+ # source://prism//lib/prism/node.rb#8625
sig { returns(Prism::Node) }
def receiver; end
@@ -17365,26 +18154,13 @@ class Prism::IndexTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9859
+ # source://prism//lib/prism/node.rb#8605
sig { returns(T::Boolean) }
def safe_navigation?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#9907
+ # source://prism//lib/prism/node.rb#8663
sig { override.returns(Symbol) }
def type; end
@@ -17392,27 +18168,14 @@ class Prism::IndexTargetNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#9864
+ # source://prism//lib/prism/node.rb#8610
sig { returns(T::Boolean) }
def variable_call?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#9832
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#9917
+ # source://prism//lib/prism/node.rb#8668
def type; end
end
end
@@ -17420,11 +18183,11 @@ end
# InlineComment objects are the most common. They correspond to comments in
# the source file like this one that start with #.
#
-# source://prism//lib/prism/parse_result.rb#388
+# source://prism//lib/prism/parse_result.rb#529
class Prism::InlineComment < ::Prism::Comment
# Returns a string representation of this comment.
#
- # source://prism//lib/prism/parse_result.rb#396
+ # source://prism//lib/prism/parse_result.rb#537
sig { returns(String) }
def inspect; end
@@ -17433,7 +18196,7 @@ class Prism::InlineComment < ::Prism::Comment
#
# @return [Boolean]
#
- # source://prism//lib/prism/parse_result.rb#391
+ # source://prism//lib/prism/parse_result.rb#532
sig { override.returns(T::Boolean) }
def trailing?; end
end
@@ -17475,759 +18238,764 @@ class Prism::InspectVisitor < ::Prism::Visitor
# Inspect a AliasMethodNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#87
+ # source://prism//lib/prism/inspect_visitor.rb#89
def visit_alias_method_node(node); end
# Inspect a AlternationPatternNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#97
+ # source://prism//lib/prism/inspect_visitor.rb#101
def visit_alternation_pattern_node(node); end
# Inspect a AndNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#107
+ # source://prism//lib/prism/inspect_visitor.rb#113
def visit_and_node(node); end
# Inspect a ArgumentsNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#117
+ # source://prism//lib/prism/inspect_visitor.rb#125
def visit_arguments_node(node); end
# Inspect a ArrayNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#133
+ # source://prism//lib/prism/inspect_visitor.rb#141
def visit_array_node(node); end
# Inspect a ArrayPatternNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#151
+ # source://prism//lib/prism/inspect_visitor.rb#159
def visit_array_pattern_node(node); end
# Inspect a AssocNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#188
+ # source://prism//lib/prism/inspect_visitor.rb#198
def visit_assoc_node(node); end
# Inspect a AssocSplatNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#198
+ # source://prism//lib/prism/inspect_visitor.rb#210
def visit_assoc_splat_node(node); end
# Inspect a BackReferenceReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#210
+ # source://prism//lib/prism/inspect_visitor.rb#224
def visit_back_reference_read_node(node); end
# Inspect a BeginNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#216
+ # source://prism//lib/prism/inspect_visitor.rb#232
def visit_begin_node(node); end
# Inspect a BlockArgumentNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#247
+ # source://prism//lib/prism/inspect_visitor.rb#265
def visit_block_argument_node(node); end
# Inspect a BlockLocalVariableNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#259
+ # source://prism//lib/prism/inspect_visitor.rb#279
def visit_block_local_variable_node(node); end
# Inspect a BlockNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#267
+ # source://prism//lib/prism/inspect_visitor.rb#287
def visit_block_node(node); end
# Inspect a BlockParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#287
+ # source://prism//lib/prism/inspect_visitor.rb#309
def visit_block_parameter_node(node); end
# Inspect a BlockParametersNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#301
+ # source://prism//lib/prism/inspect_visitor.rb#323
def visit_block_parameters_node(node); end
# Inspect a BreakNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#323
+ # source://prism//lib/prism/inspect_visitor.rb#347
def visit_break_node(node); end
# Inspect a CallAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#335
+ # source://prism//lib/prism/inspect_visitor.rb#361
def visit_call_and_write_node(node); end
# Inspect a CallNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#355
+ # source://prism//lib/prism/inspect_visitor.rb#381
def visit_call_node(node); end
# Inspect a CallOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#385
+ # source://prism//lib/prism/inspect_visitor.rb#411
def visit_call_operator_write_node(node); end
# Inspect a CallOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#406
+ # source://prism//lib/prism/inspect_visitor.rb#432
def visit_call_or_write_node(node); end
# Inspect a CallTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#426
+ # source://prism//lib/prism/inspect_visitor.rb#452
def visit_call_target_node(node); end
# Inspect a CapturePatternNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#438
+ # source://prism//lib/prism/inspect_visitor.rb#464
def visit_capture_pattern_node(node); end
# Inspect a CaseMatchNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#448
+ # source://prism//lib/prism/inspect_visitor.rb#476
def visit_case_match_node(node); end
# Inspect a CaseNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#476
+ # source://prism//lib/prism/inspect_visitor.rb#506
def visit_case_node(node); end
# Inspect a ClassNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#504
+ # source://prism//lib/prism/inspect_visitor.rb#536
def visit_class_node(node); end
# Inspect a ClassVariableAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#528
+ # source://prism//lib/prism/inspect_visitor.rb#562
def visit_class_variable_and_write_node(node); end
# Inspect a ClassVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#538
+ # source://prism//lib/prism/inspect_visitor.rb#574
def visit_class_variable_operator_write_node(node); end
# Inspect a ClassVariableOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#549
+ # source://prism//lib/prism/inspect_visitor.rb#587
def visit_class_variable_or_write_node(node); end
# Inspect a ClassVariableReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#559
+ # source://prism//lib/prism/inspect_visitor.rb#599
def visit_class_variable_read_node(node); end
# Inspect a ClassVariableTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#565
+ # source://prism//lib/prism/inspect_visitor.rb#607
def visit_class_variable_target_node(node); end
# Inspect a ClassVariableWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#571
+ # source://prism//lib/prism/inspect_visitor.rb#615
def visit_class_variable_write_node(node); end
# Inspect a ConstantAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#581
+ # source://prism//lib/prism/inspect_visitor.rb#627
def visit_constant_and_write_node(node); end
# Inspect a ConstantOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#591
+ # source://prism//lib/prism/inspect_visitor.rb#639
def visit_constant_operator_write_node(node); end
# Inspect a ConstantOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#602
+ # source://prism//lib/prism/inspect_visitor.rb#652
def visit_constant_or_write_node(node); end
# Inspect a ConstantPathAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#612
+ # source://prism//lib/prism/inspect_visitor.rb#664
def visit_constant_path_and_write_node(node); end
# Inspect a ConstantPathNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#622
+ # source://prism//lib/prism/inspect_visitor.rb#676
def visit_constant_path_node(node); end
# Inspect a ConstantPathOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#640
+ # source://prism//lib/prism/inspect_visitor.rb#696
def visit_constant_path_operator_write_node(node); end
# Inspect a ConstantPathOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#651
+ # source://prism//lib/prism/inspect_visitor.rb#709
def visit_constant_path_or_write_node(node); end
# Inspect a ConstantPathTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#661
+ # source://prism//lib/prism/inspect_visitor.rb#721
def visit_constant_path_target_node(node); end
# Inspect a ConstantPathWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#679
+ # source://prism//lib/prism/inspect_visitor.rb#741
def visit_constant_path_write_node(node); end
# Inspect a ConstantReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#689
+ # source://prism//lib/prism/inspect_visitor.rb#753
def visit_constant_read_node(node); end
# Inspect a ConstantTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#695
+ # source://prism//lib/prism/inspect_visitor.rb#761
def visit_constant_target_node(node); end
# Inspect a ConstantWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#701
+ # source://prism//lib/prism/inspect_visitor.rb#769
def visit_constant_write_node(node); end
# Inspect a DefNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#711
+ # source://prism//lib/prism/inspect_visitor.rb#781
def visit_def_node(node); end
# Inspect a DefinedNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#743
+ # source://prism//lib/prism/inspect_visitor.rb#815
def visit_defined_node(node); end
# Inspect a ElseNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#753
+ # source://prism//lib/prism/inspect_visitor.rb#827
def visit_else_node(node); end
# Inspect a EmbeddedStatementsNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#766
+ # source://prism//lib/prism/inspect_visitor.rb#842
def visit_embedded_statements_node(node); end
# Inspect a EmbeddedVariableNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#779
+ # source://prism//lib/prism/inspect_visitor.rb#857
def visit_embedded_variable_node(node); end
# Inspect a EnsureNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#787
+ # source://prism//lib/prism/inspect_visitor.rb#867
def visit_ensure_node(node); end
# Inspect a FalseNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#800
+ # source://prism//lib/prism/inspect_visitor.rb#882
def visit_false_node(node); end
# Inspect a FindPatternNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#805
+ # source://prism//lib/prism/inspect_visitor.rb#889
def visit_find_pattern_node(node); end
# Inspect a FlipFlopNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#831
+ # source://prism//lib/prism/inspect_visitor.rb#917
def visit_flip_flop_node(node); end
# Inspect a FloatNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#851
+ # source://prism//lib/prism/inspect_visitor.rb#937
def visit_float_node(node); end
# Inspect a ForNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#857
+ # source://prism//lib/prism/inspect_visitor.rb#945
def visit_for_node(node); end
# Inspect a ForwardingArgumentsNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#876
+ # source://prism//lib/prism/inspect_visitor.rb#966
def visit_forwarding_arguments_node(node); end
# Inspect a ForwardingParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#881
+ # source://prism//lib/prism/inspect_visitor.rb#973
def visit_forwarding_parameter_node(node); end
# Inspect a ForwardingSuperNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#886
+ # source://prism//lib/prism/inspect_visitor.rb#980
def visit_forwarding_super_node(node); end
# Inspect a GlobalVariableAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#897
+ # source://prism//lib/prism/inspect_visitor.rb#993
def visit_global_variable_and_write_node(node); end
# Inspect a GlobalVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#907
+ # source://prism//lib/prism/inspect_visitor.rb#1005
def visit_global_variable_operator_write_node(node); end
# Inspect a GlobalVariableOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#918
+ # source://prism//lib/prism/inspect_visitor.rb#1018
def visit_global_variable_or_write_node(node); end
# Inspect a GlobalVariableReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#928
+ # source://prism//lib/prism/inspect_visitor.rb#1030
def visit_global_variable_read_node(node); end
# Inspect a GlobalVariableTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#934
+ # source://prism//lib/prism/inspect_visitor.rb#1038
def visit_global_variable_target_node(node); end
# Inspect a GlobalVariableWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#940
+ # source://prism//lib/prism/inspect_visitor.rb#1046
def visit_global_variable_write_node(node); end
# Inspect a HashNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#950
+ # source://prism//lib/prism/inspect_visitor.rb#1058
def visit_hash_node(node); end
# Inspect a HashPatternNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#966
+ # source://prism//lib/prism/inspect_visitor.rb#1076
def visit_hash_pattern_node(node); end
# Inspect a IfNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#994
+ # source://prism//lib/prism/inspect_visitor.rb#1106
def visit_if_node(node); end
# Inspect a ImaginaryNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1016
+ # source://prism//lib/prism/inspect_visitor.rb#1130
def visit_imaginary_node(node); end
# Inspect a ImplicitNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1023
+ # source://prism//lib/prism/inspect_visitor.rb#1139
def visit_implicit_node(node); end
# Inspect a ImplicitRestNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1030
+ # source://prism//lib/prism/inspect_visitor.rb#1148
def visit_implicit_rest_node(node); end
# Inspect a InNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1035
+ # source://prism//lib/prism/inspect_visitor.rb#1155
def visit_in_node(node); end
# Inspect a IndexAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1050
+ # source://prism//lib/prism/inspect_visitor.rb#1172
def visit_index_and_write_node(node); end
# Inspect a IndexOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1081
+ # source://prism//lib/prism/inspect_visitor.rb#1203
def visit_index_operator_write_node(node); end
# Inspect a IndexOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1113
+ # source://prism//lib/prism/inspect_visitor.rb#1235
def visit_index_or_write_node(node); end
# Inspect a IndexTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1144
+ # source://prism//lib/prism/inspect_visitor.rb#1266
def visit_index_target_node(node); end
# Inspect a InstanceVariableAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1167
+ # source://prism//lib/prism/inspect_visitor.rb#1289
def visit_instance_variable_and_write_node(node); end
# Inspect a InstanceVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1177
+ # source://prism//lib/prism/inspect_visitor.rb#1301
def visit_instance_variable_operator_write_node(node); end
# Inspect a InstanceVariableOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1188
+ # source://prism//lib/prism/inspect_visitor.rb#1314
def visit_instance_variable_or_write_node(node); end
# Inspect a InstanceVariableReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1198
+ # source://prism//lib/prism/inspect_visitor.rb#1326
def visit_instance_variable_read_node(node); end
# Inspect a InstanceVariableTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1204
+ # source://prism//lib/prism/inspect_visitor.rb#1334
def visit_instance_variable_target_node(node); end
# Inspect a InstanceVariableWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1210
+ # source://prism//lib/prism/inspect_visitor.rb#1342
def visit_instance_variable_write_node(node); end
# Inspect a IntegerNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1220
+ # source://prism//lib/prism/inspect_visitor.rb#1354
def visit_integer_node(node); end
# Inspect a InterpolatedMatchLastLineNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1228
+ # source://prism//lib/prism/inspect_visitor.rb#1362
def visit_interpolated_match_last_line_node(node); end
# Inspect a InterpolatedRegularExpressionNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1246
+ # source://prism//lib/prism/inspect_visitor.rb#1380
def visit_interpolated_regular_expression_node(node); end
# Inspect a InterpolatedStringNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1264
+ # source://prism//lib/prism/inspect_visitor.rb#1398
def visit_interpolated_string_node(node); end
# Inspect a InterpolatedSymbolNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1282
+ # source://prism//lib/prism/inspect_visitor.rb#1416
def visit_interpolated_symbol_node(node); end
# Inspect a InterpolatedXStringNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1298
+ # source://prism//lib/prism/inspect_visitor.rb#1434
def visit_interpolated_x_string_node(node); end
+ # Inspect a ItLocalVariableReadNode node.
+ #
+ # source://prism//lib/prism/inspect_visitor.rb#1452
+ def visit_it_local_variable_read_node(node); end
+
# Inspect a ItParametersNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1314
+ # source://prism//lib/prism/inspect_visitor.rb#1459
def visit_it_parameters_node(node); end
# Inspect a KeywordHashNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1319
+ # source://prism//lib/prism/inspect_visitor.rb#1466
def visit_keyword_hash_node(node); end
# Inspect a KeywordRestParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1335
+ # source://prism//lib/prism/inspect_visitor.rb#1482
def visit_keyword_rest_parameter_node(node); end
# Inspect a LambdaNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1349
+ # source://prism//lib/prism/inspect_visitor.rb#1496
def visit_lambda_node(node); end
# Inspect a LocalVariableAndWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1370
+ # source://prism//lib/prism/inspect_visitor.rb#1519
def visit_local_variable_and_write_node(node); end
# Inspect a LocalVariableOperatorWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1381
+ # source://prism//lib/prism/inspect_visitor.rb#1532
def visit_local_variable_operator_write_node(node); end
# Inspect a LocalVariableOrWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1393
+ # source://prism//lib/prism/inspect_visitor.rb#1546
def visit_local_variable_or_write_node(node); end
# Inspect a LocalVariableReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1404
+ # source://prism//lib/prism/inspect_visitor.rb#1559
def visit_local_variable_read_node(node); end
# Inspect a LocalVariableTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1411
+ # source://prism//lib/prism/inspect_visitor.rb#1568
def visit_local_variable_target_node(node); end
# Inspect a LocalVariableWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1418
+ # source://prism//lib/prism/inspect_visitor.rb#1577
def visit_local_variable_write_node(node); end
# Inspect a MatchLastLineNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1429
+ # source://prism//lib/prism/inspect_visitor.rb#1590
def visit_match_last_line_node(node); end
# Inspect a MatchPredicateNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1440
+ # source://prism//lib/prism/inspect_visitor.rb#1601
def visit_match_predicate_node(node); end
# Inspect a MatchRequiredNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1450
+ # source://prism//lib/prism/inspect_visitor.rb#1613
def visit_match_required_node(node); end
# Inspect a MatchWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1460
+ # source://prism//lib/prism/inspect_visitor.rb#1625
def visit_match_write_node(node); end
# Inspect a MissingNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1476
+ # source://prism//lib/prism/inspect_visitor.rb#1643
def visit_missing_node(node); end
# Inspect a ModuleNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1481
+ # source://prism//lib/prism/inspect_visitor.rb#1650
def visit_module_node(node); end
# Inspect a MultiTargetNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1498
+ # source://prism//lib/prism/inspect_visitor.rb#1669
def visit_multi_target_node(node); end
# Inspect a MultiWriteNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1529
+ # source://prism//lib/prism/inspect_visitor.rb#1702
def visit_multi_write_node(node); end
# Inspect a NextNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1563
+ # source://prism//lib/prism/inspect_visitor.rb#1738
def visit_next_node(node); end
# Inspect a NilNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1575
+ # source://prism//lib/prism/inspect_visitor.rb#1752
def visit_nil_node(node); end
# Inspect a NoKeywordsParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1580
+ # source://prism//lib/prism/inspect_visitor.rb#1759
def visit_no_keywords_parameter_node(node); end
# Inspect a NumberedParametersNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1587
+ # source://prism//lib/prism/inspect_visitor.rb#1768
def visit_numbered_parameters_node(node); end
# Inspect a NumberedReferenceReadNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1593
+ # source://prism//lib/prism/inspect_visitor.rb#1776
def visit_numbered_reference_read_node(node); end
# Inspect a OptionalKeywordParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1599
+ # source://prism//lib/prism/inspect_visitor.rb#1784
def visit_optional_keyword_parameter_node(node); end
# Inspect a OptionalParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1610
+ # source://prism//lib/prism/inspect_visitor.rb#1795
def visit_optional_parameter_node(node); end
# Inspect a OrNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1622
+ # source://prism//lib/prism/inspect_visitor.rb#1807
def visit_or_node(node); end
# Inspect a ParametersNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1632
+ # source://prism//lib/prism/inspect_visitor.rb#1819
def visit_parameters_node(node); end
# Inspect a ParenthesesNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1691
+ # source://prism//lib/prism/inspect_visitor.rb#1880
def visit_parentheses_node(node); end
# Inspect a PinnedExpressionNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1704
+ # source://prism//lib/prism/inspect_visitor.rb#1895
def visit_pinned_expression_node(node); end
# Inspect a PinnedVariableNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1714
+ # source://prism//lib/prism/inspect_visitor.rb#1907
def visit_pinned_variable_node(node); end
# Inspect a PostExecutionNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1722
+ # source://prism//lib/prism/inspect_visitor.rb#1917
def visit_post_execution_node(node); end
# Inspect a PreExecutionNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1736
+ # source://prism//lib/prism/inspect_visitor.rb#1933
def visit_pre_execution_node(node); end
# Inspect a ProgramNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1750
+ # source://prism//lib/prism/inspect_visitor.rb#1949
def visit_program_node(node); end
# Inspect a RangeNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1758
+ # source://prism//lib/prism/inspect_visitor.rb#1959
def visit_range_node(node); end
# Inspect a RationalNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1778
+ # source://prism//lib/prism/inspect_visitor.rb#1979
def visit_rational_node(node); end
# Inspect a RedoNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1785
+ # source://prism//lib/prism/inspect_visitor.rb#1988
def visit_redo_node(node); end
# Inspect a RegularExpressionNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1790
+ # source://prism//lib/prism/inspect_visitor.rb#1995
def visit_regular_expression_node(node); end
# Inspect a RequiredKeywordParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1801
+ # source://prism//lib/prism/inspect_visitor.rb#2006
def visit_required_keyword_parameter_node(node); end
# Inspect a RequiredParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1810
+ # source://prism//lib/prism/inspect_visitor.rb#2015
def visit_required_parameter_node(node); end
# Inspect a RescueModifierNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1818
+ # source://prism//lib/prism/inspect_visitor.rb#2023
def visit_rescue_modifier_node(node); end
# Inspect a RescueNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1828
+ # source://prism//lib/prism/inspect_visitor.rb#2035
def visit_rescue_node(node); end
# Inspect a RestParameterNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1862
+ # source://prism//lib/prism/inspect_visitor.rb#2071
def visit_rest_parameter_node(node); end
# Inspect a RetryNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1876
+ # source://prism//lib/prism/inspect_visitor.rb#2085
def visit_retry_node(node); end
# Inspect a ReturnNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1881
+ # source://prism//lib/prism/inspect_visitor.rb#2092
def visit_return_node(node); end
# Inspect a SelfNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1895
+ # source://prism//lib/prism/inspect_visitor.rb#2106
def visit_self_node(node); end
# Inspect a ShareableConstantNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1900
+ # source://prism//lib/prism/inspect_visitor.rb#2113
def visit_shareable_constant_node(node); end
# Inspect a SingletonClassNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1909
+ # source://prism//lib/prism/inspect_visitor.rb#2122
def visit_singleton_class_node(node); end
# Inspect a SourceEncodingNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1926
+ # source://prism//lib/prism/inspect_visitor.rb#2141
def visit_source_encoding_node(node); end
# Inspect a SourceFileNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1931
+ # source://prism//lib/prism/inspect_visitor.rb#2148
def visit_source_file_node(node); end
# Inspect a SourceLineNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1939
+ # source://prism//lib/prism/inspect_visitor.rb#2156
def visit_source_line_node(node); end
# Inspect a SplatNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1944
+ # source://prism//lib/prism/inspect_visitor.rb#2163
def visit_splat_node(node); end
# Inspect a StatementsNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1956
+ # source://prism//lib/prism/inspect_visitor.rb#2177
def visit_statements_node(node); end
# Inspect a StringNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1970
+ # source://prism//lib/prism/inspect_visitor.rb#2193
def visit_string_node(node); end
# Inspect a SuperNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#1981
+ # source://prism//lib/prism/inspect_visitor.rb#2204
def visit_super_node(node); end
# Inspect a SymbolNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2001
+ # source://prism//lib/prism/inspect_visitor.rb#2226
def visit_symbol_node(node); end
# Inspect a TrueNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2012
+ # source://prism//lib/prism/inspect_visitor.rb#2237
def visit_true_node(node); end
# Inspect a UndefNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2017
+ # source://prism//lib/prism/inspect_visitor.rb#2244
def visit_undef_node(node); end
# Inspect a UnlessNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2032
+ # source://prism//lib/prism/inspect_visitor.rb#2261
def visit_unless_node(node); end
# Inspect a UntilNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2054
+ # source://prism//lib/prism/inspect_visitor.rb#2285
def visit_until_node(node); end
# Inspect a WhenNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2071
+ # source://prism//lib/prism/inspect_visitor.rb#2302
def visit_when_node(node); end
# Inspect a WhileNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2093
+ # source://prism//lib/prism/inspect_visitor.rb#2326
def visit_while_node(node); end
# Inspect a XStringNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2110
+ # source://prism//lib/prism/inspect_visitor.rb#2343
def visit_x_string_node(node); end
# Inspect a YieldNode node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2121
+ # source://prism//lib/prism/inspect_visitor.rb#2354
def visit_yield_node(node); end
private
# Compose a string representing the given inner location field.
#
- # source://prism//lib/prism/inspect_visitor.rb#2148
+ # source://prism//lib/prism/inspect_visitor.rb#2378
def inspect_location(location); end
# Compose a header for the given node.
#
- # source://prism//lib/prism/inspect_visitor.rb#2137
+ # source://prism//lib/prism/inspect_visitor.rb#2372
def inspect_node(name, node); end
class << self
@@ -18260,83 +19028,87 @@ end
# @target &&= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#9938
+# source://prism//lib/prism/node.rb#8689
class Prism::InstanceVariableAndWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new InstanceVariableAndWriteNode node.
#
# @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#9940
+ # source://prism//lib/prism/node.rb#8691
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10043
+ # source://prism//lib/prism/node.rb#8777
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#9951
+ # source://prism//lib/prism/node.rb#8703
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9956
+ # source://prism//lib/prism/node.rb#8708
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#9966
+ # source://prism//lib/prism/node.rb#8718
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#9961
+ # source://prism//lib/prism/node.rb#8713
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#9971
+ # source://prism//lib/prism/node.rb#8723
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::InstanceVariableAndWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#9956
+ # source://prism//lib/prism/node.rb#8708
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#9979
+ # source://prism//lib/prism/node.rb#8731
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#181
+ # source://prism//lib/prism/desugar_compiler.rb#218
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -18344,68 +19116,50 @@ class Prism::InstanceVariableAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10009
+ # source://prism//lib/prism/node.rb#8761
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#9984
+ # source://prism//lib/prism/node.rb#8736
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#9987
+ # source://prism//lib/prism/node.rb#8739
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#10004
+ # source://prism//lib/prism/node.rb#8756
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#9994
+ # source://prism//lib/prism/node.rb#8746
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#10027
+ # source://prism//lib/prism/node.rb#8766
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#10001
+ # source://prism//lib/prism/node.rb#8753
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10037
+ # source://prism//lib/prism/node.rb#8771
def type; end
end
end
@@ -18415,97 +19169,101 @@ end
# @target += value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#10056
+# source://prism//lib/prism/node.rb#8790
class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
+ # Initialize a new InstanceVariableOperatorWriteNode node.
#
# @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#10058
+ # source://prism//lib/prism/node.rb#8792
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).void
end
- def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10160
+ # source://prism//lib/prism/node.rb#8877
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10070
+ # source://prism//lib/prism/node.rb#8805
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#10123
+ # source://prism//lib/prism/node.rb#8858
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#10113
+ # source://prism//lib/prism/node.rb#8848
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10075
+ # source://prism//lib/prism/node.rb#8810
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10085
+ # source://prism//lib/prism/node.rb#8820
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10080
+ # source://prism//lib/prism/node.rb#8815
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> InstanceVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#10090
+ # source://prism//lib/prism/node.rb#8825
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
- binary_operator: Symbol,
- location: Prism::Location
+ binary_operator: Symbol
).returns(Prism::InstanceVariableOperatorWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), binary_operator: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10075
+ # source://prism//lib/prism/node.rb#8810
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }
#
- # source://prism//lib/prism/node.rb#10098
+ # source://prism//lib/prism/node.rb#8833
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#193
+ # source://prism//lib/prism/desugar_compiler.rb#230
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -18513,68 +19271,50 @@ class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10126
+ # source://prism//lib/prism/node.rb#8861
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#10103
+ # source://prism//lib/prism/node.rb#8838
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#10106
+ # source://prism//lib/prism/node.rb#8841
sig { returns(Prism::Location) }
def name_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#403
+ # source://prism//lib/prism/node_ext.rb#435
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#410
+ # source://prism//lib/prism/node_ext.rb#442
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#10144
+ # source://prism//lib/prism/node.rb#8866
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#10120
+ # source://prism//lib/prism/node.rb#8855
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10154
+ # source://prism//lib/prism/node.rb#8871
def type; end
end
end
@@ -18584,83 +19324,87 @@ end
# @target ||= value
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#10174
+# source://prism//lib/prism/node.rb#8891
class Prism::InstanceVariableOrWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new InstanceVariableOrWriteNode node.
#
# @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#10176
+ # source://prism//lib/prism/node.rb#8893
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10279
+ # source://prism//lib/prism/node.rb#8979
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10187
+ # source://prism//lib/prism/node.rb#8905
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10192
+ # source://prism//lib/prism/node.rb#8910
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10202
+ # source://prism//lib/prism/node.rb#8920
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10197
+ # source://prism//lib/prism/node.rb#8915
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> InstanceVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#10207
+ # source://prism//lib/prism/node.rb#8925
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::InstanceVariableOrWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10192
+ # source://prism//lib/prism/node.rb#8910
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#10215
+ # source://prism//lib/prism/node.rb#8933
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # source://prism//lib/prism/desugar_compiler.rb#187
+ # source://prism//lib/prism/desugar_compiler.rb#224
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -18668,68 +19412,50 @@ class Prism::InstanceVariableOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10245
+ # source://prism//lib/prism/node.rb#8963
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#10220
+ # source://prism//lib/prism/node.rb#8938
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#10223
+ # source://prism//lib/prism/node.rb#8941
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#10240
+ # source://prism//lib/prism/node.rb#8958
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#10230
+ # source://prism//lib/prism/node.rb#8948
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10263
+ # source://prism//lib/prism/node.rb#8968
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#10237
+ # source://prism//lib/prism/node.rb#8955
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#10273
+ # source://prism//lib/prism/node.rb#8973
def type; end
end
end
@@ -18739,62 +19465,69 @@ end
# @foo
# ^^^^
#
-# source://prism//lib/prism/node.rb#10292
+# source://prism//lib/prism/node.rb#8992
class Prism::InstanceVariableReadNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new InstanceVariableReadNode node.
#
# @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode
#
- # source://prism//lib/prism/node.rb#10294
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#8994
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10376
+ # source://prism//lib/prism/node.rb#9059
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10302
+ # source://prism//lib/prism/node.rb#9003
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10307
+ # source://prism//lib/prism/node.rb#9008
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10317
+ # source://prism//lib/prism/node.rb#9018
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10312
+ # source://prism//lib/prism/node.rb#9013
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableReadNode
#
- # source://prism//lib/prism/node.rb#10322
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableReadNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#9023
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::InstanceVariableReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10307
+ # source://prism//lib/prism/node.rb#9008
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#10330
+ # source://prism//lib/prism/node.rb#9031
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -18803,7 +19536,7 @@ class Prism::InstanceVariableReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10342
+ # source://prism//lib/prism/node.rb#9043
sig { override.returns(String) }
def inspect; end
@@ -18813,38 +19546,20 @@ class Prism::InstanceVariableReadNode < ::Prism::Node
#
# @_test # name `:@_test`
#
- # source://prism//lib/prism/node.rb#10339
+ # source://prism//lib/prism/node.rb#9040
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10360
+ # source://prism//lib/prism/node.rb#9048
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10370
+ # source://prism//lib/prism/node.rb#9053
def type; end
end
end
@@ -18854,62 +19569,69 @@ end
# @foo, @bar = baz
# ^^^^ ^^^^
#
-# source://prism//lib/prism/node.rb#10386
+# source://prism//lib/prism/node.rb#9069
class Prism::InstanceVariableTargetNode < ::Prism::Node
- # def initialize: (Symbol name, Location location) -> void
+ # Initialize a new InstanceVariableTargetNode node.
#
# @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode
#
- # source://prism//lib/prism/node.rb#10388
- sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void }
- def initialize(source, name, location); end
+ # source://prism//lib/prism/node.rb#9071
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10466
+ # source://prism//lib/prism/node.rb#9132
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10396
+ # source://prism//lib/prism/node.rb#9080
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10401
+ # source://prism//lib/prism/node.rb#9085
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10411
+ # source://prism//lib/prism/node.rb#9095
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10406
+ # source://prism//lib/prism/node.rb#9090
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> InstanceVariableTargetNode
#
- # source://prism//lib/prism/node.rb#10416
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableTargetNode) }
- def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#9100
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::InstanceVariableTargetNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10401
+ # source://prism//lib/prism/node.rb#9085
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#10424
+ # source://prism//lib/prism/node.rb#9108
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -18918,44 +19640,26 @@ class Prism::InstanceVariableTargetNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10432
+ # source://prism//lib/prism/node.rb#9116
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#10429
+ # source://prism//lib/prism/node.rb#9113
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#10450
+ # source://prism//lib/prism/node.rb#9121
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#10460
+ # source://prism//lib/prism/node.rb#9126
def type; end
end
end
@@ -18965,79 +19669,83 @@ end
# @foo = 1
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#10476
+# source://prism//lib/prism/node.rb#9142
class Prism::InstanceVariableWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void
+ # Initialize a new InstanceVariableWriteNode node.
#
# @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode
#
- # source://prism//lib/prism/node.rb#10478
+ # source://prism//lib/prism/node.rb#9144
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, name, name_loc, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10597
+ # source://prism//lib/prism/node.rb#9246
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10489
+ # source://prism//lib/prism/node.rb#9156
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10494
+ # source://prism//lib/prism/node.rb#9161
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10504
+ # source://prism//lib/prism/node.rb#9171
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10499
+ # source://prism//lib/prism/node.rb#9166
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> InstanceVariableWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> InstanceVariableWriteNode
#
- # source://prism//lib/prism/node.rb#10509
+ # source://prism//lib/prism/node.rb#9176
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::InstanceVariableWriteNode)
end
- def copy(name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10494
+ # source://prism//lib/prism/node.rb#9161
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#10517
+ # source://prism//lib/prism/node.rb#9184
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -19046,7 +19754,7 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10563
+ # source://prism//lib/prism/node.rb#9230
sig { override.returns(String) }
def inspect; end
@@ -19056,7 +19764,7 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node
#
# @_foo = "bar" # name `@_foo`
#
- # source://prism//lib/prism/node.rb#10526
+ # source://prism//lib/prism/node.rb#9193
sig { returns(Symbol) }
def name; end
@@ -19065,13 +19773,13 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node
# @_x = 1
# ^^^
#
- # source://prism//lib/prism/node.rb#10532
+ # source://prism//lib/prism/node.rb#9199
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#10558
+ # source://prism//lib/prism/node.rb#9225
sig { returns(String) }
def operator; end
@@ -19080,26 +19788,13 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node
# @x = y
# ^
#
- # source://prism//lib/prism/node.rb#10551
+ # source://prism//lib/prism/node.rb#9218
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10581
+ # source://prism//lib/prism/node.rb#9235
sig { override.returns(Symbol) }
def type; end
@@ -19111,46 +19806,41 @@ class Prism::InstanceVariableWriteNode < ::Prism::Node
# @_x = 1234
# ^^^^
#
- # source://prism//lib/prism/node.rb#10545
+ # source://prism//lib/prism/node.rb#9212
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10591
+ # source://prism//lib/prism/node.rb#9240
def type; end
end
end
# Flags for integer nodes that correspond to the base of the integer.
#
-# source://prism//lib/prism/node.rb#19241
+# source://prism//lib/prism/node.rb#16732
module Prism::IntegerBaseFlags; end
# 0b prefix
#
-# source://prism//lib/prism/node.rb#19243
+# source://prism//lib/prism/node.rb#16734
Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer)
# 0d or no prefix
#
-# source://prism//lib/prism/node.rb#19246
+# source://prism//lib/prism/node.rb#16737
Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer)
# 0x prefix
#
-# source://prism//lib/prism/node.rb#19252
+# source://prism//lib/prism/node.rb#16743
Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer)
# 0o or 0 prefix
#
-# source://prism//lib/prism/node.rb#19249
+# source://prism//lib/prism/node.rb#16740
Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer)
# Represents an integer number literal.
@@ -19158,25 +19848,33 @@ Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer)
# 1
# ^
#
-# source://prism//lib/prism/node.rb#10610
+# source://prism//lib/prism/node.rb#9259
class Prism::IntegerNode < ::Prism::Node
- # def initialize: (Integer flags, Integer value, Location location) -> void
+ # Initialize a new IntegerNode node.
#
# @return [IntegerNode] a new instance of IntegerNode
#
- # source://prism//lib/prism/node.rb#10612
- sig { params(source: Prism::Source, flags: Integer, value: Integer, location: Prism::Location).void }
- def initialize(source, flags, value, location); end
+ # source://prism//lib/prism/node.rb#9261
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10715
+ # source://prism//lib/prism/node.rb#9342
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10621
+ # source://prism//lib/prism/node.rb#9270
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -19184,52 +19882,59 @@ class Prism::IntegerNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10661
+ # source://prism//lib/prism/node.rb#9303
sig { returns(T::Boolean) }
def binary?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10626
+ # source://prism//lib/prism/node.rb#9275
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10636
+ # source://prism//lib/prism/node.rb#9285
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10631
+ # source://prism//lib/prism/node.rb#9280
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?value: Integer, ?location: Location) -> IntegerNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Integer) -> IntegerNode
#
- # source://prism//lib/prism/node.rb#10641
- sig { params(flags: Integer, value: Integer, location: Prism::Location).returns(Prism::IntegerNode) }
- def copy(flags: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#9290
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ value: Integer
+ ).returns(Prism::IntegerNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil)); end
# def decimal?: () -> bool
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10666
+ # source://prism//lib/prism/node.rb#9308
sig { returns(T::Boolean) }
def decimal?; end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10626
+ # source://prism//lib/prism/node.rb#9275
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, value: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Integer }
#
- # source://prism//lib/prism/node.rb#10649
+ # source://prism//lib/prism/node.rb#9298
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -19240,13 +19945,13 @@ class Prism::IntegerNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10676
+ # source://prism//lib/prism/node.rb#9318
sig { returns(T::Boolean) }
def hexadecimal?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10681
+ # source://prism//lib/prism/node.rb#9326
sig { override.returns(String) }
def inspect; end
@@ -19254,52 +19959,26 @@ class Prism::IntegerNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10671
+ # source://prism//lib/prism/node.rb#9313
sig { returns(T::Boolean) }
def octal?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#10699
+ # source://prism//lib/prism/node.rb#9331
sig { override.returns(Symbol) }
def type; end
# The value of the integer literal as a number.
#
- # source://prism//lib/prism/node.rb#10658
+ # source://prism//lib/prism/node.rb#9323
sig { returns(Integer) }
def value; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#10654
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#10709
+ # source://prism//lib/prism/node.rb#9336
def type; end
end
end
@@ -19309,36 +19988,37 @@ end
# if /foo #{bar} baz/ then end
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#10726
+# source://prism//lib/prism/node.rb#9353
class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
include ::Prism::RegularExpressionOptions
- # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void
+ # Initialize a new InterpolatedMatchLastLineNode node.
#
# @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode
#
- # source://prism//lib/prism/node.rb#10728
+ # source://prism//lib/prism/node.rb#9355
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, flags, opening_loc, parts, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#10897
+ # source://prism//lib/prism/node.rb#9497
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10739
+ # source://prism//lib/prism/node.rb#9366
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -19346,64 +20026,65 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10823
+ # source://prism//lib/prism/node.rb#9424
sig { returns(T::Boolean) }
def ascii_8bit?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10749
+ # source://prism//lib/prism/node.rb#9371
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#10858
+ # source://prism//lib/prism/node.rb#9476
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#10791
+ # source://prism//lib/prism/node.rb#9464
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10759
+ # source://prism//lib/prism/node.rb#9381
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10754
+ # source://prism//lib/prism/node.rb#9376
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedMatchLastLineNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedMatchLastLineNode
#
- # source://prism//lib/prism/node.rb#10764
+ # source://prism//lib/prism/node.rb#9386
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::InterpolatedMatchLastLineNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10749
+ # source://prism//lib/prism/node.rb#9371
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#10772
+ # source://prism//lib/prism/node.rb#9394
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -19411,7 +20092,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10818
+ # source://prism//lib/prism/node.rb#9419
sig { returns(T::Boolean) }
def euc_jp?; end
@@ -19419,7 +20100,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10803
+ # source://prism//lib/prism/node.rb#9404
sig { returns(T::Boolean) }
def extended?; end
@@ -19430,7 +20111,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10843
+ # source://prism//lib/prism/node.rb#9444
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -19438,7 +20119,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10848
+ # source://prism//lib/prism/node.rb#9449
sig { returns(T::Boolean) }
def forced_us_ascii_encoding?; end
@@ -19446,7 +20127,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10838
+ # source://prism//lib/prism/node.rb#9439
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -19454,13 +20135,13 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10798
+ # source://prism//lib/prism/node.rb#9399
sig { returns(T::Boolean) }
def ignore_case?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#10863
+ # source://prism//lib/prism/node.rb#9481
sig { override.returns(String) }
def inspect; end
@@ -19468,27 +20149,30 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10808
+ # source://prism//lib/prism/node.rb#9409
sig { returns(T::Boolean) }
def multi_line?; end
+ # source://prism//lib/prism/parse_result/newlines.rb#121
+ def newline_flag!(lines); end
+
# def once?: () -> bool
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10813
+ # source://prism//lib/prism/node.rb#9414
sig { returns(T::Boolean) }
def once?; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#10853
+ # source://prism//lib/prism/node.rb#9471
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#10781
+ # source://prism//lib/prism/node.rb#9454
sig { returns(Prism::Location) }
def opening_loc; end
@@ -19497,29 +20181,13 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
# attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
#
- # source://prism//lib/prism/node.rb#10788
+ # source://prism//lib/prism/node.rb#9461
sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) }
def parts; end
- # source://prism//lib/prism/node.rb#10743
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#10881
+ # source://prism//lib/prism/node.rb#9486
sig { override.returns(Symbol) }
def type; end
@@ -19527,7 +20195,7 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10833
+ # source://prism//lib/prism/node.rb#9434
sig { returns(T::Boolean) }
def utf_8?; end
@@ -19535,27 +20203,14 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10828
+ # source://prism//lib/prism/node.rb#9429
sig { returns(T::Boolean) }
def windows_31j?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#10777
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#10891
+ # source://prism//lib/prism/node.rb#9491
def type; end
end
end
@@ -19565,36 +20220,37 @@ end
# /foo #{bar} baz/
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#10911
+# source://prism//lib/prism/node.rb#9511
class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
include ::Prism::RegularExpressionOptions
- # def initialize: (Integer flags, Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void
+ # Initialize a new InterpolatedRegularExpressionNode node.
#
# @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode
#
- # source://prism//lib/prism/node.rb#10913
+ # source://prism//lib/prism/node.rb#9513
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, flags, opening_loc, parts, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11082
+ # source://prism//lib/prism/node.rb#9655
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#10924
+ # source://prism//lib/prism/node.rb#9524
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -19602,64 +20258,65 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11008
+ # source://prism//lib/prism/node.rb#9582
sig { returns(T::Boolean) }
def ascii_8bit?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10934
+ # source://prism//lib/prism/node.rb#9529
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#11043
+ # source://prism//lib/prism/node.rb#9634
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#10976
+ # source://prism//lib/prism/node.rb#9622
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#10944
+ # source://prism//lib/prism/node.rb#9539
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#10939
+ # source://prism//lib/prism/node.rb#9534
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedRegularExpressionNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedRegularExpressionNode
#
- # source://prism//lib/prism/node.rb#10949
+ # source://prism//lib/prism/node.rb#9544
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::InterpolatedRegularExpressionNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#10934
+ # source://prism//lib/prism/node.rb#9529
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#10957
+ # source://prism//lib/prism/node.rb#9552
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -19667,7 +20324,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11003
+ # source://prism//lib/prism/node.rb#9577
sig { returns(T::Boolean) }
def euc_jp?; end
@@ -19675,7 +20332,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10988
+ # source://prism//lib/prism/node.rb#9562
sig { returns(T::Boolean) }
def extended?; end
@@ -19686,7 +20343,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11028
+ # source://prism//lib/prism/node.rb#9602
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -19694,7 +20351,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11033
+ # source://prism//lib/prism/node.rb#9607
sig { returns(T::Boolean) }
def forced_us_ascii_encoding?; end
@@ -19702,7 +20359,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11023
+ # source://prism//lib/prism/node.rb#9597
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -19710,13 +20367,13 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10983
+ # source://prism//lib/prism/node.rb#9557
sig { returns(T::Boolean) }
def ignore_case?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11048
+ # source://prism//lib/prism/node.rb#9639
sig { override.returns(String) }
def inspect; end
@@ -19724,27 +20381,30 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10993
+ # source://prism//lib/prism/node.rb#9567
sig { returns(T::Boolean) }
def multi_line?; end
+ # source://prism//lib/prism/parse_result/newlines.rb#128
+ def newline_flag!(lines); end
+
# def once?: () -> bool
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#10998
+ # source://prism//lib/prism/node.rb#9572
sig { returns(T::Boolean) }
def once?; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#11038
+ # source://prism//lib/prism/node.rb#9629
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#10966
+ # source://prism//lib/prism/node.rb#9612
sig { returns(Prism::Location) }
def opening_loc; end
@@ -19753,29 +20413,13 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
# attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
#
- # source://prism//lib/prism/node.rb#10973
+ # source://prism//lib/prism/node.rb#9619
sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) }
def parts; end
- # source://prism//lib/prism/node.rb#10928
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#11066
+ # source://prism//lib/prism/node.rb#9644
sig { override.returns(Symbol) }
def type; end
@@ -19783,7 +20427,7 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11018
+ # source://prism//lib/prism/node.rb#9592
sig { returns(T::Boolean) }
def utf_8?; end
@@ -19791,27 +20435,14 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11013
+ # source://prism//lib/prism/node.rb#9587
sig { returns(T::Boolean) }
def windows_31j?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#10962
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11076
+ # source://prism//lib/prism/node.rb#9649
def type; end
end
end
@@ -19821,93 +20452,95 @@ end
# "foo #{bar} baz"
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#11096
+# source://prism//lib/prism/node.rb#9669
class Prism::InterpolatedStringNode < ::Prism::Node
include ::Prism::HeredocQuery
- # def initialize: (Integer flags, Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] parts, Location? closing_loc, Location location) -> void
+ # Initialize a new InterpolatedStringNode node.
#
# @return [InterpolatedStringNode] a new instance of InterpolatedStringNode
#
- # source://prism//lib/prism/node.rb#11098
+ # source://prism//lib/prism/node.rb#9671
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)],
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, flags, opening_loc, parts, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11234
+ # source://prism//lib/prism/node.rb#9780
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11109
+ # source://prism//lib/prism/node.rb#9682
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11119
+ # source://prism//lib/prism/node.rb#9687
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#11195
+ # source://prism//lib/prism/node.rb#9759
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#11167
+ # source://prism//lib/prism/node.rb#9741
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11129
+ # source://prism//lib/prism/node.rb#9697
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11124
+ # source://prism//lib/prism/node.rb#9692
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedStringNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?) -> InterpolatedStringNode
#
- # source://prism//lib/prism/node.rb#11134
+ # source://prism//lib/prism/node.rb#9702
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)],
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::InterpolatedStringNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11119
+ # source://prism//lib/prism/node.rb#9687
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#11142
+ # source://prism//lib/prism/node.rb#9710
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -19918,7 +20551,7 @@ class Prism::InterpolatedStringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11180
+ # source://prism//lib/prism/node.rb#9715
sig { returns(T::Boolean) }
def frozen?; end
@@ -19927,7 +20560,7 @@ class Prism::InterpolatedStringNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11200
+ # source://prism//lib/prism/node.rb#9764
sig { override.returns(String) }
def inspect; end
@@ -19935,82 +20568,56 @@ class Prism::InterpolatedStringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11185
+ # source://prism//lib/prism/node.rb#9720
sig { returns(T::Boolean) }
def mutable?; end
+ # source://prism//lib/prism/parse_result/newlines.rb#135
+ def newline_flag!(lines); end
+
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#11190
+ # source://prism//lib/prism/node.rb#9754
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#11151
+ # source://prism//lib/prism/node.rb#9725
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode]
#
- # source://prism//lib/prism/node.rb#11164
+ # source://prism//lib/prism/node.rb#9738
sig do
returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)])
end
def parts; end
- # source://prism//lib/prism/node.rb#11113
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11218
+ # source://prism//lib/prism/node.rb#9769
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#11147
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#11228
+ # source://prism//lib/prism/node.rb#9774
def type; end
end
end
# Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
#
-# source://prism//lib/prism/node.rb#19256
+# source://prism//lib/prism/node.rb#16747
module Prism::InterpolatedStringNodeFlags; end
-# source://prism//lib/prism/node.rb#19258
+# source://prism//lib/prism/node.rb#16749
Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer)
-# source://prism//lib/prism/node.rb#19261
+# source://prism//lib/prism/node.rb#16752
Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer)
# Represents a symbol literal that contains interpolation.
@@ -20018,89 +20625,93 @@ Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer)
# :"foo #{bar} baz"
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#11248
+# source://prism//lib/prism/node.rb#9794
class Prism::InterpolatedSymbolNode < ::Prism::Node
- # def initialize: (Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc, Location location) -> void
+ # Initialize a new InterpolatedSymbolNode node.
#
# @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode
#
- # source://prism//lib/prism/node.rb#11250
+ # source://prism//lib/prism/node.rb#9796
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: T.nilable(Prism::Location),
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, opening_loc, parts, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11371
+ # source://prism//lib/prism/node.rb#9895
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11260
+ # source://prism//lib/prism/node.rb#9807
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11270
+ # source://prism//lib/prism/node.rb#9812
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#11332
+ # source://prism//lib/prism/node.rb#9874
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#11314
+ # source://prism//lib/prism/node.rb#9856
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11280
+ # source://prism//lib/prism/node.rb#9822
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11275
+ # source://prism//lib/prism/node.rb#9817
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedSymbolNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?) -> InterpolatedSymbolNode
#
- # source://prism//lib/prism/node.rb#11285
+ # source://prism//lib/prism/node.rb#9827
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: T.nilable(Prism::Location),
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ closing_loc: T.nilable(Prism::Location)
).returns(Prism::InterpolatedSymbolNode)
end
- def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11270
+ # source://prism//lib/prism/node.rb#9812
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location? }
#
- # source://prism//lib/prism/node.rb#11293
+ # source://prism//lib/prism/node.rb#9835
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -20109,59 +20720,41 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11337
+ # source://prism//lib/prism/node.rb#9879
sig { override.returns(String) }
def inspect; end
+ # source://prism//lib/prism/parse_result/newlines.rb#142
+ def newline_flag!(lines); end
+
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#11327
+ # source://prism//lib/prism/node.rb#9869
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#11298
+ # source://prism//lib/prism/node.rb#9840
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
#
- # source://prism//lib/prism/node.rb#11311
+ # source://prism//lib/prism/node.rb#9853
sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) }
def parts; end
- # source://prism//lib/prism/node.rb#11264
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11355
+ # source://prism//lib/prism/node.rb#9884
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11365
+ # source://prism//lib/prism/node.rb#9889
def type; end
end
end
@@ -20171,91 +20764,95 @@ end
# `foo #{bar} baz`
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#11384
+# source://prism//lib/prism/node.rb#9908
class Prism::InterpolatedXStringNode < ::Prism::Node
include ::Prism::HeredocQuery
- # def initialize: (Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void
+ # Initialize a new InterpolatedXStringNode node.
#
# @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode
#
- # source://prism//lib/prism/node.rb#11386
+ # source://prism//lib/prism/node.rb#9910
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, opening_loc, parts, closing_loc, location); end
+ def initialize(source, node_id, location, flags, opening_loc, parts, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11495
+ # source://prism//lib/prism/node.rb#9997
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11396
+ # source://prism//lib/prism/node.rb#9921
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11406
+ # source://prism//lib/prism/node.rb#9926
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#11456
+ # source://prism//lib/prism/node.rb#9976
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#11444
+ # source://prism//lib/prism/node.rb#9964
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11416
+ # source://prism//lib/prism/node.rb#9936
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11411
+ # source://prism//lib/prism/node.rb#9931
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedXStringNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location) -> InterpolatedXStringNode
#
- # source://prism//lib/prism/node.rb#11421
+ # source://prism//lib/prism/node.rb#9941
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
opening_loc: Prism::Location,
parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)],
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::InterpolatedXStringNode)
end
- def copy(opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), parts: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11406
+ # source://prism//lib/prism/node.rb#9926
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#11429
+ # source://prism//lib/prism/node.rb#9949
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -20267,124 +20864,106 @@ class Prism::InterpolatedXStringNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11461
+ # source://prism//lib/prism/node.rb#9981
sig { override.returns(String) }
def inspect; end
+ # source://prism//lib/prism/parse_result/newlines.rb#149
+ def newline_flag!(lines); end
+
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#11451
+ # source://prism//lib/prism/node.rb#9971
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#11434
+ # source://prism//lib/prism/node.rb#9954
sig { returns(Prism::Location) }
def opening_loc; end
# attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode]
#
- # source://prism//lib/prism/node.rb#11441
+ # source://prism//lib/prism/node.rb#9961
sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) }
def parts; end
- # source://prism//lib/prism/node.rb#11400
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#11479
+ # source://prism//lib/prism/node.rb#9986
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#11489
+ # source://prism//lib/prism/node.rb#9991
def type; end
end
end
-# Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
+# Represents reading from the implicit `it` local variable.
#
-# -> { it + it }
-# ^^^^^^^^^^^^^^
+# -> { it }
+# ^^
#
-# source://prism//lib/prism/node.rb#11508
-class Prism::ItParametersNode < ::Prism::Node
- # def initialize: (Location location) -> void
+# source://prism//lib/prism/node.rb#10010
+class Prism::ItLocalVariableReadNode < ::Prism::Node
+ # Initialize a new ItLocalVariableReadNode node.
#
- # @return [ItParametersNode] a new instance of ItParametersNode
+ # @return [ItLocalVariableReadNode] a new instance of ItLocalVariableReadNode
#
- # source://prism//lib/prism/node.rb#11510
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#10012
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11584
+ # source://prism//lib/prism/node.rb#10069
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11517
+ # source://prism//lib/prism/node.rb#10020
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11522
+ # source://prism//lib/prism/node.rb#10025
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11532
+ # source://prism//lib/prism/node.rb#10035
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11527
+ # source://prism//lib/prism/node.rb#10030
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> ItParametersNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItLocalVariableReadNode
#
- # source://prism//lib/prism/node.rb#11537
- sig { params(location: Prism::Location).returns(Prism::ItParametersNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#10040
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ItLocalVariableReadNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11522
+ # source://prism//lib/prism/node.rb#10025
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#11545
+ # source://prism//lib/prism/node.rb#10048
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -20393,38 +20972,107 @@ class Prism::ItParametersNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11550
+ # source://prism//lib/prism/node.rb#10053
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # source://prism//lib/prism/node.rb#10058
+ sig { override.returns(Symbol) }
+ def type; end
+
+ class << self
+ # Return a symbol representation of this node type. See `Node::type`.
+ #
+ # source://prism//lib/prism/node.rb#10063
+ def type; end
+ end
+end
+
+# Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
+#
+# -> { it + it }
+# ^^^^^^^^^^^^^^
+#
+# source://prism//lib/prism/node.rb#10078
+class Prism::ItParametersNode < ::Prism::Node
+ # Initialize a new ItParametersNode node.
+ #
+ # @return [ItParametersNode] a new instance of ItParametersNode
+ #
+ # source://prism//lib/prism/node.rb#10080
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
+
+ # Implements case-equality for the node. This is effectively == but without
+ # comparing the value of locations. Locations are checked only for presence.
+ #
+ # source://prism//lib/prism/node.rb#10137
+ def ===(other); end
+
+ # def accept: (Visitor visitor) -> void
+ #
+ # source://prism//lib/prism/node.rb#10088
+ sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
+ def accept(visitor); end
+
+ # def child_nodes: () -> Array[nil | Node]
+ #
+ # source://prism//lib/prism/node.rb#10093
+ sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
+ def child_nodes; end
+
+ # def comment_targets: () -> Array[Node | Location]
+ #
+ # source://prism//lib/prism/node.rb#10103
+ sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
+ def comment_targets; end
+
+ # def compact_child_nodes: () -> Array[Node]
+ #
+ # source://prism//lib/prism/node.rb#10098
+ sig { override.returns(T::Array[Prism::Node]) }
+ def compact_child_nodes; end
+
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> ItParametersNode
+ #
+ # source://prism//lib/prism/node.rb#10108
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::ItParametersNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
+
+ # def child_nodes: () -> Array[nil | Node]
+ # def deconstruct: () -> Array[nil | Node]
+ #
+ # source://prism//lib/prism/node.rb#10093
+ sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
+ def deconstruct; end
+
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
+ #
+ # source://prism//lib/prism/node.rb#10116
+ sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
+ def deconstruct_keys(keys); end
+
+ sig { override.returns(T::Array[Prism::Reflection::Field]) }
+ def fields; end
+
+ # def inspect -> String
#
- # def type: () -> Symbol
+ # source://prism//lib/prism/node.rb#10121
+ sig { override.returns(String) }
+ def inspect; end
+
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#11568
+ # source://prism//lib/prism/node.rb#10126
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11578
+ # source://prism//lib/prism/node.rb#10131
def type; end
end
end
@@ -20434,81 +21082,83 @@ end
# foo(a: b)
# ^^^^
#
-# source://prism//lib/prism/node.rb#11593
+# source://prism//lib/prism/node.rb#10146
class Prism::KeywordHashNode < ::Prism::Node
- # def initialize: (Integer flags, Array[AssocNode | AssocSplatNode] elements, Location location) -> void
+ # Initialize a new KeywordHashNode node.
#
# @return [KeywordHashNode] a new instance of KeywordHashNode
#
- # source://prism//lib/prism/node.rb#11595
+ # source://prism//lib/prism/node.rb#10148
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)],
- location: Prism::Location
+ elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]
).void
end
- def initialize(source, flags, elements, location); end
+ def initialize(source, node_id, location, flags, elements); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11683
+ # source://prism//lib/prism/node.rb#10214
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11604
+ # source://prism//lib/prism/node.rb#10157
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11609
+ # source://prism//lib/prism/node.rb#10162
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11619
+ # source://prism//lib/prism/node.rb#10172
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11614
+ # source://prism//lib/prism/node.rb#10167
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode], ?location: Location) -> KeywordHashNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode]) -> KeywordHashNode
#
- # source://prism//lib/prism/node.rb#11624
+ # source://prism//lib/prism/node.rb#10177
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)],
- location: Prism::Location
+ elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]
).returns(Prism::KeywordHashNode)
end
- def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), elements: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11609
+ # source://prism//lib/prism/node.rb#10162
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[AssocNode | AssocSplatNode], location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, elements: Array[AssocNode | AssocSplatNode] }
#
- # source://prism//lib/prism/node.rb#11632
+ # source://prism//lib/prism/node.rb#10185
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader elements: Array[AssocNode | AssocSplatNode]
#
- # source://prism//lib/prism/node.rb#11641
+ # source://prism//lib/prism/node.rb#10195
sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) }
def elements; end
@@ -20517,7 +21167,7 @@ class Prism::KeywordHashNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11649
+ # source://prism//lib/prism/node.rb#10198
sig { override.returns(String) }
def inspect; end
@@ -20525,58 +21175,32 @@ class Prism::KeywordHashNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11644
+ # source://prism//lib/prism/node.rb#10190
sig { returns(T::Boolean) }
def symbol_keys?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11667
+ # source://prism//lib/prism/node.rb#10203
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#11637
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#11677
+ # source://prism//lib/prism/node.rb#10208
def type; end
end
end
# Flags for keyword hash nodes.
#
-# source://prism//lib/prism/node.rb#19265
+# source://prism//lib/prism/node.rb#16756
module Prism::KeywordHashNodeFlags; end
# a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
#
-# source://prism//lib/prism/node.rb#19267
+# source://prism//lib/prism/node.rb#16758
Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer)
# Represents a keyword rest parameter to a method, block, or lambda definition.
@@ -20585,79 +21209,81 @@ Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer)
# ^^^
# end
#
-# source://prism//lib/prism/node.rb#11696
+# source://prism//lib/prism/node.rb#10227
class Prism::KeywordRestParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void
+ # Initialize a new KeywordRestParameterNode node.
#
# @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode
#
- # source://prism//lib/prism/node.rb#11698
+ # source://prism//lib/prism/node.rb#10229
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, flags, name, name_loc, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11813
+ # source://prism//lib/prism/node.rb#10322
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11709
+ # source://prism//lib/prism/node.rb#10240
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11714
+ # source://prism//lib/prism/node.rb#10245
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11724
+ # source://prism//lib/prism/node.rb#10255
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11719
+ # source://prism//lib/prism/node.rb#10250
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> KeywordRestParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> KeywordRestParameterNode
#
- # source://prism//lib/prism/node.rb#11729
+ # source://prism//lib/prism/node.rb#10260
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::KeywordRestParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11714
+ # source://prism//lib/prism/node.rb#10245
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#11737
+ # source://prism//lib/prism/node.rb#10268
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -20666,31 +21292,31 @@ class Prism::KeywordRestParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11779
+ # source://prism//lib/prism/node.rb#10306
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol?
#
- # source://prism//lib/prism/node.rb#11746
+ # source://prism//lib/prism/node.rb#10278
sig { returns(T.nilable(Symbol)) }
def name; end
# attr_reader name_loc: Location?
#
- # source://prism//lib/prism/node.rb#11749
+ # source://prism//lib/prism/node.rb#10281
sig { returns(T.nilable(Prism::Location)) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#11774
+ # source://prism//lib/prism/node.rb#10301
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#11762
+ # source://prism//lib/prism/node.rb#10294
sig { returns(Prism::Location) }
def operator_loc; end
@@ -20698,46 +21324,20 @@ class Prism::KeywordRestParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#11769
+ # source://prism//lib/prism/node.rb#10273
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#11797
+ # source://prism//lib/prism/node.rb#10311
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#11742
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#11807
+ # source://prism//lib/prism/node.rb#10316
def type; end
end
end
@@ -20747,101 +21347,105 @@ end
# ->(value) { value * 2 }
# ^^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#11826
+# source://prism//lib/prism/node.rb#10335
class Prism::LambdaNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, Prism::node? parameters, Prism::node? body, Location location) -> void
+ # Initialize a new LambdaNode node.
#
# @return [LambdaNode] a new instance of LambdaNode
#
- # source://prism//lib/prism/node.rb#11828
+ # source://prism//lib/prism/node.rb#10337
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
operator_loc: Prism::Location,
opening_loc: Prism::Location,
closing_loc: Prism::Location,
- parameters: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
- location: Prism::Location
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))
).void
end
- def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end
+ def initialize(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#11956
+ # source://prism//lib/prism/node.rb#10448
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11841
+ # source://prism//lib/prism/node.rb#10351
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
- # attr_reader body: Prism::node?
+ # attr_reader body: StatementsNode | BeginNode | nil
#
- # source://prism//lib/prism/node.rb#11904
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#10414
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11846
+ # source://prism//lib/prism/node.rb#10356
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#11917
+ # source://prism//lib/prism/node.rb#10427
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#11894
+ # source://prism//lib/prism/node.rb#10404
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#11859
+ # source://prism//lib/prism/node.rb#10369
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11851
+ # source://prism//lib/prism/node.rb#10361
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: Prism::node?, ?body: Prism::node?, ?location: Location) -> LambdaNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, ?body: StatementsNode | BeginNode | nil) -> LambdaNode
#
- # source://prism//lib/prism/node.rb#11864
+ # source://prism//lib/prism/node.rb#10374
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
operator_loc: Prism::Location,
opening_loc: Prism::Location,
closing_loc: Prism::Location,
- parameters: T.nilable(Prism::Node),
- body: T.nilable(Prism::Node),
- location: Prism::Location
+ parameters: T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode)),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))
).returns(Prism::LambdaNode)
end
- def copy(locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), operator_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), parameters: T.unsafe(nil), body: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11846
+ # source://prism//lib/prism/node.rb#10356
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Prism::node?, body: Prism::node?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil, body: StatementsNode | BeginNode | nil }
#
- # source://prism//lib/prism/node.rb#11872
+ # source://prism//lib/prism/node.rb#10382
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -20850,74 +21454,56 @@ class Prism::LambdaNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#11922
+ # source://prism//lib/prism/node.rb#10432
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#11877
+ # source://prism//lib/prism/node.rb#10387
sig { returns(T::Array[Symbol]) }
def locals; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#11912
+ # source://prism//lib/prism/node.rb#10422
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#11887
+ # source://prism//lib/prism/node.rb#10397
sig { returns(Prism::Location) }
def opening_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#11907
+ # source://prism//lib/prism/node.rb#10417
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#11880
+ # source://prism//lib/prism/node.rb#10390
sig { returns(Prism::Location) }
def operator_loc; end
- # attr_reader parameters: Prism::node?
+ # attr_reader parameters: BlockParametersNode | NumberedParametersNode | ItParametersNode | nil
#
- # source://prism//lib/prism/node.rb#11901
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#10411
+ sig { returns(T.nilable(T.any(Prism::BlockParametersNode, Prism::NumberedParametersNode, Prism::ItParametersNode))) }
def parameters; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#11940
+ # source://prism//lib/prism/node.rb#10437
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#11950
+ # source://prism//lib/prism/node.rb#10442
def type; end
end
end
@@ -21173,13 +21759,13 @@ end
# This is a result specific to the `lex` and `lex_file` methods.
#
-# source://prism//lib/prism/parse_result.rb#593
+# source://prism//lib/prism/parse_result.rb#764
class Prism::LexResult < ::Prism::Result
# Create a new lex result object with the given values.
#
# @return [LexResult] a new instance of LexResult
#
- # source://prism//lib/prism/parse_result.rb#598
+ # source://prism//lib/prism/parse_result.rb#769
sig do
params(
value: T::Array[T.untyped],
@@ -21195,13 +21781,13 @@ class Prism::LexResult < ::Prism::Result
# Implement the hash pattern matching interface for LexResult.
#
- # source://prism//lib/prism/parse_result.rb#604
+ # source://prism//lib/prism/parse_result.rb#775
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# The list of tokens that were parsed from the source code.
#
- # source://prism//lib/prism/parse_result.rb#595
+ # source://prism//lib/prism/parse_result.rb#766
sig { returns(T::Array[T.untyped]) }
def value; end
end
@@ -21233,91 +21819,95 @@ end
# target &&= value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#11972
+# source://prism//lib/prism/node.rb#10464
class Prism::LocalVariableAndWriteNode < ::Prism::Node
- # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void
+ # Initialize a new LocalVariableAndWriteNode node.
#
# @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#11974
+ # source://prism//lib/prism/node.rb#10466
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).void
end
- def initialize(source, name_loc, operator_loc, value, name, depth, location); end
+ def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12081
+ # source://prism//lib/prism/node.rb#10556
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#11986
+ # source://prism//lib/prism/node.rb#10479
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11991
+ # source://prism//lib/prism/node.rb#10484
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12001
+ # source://prism//lib/prism/node.rb#10494
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#11996
+ # source://prism//lib/prism/node.rb#10489
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableAndWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableAndWriteNode
#
- # source://prism//lib/prism/node.rb#12006
+ # source://prism//lib/prism/node.rb#10499
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).returns(Prism::LocalVariableAndWriteNode)
end
- def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#11991
+ # source://prism//lib/prism/node.rb#10484
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer }
#
- # source://prism//lib/prism/node.rb#12014
+ # source://prism//lib/prism/node.rb#10507
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader depth: Integer
#
- # source://prism//lib/prism/node.rb#12039
+ # source://prism//lib/prism/node.rb#10532
sig { returns(Integer) }
def depth; end
- # source://prism//lib/prism/desugar_compiler.rb#199
+ # source://prism//lib/prism/desugar_compiler.rb#236
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -21325,68 +21915,50 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12047
+ # source://prism//lib/prism/node.rb#10540
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#12036
+ # source://prism//lib/prism/node.rb#10529
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#12019
+ # source://prism//lib/prism/node.rb#10512
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#12042
+ # source://prism//lib/prism/node.rb#10535
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#12026
+ # source://prism//lib/prism/node.rb#10519
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12065
+ # source://prism//lib/prism/node.rb#10545
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#12033
+ # source://prism//lib/prism/node.rb#10526
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12075
+ # source://prism//lib/prism/node.rb#10550
def type; end
end
end
@@ -21396,105 +21968,109 @@ end
# target += value
# ^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#12095
+# source://prism//lib/prism/node.rb#10570
class Prism::LocalVariableOperatorWriteNode < ::Prism::Node
- # def initialize: (Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, Location location) -> void
+ # Initialize a new LocalVariableOperatorWriteNode node.
#
# @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#12097
+ # source://prism//lib/prism/node.rb#10572
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
binary_operator: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).void
end
- def initialize(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location); end
+ def initialize(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12203
+ # source://prism//lib/prism/node.rb#10661
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12110
+ # source://prism//lib/prism/node.rb#10586
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader binary_operator: Symbol
#
- # source://prism//lib/prism/node.rb#12163
+ # source://prism//lib/prism/node.rb#10639
sig { returns(Symbol) }
def binary_operator; end
# attr_reader binary_operator_loc: Location
#
- # source://prism//lib/prism/node.rb#12150
+ # source://prism//lib/prism/node.rb#10626
sig { returns(Prism::Location) }
def binary_operator_loc; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12115
+ # source://prism//lib/prism/node.rb#10591
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12125
+ # source://prism//lib/prism/node.rb#10601
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12120
+ # source://prism//lib/prism/node.rb#10596
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer) -> LocalVariableOperatorWriteNode
#
- # source://prism//lib/prism/node.rb#12130
+ # source://prism//lib/prism/node.rb#10606
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
binary_operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
binary_operator: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).returns(Prism::LocalVariableOperatorWriteNode)
end
- def copy(name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), binary_operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), binary_operator: T.unsafe(nil), depth: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12115
+ # source://prism//lib/prism/node.rb#10591
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer }
#
- # source://prism//lib/prism/node.rb#12138
+ # source://prism//lib/prism/node.rb#10614
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader depth: Integer
#
- # source://prism//lib/prism/node.rb#12166
+ # source://prism//lib/prism/node.rb#10642
sig { returns(Integer) }
def depth; end
- # source://prism//lib/prism/desugar_compiler.rb#211
+ # source://prism//lib/prism/desugar_compiler.rb#248
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -21502,68 +22078,50 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12169
+ # source://prism//lib/prism/node.rb#10645
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#12160
+ # source://prism//lib/prism/node.rb#10636
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#12143
+ # source://prism//lib/prism/node.rb#10619
sig { returns(Prism::Location) }
def name_loc; end
# Returns the binary operator used to modify the receiver. This method is
# deprecated in favor of #binary_operator.
#
- # source://prism//lib/prism/node_ext.rb#419
+ # source://prism//lib/prism/node_ext.rb#451
def operator; end
# Returns the location of the binary operator used to modify the receiver.
# This method is deprecated in favor of #binary_operator_loc.
#
- # source://prism//lib/prism/node_ext.rb#426
+ # source://prism//lib/prism/node_ext.rb#458
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12187
+ # source://prism//lib/prism/node.rb#10650
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#12157
+ # source://prism//lib/prism/node.rb#10633
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12197
+ # source://prism//lib/prism/node.rb#10655
def type; end
end
end
@@ -21573,91 +22131,95 @@ end
# target ||= value
# ^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#12218
+# source://prism//lib/prism/node.rb#10676
class Prism::LocalVariableOrWriteNode < ::Prism::Node
- # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void
+ # Initialize a new LocalVariableOrWriteNode node.
#
# @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#12220
+ # source://prism//lib/prism/node.rb#10678
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).void
end
- def initialize(source, name_loc, operator_loc, value, name, depth, location); end
+ def initialize(source, node_id, location, flags, name_loc, operator_loc, value, name, depth); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12327
+ # source://prism//lib/prism/node.rb#10768
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12232
+ # source://prism//lib/prism/node.rb#10691
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12237
+ # source://prism//lib/prism/node.rb#10696
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12247
+ # source://prism//lib/prism/node.rb#10706
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12242
+ # source://prism//lib/prism/node.rb#10701
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOrWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer) -> LocalVariableOrWriteNode
#
- # source://prism//lib/prism/node.rb#12252
+ # source://prism//lib/prism/node.rb#10711
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name_loc: Prism::Location,
operator_loc: Prism::Location,
value: Prism::Node,
name: Symbol,
- depth: Integer,
- location: Prism::Location
+ depth: Integer
).returns(Prism::LocalVariableOrWriteNode)
end
- def copy(name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12237
+ # source://prism//lib/prism/node.rb#10696
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer }
#
- # source://prism//lib/prism/node.rb#12260
+ # source://prism//lib/prism/node.rb#10719
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader depth: Integer
#
- # source://prism//lib/prism/node.rb#12285
+ # source://prism//lib/prism/node.rb#10744
sig { returns(Integer) }
def depth; end
- # source://prism//lib/prism/desugar_compiler.rb#205
+ # source://prism//lib/prism/desugar_compiler.rb#242
def desugar; end
sig { override.returns(T::Array[Prism::Reflection::Field]) }
@@ -21665,68 +22227,50 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12293
+ # source://prism//lib/prism/node.rb#10752
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#12282
+ # source://prism//lib/prism/node.rb#10741
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#12265
+ # source://prism//lib/prism/node.rb#10724
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#12288
+ # source://prism//lib/prism/node.rb#10747
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#12272
+ # source://prism//lib/prism/node.rb#10731
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12311
+ # source://prism//lib/prism/node.rb#10757
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#12279
+ # source://prism//lib/prism/node.rb#10738
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#12321
+ # source://prism//lib/prism/node.rb#10762
def type; end
end
end
@@ -21736,62 +22280,79 @@ end
# foo
# ^^^
#
-# source://prism//lib/prism/node.rb#12341
+# source://prism//lib/prism/node.rb#10782
class Prism::LocalVariableReadNode < ::Prism::Node
- # def initialize: (Symbol name, Integer depth, Location location) -> void
+ # Initialize a new LocalVariableReadNode node.
#
# @return [LocalVariableReadNode] a new instance of LocalVariableReadNode
#
- # source://prism//lib/prism/node.rb#12343
- sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void }
- def initialize(source, name, depth, location); end
+ # source://prism//lib/prism/node.rb#10784
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, name, depth); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12443
+ # source://prism//lib/prism/node.rb#10863
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12352
+ # source://prism//lib/prism/node.rb#10794
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12357
+ # source://prism//lib/prism/node.rb#10799
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12367
+ # source://prism//lib/prism/node.rb#10809
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12362
+ # source://prism//lib/prism/node.rb#10804
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableReadNode
#
- # source://prism//lib/prism/node.rb#12372
- sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableReadNode) }
- def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#10814
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12357
+ # source://prism//lib/prism/node.rb#10799
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer }
#
- # source://prism//lib/prism/node.rb#12380
+ # source://prism//lib/prism/node.rb#10822
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -21803,7 +22364,7 @@ class Prism::LocalVariableReadNode < ::Prism::Node
#
# The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
#
- # source://prism//lib/prism/node.rb#12406
+ # source://prism//lib/prism/node.rb#10844
sig { returns(Integer) }
def depth; end
@@ -21812,7 +22373,7 @@ class Prism::LocalVariableReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12409
+ # source://prism//lib/prism/node.rb#10847
sig { override.returns(String) }
def inspect; end
@@ -21826,42 +22387,20 @@ class Prism::LocalVariableReadNode < ::Prism::Node
#
# _1 # name `:_1`
#
- # Finally, for the default `it` block parameter, the name is `0it`. This is to distinguish it from an `it` local variable that is explicitly declared.
- #
- # it # name `:0it`
- #
- # source://prism//lib/prism/node.rb#12397
+ # source://prism//lib/prism/node.rb#10835
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12427
+ # source://prism//lib/prism/node.rb#10852
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12437
+ # source://prism//lib/prism/node.rb#10857
def type; end
end
end
@@ -21871,68 +22410,85 @@ end
# foo, bar = baz
# ^^^ ^^^
#
-# source://prism//lib/prism/node.rb#12454
+# source://prism//lib/prism/node.rb#10874
class Prism::LocalVariableTargetNode < ::Prism::Node
- # def initialize: (Symbol name, Integer depth, Location location) -> void
+ # Initialize a new LocalVariableTargetNode node.
#
# @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#12456
- sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void }
- def initialize(source, name, depth, location); end
+ # source://prism//lib/prism/node.rb#10876
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, name, depth); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12538
+ # source://prism//lib/prism/node.rb#10941
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12465
+ # source://prism//lib/prism/node.rb#10886
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12470
+ # source://prism//lib/prism/node.rb#10891
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12480
+ # source://prism//lib/prism/node.rb#10901
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12475
+ # source://prism//lib/prism/node.rb#10896
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer) -> LocalVariableTargetNode
#
- # source://prism//lib/prism/node.rb#12485
- sig { params(name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableTargetNode) }
- def copy(name: T.unsafe(nil), depth: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#10906
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol,
+ depth: Integer
+ ).returns(Prism::LocalVariableTargetNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12470
+ # source://prism//lib/prism/node.rb#10891
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer }
#
- # source://prism//lib/prism/node.rb#12493
+ # source://prism//lib/prism/node.rb#10914
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader depth: Integer
#
- # source://prism//lib/prism/node.rb#12501
+ # source://prism//lib/prism/node.rb#10922
sig { returns(Integer) }
def depth; end
@@ -21941,44 +22497,26 @@ class Prism::LocalVariableTargetNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12504
+ # source://prism//lib/prism/node.rb#10925
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#12498
+ # source://prism//lib/prism/node.rb#10919
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12522
+ # source://prism//lib/prism/node.rb#10930
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12532
+ # source://prism//lib/prism/node.rb#10935
def type; end
end
end
@@ -21988,81 +22526,85 @@ end
# foo = 1
# ^^^^^^^
#
-# source://prism//lib/prism/node.rb#12549
+# source://prism//lib/prism/node.rb#10952
class Prism::LocalVariableWriteNode < ::Prism::Node
- # def initialize: (Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void
+ # Initialize a new LocalVariableWriteNode node.
#
# @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode
#
- # source://prism//lib/prism/node.rb#12551
+ # source://prism//lib/prism/node.rb#10954
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
depth: Integer,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, name, depth, name_loc, value, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, depth, name_loc, value, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12684
+ # source://prism//lib/prism/node.rb#11070
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12563
+ # source://prism//lib/prism/node.rb#10967
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12568
+ # source://prism//lib/prism/node.rb#10972
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12578
+ # source://prism//lib/prism/node.rb#10982
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12573
+ # source://prism//lib/prism/node.rb#10977
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> LocalVariableWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location) -> LocalVariableWriteNode
#
- # source://prism//lib/prism/node.rb#12583
+ # source://prism//lib/prism/node.rb#10987
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
name: Symbol,
depth: Integer,
name_loc: Prism::Location,
value: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::LocalVariableWriteNode)
end
- def copy(name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), depth: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12568
+ # source://prism//lib/prism/node.rb#10972
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#12591
+ # source://prism//lib/prism/node.rb#10995
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -22074,7 +22616,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
#
# The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
#
- # source://prism//lib/prism/node.rb#12609
+ # source://prism//lib/prism/node.rb#11013
sig { returns(Integer) }
def depth; end
@@ -22083,7 +22625,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12650
+ # source://prism//lib/prism/node.rb#11054
sig { override.returns(String) }
def inspect; end
@@ -22093,7 +22635,7 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
#
# abc = 123 # name `:abc`
#
- # source://prism//lib/prism/node.rb#12600
+ # source://prism//lib/prism/node.rb#11004
sig { returns(Symbol) }
def name; end
@@ -22102,13 +22644,13 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
# foo = :bar
# ^^^
#
- # source://prism//lib/prism/node.rb#12615
+ # source://prism//lib/prism/node.rb#11019
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#12645
+ # source://prism//lib/prism/node.rb#11049
sig { returns(String) }
def operator; end
@@ -22117,26 +22659,13 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
# x = :y
# ^
#
- # source://prism//lib/prism/node.rb#12638
+ # source://prism//lib/prism/node.rb#11042
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12668
+ # source://prism//lib/prism/node.rb#11059
sig { override.returns(Symbol) }
def type; end
@@ -22152,39 +22681,34 @@ class Prism::LocalVariableWriteNode < ::Prism::Node
#
# foo = foo
#
- # source://prism//lib/prism/node.rb#12632
+ # source://prism//lib/prism/node.rb#11036
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#12678
+ # source://prism//lib/prism/node.rb#11064
def type; end
end
end
# This represents a location in the source.
#
-# source://prism//lib/prism/parse_result.rb#156
+# source://prism//lib/prism/parse_result.rb#273
class Prism::Location
# Create a new location object with the given source, start byte offset, and
# byte length.
#
# @return [Location] a new instance of Location
#
- # source://prism//lib/prism/parse_result.rb#171
+ # source://prism//lib/prism/parse_result.rb#288
sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void }
def initialize(source, start_offset, length); end
# Returns true if the given other location is equal to this location.
#
- # source://prism//lib/prism/parse_result.rb#335
+ # source://prism//lib/prism/parse_result.rb#476
sig { params(other: T.untyped).returns(T::Boolean) }
def ==(other); end
@@ -22192,84 +22716,128 @@ class Prism::Location
# that occurs after this location on the same line, and return the new
# location. This will raise an error if the string does not exist.
#
- # source://prism//lib/prism/parse_result.rb#354
+ # source://prism//lib/prism/parse_result.rb#495
sig { params(string: String).returns(Prism::Location) }
def adjoin(string); end
+ # The end column in code units using the given cache to fetch or calculate
+ # the value.
+ #
+ # source://prism//lib/prism/parse_result.rb#461
+ sig do
+ params(
+ cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))
+ ).returns(Integer)
+ end
+ def cached_end_code_units_column(cache); end
+
+ # The end offset from the start of the file in code units using the given
+ # cache to fetch or calculate the value.
+ #
+ # source://prism//lib/prism/parse_result.rb#397
+ sig do
+ params(
+ cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))
+ ).returns(Integer)
+ end
+ def cached_end_code_units_offset(cache); end
+
+ # The start column in code units using the given cache to fetch or calculate
+ # the value.
+ #
+ # source://prism//lib/prism/parse_result.rb#437
+ sig do
+ params(
+ cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))
+ ).returns(Integer)
+ end
+ def cached_start_code_units_column(cache); end
+
+ # The start offset from the start of the file in code units using the given
+ # cache to fetch or calculate the value.
+ #
+ # source://prism//lib/prism/parse_result.rb#375
+ sig do
+ params(
+ cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))
+ ).returns(Integer)
+ end
+ def cached_start_code_units_offset(cache); end
+
# Returns a new location that is the result of chopping off the last byte.
#
- # source://prism//lib/prism/parse_result.rb#217
+ # source://prism//lib/prism/parse_result.rb#334
sig { returns(Prism::Location) }
def chop; end
# Returns all comments that are associated with this location (both leading
# and trailing comments).
#
- # source://prism//lib/prism/parse_result.rb#207
+ # source://prism//lib/prism/parse_result.rb#324
sig { returns(T::Array[Prism::Comment]) }
def comments; end
# Create a new location object with the given options.
#
- # source://prism//lib/prism/parse_result.rb#212
+ # source://prism//lib/prism/parse_result.rb#329
sig { params(source: Prism::Source, start_offset: Integer, length: Integer).returns(Prism::Location) }
def copy(source: T.unsafe(nil), start_offset: T.unsafe(nil), length: T.unsafe(nil)); end
# Implement the hash pattern matching interface for Location.
#
- # source://prism//lib/prism/parse_result.rb#325
+ # source://prism//lib/prism/parse_result.rb#466
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# The column number in characters where this location ends from the start of
# the line.
#
- # source://prism//lib/prism/parse_result.rb#314
+ # source://prism//lib/prism/parse_result.rb#449
sig { returns(Integer) }
def end_character_column; end
# The character offset from the beginning of the source where this location
# ends.
#
- # source://prism//lib/prism/parse_result.rb#263
+ # source://prism//lib/prism/parse_result.rb#386
sig { returns(Integer) }
def end_character_offset; end
# The column number in code units of the given encoding where this location
# ends from the start of the line.
#
- # source://prism//lib/prism/parse_result.rb#320
+ # source://prism//lib/prism/parse_result.rb#455
sig { params(encoding: Encoding).returns(Integer) }
def end_code_units_column(encoding = T.unsafe(nil)); end
# The offset from the start of the file in code units of the given encoding.
#
- # source://prism//lib/prism/parse_result.rb#268
+ # source://prism//lib/prism/parse_result.rb#391
sig { params(encoding: Encoding).returns(Integer) }
def end_code_units_offset(encoding = T.unsafe(nil)); end
# The column number in bytes where this location ends from the start of the
# line.
#
- # source://prism//lib/prism/parse_result.rb#308
+ # source://prism//lib/prism/parse_result.rb#443
sig { returns(Integer) }
def end_column; end
# The line number where this location ends.
#
- # source://prism//lib/prism/parse_result.rb#284
+ # source://prism//lib/prism/parse_result.rb#413
sig { returns(Integer) }
def end_line; end
# The byte offset from the beginning of the source where this location ends.
#
- # source://prism//lib/prism/parse_result.rb#257
+ # source://prism//lib/prism/parse_result.rb#380
sig { returns(Integer) }
def end_offset; end
# Returns a string representation of this location.
#
- # source://prism//lib/prism/parse_result.rb#222
+ # source://prism//lib/prism/parse_result.rb#339
sig { returns(String) }
def inspect; end
@@ -22277,38 +22845,38 @@ class Prism::Location
# other location. Raises an error if this location is not before the other
# location or if they don't share the same source.
#
- # source://prism//lib/prism/parse_result.rb#344
+ # source://prism//lib/prism/parse_result.rb#485
sig { params(other: Prism::Location).returns(Prism::Location) }
def join(other); end
# Attach a comment to the leading comments of this location.
#
- # source://prism//lib/prism/parse_result.rb#190
+ # source://prism//lib/prism/parse_result.rb#307
sig { params(comment: Prism::Comment).void }
def leading_comment(comment); end
# These are the comments that are associated with this location that exist
# before the start of this location.
#
- # source://prism//lib/prism/parse_result.rb#185
+ # source://prism//lib/prism/parse_result.rb#302
sig { returns(T::Array[Prism::Comment]) }
def leading_comments; end
# The length of this location in bytes.
#
- # source://prism//lib/prism/parse_result.rb#167
+ # source://prism//lib/prism/parse_result.rb#284
sig { returns(Integer) }
def length; end
# Implement the pretty print interface for Location.
#
- # source://prism//lib/prism/parse_result.rb#330
+ # source://prism//lib/prism/parse_result.rb#471
sig { params(q: T.untyped).void }
def pretty_print(q); end
# The source code that this location represents.
#
- # source://prism//lib/prism/parse_result.rb#232
+ # source://prism//lib/prism/parse_result.rb#349
sig { returns(String) }
def slice; end
@@ -22316,78 +22884,78 @@ class Prism::Location
# of the line that this location starts on to the end of the line that this
# location ends on.
#
- # source://prism//lib/prism/parse_result.rb#239
+ # source://prism//lib/prism/parse_result.rb#356
def slice_lines; end
# Returns all of the lines of the source code associated with this location.
#
- # source://prism//lib/prism/parse_result.rb#227
+ # source://prism//lib/prism/parse_result.rb#344
sig { returns(T::Array[String]) }
def source_lines; end
# The column number in characters where this location ends from the start of
# the line.
#
- # source://prism//lib/prism/parse_result.rb#296
+ # source://prism//lib/prism/parse_result.rb#425
sig { returns(Integer) }
def start_character_column; end
# The character offset from the beginning of the source where this location
# starts.
#
- # source://prism//lib/prism/parse_result.rb#247
+ # source://prism//lib/prism/parse_result.rb#364
sig { returns(Integer) }
def start_character_offset; end
# The column number in code units of the given encoding where this location
# starts from the start of the line.
#
- # source://prism//lib/prism/parse_result.rb#302
+ # source://prism//lib/prism/parse_result.rb#431
sig { params(encoding: Encoding).returns(Integer) }
def start_code_units_column(encoding = T.unsafe(nil)); end
# The offset from the start of the file in code units of the given encoding.
#
- # source://prism//lib/prism/parse_result.rb#252
+ # source://prism//lib/prism/parse_result.rb#369
sig { params(encoding: Encoding).returns(Integer) }
def start_code_units_offset(encoding = T.unsafe(nil)); end
# The column number in bytes where this location starts from the start of
# the line.
#
- # source://prism//lib/prism/parse_result.rb#290
+ # source://prism//lib/prism/parse_result.rb#419
sig { returns(Integer) }
def start_column; end
# The line number where this location starts.
#
- # source://prism//lib/prism/parse_result.rb#273
+ # source://prism//lib/prism/parse_result.rb#402
sig { returns(Integer) }
def start_line; end
# The content of the line where this location starts before this location.
#
- # source://prism//lib/prism/parse_result.rb#278
+ # source://prism//lib/prism/parse_result.rb#407
sig { returns(String) }
def start_line_slice; end
# The byte offset from the beginning of the source where this location
# starts.
#
- # source://prism//lib/prism/parse_result.rb#164
+ # source://prism//lib/prism/parse_result.rb#281
sig { returns(Integer) }
def start_offset; end
# Attach a comment to the trailing comments of this location.
#
- # source://prism//lib/prism/parse_result.rb#201
+ # source://prism//lib/prism/parse_result.rb#318
sig { params(comment: Prism::Comment).void }
def trailing_comment(comment); end
# These are the comments that are associated with this location that exist
# after the end of this location.
#
- # source://prism//lib/prism/parse_result.rb#196
+ # source://prism//lib/prism/parse_result.rb#313
sig { returns(T::Array[Prism::Comment]) }
def trailing_comments; end
@@ -22396,66 +22964,66 @@ class Prism::Location
# A Source object that is used to determine more information from the given
# offset and length.
#
- # source://prism//lib/prism/parse_result.rb#159
+ # source://prism//lib/prism/parse_result.rb#276
sig { returns(Prism::Source) }
def source; end
end
# Flags for while and until loop nodes.
#
-# source://prism//lib/prism/node.rb#19271
+# source://prism//lib/prism/node.rb#16762
module Prism::LoopFlags; end
# a loop after a begin statement, so the body is executed first before the condition
#
-# source://prism//lib/prism/node.rb#19273
+# source://prism//lib/prism/node.rb#16764
Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer)
# This represents a magic comment that was encountered during parsing.
#
-# source://prism//lib/prism/parse_result.rb#416
+# source://prism//lib/prism/parse_result.rb#557
class Prism::MagicComment
# Create a new magic comment object with the given key and value locations.
#
# @return [MagicComment] a new instance of MagicComment
#
- # source://prism//lib/prism/parse_result.rb#424
+ # source://prism//lib/prism/parse_result.rb#565
sig { params(key_loc: Prism::Location, value_loc: Prism::Location).void }
def initialize(key_loc, value_loc); end
# Implement the hash pattern matching interface for MagicComment.
#
- # source://prism//lib/prism/parse_result.rb#440
+ # source://prism//lib/prism/parse_result.rb#581
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# Returns a string representation of this magic comment.
#
- # source://prism//lib/prism/parse_result.rb#445
+ # source://prism//lib/prism/parse_result.rb#586
sig { returns(String) }
def inspect; end
# Returns the key of the magic comment by slicing it from the source code.
#
- # source://prism//lib/prism/parse_result.rb#430
+ # source://prism//lib/prism/parse_result.rb#571
sig { returns(String) }
def key; end
# A Location object representing the location of the key in the source.
#
- # source://prism//lib/prism/parse_result.rb#418
+ # source://prism//lib/prism/parse_result.rb#559
sig { returns(Prism::Location) }
def key_loc; end
# Returns the value of the magic comment by slicing it from the source code.
#
- # source://prism//lib/prism/parse_result.rb#435
+ # source://prism//lib/prism/parse_result.rb#576
sig { returns(String) }
def value; end
# A Location object representing the location of the value in the source.
#
- # source://prism//lib/prism/parse_result.rb#421
+ # source://prism//lib/prism/parse_result.rb#562
sig { returns(Prism::Location) }
def value_loc; end
end
@@ -22465,37 +23033,38 @@ end
# if /foo/i then end
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#12698
+# source://prism//lib/prism/node.rb#11084
class Prism::MatchLastLineNode < ::Prism::Node
include ::Prism::RegularExpressionOptions
- # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void
+ # Initialize a new MatchLastLineNode node.
#
# @return [MatchLastLineNode] a new instance of MatchLastLineNode
#
- # source://prism//lib/prism/node.rb#12700
+ # source://prism//lib/prism/node.rb#11086
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).void
end
- def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end
+ def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12877
+ # source://prism//lib/prism/node.rb#11241
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12712
+ # source://prism//lib/prism/node.rb#11098
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -22503,77 +23072,78 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12798
+ # source://prism//lib/prism/node.rb#11156
sig { returns(T::Boolean) }
def ascii_8bit?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12717
+ # source://prism//lib/prism/node.rb#11103
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#12838
+ # source://prism//lib/prism/node.rb#11220
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#12763
+ # source://prism//lib/prism/node.rb#11200
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12727
+ # source://prism//lib/prism/node.rb#11113
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12722
+ # source://prism//lib/prism/node.rb#11108
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
# def content: () -> String
#
- # source://prism//lib/prism/node.rb#12833
+ # source://prism//lib/prism/node.rb#11215
sig { returns(String) }
def content; end
# attr_reader content_loc: Location
#
- # source://prism//lib/prism/node.rb#12756
+ # source://prism//lib/prism/node.rb#11193
sig { returns(Prism::Location) }
def content_loc; end
- # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> MatchLastLineNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> MatchLastLineNode
#
- # source://prism//lib/prism/node.rb#12732
+ # source://prism//lib/prism/node.rb#11118
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).returns(Prism::MatchLastLineNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12717
+ # source://prism//lib/prism/node.rb#11103
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
#
- # source://prism//lib/prism/node.rb#12740
+ # source://prism//lib/prism/node.rb#11126
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -22581,7 +23151,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12793
+ # source://prism//lib/prism/node.rb#11151
sig { returns(T::Boolean) }
def euc_jp?; end
@@ -22589,7 +23159,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12778
+ # source://prism//lib/prism/node.rb#11136
sig { returns(T::Boolean) }
def extended?; end
@@ -22600,7 +23170,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12818
+ # source://prism//lib/prism/node.rb#11176
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -22608,7 +23178,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12823
+ # source://prism//lib/prism/node.rb#11181
sig { returns(T::Boolean) }
def forced_us_ascii_encoding?; end
@@ -22616,7 +23186,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12813
+ # source://prism//lib/prism/node.rb#11171
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -22624,13 +23194,13 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12773
+ # source://prism//lib/prism/node.rb#11131
sig { returns(T::Boolean) }
def ignore_case?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12843
+ # source://prism//lib/prism/node.rb#11225
sig { override.returns(String) }
def inspect; end
@@ -22638,7 +23208,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12783
+ # source://prism//lib/prism/node.rb#11141
sig { returns(T::Boolean) }
def multi_line?; end
@@ -22646,47 +23216,34 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12788
+ # source://prism//lib/prism/node.rb#11146
sig { returns(T::Boolean) }
def once?; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#12828
+ # source://prism//lib/prism/node.rb#11210
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#12749
+ # source://prism//lib/prism/node.rb#11186
sig { returns(Prism::Location) }
def opening_loc; end
sig { returns(Integer) }
def options; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12861
+ # source://prism//lib/prism/node.rb#11230
sig { override.returns(Symbol) }
def type; end
# attr_reader unescaped: String
#
- # source://prism//lib/prism/node.rb#12770
+ # source://prism//lib/prism/node.rb#11207
sig { returns(String) }
def unescaped; end
@@ -22694,7 +23251,7 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12808
+ # source://prism//lib/prism/node.rb#11166
sig { returns(T::Boolean) }
def utf_8?; end
@@ -22702,27 +23259,14 @@ class Prism::MatchLastLineNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#12803
+ # source://prism//lib/prism/node.rb#11161
sig { returns(T::Boolean) }
def windows_31j?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#12745
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#12871
+ # source://prism//lib/prism/node.rb#11235
def type; end
end
end
@@ -22732,77 +23276,81 @@ end
# foo in bar
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#12891
+# source://prism//lib/prism/node.rb#11255
class Prism::MatchPredicateNode < ::Prism::Node
- # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void
+ # Initialize a new MatchPredicateNode node.
#
# @return [MatchPredicateNode] a new instance of MatchPredicateNode
#
- # source://prism//lib/prism/node.rb#12893
+ # source://prism//lib/prism/node.rb#11257
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
pattern: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, value, pattern, operator_loc, location); end
+ def initialize(source, node_id, location, flags, value, pattern, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#12988
+ # source://prism//lib/prism/node.rb#11335
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#12903
+ # source://prism//lib/prism/node.rb#11268
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12908
+ # source://prism//lib/prism/node.rb#11273
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#12918
+ # source://prism//lib/prism/node.rb#11283
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#12913
+ # source://prism//lib/prism/node.rb#11278
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchPredicateNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchPredicateNode
#
- # source://prism//lib/prism/node.rb#12923
+ # source://prism//lib/prism/node.rb#11288
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
pattern: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::MatchPredicateNode)
end
- def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#12908
+ # source://prism//lib/prism/node.rb#11273
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#12931
+ # source://prism//lib/prism/node.rb#11296
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -22811,62 +23359,44 @@ class Prism::MatchPredicateNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#12954
+ # source://prism//lib/prism/node.rb#11319
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#12949
+ # source://prism//lib/prism/node.rb#11314
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#12942
+ # source://prism//lib/prism/node.rb#11307
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader pattern: Prism::node
#
- # source://prism//lib/prism/node.rb#12939
+ # source://prism//lib/prism/node.rb#11304
sig { returns(Prism::Node) }
def pattern; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#12972
+ # source://prism//lib/prism/node.rb#11324
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#12936
+ # source://prism//lib/prism/node.rb#11301
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#12982
+ # source://prism//lib/prism/node.rb#11329
def type; end
end
end
@@ -22876,77 +23406,81 @@ end
# foo => bar
# ^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#13000
+# source://prism//lib/prism/node.rb#11347
class Prism::MatchRequiredNode < ::Prism::Node
- # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void
+ # Initialize a new MatchRequiredNode node.
#
# @return [MatchRequiredNode] a new instance of MatchRequiredNode
#
- # source://prism//lib/prism/node.rb#13002
+ # source://prism//lib/prism/node.rb#11349
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
pattern: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, value, pattern, operator_loc, location); end
+ def initialize(source, node_id, location, flags, value, pattern, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13097
+ # source://prism//lib/prism/node.rb#11427
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13012
+ # source://prism//lib/prism/node.rb#11360
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13017
+ # source://prism//lib/prism/node.rb#11365
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13027
+ # source://prism//lib/prism/node.rb#11375
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13022
+ # source://prism//lib/prism/node.rb#11370
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchRequiredNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location) -> MatchRequiredNode
#
- # source://prism//lib/prism/node.rb#13032
+ # source://prism//lib/prism/node.rb#11380
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
value: Prism::Node,
pattern: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::MatchRequiredNode)
end
- def copy(value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), value: T.unsafe(nil), pattern: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13017
+ # source://prism//lib/prism/node.rb#11365
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, value: Prism::node, pattern: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#13040
+ # source://prism//lib/prism/node.rb#11388
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -22955,62 +23489,44 @@ class Prism::MatchRequiredNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13063
+ # source://prism//lib/prism/node.rb#11411
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#13058
+ # source://prism//lib/prism/node.rb#11406
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#13051
+ # source://prism//lib/prism/node.rb#11399
sig { returns(Prism::Location) }
def operator_loc; end
# attr_reader pattern: Prism::node
#
- # source://prism//lib/prism/node.rb#13048
+ # source://prism//lib/prism/node.rb#11396
sig { returns(Prism::Node) }
def pattern; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13081
+ # source://prism//lib/prism/node.rb#11416
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#13045
+ # source://prism//lib/prism/node.rb#11393
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13091
+ # source://prism//lib/prism/node.rb#11421
def type; end
end
end
@@ -23020,81 +23536,85 @@ end
# /(?bar)/ =~ baz
# ^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#13109
+# source://prism//lib/prism/node.rb#11439
class Prism::MatchWriteNode < ::Prism::Node
- # def initialize: (CallNode call, Array[LocalVariableTargetNode] targets, Location location) -> void
+ # Initialize a new MatchWriteNode node.
#
# @return [MatchWriteNode] a new instance of MatchWriteNode
#
- # source://prism//lib/prism/node.rb#13111
+ # source://prism//lib/prism/node.rb#11441
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
call: Prism::CallNode,
- targets: T::Array[Prism::LocalVariableTargetNode],
- location: Prism::Location
+ targets: T::Array[Prism::LocalVariableTargetNode]
).void
end
- def initialize(source, call, targets, location); end
+ def initialize(source, node_id, location, flags, call, targets); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13193
+ # source://prism//lib/prism/node.rb#11506
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13120
+ # source://prism//lib/prism/node.rb#11451
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader call: CallNode
#
- # source://prism//lib/prism/node.rb#13153
+ # source://prism//lib/prism/node.rb#11484
sig { returns(Prism::CallNode) }
def call; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13125
+ # source://prism//lib/prism/node.rb#11456
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13135
+ # source://prism//lib/prism/node.rb#11466
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13130
+ # source://prism//lib/prism/node.rb#11461
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?call: CallNode, ?targets: Array[LocalVariableTargetNode], ?location: Location) -> MatchWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?call: CallNode, ?targets: Array[LocalVariableTargetNode]) -> MatchWriteNode
#
- # source://prism//lib/prism/node.rb#13140
+ # source://prism//lib/prism/node.rb#11471
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
call: Prism::CallNode,
- targets: T::Array[Prism::LocalVariableTargetNode],
- location: Prism::Location
+ targets: T::Array[Prism::LocalVariableTargetNode]
).returns(Prism::MatchWriteNode)
end
- def copy(call: T.unsafe(nil), targets: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), call: T.unsafe(nil), targets: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13125
+ # source://prism//lib/prism/node.rb#11456
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[LocalVariableTargetNode], location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, call: CallNode, targets: Array[LocalVariableTargetNode] }
#
- # source://prism//lib/prism/node.rb#13148
+ # source://prism//lib/prism/node.rb#11479
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -23103,106 +23623,88 @@ class Prism::MatchWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13159
+ # source://prism//lib/prism/node.rb#11490
sig { override.returns(String) }
def inspect; end
# attr_reader targets: Array[LocalVariableTargetNode]
#
- # source://prism//lib/prism/node.rb#13156
+ # source://prism//lib/prism/node.rb#11487
sig { returns(T::Array[Prism::LocalVariableTargetNode]) }
def targets; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13177
+ # source://prism//lib/prism/node.rb#11495
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#13187
+ # source://prism//lib/prism/node.rb#11500
def type; end
end
end
# Represents a node that is missing from the source and results in a syntax error.
#
-# source://prism//lib/prism/node.rb#13202
+# source://prism//lib/prism/node.rb#11515
class Prism::MissingNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new MissingNode node.
#
# @return [MissingNode] a new instance of MissingNode
#
- # source://prism//lib/prism/node.rb#13204
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#11517
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13278
+ # source://prism//lib/prism/node.rb#11574
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13211
+ # source://prism//lib/prism/node.rb#11525
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13216
+ # source://prism//lib/prism/node.rb#11530
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13226
+ # source://prism//lib/prism/node.rb#11540
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13221
+ # source://prism//lib/prism/node.rb#11535
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> MissingNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> MissingNode
#
- # source://prism//lib/prism/node.rb#13231
- sig { params(location: Prism::Location).returns(Prism::MissingNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#11545
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::MissingNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13216
+ # source://prism//lib/prism/node.rb#11530
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#13239
+ # source://prism//lib/prism/node.rb#11553
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -23211,38 +23713,20 @@ class Prism::MissingNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13244
+ # source://prism//lib/prism/node.rb#11558
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13262
+ # source://prism//lib/prism/node.rb#11563
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#13272
+ # source://prism//lib/prism/node.rb#11568
def type; end
end
end
@@ -23252,107 +23736,111 @@ end
# module Foo end
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#13287
+# source://prism//lib/prism/node.rb#11583
class Prism::ModuleNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, Location module_keyword_loc, Prism::node constant_path, Prism::node? body, Location end_keyword_loc, Symbol name, Location location) -> void
+ # Initialize a new ModuleNode node.
#
# @return [ModuleNode] a new instance of ModuleNode
#
- # source://prism//lib/prism/node.rb#13289
+ # source://prism//lib/prism/node.rb#11585
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
module_keyword_loc: Prism::Location,
- constant_path: Prism::Node,
- body: T.nilable(Prism::Node),
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
end_keyword_loc: Prism::Location,
- name: Symbol,
- location: Prism::Location
+ name: Symbol
).void
end
- def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end
+ def initialize(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13408
+ # source://prism//lib/prism/node.rb#11687
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13302
+ # source://prism//lib/prism/node.rb#11599
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
- # attr_reader body: Prism::node?
+ # attr_reader body: StatementsNode | BeginNode | nil
#
- # source://prism//lib/prism/node.rb#13351
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#11648
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13307
+ # source://prism//lib/prism/node.rb#11604
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13320
+ # source://prism//lib/prism/node.rb#11617
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13312
+ # source://prism//lib/prism/node.rb#11609
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader constant_path: Prism::node
+ # attr_reader constant_path: ConstantReadNode | ConstantPathNode | MissingNode
#
- # source://prism//lib/prism/node.rb#13348
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#11645
+ sig { returns(T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode)) }
def constant_path; end
- # def copy: (?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?name: Symbol, ?location: Location) -> ModuleNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?module_keyword_loc: Location, ?constant_path: ConstantReadNode | ConstantPathNode | MissingNode, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location, ?name: Symbol) -> ModuleNode
#
- # source://prism//lib/prism/node.rb#13325
+ # source://prism//lib/prism/node.rb#11622
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
module_keyword_loc: Prism::Location,
- constant_path: Prism::Node,
- body: T.nilable(Prism::Node),
+ constant_path: T.any(Prism::ConstantReadNode, Prism::ConstantPathNode, Prism::MissingNode),
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
end_keyword_loc: Prism::Location,
- name: Symbol,
- location: Prism::Location
+ name: Symbol
).returns(Prism::ModuleNode)
end
- def copy(locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), module_keyword_loc: T.unsafe(nil), constant_path: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13307
+ # source://prism//lib/prism/node.rb#11604
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], module_keyword_loc: Location, constant_path: Prism::node, body: Prism::node?, end_keyword_loc: Location, name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], module_keyword_loc: Location, constant_path: ConstantReadNode | ConstantPathNode | MissingNode, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#13333
+ # source://prism//lib/prism/node.rb#11630
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#13369
+ # source://prism//lib/prism/node.rb#11666
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#13354
+ # source://prism//lib/prism/node.rb#11651
sig { returns(Prism::Location) }
def end_keyword_loc; end
@@ -23361,62 +23849,44 @@ class Prism::ModuleNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13374
+ # source://prism//lib/prism/node.rb#11671
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#13338
+ # source://prism//lib/prism/node.rb#11635
sig { returns(T::Array[Symbol]) }
def locals; end
# def module_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#13364
+ # source://prism//lib/prism/node.rb#11661
sig { returns(String) }
def module_keyword; end
# attr_reader module_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#13341
+ # source://prism//lib/prism/node.rb#11638
sig { returns(Prism::Location) }
def module_keyword_loc; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#13361
+ # source://prism//lib/prism/node.rb#11658
sig { returns(Symbol) }
def name; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#13392
+ # source://prism//lib/prism/node.rb#11676
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13402
+ # source://prism//lib/prism/node.rb#11681
def type; end
end
end
@@ -23426,81 +23896,90 @@ end
# a, (b, c) = 1, 2, 3
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#13424
+# This can be a part of `MultiWriteNode` as above, or the target of a `for` loop
+#
+# for a, b in [[1, 2], [3, 4]]
+# ^^^^
+#
+# source://prism//lib/prism/node.rb#11708
class Prism::MultiTargetNode < ::Prism::Node
- # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] rights, Location? lparen_loc, Location? rparen_loc, Location location) -> void
+ # Initialize a new MultiTargetNode node.
#
# @return [MultiTargetNode] a new instance of MultiTargetNode
#
- # source://prism//lib/prism/node.rb#13426
+ # source://prism//lib/prism/node.rb#11710
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
- rest: T.nilable(Prism::Node),
- rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
lparen_loc: T.nilable(Prism::Location),
- rparen_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ rparen_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); end
+ def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13554
+ # source://prism//lib/prism/node.rb#11851
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13438
+ # source://prism//lib/prism/node.rb#11723
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13443
+ # source://prism//lib/prism/node.rb#11728
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13457
+ # source://prism//lib/prism/node.rb#11742
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13448
+ # source://prism//lib/prism/node.rb#11733
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?location: Location) -> MultiTargetNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?) -> MultiTargetNode
#
- # source://prism//lib/prism/node.rb#13462
+ # source://prism//lib/prism/node.rb#11747
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
- rest: T.nilable(Prism::Node),
- rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
lparen_loc: T.nilable(Prism::Location),
- rparen_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ rparen_loc: T.nilable(Prism::Location)
).returns(Prism::MultiTargetNode)
end
- def copy(lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13443
+ # source://prism//lib/prism/node.rb#11728
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode], lparen_loc: Location?, rparen_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode], lparen_loc: Location?, rparen_loc: Location? }
#
- # source://prism//lib/prism/node.rb#13470
+ # source://prism//lib/prism/node.rb#11755
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -23509,13 +23988,21 @@ class Prism::MultiTargetNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13520
+ # source://prism//lib/prism/node.rb#11835
sig { override.returns(String) }
def inspect; end
- # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode]
+ # Represents the targets expressions before a splat node.
#
- # source://prism//lib/prism/node.rb#13475
+ # a, (b, c, *) = 1, 2, 3, 4, 5
+ # ^^^^
+ #
+ # The splat node can be absent, in that case all target expressions are in the left field.
+ #
+ # a, (b, c) = 1, 2, 3, 4, 5
+ # ^^^^
+ #
+ # source://prism//lib/prism/node.rb#11768
sig do
returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)])
end
@@ -23523,70 +24010,74 @@ class Prism::MultiTargetNode < ::Prism::Node
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#13510
+ # source://prism//lib/prism/node.rb#11825
sig { returns(T.nilable(String)) }
def lparen; end
- # attr_reader lparen_loc: Location?
+ # The location of the opening parenthesis.
+ #
+ # a, (b, c) = 1, 2, 3
+ # ^
#
- # source://prism//lib/prism/node.rb#13484
+ # source://prism//lib/prism/node.rb#11796
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
- # attr_reader rest: Prism::node?
+ # Represents a splat node in the target expression.
#
- # source://prism//lib/prism/node.rb#13478
- sig { returns(T.nilable(Prism::Node)) }
+ # a, (b, *c) = 1, 2, 3, 4
+ # ^^
+ #
+ # The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
+ #
+ # a, (b, *) = 1, 2, 3, 4
+ # ^
+ #
+ # If the `*` is omitted, this field will contain an `ImplicitRestNode`
+ #
+ # a, (b,) = 1, 2, 3, 4
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#11784
+ sig { returns(T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode))) }
def rest; end
- # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode]
+ # Represents the targets expressions after a splat node.
#
- # source://prism//lib/prism/node.rb#13481
+ # a, (*, b, c) = 1, 2, 3, 4, 5
+ # ^^^^
+ #
+ # source://prism//lib/prism/node.rb#11790
sig do
- returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode)])
+ returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::RequiredParameterNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)])
end
def rights; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#13515
+ # source://prism//lib/prism/node.rb#11830
sig { returns(T.nilable(String)) }
def rparen; end
- # attr_reader rparen_loc: Location?
+ # The location of the closing parenthesis.
#
- # source://prism//lib/prism/node.rb#13497
+ # a, (b, c) = 1, 2, 3
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#11812
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#13538
+ # source://prism//lib/prism/node.rb#11840
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13548
+ # source://prism//lib/prism/node.rb#11845
def type; end
end
end
@@ -23596,85 +24087,89 @@ end
# a, b, c = 1, 2, 3
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#13570
+# source://prism//lib/prism/node.rb#11867
class Prism::MultiWriteNode < ::Prism::Node
- # def initialize: (Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] lefts, Prism::node? rest, Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new MultiWriteNode node.
#
# @return [MultiWriteNode] a new instance of MultiWriteNode
#
- # source://prism//lib/prism/node.rb#13572
+ # source://prism//lib/prism/node.rb#11869
sig do
params(
source: Prism::Source,
- lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)],
- rest: T.nilable(Prism::Node),
- rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)],
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
lparen_loc: T.nilable(Prism::Location),
rparen_loc: T.nilable(Prism::Location),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13718
+ # source://prism//lib/prism/node.rb#12034
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13586
+ # source://prism//lib/prism/node.rb#11884
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13591
+ # source://prism//lib/prism/node.rb#11889
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13606
+ # source://prism//lib/prism/node.rb#11904
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13596
+ # source://prism//lib/prism/node.rb#11894
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?rest: Prism::node?, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> MultiWriteNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?rest: ImplicitRestNode | SplatNode | nil, ?rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], ?lparen_loc: Location?, ?rparen_loc: Location?, ?operator_loc: Location, ?value: Prism::node) -> MultiWriteNode
#
- # source://prism//lib/prism/node.rb#13611
+ # source://prism//lib/prism/node.rb#11909
sig do
params(
- lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)],
- rest: T.nilable(Prism::Node),
- rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)],
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ lefts: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
+ rest: T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode)),
+ rights: T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)],
lparen_loc: T.nilable(Prism::Location),
rparen_loc: T.nilable(Prism::Location),
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::MultiWriteNode)
end
- def copy(lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), lefts: T.unsafe(nil), rest: T.unsafe(nil), rights: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13591
+ # source://prism//lib/prism/node.rb#11889
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], rest: Prism::node?, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], rest: ImplicitRestNode | SplatNode | nil, rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | BackReferenceReadNode | NumberedReferenceReadNode], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#13619
+ # source://prism//lib/prism/node.rb#11917
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -23683,102 +24178,120 @@ class Prism::MultiWriteNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13684
+ # source://prism//lib/prism/node.rb#12018
sig { override.returns(String) }
def inspect; end
- # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode]
+ # Represents the targets expressions before a splat node.
+ #
+ # a, b, * = 1, 2, 3, 4, 5
+ # ^^^^
+ #
+ # The splat node can be absent, in that case all target expressions are in the left field.
#
- # source://prism//lib/prism/node.rb#13624
+ # a, b, c = 1, 2, 3, 4, 5
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/node.rb#11930
sig do
- returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)])
+ returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)])
end
def lefts; end
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#13669
+ # source://prism//lib/prism/node.rb#12003
sig { returns(T.nilable(String)) }
def lparen; end
- # attr_reader lparen_loc: Location?
+ # The location of the opening parenthesis.
#
- # source://prism//lib/prism/node.rb#13633
+ # (a, b, c) = 1, 2, 3
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#11958
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#13679
+ # source://prism//lib/prism/node.rb#12013
sig { returns(String) }
def operator; end
- # attr_reader operator_loc: Location
+ # The location of the operator.
+ #
+ # a, b, c = 1, 2, 3
+ # ^
#
- # source://prism//lib/prism/node.rb#13659
+ # source://prism//lib/prism/node.rb#11990
sig { returns(Prism::Location) }
def operator_loc; end
- # attr_reader rest: Prism::node?
+ # Represents a splat node in the target expression.
#
- # source://prism//lib/prism/node.rb#13627
- sig { returns(T.nilable(Prism::Node)) }
+ # a, b, *c = 1, 2, 3, 4
+ # ^^
+ #
+ # The variable can be empty, this results in a `SplatNode` with a `nil` expression field.
+ #
+ # a, b, * = 1, 2, 3, 4
+ # ^
+ #
+ # If the `*` is omitted, this field will contain an `ImplicitRestNode`
+ #
+ # a, b, = 1, 2, 3, 4
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#11946
+ sig { returns(T.nilable(T.any(Prism::ImplicitRestNode, Prism::SplatNode))) }
def rest; end
- # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode]
+ # Represents the targets expressions after a splat node.
+ #
+ # a, *, b, c = 1, 2, 3, 4, 5
+ # ^^^^
#
- # source://prism//lib/prism/node.rb#13630
+ # source://prism//lib/prism/node.rb#11952
sig do
- returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)])
+ returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode)])
end
def rights; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#13674
+ # source://prism//lib/prism/node.rb#12008
sig { returns(T.nilable(String)) }
def rparen; end
- # attr_reader rparen_loc: Location?
+ # The location of the closing parenthesis.
#
- # source://prism//lib/prism/node.rb#13646
+ # (a, b, c) = 1, 2, 3
+ # ^
+ #
+ # source://prism//lib/prism/node.rb#11974
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13702
+ # source://prism//lib/prism/node.rb#12023
sig { override.returns(Symbol) }
def type; end
- # attr_reader value: Prism::node
+ # The value to write to the targets. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
#
- # source://prism//lib/prism/node.rb#13666
+ # a, b, c = 1, 2, 3
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/node.rb#12000
sig { returns(Prism::Node) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#13712
+ # source://prism//lib/prism/node.rb#12028
def type; end
end
end
@@ -24224,319 +24737,324 @@ class Prism::MutationCompiler < ::Prism::Compiler
# source://prism//lib/prism/mutation_compiler.rb#445
def visit_interpolated_x_string_node(node); end
- # Copy a ItParametersNode node
+ # Copy a ItLocalVariableReadNode node
#
# source://prism//lib/prism/mutation_compiler.rb#450
+ def visit_it_local_variable_read_node(node); end
+
+ # Copy a ItParametersNode node
+ #
+ # source://prism//lib/prism/mutation_compiler.rb#455
def visit_it_parameters_node(node); end
# Copy a KeywordHashNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#455
+ # source://prism//lib/prism/mutation_compiler.rb#460
def visit_keyword_hash_node(node); end
# Copy a KeywordRestParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#460
+ # source://prism//lib/prism/mutation_compiler.rb#465
def visit_keyword_rest_parameter_node(node); end
# Copy a LambdaNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#465
+ # source://prism//lib/prism/mutation_compiler.rb#470
def visit_lambda_node(node); end
# Copy a LocalVariableAndWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#470
+ # source://prism//lib/prism/mutation_compiler.rb#475
def visit_local_variable_and_write_node(node); end
# Copy a LocalVariableOperatorWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#475
+ # source://prism//lib/prism/mutation_compiler.rb#480
def visit_local_variable_operator_write_node(node); end
# Copy a LocalVariableOrWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#480
+ # source://prism//lib/prism/mutation_compiler.rb#485
def visit_local_variable_or_write_node(node); end
# Copy a LocalVariableReadNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#485
+ # source://prism//lib/prism/mutation_compiler.rb#490
def visit_local_variable_read_node(node); end
# Copy a LocalVariableTargetNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#490
+ # source://prism//lib/prism/mutation_compiler.rb#495
def visit_local_variable_target_node(node); end
# Copy a LocalVariableWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#495
+ # source://prism//lib/prism/mutation_compiler.rb#500
def visit_local_variable_write_node(node); end
# Copy a MatchLastLineNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#500
+ # source://prism//lib/prism/mutation_compiler.rb#505
def visit_match_last_line_node(node); end
# Copy a MatchPredicateNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#505
+ # source://prism//lib/prism/mutation_compiler.rb#510
def visit_match_predicate_node(node); end
# Copy a MatchRequiredNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#510
+ # source://prism//lib/prism/mutation_compiler.rb#515
def visit_match_required_node(node); end
# Copy a MatchWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#515
+ # source://prism//lib/prism/mutation_compiler.rb#520
def visit_match_write_node(node); end
# Copy a MissingNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#520
+ # source://prism//lib/prism/mutation_compiler.rb#525
def visit_missing_node(node); end
# Copy a ModuleNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#525
+ # source://prism//lib/prism/mutation_compiler.rb#530
def visit_module_node(node); end
# Copy a MultiTargetNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#530
+ # source://prism//lib/prism/mutation_compiler.rb#535
def visit_multi_target_node(node); end
# Copy a MultiWriteNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#535
+ # source://prism//lib/prism/mutation_compiler.rb#540
def visit_multi_write_node(node); end
# Copy a NextNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#540
+ # source://prism//lib/prism/mutation_compiler.rb#545
def visit_next_node(node); end
# Copy a NilNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#545
+ # source://prism//lib/prism/mutation_compiler.rb#550
def visit_nil_node(node); end
# Copy a NoKeywordsParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#550
+ # source://prism//lib/prism/mutation_compiler.rb#555
def visit_no_keywords_parameter_node(node); end
# Copy a NumberedParametersNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#555
+ # source://prism//lib/prism/mutation_compiler.rb#560
def visit_numbered_parameters_node(node); end
# Copy a NumberedReferenceReadNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#560
+ # source://prism//lib/prism/mutation_compiler.rb#565
def visit_numbered_reference_read_node(node); end
# Copy a OptionalKeywordParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#565
+ # source://prism//lib/prism/mutation_compiler.rb#570
def visit_optional_keyword_parameter_node(node); end
# Copy a OptionalParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#570
+ # source://prism//lib/prism/mutation_compiler.rb#575
def visit_optional_parameter_node(node); end
# Copy a OrNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#575
+ # source://prism//lib/prism/mutation_compiler.rb#580
def visit_or_node(node); end
# Copy a ParametersNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#580
+ # source://prism//lib/prism/mutation_compiler.rb#585
def visit_parameters_node(node); end
# Copy a ParenthesesNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#585
+ # source://prism//lib/prism/mutation_compiler.rb#590
def visit_parentheses_node(node); end
# Copy a PinnedExpressionNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#590
+ # source://prism//lib/prism/mutation_compiler.rb#595
def visit_pinned_expression_node(node); end
# Copy a PinnedVariableNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#595
+ # source://prism//lib/prism/mutation_compiler.rb#600
def visit_pinned_variable_node(node); end
# Copy a PostExecutionNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#600
+ # source://prism//lib/prism/mutation_compiler.rb#605
def visit_post_execution_node(node); end
# Copy a PreExecutionNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#605
+ # source://prism//lib/prism/mutation_compiler.rb#610
def visit_pre_execution_node(node); end
# Copy a ProgramNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#610
+ # source://prism//lib/prism/mutation_compiler.rb#615
def visit_program_node(node); end
# Copy a RangeNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#615
+ # source://prism//lib/prism/mutation_compiler.rb#620
def visit_range_node(node); end
# Copy a RationalNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#620
+ # source://prism//lib/prism/mutation_compiler.rb#625
def visit_rational_node(node); end
# Copy a RedoNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#625
+ # source://prism//lib/prism/mutation_compiler.rb#630
def visit_redo_node(node); end
# Copy a RegularExpressionNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#630
+ # source://prism//lib/prism/mutation_compiler.rb#635
def visit_regular_expression_node(node); end
# Copy a RequiredKeywordParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#635
+ # source://prism//lib/prism/mutation_compiler.rb#640
def visit_required_keyword_parameter_node(node); end
# Copy a RequiredParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#640
+ # source://prism//lib/prism/mutation_compiler.rb#645
def visit_required_parameter_node(node); end
# Copy a RescueModifierNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#645
+ # source://prism//lib/prism/mutation_compiler.rb#650
def visit_rescue_modifier_node(node); end
# Copy a RescueNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#650
+ # source://prism//lib/prism/mutation_compiler.rb#655
def visit_rescue_node(node); end
# Copy a RestParameterNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#655
+ # source://prism//lib/prism/mutation_compiler.rb#660
def visit_rest_parameter_node(node); end
# Copy a RetryNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#660
+ # source://prism//lib/prism/mutation_compiler.rb#665
def visit_retry_node(node); end
# Copy a ReturnNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#665
+ # source://prism//lib/prism/mutation_compiler.rb#670
def visit_return_node(node); end
# Copy a SelfNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#670
+ # source://prism//lib/prism/mutation_compiler.rb#675
def visit_self_node(node); end
# Copy a ShareableConstantNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#675
+ # source://prism//lib/prism/mutation_compiler.rb#680
def visit_shareable_constant_node(node); end
# Copy a SingletonClassNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#680
+ # source://prism//lib/prism/mutation_compiler.rb#685
def visit_singleton_class_node(node); end
# Copy a SourceEncodingNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#685
+ # source://prism//lib/prism/mutation_compiler.rb#690
def visit_source_encoding_node(node); end
# Copy a SourceFileNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#690
+ # source://prism//lib/prism/mutation_compiler.rb#695
def visit_source_file_node(node); end
# Copy a SourceLineNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#695
+ # source://prism//lib/prism/mutation_compiler.rb#700
def visit_source_line_node(node); end
# Copy a SplatNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#700
+ # source://prism//lib/prism/mutation_compiler.rb#705
def visit_splat_node(node); end
# Copy a StatementsNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#705
+ # source://prism//lib/prism/mutation_compiler.rb#710
def visit_statements_node(node); end
# Copy a StringNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#710
+ # source://prism//lib/prism/mutation_compiler.rb#715
def visit_string_node(node); end
# Copy a SuperNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#715
+ # source://prism//lib/prism/mutation_compiler.rb#720
def visit_super_node(node); end
# Copy a SymbolNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#720
+ # source://prism//lib/prism/mutation_compiler.rb#725
def visit_symbol_node(node); end
# Copy a TrueNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#725
+ # source://prism//lib/prism/mutation_compiler.rb#730
def visit_true_node(node); end
# Copy a UndefNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#730
+ # source://prism//lib/prism/mutation_compiler.rb#735
def visit_undef_node(node); end
# Copy a UnlessNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#735
+ # source://prism//lib/prism/mutation_compiler.rb#740
def visit_unless_node(node); end
# Copy a UntilNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#740
+ # source://prism//lib/prism/mutation_compiler.rb#745
def visit_until_node(node); end
# Copy a WhenNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#745
+ # source://prism//lib/prism/mutation_compiler.rb#750
def visit_when_node(node); end
# Copy a WhileNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#750
+ # source://prism//lib/prism/mutation_compiler.rb#755
def visit_while_node(node); end
# Copy a XStringNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#755
+ # source://prism//lib/prism/mutation_compiler.rb#760
def visit_x_string_node(node); end
# Copy a YieldNode node
#
- # source://prism//lib/prism/mutation_compiler.rb#760
+ # source://prism//lib/prism/mutation_compiler.rb#765
def visit_yield_node(node); end
end
@@ -24545,81 +25063,85 @@ end
# next 1
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#13736
+# source://prism//lib/prism/node.rb#12052
class Prism::NextNode < ::Prism::Node
- # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void
+ # Initialize a new NextNode node.
#
# @return [NextNode] a new instance of NextNode
#
- # source://prism//lib/prism/node.rb#13738
+ # source://prism//lib/prism/node.rb#12054
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
arguments: T.nilable(Prism::ArgumentsNode),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, arguments, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, arguments, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13831
+ # source://prism//lib/prism/node.rb#12130
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13747
+ # source://prism//lib/prism/node.rb#12064
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#13782
+ # source://prism//lib/prism/node.rb#12099
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13752
+ # source://prism//lib/prism/node.rb#12069
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13764
+ # source://prism//lib/prism/node.rb#12081
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13757
+ # source://prism//lib/prism/node.rb#12074
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> NextNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: ArgumentsNode?, ?keyword_loc: Location) -> NextNode
#
- # source://prism//lib/prism/node.rb#13769
+ # source://prism//lib/prism/node.rb#12086
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
arguments: T.nilable(Prism::ArgumentsNode),
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).returns(Prism::NextNode)
end
- def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13752
+ # source://prism//lib/prism/node.rb#12069
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, arguments: ArgumentsNode?, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#13777
+ # source://prism//lib/prism/node.rb#12094
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -24628,50 +25150,32 @@ class Prism::NextNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13797
+ # source://prism//lib/prism/node.rb#12114
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#13792
+ # source://prism//lib/prism/node.rb#12109
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#13785
+ # source://prism//lib/prism/node.rb#12102
sig { returns(Prism::Location) }
def keyword_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13815
+ # source://prism//lib/prism/node.rb#12119
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#13825
+ # source://prism//lib/prism/node.rb#12124
def type; end
end
end
@@ -24681,62 +25185,62 @@ end
# nil
# ^^^
#
-# source://prism//lib/prism/node.rb#13842
+# source://prism//lib/prism/node.rb#12141
class Prism::NilNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new NilNode node.
#
# @return [NilNode] a new instance of NilNode
#
- # source://prism//lib/prism/node.rb#13844
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#12143
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#13918
+ # source://prism//lib/prism/node.rb#12200
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13851
+ # source://prism//lib/prism/node.rb#12151
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13856
+ # source://prism//lib/prism/node.rb#12156
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13866
+ # source://prism//lib/prism/node.rb#12166
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13861
+ # source://prism//lib/prism/node.rb#12161
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> NilNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> NilNode
#
- # source://prism//lib/prism/node.rb#13871
- sig { params(location: Prism::Location).returns(Prism::NilNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#12171
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::NilNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13856
+ # source://prism//lib/prism/node.rb#12156
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#13879
+ # source://prism//lib/prism/node.rb#12179
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -24745,38 +25249,20 @@ class Prism::NilNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13884
+ # source://prism//lib/prism/node.rb#12184
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#13902
+ # source://prism//lib/prism/node.rb#12189
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#13912
+ # source://prism//lib/prism/node.rb#12194
def type; end
end
end
@@ -24787,75 +25273,79 @@ end
# ^^^^^
# end
#
-# source://prism//lib/prism/node.rb#13928
+# source://prism//lib/prism/node.rb#12210
class Prism::NoKeywordsParameterNode < ::Prism::Node
- # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void
+ # Initialize a new NoKeywordsParameterNode node.
#
# @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode
#
- # source://prism//lib/prism/node.rb#13930
+ # source://prism//lib/prism/node.rb#12212
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, operator_loc, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, operator_loc, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14030
+ # source://prism//lib/prism/node.rb#12295
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#13939
+ # source://prism//lib/prism/node.rb#12222
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13944
+ # source://prism//lib/prism/node.rb#12227
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#13954
+ # source://prism//lib/prism/node.rb#12237
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#13949
+ # source://prism//lib/prism/node.rb#12232
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?operator_loc: Location, ?keyword_loc: Location, ?location: Location) -> NoKeywordsParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?keyword_loc: Location) -> NoKeywordsParameterNode
#
- # source://prism//lib/prism/node.rb#13959
+ # source://prism//lib/prism/node.rb#12242
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).returns(Prism::NoKeywordsParameterNode)
end
- def copy(operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#13944
+ # source://prism//lib/prism/node.rb#12227
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#13967
+ # source://prism//lib/prism/node.rb#12250
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -24864,62 +25354,44 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#13996
+ # source://prism//lib/prism/node.rb#12279
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#13991
+ # source://prism//lib/prism/node.rb#12274
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#13979
+ # source://prism//lib/prism/node.rb#12262
sig { returns(Prism::Location) }
def keyword_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#13986
+ # source://prism//lib/prism/node.rb#12269
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#13972
+ # source://prism//lib/prism/node.rb#12255
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14014
+ # source://prism//lib/prism/node.rb#12284
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#14024
+ # source://prism//lib/prism/node.rb#12289
def type; end
end
end
@@ -24935,16 +25407,26 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#143
+ # source://prism//lib/prism/node.rb#169
sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
+ # Returns the first node that matches the given block when visited in a
+ # depth-first search. This is useful for finding a node that matches a
+ # particular condition.
+ #
+ # node.breadth_first_search { |node| node.node_id == node_id }
+ #
+ # source://prism//lib/prism/node.rb#139
+ sig { params(block: T.proc.params(node: Prism::Node).returns(T::Boolean)).returns(T.nilable(Prism::Node)) }
+ def breadth_first_search(&block); end
+
# Returns an array of child nodes, including `nil`s in the place of optional
# nodes that were not present.
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#149
+ # source://prism//lib/prism/node.rb#175
sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
@@ -24953,7 +25435,7 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#163
+ # source://prism//lib/prism/node.rb#189
sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
@@ -24962,7 +25444,7 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#157
+ # source://prism//lib/prism/node.rb#183
sig { abstract.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
@@ -24971,7 +25453,7 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#149
+ # source://prism//lib/prism/node.rb#175
sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
@@ -24981,7 +25463,7 @@ class Prism::Node
# The end offset of the node in the source. This method is effectively a
# delegate method to the location object.
#
- # source://prism//lib/prism/node.rb#34
+ # source://prism//lib/prism/node.rb#40
sig { returns(Integer) }
def end_offset; end
@@ -24992,26 +25474,46 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#174
+ # source://prism//lib/prism/node.rb#194
sig { abstract.returns(String) }
def inspect; end
# A Location instance that represents the location of this node in the
# source.
#
- # source://prism//lib/prism/node.rb#19
+ # source://prism//lib/prism/node.rb#25
sig { returns(Prism::Location) }
def location; end
+ # Returns true if the node has the newline flag set.
+ #
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#39
+ # source://prism//lib/prism/node.rb#72
+ sig { returns(T::Boolean) }
def newline?; end
+ # source://prism//lib/prism/parse_result/newlines.rb#69
+ def newline_flag!(lines); end
+
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/parse_result/newlines.rb#65
+ def newline_flag?; end
+
+ # A unique identifier for this node. This is used in a very specific
+ # use case where you want to keep around a reference to a node without
+ # having to keep around the syntax tree in memory. This unique identifier
+ # will be consistent across multiple parses of the same source code.
+ #
+ # source://prism//lib/prism/node.rb#21
+ sig { returns(Integer) }
+ def node_id; end
+
# Similar to inspect, but respects the current level of indentation given by
# the pretty print object.
#
- # source://prism//lib/prism/node.rb#74
+ # source://prism//lib/prism/node.rb#83
sig { params(q: T.untyped).void }
def pretty_print(q); end
@@ -25019,16 +25521,13 @@ class Prism::Node
# An alias for source_lines, used to mimic the API from
# RubyVM::AbstractSyntaxTree to make it easier to migrate.
#
- # source://prism//lib/prism/node.rb#52
+ # source://prism//lib/prism/node.rb#46
sig { returns(T::Array[String]) }
def script_lines; end
- # source://prism//lib/prism/node.rb#43
- def set_newline_flag(newline_marked); end
-
# Slice the location of the node from the source.
#
- # source://prism//lib/prism/node.rb#61
+ # source://prism//lib/prism/node.rb#55
sig { returns(String) }
def slice; end
@@ -25036,26 +25535,34 @@ class Prism::Node
# of the line that the location starts on, ending at the end of the line
# that the location ends on.
#
- # source://prism//lib/prism/node.rb#68
+ # source://prism//lib/prism/node.rb#62
sig { returns(String) }
def slice_lines; end
# Returns all of the lines of the source code associated with this node.
#
- # source://prism//lib/prism/node.rb#52
+ # source://prism//lib/prism/node.rb#46
sig { returns(T::Array[String]) }
def source_lines; end
# The start offset of the node in the source. This method is effectively a
# delegate method to the location object.
#
- # source://prism//lib/prism/node.rb#27
+ # source://prism//lib/prism/node.rb#33
sig { returns(Integer) }
def start_offset; end
+ # Returns true if the node has the static literal flag set.
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#77
+ sig { returns(T::Boolean) }
+ def static_literal?; end
+
# Convert this node into a graphviz dot graph string.
#
- # source://prism//lib/prism/node.rb#82
+ # source://prism//lib/prism/node.rb#91
sig { returns(String) }
def to_dot; end
@@ -25066,19 +25573,38 @@ class Prism::Node
# Important to note is that the column given to this method should be in
# bytes, as opposed to characters or code units.
#
- # source://prism//lib/prism/node.rb#93
+ # source://prism//lib/prism/node.rb#102
sig { params(line: Integer, column: Integer).returns(T::Array[Prism::Node]) }
def tunnel(line, column); end
- # Returns a symbol symbolizing the type of node that this represents. This
- # is particularly useful for case statements and array comparisons.
+ # Sometimes you want to check an instance of a node against a list of
+ # classes to see what kind of behavior to perform. Usually this is done by
+ # calling `[cls1, cls2].include?(node.class)` or putting the node into a
+ # case statement and doing `case node; when cls1; when cls2; end`. Both of
+ # these approaches are relatively slow because of the constant lookups,
+ # method calls, and/or array allocations.
+ #
+ # Instead, you can call #type, which will return to you a symbol that you
+ # can use for comparison. This is faster than the other approaches because
+ # it uses a single integer comparison, but also because if you're on CRuby
+ # you can take advantage of the fact that case statements with all symbol
+ # keys will use a jump table.
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#169
+ # source://prism//lib/prism/node.rb#210
sig { abstract.returns(Symbol) }
def type; end
+ protected
+
+ # An bitset of flags for this node. There are certain flags that are common
+ # for all nodes, and then some nodes have specific flags.
+ #
+ # source://prism//lib/prism/node.rb#68
+ sig { returns(Integer) }
+ def flags; end
+
private
# A pointer to the source that this node was created from.
@@ -25094,79 +25620,114 @@ class Prism::Node
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#127
+ # source://prism//lib/prism/node.rb#153
def fields; end
- # Returns the type of the node as a symbol.
+ # Similar to #type, this method returns a symbol that you can use for
+ # splitting on the type of the node without having to do a long === chain.
+ # Note that like #type, it will still be slower than using == for a single
+ # class, but should be faster in a case statement or an array comparison.
#
# @raise [NoMethodError]
#
- # source://prism//lib/prism/node.rb#179
+ # source://prism//lib/prism/node.rb#218
def type; end
end
end
+# The flags that are common to all nodes.
+#
+# source://prism//lib/prism/node.rb#16855
+module Prism::NodeFlags; end
+
+# A flag to indicate that the node is a candidate to emit a :line event
+# through tracepoint when compiled.
+#
+# source://prism//lib/prism/node.rb#16858
+Prism::NodeFlags::NEWLINE = T.let(T.unsafe(nil), Integer)
+
+# A flag to indicate that the value that the node represents is a value that
+# can be determined at parse-time.
+#
+# source://prism//lib/prism/node.rb#16862
+Prism::NodeFlags::STATIC_LITERAL = T.let(T.unsafe(nil), Integer)
+
# Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
#
# -> { _1 + _2 }
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#14041
+# source://prism//lib/prism/node.rb#12306
class Prism::NumberedParametersNode < ::Prism::Node
- # def initialize: (Integer maximum, Location location) -> void
+ # Initialize a new NumberedParametersNode node.
#
# @return [NumberedParametersNode] a new instance of NumberedParametersNode
#
- # source://prism//lib/prism/node.rb#14043
- sig { params(source: Prism::Source, maximum: Integer, location: Prism::Location).void }
- def initialize(source, maximum, location); end
+ # source://prism//lib/prism/node.rb#12308
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ maximum: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, maximum); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14121
+ # source://prism//lib/prism/node.rb#12369
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14051
+ # source://prism//lib/prism/node.rb#12317
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14056
+ # source://prism//lib/prism/node.rb#12322
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14066
+ # source://prism//lib/prism/node.rb#12332
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14061
+ # source://prism//lib/prism/node.rb#12327
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?maximum: Integer, ?location: Location) -> NumberedParametersNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?maximum: Integer) -> NumberedParametersNode
#
- # source://prism//lib/prism/node.rb#14071
- sig { params(maximum: Integer, location: Prism::Location).returns(Prism::NumberedParametersNode) }
- def copy(maximum: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#12337
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ maximum: Integer
+ ).returns(Prism::NumberedParametersNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), maximum: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14056
+ # source://prism//lib/prism/node.rb#12322
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, maximum: Integer }
#
- # source://prism//lib/prism/node.rb#14079
+ # source://prism//lib/prism/node.rb#12345
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -25175,44 +25736,26 @@ class Prism::NumberedParametersNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14087
+ # source://prism//lib/prism/node.rb#12353
sig { override.returns(String) }
def inspect; end
# attr_reader maximum: Integer
#
- # source://prism//lib/prism/node.rb#14084
+ # source://prism//lib/prism/node.rb#12350
sig { returns(Integer) }
def maximum; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14105
+ # source://prism//lib/prism/node.rb#12358
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#14115
+ # source://prism//lib/prism/node.rb#12363
def type; end
end
end
@@ -25222,62 +25765,77 @@ end
# $1
# ^^
#
-# source://prism//lib/prism/node.rb#14131
+# source://prism//lib/prism/node.rb#12379
class Prism::NumberedReferenceReadNode < ::Prism::Node
- # def initialize: (Integer number, Location location) -> void
+ # Initialize a new NumberedReferenceReadNode node.
#
# @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode
#
- # source://prism//lib/prism/node.rb#14133
- sig { params(source: Prism::Source, number: Integer, location: Prism::Location).void }
- def initialize(source, number, location); end
+ # source://prism//lib/prism/node.rb#12381
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ number: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, number); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14217
+ # source://prism//lib/prism/node.rb#12448
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14141
+ # source://prism//lib/prism/node.rb#12390
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14146
+ # source://prism//lib/prism/node.rb#12395
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14156
+ # source://prism//lib/prism/node.rb#12405
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14151
+ # source://prism//lib/prism/node.rb#12400
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?number: Integer, ?location: Location) -> NumberedReferenceReadNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?number: Integer) -> NumberedReferenceReadNode
#
- # source://prism//lib/prism/node.rb#14161
- sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) }
- def copy(number: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#12410
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ number: Integer
+ ).returns(Prism::NumberedReferenceReadNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), number: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14146
+ # source://prism//lib/prism/node.rb#12395
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, number: Integer }
#
- # source://prism//lib/prism/node.rb#14169
+ # source://prism//lib/prism/node.rb#12418
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -25286,7 +25844,7 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14183
+ # source://prism//lib/prism/node.rb#12432
sig { override.returns(String) }
def inspect; end
@@ -25298,38 +25856,20 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node
#
# $4294967296 # number `0`
#
- # source://prism//lib/prism/node.rb#14180
+ # source://prism//lib/prism/node.rb#12429
sig { returns(Integer) }
def number; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14201
+ # source://prism//lib/prism/node.rb#12437
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#14211
+ # source://prism//lib/prism/node.rb#12442
def type; end
end
end
@@ -25340,79 +25880,81 @@ end
# ^^^^
# end
#
-# source://prism//lib/prism/node.rb#14228
+# source://prism//lib/prism/node.rb#12459
class Prism::OptionalKeywordParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol name, Location name_loc, Prism::node value, Location location) -> void
+ # Initialize a new OptionalKeywordParameterNode node.
#
# @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode
#
- # source://prism//lib/prism/node.rb#14230
+ # source://prism//lib/prism/node.rb#12461
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
name_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, name, name_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14330
+ # source://prism//lib/prism/node.rb#12539
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14241
+ # source://prism//lib/prism/node.rb#12472
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14246
+ # source://prism//lib/prism/node.rb#12477
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14256
+ # source://prism//lib/prism/node.rb#12487
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14251
+ # source://prism//lib/prism/node.rb#12482
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalKeywordParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node) -> OptionalKeywordParameterNode
#
- # source://prism//lib/prism/node.rb#14261
+ # source://prism//lib/prism/node.rb#12492
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
name_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::OptionalKeywordParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14246
+ # source://prism//lib/prism/node.rb#12477
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#14269
+ # source://prism//lib/prism/node.rb#12500
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -25421,19 +25963,19 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14296
+ # source://prism//lib/prism/node.rb#12523
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#14278
+ # source://prism//lib/prism/node.rb#12510
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#14281
+ # source://prism//lib/prism/node.rb#12513
sig { returns(Prism::Location) }
def name_loc; end
@@ -25441,52 +25983,26 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#14291
+ # source://prism//lib/prism/node.rb#12505
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14314
+ # source://prism//lib/prism/node.rb#12528
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#14288
+ # source://prism//lib/prism/node.rb#12520
sig { returns(Prism::Node) }
def value; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#14274
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14324
+ # source://prism//lib/prism/node.rb#12533
def type; end
end
end
@@ -25497,81 +26013,83 @@ end
# ^^^^^
# end
#
-# source://prism//lib/prism/node.rb#14344
+# source://prism//lib/prism/node.rb#12553
class Prism::OptionalParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void
+ # Initialize a new OptionalParameterNode node.
#
# @return [OptionalParameterNode] a new instance of OptionalParameterNode
#
- # source://prism//lib/prism/node.rb#14346
+ # source://prism//lib/prism/node.rb#12555
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).void
end
- def initialize(source, flags, name, name_loc, operator_loc, value, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc, value); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14459
+ # source://prism//lib/prism/node.rb#12646
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14358
+ # source://prism//lib/prism/node.rb#12567
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14363
+ # source://prism//lib/prism/node.rb#12572
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14373
+ # source://prism//lib/prism/node.rb#12582
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14368
+ # source://prism//lib/prism/node.rb#12577
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node) -> OptionalParameterNode
#
- # source://prism//lib/prism/node.rb#14378
+ # source://prism//lib/prism/node.rb#12587
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
name_loc: Prism::Location,
operator_loc: Prism::Location,
- value: Prism::Node,
- location: Prism::Location
+ value: Prism::Node
).returns(Prism::OptionalParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), value: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14363
+ # source://prism//lib/prism/node.rb#12572
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node }
#
- # source://prism//lib/prism/node.rb#14386
+ # source://prism//lib/prism/node.rb#12595
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -25580,31 +26098,31 @@ class Prism::OptionalParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14425
+ # source://prism//lib/prism/node.rb#12630
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#14395
+ # source://prism//lib/prism/node.rb#12605
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#14398
+ # source://prism//lib/prism/node.rb#12608
sig { returns(Prism::Location) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#14420
+ # source://prism//lib/prism/node.rb#12625
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#14405
+ # source://prism//lib/prism/node.rb#12615
sig { returns(Prism::Location) }
def operator_loc; end
@@ -25612,52 +26130,26 @@ class Prism::OptionalParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#14415
+ # source://prism//lib/prism/node.rb#12600
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14443
+ # source://prism//lib/prism/node.rb#12635
sig { override.returns(Symbol) }
def type; end
# attr_reader value: Prism::node
#
- # source://prism//lib/prism/node.rb#14412
+ # source://prism//lib/prism/node.rb#12622
sig { returns(Prism::Node) }
def value; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#14391
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#14453
+ # source://prism//lib/prism/node.rb#12640
def type; end
end
end
@@ -25667,77 +26159,81 @@ end
# left or right
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#14473
+# source://prism//lib/prism/node.rb#12660
class Prism::OrNode < ::Prism::Node
- # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void
+ # Initialize a new OrNode node.
#
# @return [OrNode] a new instance of OrNode
#
- # source://prism//lib/prism/node.rb#14475
+ # source://prism//lib/prism/node.rb#12662
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, left, right, operator_loc, location); end
+ def initialize(source, node_id, location, flags, left, right, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14585
+ # source://prism//lib/prism/node.rb#12755
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14485
+ # source://prism//lib/prism/node.rb#12673
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14490
+ # source://prism//lib/prism/node.rb#12678
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14500
+ # source://prism//lib/prism/node.rb#12688
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14495
+ # source://prism//lib/prism/node.rb#12683
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> OrNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node, ?right: Prism::node, ?operator_loc: Location) -> OrNode
#
- # source://prism//lib/prism/node.rb#14505
+ # source://prism//lib/prism/node.rb#12693
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
left: Prism::Node,
right: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::OrNode)
end
- def copy(left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14490
+ # source://prism//lib/prism/node.rb#12678
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node, right: Prism::node, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#14513
+ # source://prism//lib/prism/node.rb#12701
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -25746,7 +26242,7 @@ class Prism::OrNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14551
+ # source://prism//lib/prism/node.rb#12739
sig { override.returns(String) }
def inspect; end
@@ -25758,13 +26254,13 @@ class Prism::OrNode < ::Prism::Node
# 1 || 2
# ^
#
- # source://prism//lib/prism/node.rb#14524
+ # source://prism//lib/prism/node.rb#12712
sig { returns(Prism::Node) }
def left; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#14546
+ # source://prism//lib/prism/node.rb#12734
sig { returns(String) }
def operator; end
@@ -25773,11 +26269,11 @@ class Prism::OrNode < ::Prism::Node
# left or right
# ^^
#
- # source://prism//lib/prism/node.rb#14539
+ # source://prism//lib/prism/node.rb#12727
sig { returns(Prism::Location) }
def operator_loc; end
- # Represents the right side of the expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
+ # Represents the right side of the expression.
#
# left || right
# ^^^^^
@@ -25785,38 +26281,20 @@ class Prism::OrNode < ::Prism::Node
# 1 or 2
# ^
#
- # source://prism//lib/prism/node.rb#14533
+ # source://prism//lib/prism/node.rb#12721
sig { returns(Prism::Node) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#14569
+ # source://prism//lib/prism/node.rb#12744
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14579
+ # source://prism//lib/prism/node.rb#12749
def type; end
end
end
@@ -26065,12 +26543,12 @@ Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol)
# Flags for parameter nodes.
#
-# source://prism//lib/prism/node.rb#19277
+# source://prism//lib/prism/node.rb#16768
module Prism::ParameterFlags; end
# a parameter name that has been repeated in the method signature
#
-# source://prism//lib/prism/node.rb#19279
+# source://prism//lib/prism/node.rb#16770
Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer)
# Represents the list of parameters on a method, block, or lambda definition.
@@ -26079,91 +26557,95 @@ Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer)
# ^^^^^^^
# end
#
-# source://prism//lib/prism/node.rb#14598
+# source://prism//lib/prism/node.rb#12768
class Prism::ParametersNode < ::Prism::Node
- # def initialize: (Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void
+ # Initialize a new ParametersNode node.
#
# @return [ParametersNode] a new instance of ParametersNode
#
- # source://prism//lib/prism/node.rb#14600
+ # source://prism//lib/prism/node.rb#12770
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)],
optionals: T::Array[Prism::OptionalParameterNode],
rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)),
posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)],
keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)],
keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)),
- block: T.nilable(Prism::BlockParameterNode),
- location: Prism::Location
+ block: T.nilable(Prism::BlockParameterNode)
).void
end
- def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end
+ def initialize(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14710
+ # source://prism//lib/prism/node.rb#12863
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14614
+ # source://prism//lib/prism/node.rb#12785
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader block: BlockParameterNode?
#
- # source://prism//lib/prism/node.rb#14673
+ # source://prism//lib/prism/node.rb#12844
sig { returns(T.nilable(Prism::BlockParameterNode)) }
def block; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14619
+ # source://prism//lib/prism/node.rb#12790
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14637
+ # source://prism//lib/prism/node.rb#12808
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14624
+ # source://prism//lib/prism/node.rb#12795
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?) -> ParametersNode
#
- # source://prism//lib/prism/node.rb#14642
+ # source://prism//lib/prism/node.rb#12813
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)],
optionals: T::Array[Prism::OptionalParameterNode],
rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)),
posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)],
keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)],
keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)),
- block: T.nilable(Prism::BlockParameterNode),
- location: Prism::Location
+ block: T.nilable(Prism::BlockParameterNode)
).returns(Prism::ParametersNode)
end
- def copy(requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), requireds: T.unsafe(nil), optionals: T.unsafe(nil), rest: T.unsafe(nil), posts: T.unsafe(nil), keywords: T.unsafe(nil), keyword_rest: T.unsafe(nil), block: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14619
+ # source://prism//lib/prism/node.rb#12790
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode? }
#
- # source://prism//lib/prism/node.rb#14650
+ # source://prism//lib/prism/node.rb#12821
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -26172,13 +26654,13 @@ class Prism::ParametersNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14676
+ # source://prism//lib/prism/node.rb#12847
sig { override.returns(String) }
def inspect; end
# attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil
#
- # source://prism//lib/prism/node.rb#14670
+ # source://prism//lib/prism/node.rb#12841
sig do
returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)))
end
@@ -26186,19 +26668,19 @@ class Prism::ParametersNode < ::Prism::Node
# attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode]
#
- # source://prism//lib/prism/node.rb#14667
+ # source://prism//lib/prism/node.rb#12838
sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) }
def keywords; end
# attr_reader optionals: Array[OptionalParameterNode]
#
- # source://prism//lib/prism/node.rb#14658
+ # source://prism//lib/prism/node.rb#12829
sig { returns(T::Array[Prism::OptionalParameterNode]) }
def optionals; end
# attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode]
#
- # source://prism//lib/prism/node.rb#14664
+ # source://prism//lib/prism/node.rb#12835
sig do
returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)])
end
@@ -26206,50 +26688,32 @@ class Prism::ParametersNode < ::Prism::Node
# attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode]
#
- # source://prism//lib/prism/node.rb#14655
+ # source://prism//lib/prism/node.rb#12826
sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)]) }
def requireds; end
# attr_reader rest: RestParameterNode | ImplicitRestNode | nil
#
- # source://prism//lib/prism/node.rb#14661
+ # source://prism//lib/prism/node.rb#12832
sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) }
def rest; end
# Mirrors the Method#parameters method.
#
- # source://prism//lib/prism/node_ext.rb#238
+ # source://prism//lib/prism/node_ext.rb#269
sig { returns(T::Array[T.any([Symbol, Symbol], [Symbol])]) }
def signature; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#14694
+ # source://prism//lib/prism/node.rb#12852
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14704
+ # source://prism//lib/prism/node.rb#12857
def type; end
end
end
@@ -26259,95 +26723,99 @@ end
# (10 + 34)
# ^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#14730
+# source://prism//lib/prism/node.rb#12883
class Prism::ParenthesesNode < ::Prism::Node
- # def initialize: (Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void
+ # Initialize a new ParenthesesNode node.
#
# @return [ParenthesesNode] a new instance of ParenthesesNode
#
- # source://prism//lib/prism/node.rb#14732
+ # source://prism//lib/prism/node.rb#12885
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
body: T.nilable(Prism::Node),
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, body, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, body, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14842
+ # source://prism//lib/prism/node.rb#12974
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14742
+ # source://prism//lib/prism/node.rb#12896
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader body: Prism::node?
#
- # source://prism//lib/prism/node.rb#14781
+ # source://prism//lib/prism/node.rb#12931
sig { returns(T.nilable(Prism::Node)) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14751
+ # source://prism//lib/prism/node.rb#12901
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#14803
+ # source://prism//lib/prism/node.rb#12953
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#14791
+ # source://prism//lib/prism/node.rb#12941
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14763
+ # source://prism//lib/prism/node.rb#12913
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14756
+ # source://prism//lib/prism/node.rb#12906
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> ParenthesesNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location) -> ParenthesesNode
#
- # source://prism//lib/prism/node.rb#14768
+ # source://prism//lib/prism/node.rb#12918
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
body: T.nilable(Prism::Node),
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::ParenthesesNode)
end
- def copy(body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14751
+ # source://prism//lib/prism/node.rb#12901
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Prism::node?, opening_loc: Location, closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#14776
+ # source://prism//lib/prism/node.rb#12926
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -26356,116 +26824,98 @@ class Prism::ParenthesesNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14808
+ # source://prism//lib/prism/node.rb#12958
sig { override.returns(String) }
def inspect; end
+ # source://prism//lib/prism/parse_result/newlines.rb#85
+ def newline_flag!(lines); end
+
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#14798
+ # source://prism//lib/prism/node.rb#12948
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#14784
+ # source://prism//lib/prism/node.rb#12934
sig { returns(Prism::Location) }
def opening_loc; end
- # source://prism//lib/prism/node.rb#14746
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#14826
+ # source://prism//lib/prism/node.rb#12963
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14836
+ # source://prism//lib/prism/node.rb#12968
def type; end
end
end
# This represents an error that was encountered during parsing.
#
-# source://prism//lib/prism/parse_result.rb#451
+# source://prism//lib/prism/parse_result.rb#592
class Prism::ParseError
# Create a new error object with the given message and location.
#
# @return [ParseError] a new instance of ParseError
#
- # source://prism//lib/prism/parse_result.rb#466
+ # source://prism//lib/prism/parse_result.rb#607
sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void }
def initialize(type, message, location, level); end
# Implement the hash pattern matching interface for ParseError.
#
- # source://prism//lib/prism/parse_result.rb#474
+ # source://prism//lib/prism/parse_result.rb#615
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# Returns a string representation of this error.
#
- # source://prism//lib/prism/parse_result.rb#479
+ # source://prism//lib/prism/parse_result.rb#620
sig { returns(String) }
def inspect; end
# The level of this error.
#
- # source://prism//lib/prism/parse_result.rb#463
+ # source://prism//lib/prism/parse_result.rb#604
sig { returns(Symbol) }
def level; end
# A Location object representing the location of this error in the source.
#
- # source://prism//lib/prism/parse_result.rb#460
+ # source://prism//lib/prism/parse_result.rb#601
sig { returns(Prism::Location) }
def location; end
# The message associated with this error.
#
- # source://prism//lib/prism/parse_result.rb#457
+ # source://prism//lib/prism/parse_result.rb#598
sig { returns(String) }
def message; end
# The type of error. This is an _internal_ symbol that is used for
# communicating with translation layers. It is not meant to be public API.
#
- # source://prism//lib/prism/parse_result.rb#454
+ # source://prism//lib/prism/parse_result.rb#595
sig { returns(Symbol) }
def type; end
end
# This is a result specific to the `parse_lex` and `parse_lex_file` methods.
#
-# source://prism//lib/prism/parse_result.rb#610
+# source://prism//lib/prism/parse_result.rb#781
class Prism::ParseLexResult < ::Prism::Result
# Create a new parse lex result object with the given values.
#
# @return [ParseLexResult] a new instance of ParseLexResult
#
- # source://prism//lib/prism/parse_result.rb#616
+ # source://prism//lib/prism/parse_result.rb#787
sig do
params(
value: [Prism::ProgramNode, T::Array[T.untyped]],
@@ -26481,27 +26931,27 @@ class Prism::ParseLexResult < ::Prism::Result
# Implement the hash pattern matching interface for ParseLexResult.
#
- # source://prism//lib/prism/parse_result.rb#622
+ # source://prism//lib/prism/parse_result.rb#793
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# A tuple of the syntax tree and the list of tokens that were parsed from
# the source code.
#
- # source://prism//lib/prism/parse_result.rb#613
+ # source://prism//lib/prism/parse_result.rb#784
sig { returns([Prism::ProgramNode, T::Array[T.untyped]]) }
def value; end
end
# This is a result specific to the `parse` and `parse_file` methods.
#
-# source://prism//lib/prism/parse_result.rb#576
+# source://prism//lib/prism/parse_result.rb#722
class Prism::ParseResult < ::Prism::Result
# Create a new parse result object with the given values.
#
# @return [ParseResult] a new instance of ParseResult
#
- # source://prism//lib/prism/parse_result.rb#581
+ # source://prism//lib/prism/parse_result.rb#735
sig do
params(
value: Prism::ProgramNode,
@@ -26517,23 +26967,30 @@ class Prism::ParseResult < ::Prism::Result
# Attach the list of comments to their respective locations in the tree.
#
- # source://prism//lib/prism/parse_result/comments.rb#190
+ # source://prism//lib/prism/parse_result.rb#746
def attach_comments!; end
# Implement the hash pattern matching interface for ParseResult.
#
- # source://prism//lib/prism/parse_result.rb#587
+ # source://prism//lib/prism/parse_result.rb#741
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
- # Walk the tree and mark nodes that are on a new line.
+ # Returns a string representation of the syntax tree with the errors
+ # displayed inline.
+ #
+ # source://prism//lib/prism/parse_result.rb#758
+ def errors_format; end
+
+ # Walk the tree and mark nodes that are on a new line, loosely emulating
+ # the behavior of CRuby's `:line` tracepoint event.
#
- # source://prism//lib/prism/parse_result/newlines.rb#60
+ # source://prism//lib/prism/parse_result.rb#752
def mark_newlines!; end
# The syntax tree that was parsed from the source code.
#
- # source://prism//lib/prism/parse_result.rb#578
+ # source://prism//lib/prism/parse_result.rb#732
sig { returns(Prism::ProgramNode) }
def value; end
end
@@ -26645,6 +27102,29 @@ class Prism::ParseResult::Comments::NodeTarget
def trailing_comment(comment); end
end
+# An object to represent the set of errors on a parse result. This object
+# can be used to format the errors in a human-readable way.
+#
+# source://prism//lib/prism/parse_result/errors.rb#9
+class Prism::ParseResult::Errors
+ # Initialize a new set of errors from the given parse result.
+ #
+ # @return [Errors] a new instance of Errors
+ #
+ # source://prism//lib/prism/parse_result/errors.rb#14
+ def initialize(parse_result); end
+
+ # Formats the errors in a human-readable way and return them as a string.
+ #
+ # source://prism//lib/prism/parse_result/errors.rb#19
+ def format; end
+
+ # The parse result that contains the errors.
+ #
+ # source://prism//lib/prism/parse_result/errors.rb#11
+ def parse_result; end
+end
+
# The :line tracepoint event gets fired whenever the Ruby VM encounters an
# expression on a new line. The types of expressions that can trigger this
# event are:
@@ -26661,87 +27141,92 @@ end
# MarkNewlinesVisitor, since that visitor is responsible for marking the
# newlines for JRuby/TruffleRuby.
#
-# source://prism//lib/prism/parse_result/newlines.rb#20
+# This file is autoloaded only when `mark_newlines!` is called, so the
+# re-opening of the various nodes in this file will only be performed in
+# that case. We do that to avoid storing the extra `@newline` instance
+# variable on every node if we don't need it.
+#
+# source://prism//lib/prism/parse_result/newlines.rb#25
class Prism::ParseResult::Newlines < ::Prism::Visitor
# Create a new Newlines visitor with the given newline offsets.
#
# @return [Newlines] a new instance of Newlines
#
- # source://prism//lib/prism/parse_result/newlines.rb#22
- def initialize(newline_marked); end
+ # source://prism//lib/prism/parse_result/newlines.rb#27
+ def initialize(lines); end
# Permit block/lambda nodes to mark newlines within themselves.
#
- # source://prism//lib/prism/parse_result/newlines.rb#27
+ # source://prism//lib/prism/parse_result/newlines.rb#33
def visit_block_node(node); end
# Mark if/unless nodes as newlines.
#
- # source://prism//lib/prism/parse_result/newlines.rb#41
+ # source://prism//lib/prism/parse_result/newlines.rb#47
def visit_if_node(node); end
# Permit block/lambda nodes to mark newlines within themselves.
#
- # source://prism//lib/prism/parse_result/newlines.rb#27
+ # source://prism//lib/prism/parse_result/newlines.rb#33
def visit_lambda_node(node); end
# Permit statements lists to mark newlines within themselves.
#
- # source://prism//lib/prism/parse_result/newlines.rb#49
+ # source://prism//lib/prism/parse_result/newlines.rb#55
def visit_statements_node(node); end
# Mark if/unless nodes as newlines.
#
- # source://prism//lib/prism/parse_result/newlines.rb#41
+ # source://prism//lib/prism/parse_result/newlines.rb#47
def visit_unless_node(node); end
end
# This represents a warning that was encountered during parsing.
#
-# source://prism//lib/prism/parse_result.rb#485
+# source://prism//lib/prism/parse_result.rb#626
class Prism::ParseWarning
# Create a new warning object with the given message and location.
#
# @return [ParseWarning] a new instance of ParseWarning
#
- # source://prism//lib/prism/parse_result.rb#500
+ # source://prism//lib/prism/parse_result.rb#641
sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void }
def initialize(type, message, location, level); end
# Implement the hash pattern matching interface for ParseWarning.
#
- # source://prism//lib/prism/parse_result.rb#508
+ # source://prism//lib/prism/parse_result.rb#649
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# Returns a string representation of this warning.
#
- # source://prism//lib/prism/parse_result.rb#513
+ # source://prism//lib/prism/parse_result.rb#654
sig { returns(String) }
def inspect; end
# The level of this warning.
#
- # source://prism//lib/prism/parse_result.rb#497
+ # source://prism//lib/prism/parse_result.rb#638
sig { returns(Symbol) }
def level; end
# A Location object representing the location of this warning in the source.
#
- # source://prism//lib/prism/parse_result.rb#494
+ # source://prism//lib/prism/parse_result.rb#635
sig { returns(Prism::Location) }
def location; end
# The message associated with this warning.
#
- # source://prism//lib/prism/parse_result.rb#491
+ # source://prism//lib/prism/parse_result.rb#632
sig { returns(String) }
def message; end
# The type of warning. This is an _internal_ symbol that is used for
# communicating with translation layers. It is not meant to be public API.
#
- # source://prism//lib/prism/parse_result.rb#488
+ # source://prism//lib/prism/parse_result.rb#629
sig { returns(Symbol) }
def type; end
end
@@ -26912,85 +27397,89 @@ end
# foo in ^(bar)
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#14854
+# source://prism//lib/prism/node.rb#12986
class Prism::PinnedExpressionNode < ::Prism::Node
- # def initialize: (Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void
+ # Initialize a new PinnedExpressionNode node.
#
# @return [PinnedExpressionNode] a new instance of PinnedExpressionNode
#
- # source://prism//lib/prism/node.rb#14856
+ # source://prism//lib/prism/node.rb#12988
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: Prism::Node,
operator_loc: Prism::Location,
lparen_loc: Prism::Location,
- rparen_loc: Prism::Location,
- location: Prism::Location
+ rparen_loc: Prism::Location
).void
end
- def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); end
+ def initialize(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#14973
+ # source://prism//lib/prism/node.rb#13088
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14867
+ # source://prism//lib/prism/node.rb#13000
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14872
+ # source://prism//lib/prism/node.rb#13005
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#14882
+ # source://prism//lib/prism/node.rb#13015
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#14877
+ # source://prism//lib/prism/node.rb#13010
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location, ?location: Location) -> PinnedExpressionNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location) -> PinnedExpressionNode
#
- # source://prism//lib/prism/node.rb#14887
+ # source://prism//lib/prism/node.rb#13020
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: Prism::Node,
operator_loc: Prism::Location,
lparen_loc: Prism::Location,
- rparen_loc: Prism::Location,
- location: Prism::Location
+ rparen_loc: Prism::Location
).returns(Prism::PinnedExpressionNode)
end
- def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), operator_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#14872
+ # source://prism//lib/prism/node.rb#13005
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location }
#
- # source://prism//lib/prism/node.rb#14895
+ # source://prism//lib/prism/node.rb#13028
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader expression: Prism::node
#
- # source://prism//lib/prism/node.rb#14900
+ # source://prism//lib/prism/node.rb#13033
sig { returns(Prism::Node) }
def expression; end
@@ -26999,74 +27488,56 @@ class Prism::PinnedExpressionNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#14939
+ # source://prism//lib/prism/node.rb#13072
sig { override.returns(String) }
def inspect; end
# def lparen: () -> String
#
- # source://prism//lib/prism/node.rb#14929
+ # source://prism//lib/prism/node.rb#13062
sig { returns(String) }
def lparen; end
# attr_reader lparen_loc: Location
#
- # source://prism//lib/prism/node.rb#14910
+ # source://prism//lib/prism/node.rb#13043
sig { returns(Prism::Location) }
def lparen_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#14924
+ # source://prism//lib/prism/node.rb#13057
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#14903
+ # source://prism//lib/prism/node.rb#13036
sig { returns(Prism::Location) }
def operator_loc; end
# def rparen: () -> String
#
- # source://prism//lib/prism/node.rb#14934
+ # source://prism//lib/prism/node.rb#13067
sig { returns(String) }
def rparen; end
# attr_reader rparen_loc: Location
#
- # source://prism//lib/prism/node.rb#14917
+ # source://prism//lib/prism/node.rb#13050
sig { returns(Prism::Location) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#14957
+ # source://prism//lib/prism/node.rb#13077
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#14967
+ # source://prism//lib/prism/node.rb#13082
def type; end
end
end
@@ -27076,75 +27547,79 @@ end
# foo in ^bar
# ^^^^
#
-# source://prism//lib/prism/node.rb#14986
+# source://prism//lib/prism/node.rb#13101
class Prism::PinnedVariableNode < ::Prism::Node
- # def initialize: (Prism::node variable, Location operator_loc, Location location) -> void
+ # Initialize a new PinnedVariableNode node.
#
# @return [PinnedVariableNode] a new instance of PinnedVariableNode
#
- # source://prism//lib/prism/node.rb#14988
+ # source://prism//lib/prism/node.rb#13103
sig do
params(
source: Prism::Source,
- variable: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode),
+ operator_loc: Prism::Location
).void
end
- def initialize(source, variable, operator_loc, location); end
+ def initialize(source, node_id, location, flags, variable, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15079
+ # source://prism//lib/prism/node.rb#13177
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#14997
+ # source://prism//lib/prism/node.rb#13113
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15002
+ # source://prism//lib/prism/node.rb#13118
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15012
+ # source://prism//lib/prism/node.rb#13128
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15007
+ # source://prism//lib/prism/node.rb#13123
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?variable: Prism::node, ?operator_loc: Location, ?location: Location) -> PinnedVariableNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, ?operator_loc: Location) -> PinnedVariableNode
#
- # source://prism//lib/prism/node.rb#15017
+ # source://prism//lib/prism/node.rb#13133
sig do
params(
- variable: Prism::Node,
- operator_loc: Prism::Location,
- location: Prism::Location
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ variable: T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode),
+ operator_loc: Prism::Location
).returns(Prism::PinnedVariableNode)
end
- def copy(variable: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), variable: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15002
+ # source://prism//lib/prism/node.rb#13118
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Prism::node, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#15025
+ # source://prism//lib/prism/node.rb#13141
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -27153,56 +27628,40 @@ class Prism::PinnedVariableNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15045
+ # source://prism//lib/prism/node.rb#13161
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#15040
+ # source://prism//lib/prism/node.rb#13156
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#15033
+ # source://prism//lib/prism/node.rb#13149
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15063
+ # source://prism//lib/prism/node.rb#13166
sig { override.returns(Symbol) }
def type; end
- # attr_reader variable: Prism::node
+ # attr_reader variable: LocalVariableReadNode | InstanceVariableReadNode | ClassVariableReadNode | GlobalVariableReadNode | BackReferenceReadNode | NumberedReferenceReadNode | ItLocalVariableReadNode | MissingNode
#
- # source://prism//lib/prism/node.rb#15030
- sig { returns(Prism::Node) }
+ # source://prism//lib/prism/node.rb#13146
+ sig do
+ returns(T.any(Prism::LocalVariableReadNode, Prism::InstanceVariableReadNode, Prism::ClassVariableReadNode, Prism::GlobalVariableReadNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::ItLocalVariableReadNode, Prism::MissingNode))
+ end
def variable; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15073
+ # source://prism//lib/prism/node.rb#13171
def type; end
end
end
@@ -27212,91 +27671,95 @@ end
# END { foo }
# ^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#15090
+# source://prism//lib/prism/node.rb#13188
class Prism::PostExecutionNode < ::Prism::Node
- # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void
+ # Initialize a new PostExecutionNode node.
#
# @return [PostExecutionNode] a new instance of PostExecutionNode
#
- # source://prism//lib/prism/node.rb#15092
+ # source://prism//lib/prism/node.rb#13190
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
statements: T.nilable(Prism::StatementsNode),
keyword_loc: Prism::Location,
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15211
+ # source://prism//lib/prism/node.rb#13292
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15103
+ # source://prism//lib/prism/node.rb#13202
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15108
+ # source://prism//lib/prism/node.rb#13207
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#15172
+ # source://prism//lib/prism/node.rb#13271
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#15155
+ # source://prism//lib/prism/node.rb#13254
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15120
+ # source://prism//lib/prism/node.rb#13219
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15113
+ # source://prism//lib/prism/node.rb#13212
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PostExecutionNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PostExecutionNode
#
- # source://prism//lib/prism/node.rb#15125
+ # source://prism//lib/prism/node.rb#13224
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
statements: T.nilable(Prism::StatementsNode),
keyword_loc: Prism::Location,
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::PostExecutionNode)
end
- def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15108
+ # source://prism//lib/prism/node.rb#13207
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#15133
+ # source://prism//lib/prism/node.rb#13232
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -27305,68 +27768,50 @@ class Prism::PostExecutionNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15177
+ # source://prism//lib/prism/node.rb#13276
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#15162
+ # source://prism//lib/prism/node.rb#13261
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#15141
+ # source://prism//lib/prism/node.rb#13240
sig { returns(Prism::Location) }
def keyword_loc; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#15167
+ # source://prism//lib/prism/node.rb#13266
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#15148
+ # source://prism//lib/prism/node.rb#13247
sig { returns(Prism::Location) }
def opening_loc; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#15138
+ # source://prism//lib/prism/node.rb#13237
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15195
+ # source://prism//lib/prism/node.rb#13281
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#15205
+ # source://prism//lib/prism/node.rb#13286
def type; end
end
end
@@ -27376,91 +27821,95 @@ end
# BEGIN { foo }
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#15224
+# source://prism//lib/prism/node.rb#13305
class Prism::PreExecutionNode < ::Prism::Node
- # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void
+ # Initialize a new PreExecutionNode node.
#
# @return [PreExecutionNode] a new instance of PreExecutionNode
#
- # source://prism//lib/prism/node.rb#15226
+ # source://prism//lib/prism/node.rb#13307
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
statements: T.nilable(Prism::StatementsNode),
keyword_loc: Prism::Location,
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).void
end
- def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end
+ def initialize(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15345
+ # source://prism//lib/prism/node.rb#13409
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15237
+ # source://prism//lib/prism/node.rb#13319
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15242
+ # source://prism//lib/prism/node.rb#13324
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#15306
+ # source://prism//lib/prism/node.rb#13388
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#15289
+ # source://prism//lib/prism/node.rb#13371
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15254
+ # source://prism//lib/prism/node.rb#13336
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15247
+ # source://prism//lib/prism/node.rb#13329
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PreExecutionNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location) -> PreExecutionNode
#
- # source://prism//lib/prism/node.rb#15259
+ # source://prism//lib/prism/node.rb#13341
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
statements: T.nilable(Prism::StatementsNode),
keyword_loc: Prism::Location,
opening_loc: Prism::Location,
- closing_loc: Prism::Location,
- location: Prism::Location
+ closing_loc: Prism::Location
).returns(Prism::PreExecutionNode)
end
- def copy(statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), statements: T.unsafe(nil), keyword_loc: T.unsafe(nil), opening_loc: T.unsafe(nil), closing_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15242
+ # source://prism//lib/prism/node.rb#13324
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location }
#
- # source://prism//lib/prism/node.rb#15267
+ # source://prism//lib/prism/node.rb#13349
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -27469,143 +27918,129 @@ class Prism::PreExecutionNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15311
+ # source://prism//lib/prism/node.rb#13393
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#15296
+ # source://prism//lib/prism/node.rb#13378
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#15275
+ # source://prism//lib/prism/node.rb#13357
sig { returns(Prism::Location) }
def keyword_loc; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#15301
+ # source://prism//lib/prism/node.rb#13383
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#15282
+ # source://prism//lib/prism/node.rb#13364
sig { returns(Prism::Location) }
def opening_loc; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#15272
+ # source://prism//lib/prism/node.rb#13354
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15329
+ # source://prism//lib/prism/node.rb#13398
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#15339
+ # source://prism//lib/prism/node.rb#13403
def type; end
end
end
# The top level node of any parse tree.
#
-# source://prism//lib/prism/node.rb#15355
+# source://prism//lib/prism/node.rb#13419
class Prism::ProgramNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void
+ # Initialize a new ProgramNode node.
#
# @return [ProgramNode] a new instance of ProgramNode
#
- # source://prism//lib/prism/node.rb#15357
+ # source://prism//lib/prism/node.rb#13421
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
- statements: Prism::StatementsNode,
- location: Prism::Location
+ statements: Prism::StatementsNode
).void
end
- def initialize(source, locals, statements, location); end
+ def initialize(source, node_id, location, flags, locals, statements); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15439
+ # source://prism//lib/prism/node.rb#13486
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15366
+ # source://prism//lib/prism/node.rb#13431
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15371
+ # source://prism//lib/prism/node.rb#13436
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15381
+ # source://prism//lib/prism/node.rb#13446
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15376
+ # source://prism//lib/prism/node.rb#13441
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?locals: Array[Symbol], ?statements: StatementsNode, ?location: Location) -> ProgramNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?statements: StatementsNode) -> ProgramNode
#
- # source://prism//lib/prism/node.rb#15386
+ # source://prism//lib/prism/node.rb#13451
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
- statements: Prism::StatementsNode,
- location: Prism::Location
+ statements: Prism::StatementsNode
).returns(Prism::ProgramNode)
end
- def copy(locals: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), statements: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15371
+ # source://prism//lib/prism/node.rb#13436
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], statements: StatementsNode }
#
- # source://prism//lib/prism/node.rb#15394
+ # source://prism//lib/prism/node.rb#13459
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -27614,62 +28049,44 @@ class Prism::ProgramNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15405
+ # source://prism//lib/prism/node.rb#13470
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#15399
+ # source://prism//lib/prism/node.rb#13464
sig { returns(T::Array[Symbol]) }
def locals; end
# attr_reader statements: StatementsNode
#
- # source://prism//lib/prism/node.rb#15402
+ # source://prism//lib/prism/node.rb#13467
sig { returns(Prism::StatementsNode) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#15423
+ # source://prism//lib/prism/node.rb#13475
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#15433
+ # source://prism//lib/prism/node.rb#13480
def type; end
end
end
# Flags for range and flip-flop nodes.
#
-# source://prism//lib/prism/node.rb#19283
+# source://prism//lib/prism/node.rb#16774
module Prism::RangeFlags; end
# ... operator
#
-# source://prism//lib/prism/node.rb#19285
+# source://prism//lib/prism/node.rb#16776
Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer)
# Represents the use of the `..` or `...` operators.
@@ -27680,79 +28097,81 @@ Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer)
# c if a =~ /left/ ... b =~ /right/
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#15454
+# source://prism//lib/prism/node.rb#13501
class Prism::RangeNode < ::Prism::Node
- # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void
+ # Initialize a new RangeNode node.
#
# @return [RangeNode] a new instance of RangeNode
#
- # source://prism//lib/prism/node.rb#15456
+ # source://prism//lib/prism/node.rb#13503
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
left: T.nilable(Prism::Node),
right: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, flags, left, right, operator_loc, location); end
+ def initialize(source, node_id, location, flags, left, right, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15577
+ # source://prism//lib/prism/node.rb#13602
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15467
+ # source://prism//lib/prism/node.rb#13514
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15472
+ # source://prism//lib/prism/node.rb#13519
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15485
+ # source://prism//lib/prism/node.rb#13532
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15477
+ # source://prism//lib/prism/node.rb#13524
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> RangeNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location) -> RangeNode
#
- # source://prism//lib/prism/node.rb#15490
+ # source://prism//lib/prism/node.rb#13537
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
left: T.nilable(Prism::Node),
right: T.nilable(Prism::Node),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::RangeNode)
end
- def copy(flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), left: T.unsafe(nil), right: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15472
+ # source://prism//lib/prism/node.rb#13519
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, left: Prism::node?, right: Prism::node?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#15498
+ # source://prism//lib/prism/node.rb#13545
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -27760,7 +28179,7 @@ class Prism::RangeNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15533
+ # source://prism//lib/prism/node.rb#13550
sig { returns(T::Boolean) }
def exclude_end?; end
@@ -27769,7 +28188,7 @@ class Prism::RangeNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15543
+ # source://prism//lib/prism/node.rb#13586
sig { override.returns(String) }
def inspect; end
@@ -27781,19 +28200,19 @@ class Prism::RangeNode < ::Prism::Node
# hello...goodbye
# ^^^^^
#
- # source://prism//lib/prism/node.rb#15513
+ # source://prism//lib/prism/node.rb#13561
sig { returns(T.nilable(Prism::Node)) }
def left; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#15538
+ # source://prism//lib/prism/node.rb#13581
sig { returns(String) }
def operator; end
# The location of the `..` or `...` operator.
#
- # source://prism//lib/prism/node.rb#15526
+ # source://prism//lib/prism/node.rb#13574
sig { returns(Prism::Location) }
def operator_loc; end
@@ -27806,46 +28225,20 @@ class Prism::RangeNode < ::Prism::Node
# ^^^
# If neither right-hand or left-hand side was included, this will be a MissingNode.
#
- # source://prism//lib/prism/node.rb#15523
+ # source://prism//lib/prism/node.rb#13571
sig { returns(T.nilable(Prism::Node)) }
def right; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15561
+ # source://prism//lib/prism/node.rb#13591
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#15503
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#15571
+ # source://prism//lib/prism/node.rb#13596
def type; end
end
end
@@ -27855,114 +28248,161 @@ end
# 1.0r
# ^^^^
#
-# source://prism//lib/prism/node.rb#15590
+# source://prism//lib/prism/node.rb#13615
class Prism::RationalNode < ::Prism::Node
- # def initialize: (Prism::node numeric, Location location) -> void
+ # Initialize a new RationalNode node.
#
# @return [RationalNode] a new instance of RationalNode
#
- # source://prism//lib/prism/node.rb#15592
- sig { params(source: Prism::Source, numeric: Prism::Node, location: Prism::Location).void }
- def initialize(source, numeric, location); end
+ # source://prism//lib/prism/node.rb#13617
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numerator: Integer,
+ denominator: Integer
+ ).void
+ end
+ def initialize(source, node_id, location, flags, numerator, denominator); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15670
+ # source://prism//lib/prism/node.rb#13706
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15600
+ # source://prism//lib/prism/node.rb#13627
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
+ # def binary?: () -> bool
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#13660
+ sig { returns(T::Boolean) }
+ def binary?; end
+
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15605
+ # source://prism//lib/prism/node.rb#13632
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15615
+ # source://prism//lib/prism/node.rb#13642
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15610
+ # source://prism//lib/prism/node.rb#13637
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?numeric: Prism::node, ?location: Location) -> RationalNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode
+ #
+ # source://prism//lib/prism/node.rb#13647
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ numerator: Integer,
+ denominator: Integer
+ ).returns(Prism::RationalNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil)); end
+
+ # def decimal?: () -> bool
+ #
+ # @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15620
- sig { params(numeric: Prism::Node, location: Prism::Location).returns(Prism::RationalNode) }
- def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#13665
+ sig { returns(T::Boolean) }
+ def decimal?; end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15605
+ # source://prism//lib/prism/node.rb#13632
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numerator: Integer, denominator: Integer }
#
- # source://prism//lib/prism/node.rb#15628
+ # source://prism//lib/prism/node.rb#13655
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
+ # The denominator of the rational number.
+ #
+ # 1.5r # denominator 2
+ #
+ # source://prism//lib/prism/node.rb#13687
+ sig { returns(Integer) }
+ def denominator; end
+
sig { override.returns(T::Array[Prism::Reflection::Field]) }
def fields; end
+ # def hexadecimal?: () -> bool
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/node.rb#13675
+ sig { returns(T::Boolean) }
+ def hexadecimal?; end
+
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15636
+ # source://prism//lib/prism/node.rb#13690
sig { override.returns(String) }
def inspect; end
- # attr_reader numeric: Prism::node
+ # The numerator of the rational number.
#
- # source://prism//lib/prism/node.rb#15633
- sig { returns(Prism::Node) }
+ # 1.5r # numerator 3
+ #
+ # source://prism//lib/prism/node.rb#13682
+ sig { returns(Integer) }
+ def numerator; end
+
+ # Returns the value of the node as an IntegerNode or a FloatNode. This
+ # method is deprecated in favor of #value or #numerator/#denominator.
+ #
+ # source://prism//lib/prism/node_ext.rb#120
def numeric; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # def octal?: () -> bool
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # @return [Boolean]
#
- # def type: () -> Symbol
+ # source://prism//lib/prism/node.rb#13670
+ sig { returns(T::Boolean) }
+ def octal?; end
+
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#15654
+ # source://prism//lib/prism/node.rb#13695
sig { override.returns(Symbol) }
def type; end
# Returns the value of the node as a Ruby Rational.
#
- # source://prism//lib/prism/node_ext.rb#105
+ # source://prism//lib/prism/node_ext.rb#114
sig { returns(Rational) }
def value; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15664
+ # source://prism//lib/prism/node.rb#13700
def type; end
end
end
@@ -27972,62 +28412,62 @@ end
# redo
# ^^^^
#
-# source://prism//lib/prism/node.rb#15680
+# source://prism//lib/prism/node.rb#13718
class Prism::RedoNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new RedoNode node.
#
# @return [RedoNode] a new instance of RedoNode
#
- # source://prism//lib/prism/node.rb#15682
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#13720
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15756
+ # source://prism//lib/prism/node.rb#13777
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15689
+ # source://prism//lib/prism/node.rb#13728
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15694
+ # source://prism//lib/prism/node.rb#13733
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15704
+ # source://prism//lib/prism/node.rb#13743
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15699
+ # source://prism//lib/prism/node.rb#13738
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> RedoNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RedoNode
#
- # source://prism//lib/prism/node.rb#15709
- sig { params(location: Prism::Location).returns(Prism::RedoNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#13748
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::RedoNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15694
+ # source://prism//lib/prism/node.rb#13733
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#15717
+ # source://prism//lib/prism/node.rb#13756
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -28036,38 +28476,20 @@ class Prism::RedoNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15722
+ # source://prism//lib/prism/node.rb#13761
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15740
+ # source://prism//lib/prism/node.rb#13766
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#15750
+ # source://prism//lib/prism/node.rb#13771
def type; end
end
end
@@ -28204,62 +28626,62 @@ class Prism::Reflection::StringField < ::Prism::Reflection::Field; end
# Flags for regular expression and match last line nodes.
#
-# source://prism//lib/prism/node.rb#19289
+# source://prism//lib/prism/node.rb#16780
module Prism::RegularExpressionFlags; end
# n - forces the ASCII-8BIT encoding
#
-# source://prism//lib/prism/node.rb#19306
+# source://prism//lib/prism/node.rb#16797
Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer)
# e - forces the EUC-JP encoding
#
-# source://prism//lib/prism/node.rb#19303
+# source://prism//lib/prism/node.rb#16794
Prism::RegularExpressionFlags::EUC_JP = T.let(T.unsafe(nil), Integer)
# x - ignores whitespace and allows comments in regular expressions
#
-# source://prism//lib/prism/node.rb#19294
+# source://prism//lib/prism/node.rb#16785
Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to binary
#
-# source://prism//lib/prism/node.rb#19318
+# source://prism//lib/prism/node.rb#16809
Prism::RegularExpressionFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to US-ASCII
#
-# source://prism//lib/prism/node.rb#19321
+# source://prism//lib/prism/node.rb#16812
Prism::RegularExpressionFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to UTF-8
#
-# source://prism//lib/prism/node.rb#19315
+# source://prism//lib/prism/node.rb#16806
Prism::RegularExpressionFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
# i - ignores the case of characters when matching
#
-# source://prism//lib/prism/node.rb#19291
+# source://prism//lib/prism/node.rb#16782
Prism::RegularExpressionFlags::IGNORE_CASE = T.let(T.unsafe(nil), Integer)
# m - allows $ to match the end of lines within strings
#
-# source://prism//lib/prism/node.rb#19297
+# source://prism//lib/prism/node.rb#16788
Prism::RegularExpressionFlags::MULTI_LINE = T.let(T.unsafe(nil), Integer)
# o - only interpolates values into the regular expression once
#
-# source://prism//lib/prism/node.rb#19300
+# source://prism//lib/prism/node.rb#16791
Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer)
# u - forces the UTF-8 encoding
#
-# source://prism//lib/prism/node.rb#19312
+# source://prism//lib/prism/node.rb#16803
Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer)
# s - forces the Windows-31J encoding
#
-# source://prism//lib/prism/node.rb#19309
+# source://prism//lib/prism/node.rb#16800
Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer)
# Represents a regular expression literal with no interpolation.
@@ -28267,37 +28689,38 @@ Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer)
# /foo/i
# ^^^^^^
#
-# source://prism//lib/prism/node.rb#15765
+# source://prism//lib/prism/node.rb#13786
class Prism::RegularExpressionNode < ::Prism::Node
include ::Prism::RegularExpressionOptions
- # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void
+ # Initialize a new RegularExpressionNode node.
#
# @return [RegularExpressionNode] a new instance of RegularExpressionNode
#
- # source://prism//lib/prism/node.rb#15767
+ # source://prism//lib/prism/node.rb#13788
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).void
end
- def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end
+ def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#15944
+ # source://prism//lib/prism/node.rb#13943
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15779
+ # source://prism//lib/prism/node.rb#13800
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -28305,77 +28728,78 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15865
+ # source://prism//lib/prism/node.rb#13858
sig { returns(T::Boolean) }
def ascii_8bit?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15784
+ # source://prism//lib/prism/node.rb#13805
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#15905
+ # source://prism//lib/prism/node.rb#13922
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#15830
+ # source://prism//lib/prism/node.rb#13902
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15794
+ # source://prism//lib/prism/node.rb#13815
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15789
+ # source://prism//lib/prism/node.rb#13810
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
# def content: () -> String
#
- # source://prism//lib/prism/node.rb#15900
+ # source://prism//lib/prism/node.rb#13917
sig { returns(String) }
def content; end
# attr_reader content_loc: Location
#
- # source://prism//lib/prism/node.rb#15823
+ # source://prism//lib/prism/node.rb#13895
sig { returns(Prism::Location) }
def content_loc; end
- # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> RegularExpressionNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> RegularExpressionNode
#
- # source://prism//lib/prism/node.rb#15799
+ # source://prism//lib/prism/node.rb#13820
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).returns(Prism::RegularExpressionNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15784
+ # source://prism//lib/prism/node.rb#13805
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
#
- # source://prism//lib/prism/node.rb#15807
+ # source://prism//lib/prism/node.rb#13828
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -28383,7 +28807,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15860
+ # source://prism//lib/prism/node.rb#13853
sig { returns(T::Boolean) }
def euc_jp?; end
@@ -28391,7 +28815,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15845
+ # source://prism//lib/prism/node.rb#13838
sig { returns(T::Boolean) }
def extended?; end
@@ -28402,7 +28826,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15885
+ # source://prism//lib/prism/node.rb#13878
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -28410,7 +28834,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15890
+ # source://prism//lib/prism/node.rb#13883
sig { returns(T::Boolean) }
def forced_us_ascii_encoding?; end
@@ -28418,7 +28842,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15880
+ # source://prism//lib/prism/node.rb#13873
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -28426,13 +28850,13 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15840
+ # source://prism//lib/prism/node.rb#13833
sig { returns(T::Boolean) }
def ignore_case?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#15910
+ # source://prism//lib/prism/node.rb#13927
sig { override.returns(String) }
def inspect; end
@@ -28440,7 +28864,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15850
+ # source://prism//lib/prism/node.rb#13843
sig { returns(T::Boolean) }
def multi_line?; end
@@ -28448,47 +28872,34 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15855
+ # source://prism//lib/prism/node.rb#13848
sig { returns(T::Boolean) }
def once?; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#15895
+ # source://prism//lib/prism/node.rb#13912
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#15816
+ # source://prism//lib/prism/node.rb#13888
sig { returns(Prism::Location) }
def opening_loc; end
sig { returns(Integer) }
def options; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#15928
+ # source://prism//lib/prism/node.rb#13932
sig { override.returns(Symbol) }
def type; end
# attr_reader unescaped: String
#
- # source://prism//lib/prism/node.rb#15837
+ # source://prism//lib/prism/node.rb#13909
sig { returns(String) }
def unescaped; end
@@ -28496,7 +28907,7 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15875
+ # source://prism//lib/prism/node.rb#13868
sig { returns(T::Boolean) }
def utf_8?; end
@@ -28504,37 +28915,24 @@ class Prism::RegularExpressionNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#15870
+ # source://prism//lib/prism/node.rb#13863
sig { returns(T::Boolean) }
def windows_31j?; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#15812
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#15938
+ # source://prism//lib/prism/node.rb#13937
def type; end
end
end
-# source://prism//lib/prism/node_ext.rb#17
+# source://prism//lib/prism/node_ext.rb#20
module Prism::RegularExpressionOptions
# Returns a numeric value that represents the flags that were used to create
# the regular expression.
#
- # source://prism//lib/prism/node_ext.rb#20
+ # source://prism//lib/prism/node_ext.rb#23
def options; end
end
@@ -28544,77 +28942,79 @@ end
# ^^
# end
#
-# source://prism//lib/prism/node.rb#15959
+# source://prism//lib/prism/node.rb#13958
class Prism::RequiredKeywordParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void
+ # Initialize a new RequiredKeywordParameterNode node.
#
# @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode
#
- # source://prism//lib/prism/node.rb#15961
+ # source://prism//lib/prism/node.rb#13960
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).void
end
- def initialize(source, flags, name, name_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16057
+ # source://prism//lib/prism/node.rb#14034
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#15971
+ # source://prism//lib/prism/node.rb#13970
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15976
+ # source://prism//lib/prism/node.rb#13975
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#15986
+ # source://prism//lib/prism/node.rb#13985
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#15981
+ # source://prism//lib/prism/node.rb#13980
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?location: Location) -> RequiredKeywordParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location) -> RequiredKeywordParameterNode
#
- # source://prism//lib/prism/node.rb#15991
+ # source://prism//lib/prism/node.rb#13990
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: Symbol,
- name_loc: Prism::Location,
- location: Prism::Location
+ name_loc: Prism::Location
).returns(Prism::RequiredKeywordParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#15976
+ # source://prism//lib/prism/node.rb#13975
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location }
#
- # source://prism//lib/prism/node.rb#15999
+ # source://prism//lib/prism/node.rb#13998
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -28623,19 +29023,19 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16023
+ # source://prism//lib/prism/node.rb#14018
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#16008
+ # source://prism//lib/prism/node.rb#14008
sig { returns(Symbol) }
def name; end
# attr_reader name_loc: Location
#
- # source://prism//lib/prism/node.rb#16011
+ # source://prism//lib/prism/node.rb#14011
sig { returns(Prism::Location) }
def name_loc; end
@@ -28643,46 +29043,20 @@ class Prism::RequiredKeywordParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16018
+ # source://prism//lib/prism/node.rb#14003
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16041
+ # source://prism//lib/prism/node.rb#14023
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#16004
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16051
+ # source://prism//lib/prism/node.rb#14028
def type; end
end
end
@@ -28693,62 +29067,69 @@ end
# ^
# end
#
-# source://prism//lib/prism/node.rb#16070
+# source://prism//lib/prism/node.rb#14047
class Prism::RequiredParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol name, Location location) -> void
+ # Initialize a new RequiredParameterNode node.
#
# @return [RequiredParameterNode] a new instance of RequiredParameterNode
#
- # source://prism//lib/prism/node.rb#16072
- sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void }
- def initialize(source, flags, name, location); end
+ # source://prism//lib/prism/node.rb#14049
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, name: Symbol).void }
+ def initialize(source, node_id, location, flags, name); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16160
+ # source://prism//lib/prism/node.rb#14115
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16081
+ # source://prism//lib/prism/node.rb#14058
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16086
+ # source://prism//lib/prism/node.rb#14063
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16096
+ # source://prism//lib/prism/node.rb#14073
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16091
+ # source://prism//lib/prism/node.rb#14068
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> RequiredParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol) -> RequiredParameterNode
#
- # source://prism//lib/prism/node.rb#16101
- sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::RequiredParameterNode) }
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#14078
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ name: Symbol
+ ).returns(Prism::RequiredParameterNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16086
+ # source://prism//lib/prism/node.rb#14063
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol }
#
- # source://prism//lib/prism/node.rb#16109
+ # source://prism//lib/prism/node.rb#14086
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -28757,13 +29138,13 @@ class Prism::RequiredParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16126
+ # source://prism//lib/prism/node.rb#14099
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol
#
- # source://prism//lib/prism/node.rb#16118
+ # source://prism//lib/prism/node.rb#14096
sig { returns(Symbol) }
def name; end
@@ -28771,46 +29152,20 @@ class Prism::RequiredParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16121
+ # source://prism//lib/prism/node.rb#14091
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16144
+ # source://prism//lib/prism/node.rb#14104
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#16114
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16154
+ # source://prism//lib/prism/node.rb#14109
def type; end
end
end
@@ -28820,83 +29175,87 @@ end
# foo rescue nil
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#16171
+# source://prism//lib/prism/node.rb#14126
class Prism::RescueModifierNode < ::Prism::Node
- # def initialize: (Prism::node expression, Location keyword_loc, Prism::node rescue_expression, Location location) -> void
+ # Initialize a new RescueModifierNode node.
#
# @return [RescueModifierNode] a new instance of RescueModifierNode
#
- # source://prism//lib/prism/node.rb#16173
+ # source://prism//lib/prism/node.rb#14128
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: Prism::Node,
keyword_loc: Prism::Location,
- rescue_expression: Prism::Node,
- location: Prism::Location
+ rescue_expression: Prism::Node
).void
end
- def initialize(source, expression, keyword_loc, rescue_expression, location); end
+ def initialize(source, node_id, location, flags, expression, keyword_loc, rescue_expression); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16272
+ # source://prism//lib/prism/node.rb#14206
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16183
+ # source://prism//lib/prism/node.rb#14139
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16192
+ # source://prism//lib/prism/node.rb#14144
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16202
+ # source://prism//lib/prism/node.rb#14154
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16197
+ # source://prism//lib/prism/node.rb#14149
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node, ?location: Location) -> RescueModifierNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node) -> RescueModifierNode
#
- # source://prism//lib/prism/node.rb#16207
+ # source://prism//lib/prism/node.rb#14159
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
expression: Prism::Node,
keyword_loc: Prism::Location,
- rescue_expression: Prism::Node,
- location: Prism::Location
+ rescue_expression: Prism::Node
).returns(Prism::RescueModifierNode)
end
- def copy(expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), expression: T.unsafe(nil), keyword_loc: T.unsafe(nil), rescue_expression: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16192
+ # source://prism//lib/prism/node.rb#14144
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node }
#
- # source://prism//lib/prism/node.rb#16215
+ # source://prism//lib/prism/node.rb#14167
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader expression: Prism::node
#
- # source://prism//lib/prism/node.rb#16220
+ # source://prism//lib/prism/node.rb#14172
sig { returns(Prism::Node) }
def expression; end
@@ -28905,59 +29264,41 @@ class Prism::RescueModifierNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16238
+ # source://prism//lib/prism/node.rb#14190
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#16233
+ # source://prism//lib/prism/node.rb#14185
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#16223
+ # source://prism//lib/prism/node.rb#14175
sig { returns(Prism::Location) }
def keyword_loc; end
+ # source://prism//lib/prism/parse_result/newlines.rb#115
+ def newline_flag!(lines); end
+
# attr_reader rescue_expression: Prism::node
#
- # source://prism//lib/prism/node.rb#16230
+ # source://prism//lib/prism/node.rb#14182
sig { returns(Prism::Node) }
def rescue_expression; end
- # source://prism//lib/prism/node.rb#16187
- def set_newline_flag(newline_marked); end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16256
+ # source://prism//lib/prism/node.rb#14195
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16266
+ # source://prism//lib/prism/node.rb#14200
def type; end
end
end
@@ -28970,97 +29311,101 @@ end
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# end
#
-# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field.
+# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
#
-# source://prism//lib/prism/node.rb#16289
+# source://prism//lib/prism/node.rb#14223
class Prism::RescueNode < ::Prism::Node
- # def initialize: (Location keyword_loc, Array[Prism::node] exceptions, Location? operator_loc, Prism::node? reference, StatementsNode? statements, RescueNode? consequent, Location location) -> void
+ # Initialize a new RescueNode node.
#
# @return [RescueNode] a new instance of RescueNode
#
- # source://prism//lib/prism/node.rb#16291
+ # source://prism//lib/prism/node.rb#14225
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
exceptions: T::Array[Prism::Node],
operator_loc: T.nilable(Prism::Location),
- reference: T.nilable(Prism::Node),
+ reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::RescueNode),
- location: Prism::Location
+ subsequent: T.nilable(Prism::RescueNode)
).void
end
- def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, statements, subsequent); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16418
+ # source://prism//lib/prism/node.rb#14335
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16304
+ # source://prism//lib/prism/node.rb#14239
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16309
+ # source://prism//lib/prism/node.rb#14244
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16324
+ # source://prism//lib/prism/node.rb#14259
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16314
+ # source://prism//lib/prism/node.rb#14249
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # attr_reader consequent: RescueNode?
+ # Returns the subsequent rescue clause of the rescue node. This method is
+ # deprecated in favor of #subsequent.
#
- # source://prism//lib/prism/node.rb#16371
- sig { returns(T.nilable(Prism::RescueNode)) }
+ # source://prism//lib/prism/node_ext.rb#494
def consequent; end
- # def copy: (?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: Prism::node?, ?statements: StatementsNode?, ?consequent: RescueNode?, ?location: Location) -> RescueNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?exceptions: Array[Prism::node], ?operator_loc: Location?, ?reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil, ?statements: StatementsNode?, ?subsequent: RescueNode?) -> RescueNode
#
- # source://prism//lib/prism/node.rb#16329
+ # source://prism//lib/prism/node.rb#14264
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
exceptions: T::Array[Prism::Node],
operator_loc: T.nilable(Prism::Location),
- reference: T.nilable(Prism::Node),
+ reference: T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::RescueNode),
- location: Prism::Location
+ subsequent: T.nilable(Prism::RescueNode)
).returns(Prism::RescueNode)
end
- def copy(keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), exceptions: T.unsafe(nil), operator_loc: T.unsafe(nil), reference: T.unsafe(nil), statements: T.unsafe(nil), subsequent: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16309
+ # source://prism//lib/prism/node.rb#14244
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: Prism::node?, statements: StatementsNode?, consequent: RescueNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, exceptions: Array[Prism::node], operator_loc: Location?, reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil, statements: StatementsNode?, subsequent: RescueNode? }
#
- # source://prism//lib/prism/node.rb#16337
+ # source://prism//lib/prism/node.rb#14272
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader exceptions: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#16349
+ # source://prism//lib/prism/node.rb#14284
sig { returns(T::Array[Prism::Node]) }
def exceptions; end
@@ -29069,74 +29414,64 @@ class Prism::RescueNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16384
+ # source://prism//lib/prism/node.rb#14319
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#16374
+ # source://prism//lib/prism/node.rb#14309
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#16342
+ # source://prism//lib/prism/node.rb#14277
sig { returns(Prism::Location) }
def keyword_loc; end
# def operator: () -> String?
#
- # source://prism//lib/prism/node.rb#16379
+ # source://prism//lib/prism/node.rb#14314
sig { returns(T.nilable(String)) }
def operator; end
# attr_reader operator_loc: Location?
#
- # source://prism//lib/prism/node.rb#16352
+ # source://prism//lib/prism/node.rb#14287
sig { returns(T.nilable(Prism::Location)) }
def operator_loc; end
- # attr_reader reference: Prism::node?
+ # attr_reader reference: LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | BackReferenceReadNode | NumberedReferenceReadNode | MissingNode | nil
#
- # source://prism//lib/prism/node.rb#16365
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#14300
+ sig do
+ returns(T.nilable(T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::BackReferenceReadNode, Prism::NumberedReferenceReadNode, Prism::MissingNode)))
+ end
def reference; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#16368
+ # source://prism//lib/prism/node.rb#14303
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # attr_reader subsequent: RescueNode?
#
- # def type: () -> Symbol
+ # source://prism//lib/prism/node.rb#14306
+ sig { returns(T.nilable(Prism::RescueNode)) }
+ def subsequent; end
+
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16402
+ # source://prism//lib/prism/node.rb#14324
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16412
+ # source://prism//lib/prism/node.rb#14329
def type; end
end
end
@@ -29147,79 +29482,81 @@ end
# ^^
# end
#
-# source://prism//lib/prism/node.rb#16435
+# source://prism//lib/prism/node.rb#14352
class Prism::RestParameterNode < ::Prism::Node
- # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void
+ # Initialize a new RestParameterNode node.
#
# @return [RestParameterNode] a new instance of RestParameterNode
#
- # source://prism//lib/prism/node.rb#16437
+ # source://prism//lib/prism/node.rb#14354
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).void
end
- def initialize(source, flags, name, name_loc, operator_loc, location); end
+ def initialize(source, node_id, location, flags, name, name_loc, operator_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16552
+ # source://prism//lib/prism/node.rb#14447
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16448
+ # source://prism//lib/prism/node.rb#14365
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16453
+ # source://prism//lib/prism/node.rb#14370
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16463
+ # source://prism//lib/prism/node.rb#14380
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16458
+ # source://prism//lib/prism/node.rb#14375
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> RestParameterNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location) -> RestParameterNode
#
- # source://prism//lib/prism/node.rb#16468
+ # source://prism//lib/prism/node.rb#14385
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
name: T.nilable(Symbol),
name_loc: T.nilable(Prism::Location),
- operator_loc: Prism::Location,
- location: Prism::Location
+ operator_loc: Prism::Location
).returns(Prism::RestParameterNode)
end
- def copy(flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), name: T.unsafe(nil), name_loc: T.unsafe(nil), operator_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16453
+ # source://prism//lib/prism/node.rb#14370
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, name: Symbol?, name_loc: Location?, operator_loc: Location }
#
- # source://prism//lib/prism/node.rb#16476
+ # source://prism//lib/prism/node.rb#14393
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -29228,31 +29565,31 @@ class Prism::RestParameterNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16518
+ # source://prism//lib/prism/node.rb#14431
sig { override.returns(String) }
def inspect; end
# attr_reader name: Symbol?
#
- # source://prism//lib/prism/node.rb#16485
+ # source://prism//lib/prism/node.rb#14403
sig { returns(T.nilable(Symbol)) }
def name; end
# attr_reader name_loc: Location?
#
- # source://prism//lib/prism/node.rb#16488
+ # source://prism//lib/prism/node.rb#14406
sig { returns(T.nilable(Prism::Location)) }
def name_loc; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#16513
+ # source://prism//lib/prism/node.rb#14426
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#16501
+ # source://prism//lib/prism/node.rb#14419
sig { returns(Prism::Location) }
def operator_loc; end
@@ -29260,46 +29597,20 @@ class Prism::RestParameterNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16508
+ # source://prism//lib/prism/node.rb#14398
sig { returns(T::Boolean) }
def repeated_parameter?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16536
+ # source://prism//lib/prism/node.rb#14436
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#16481
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16546
+ # source://prism//lib/prism/node.rb#14441
def type; end
end
end
@@ -29308,13 +29619,13 @@ end
# the requested structure, any comments that were encounters, and any errors
# that were encountered.
#
-# source://prism//lib/prism/parse_result.rb#521
+# source://prism//lib/prism/parse_result.rb#662
class Prism::Result
# Create a new result object with the given values.
#
# @return [Result] a new instance of Result
#
- # source://prism//lib/prism/parse_result.rb#543
+ # source://prism//lib/prism/parse_result.rb#684
sig do
params(
comments: T::Array[Prism::Comment],
@@ -29327,9 +29638,19 @@ class Prism::Result
end
def initialize(comments, magic_comments, data_loc, errors, warnings, source); end
+ # Create a code units cache for the given encoding.
+ #
+ # source://prism//lib/prism/parse_result.rb#716
+ sig do
+ params(
+ encoding: Encoding
+ ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)))
+ end
+ def code_units_cache(encoding); end
+
# The list of comments that were encountered during parsing.
#
- # source://prism//lib/prism/parse_result.rb#523
+ # source://prism//lib/prism/parse_result.rb#664
sig { returns(T::Array[Prism::Comment]) }
def comments; end
@@ -29337,25 +29658,25 @@ class Prism::Result
# and the rest of the content of the file. This content is loaded into the
# DATA constant when the file being parsed is the main file being executed.
#
- # source://prism//lib/prism/parse_result.rb#531
+ # source://prism//lib/prism/parse_result.rb#672
sig { returns(T.nilable(Prism::Location)) }
def data_loc; end
# Implement the hash pattern matching interface for Result.
#
- # source://prism//lib/prism/parse_result.rb#553
+ # source://prism//lib/prism/parse_result.rb#694
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# Returns the encoding of the source code that was parsed.
#
- # source://prism//lib/prism/parse_result.rb#558
+ # source://prism//lib/prism/parse_result.rb#699
sig { returns(Encoding) }
def encoding; end
# The list of errors that were generated during parsing.
#
- # source://prism//lib/prism/parse_result.rb#534
+ # source://prism//lib/prism/parse_result.rb#675
sig { returns(T::Array[Prism::ParseError]) }
def errors; end
@@ -29364,19 +29685,19 @@ class Prism::Result
#
# @return [Boolean]
#
- # source://prism//lib/prism/parse_result.rb#570
+ # source://prism//lib/prism/parse_result.rb#711
sig { returns(T::Boolean) }
def failure?; end
# The list of magic comments that were encountered during parsing.
#
- # source://prism//lib/prism/parse_result.rb#526
+ # source://prism//lib/prism/parse_result.rb#667
sig { returns(T::Array[Prism::MagicComment]) }
def magic_comments; end
# A Source instance that represents the source code that was parsed.
#
- # source://prism//lib/prism/parse_result.rb#540
+ # source://prism//lib/prism/parse_result.rb#681
sig { returns(Prism::Source) }
def source; end
@@ -29385,13 +29706,13 @@ class Prism::Result
#
# @return [Boolean]
#
- # source://prism//lib/prism/parse_result.rb#564
+ # source://prism//lib/prism/parse_result.rb#705
sig { returns(T::Boolean) }
def success?; end
# The list of warnings that were generated during parsing.
#
- # source://prism//lib/prism/parse_result.rb#537
+ # source://prism//lib/prism/parse_result.rb#678
sig { returns(T::Array[Prism::ParseWarning]) }
def warnings; end
end
@@ -29401,62 +29722,62 @@ end
# retry
# ^^^^^
#
-# source://prism//lib/prism/node.rb#16565
+# source://prism//lib/prism/node.rb#14460
class Prism::RetryNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new RetryNode node.
#
# @return [RetryNode] a new instance of RetryNode
#
- # source://prism//lib/prism/node.rb#16567
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#14462
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16641
+ # source://prism//lib/prism/node.rb#14519
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16574
+ # source://prism//lib/prism/node.rb#14470
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16579
+ # source://prism//lib/prism/node.rb#14475
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16589
+ # source://prism//lib/prism/node.rb#14485
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16584
+ # source://prism//lib/prism/node.rb#14480
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> RetryNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> RetryNode
#
- # source://prism//lib/prism/node.rb#16594
- sig { params(location: Prism::Location).returns(Prism::RetryNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#14490
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::RetryNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16579
+ # source://prism//lib/prism/node.rb#14475
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#16602
+ # source://prism//lib/prism/node.rb#14498
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -29465,38 +29786,20 @@ class Prism::RetryNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16607
+ # source://prism//lib/prism/node.rb#14503
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16625
+ # source://prism//lib/prism/node.rb#14508
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#16635
+ # source://prism//lib/prism/node.rb#14513
def type; end
end
end
@@ -29506,83 +29809,85 @@ end
# return 1
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#16650
+# source://prism//lib/prism/node.rb#14528
class Prism::ReturnNode < ::Prism::Node
- # def initialize: (Integer flags, Location keyword_loc, ArgumentsNode? arguments, Location location) -> void
+ # Initialize a new ReturnNode node.
#
# @return [ReturnNode] a new instance of ReturnNode
#
- # source://prism//lib/prism/node.rb#16652
+ # source://prism//lib/prism/node.rb#14530
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
- arguments: T.nilable(Prism::ArgumentsNode),
- location: Prism::Location
+ arguments: T.nilable(Prism::ArgumentsNode)
).void
end
- def initialize(source, flags, keyword_loc, arguments, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, arguments); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16755
+ # source://prism//lib/prism/node.rb#14606
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16662
+ # source://prism//lib/prism/node.rb#14540
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#16708
+ # source://prism//lib/prism/node.rb#14582
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16667
+ # source://prism//lib/prism/node.rb#14545
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16679
+ # source://prism//lib/prism/node.rb#14557
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16672
+ # source://prism//lib/prism/node.rb#14550
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?, ?location: Location) -> ReturnNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?) -> ReturnNode
#
- # source://prism//lib/prism/node.rb#16684
+ # source://prism//lib/prism/node.rb#14562
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
- arguments: T.nilable(Prism::ArgumentsNode),
- location: Prism::Location
+ arguments: T.nilable(Prism::ArgumentsNode)
).returns(Prism::ReturnNode)
end
- def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16667
+ # source://prism//lib/prism/node.rb#14545
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, arguments: ArgumentsNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, arguments: ArgumentsNode? }
#
- # source://prism//lib/prism/node.rb#16692
+ # source://prism//lib/prism/node.rb#14570
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -29591,141 +29896,97 @@ class Prism::ReturnNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16721
+ # source://prism//lib/prism/node.rb#14590
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#16716
+ # source://prism//lib/prism/node.rb#14585
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#16701
+ # source://prism//lib/prism/node.rb#14575
sig { returns(Prism::Location) }
def keyword_loc; end
- # def redundant?: () -> bool
- #
- # @return [Boolean]
- #
- # source://prism//lib/prism/node.rb#16711
- sig { returns(T::Boolean) }
- def redundant?; end
-
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16739
+ # source://prism//lib/prism/node.rb#14595
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#16697
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#16749
+ # source://prism//lib/prism/node.rb#14600
def type; end
end
end
-# Flags for return nodes.
-#
-# source://prism//lib/prism/node.rb#19325
-module Prism::ReturnNodeFlags; end
-
-# a return statement that is redundant because it is the last statement in a method
-#
-# source://prism//lib/prism/node.rb#19327
-Prism::ReturnNodeFlags::REDUNDANT = T.let(T.unsafe(nil), Integer)
-
# Represents the `self` keyword.
#
# self
# ^^^^
#
-# source://prism//lib/prism/node.rb#16767
+# source://prism//lib/prism/node.rb#14617
class Prism::SelfNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new SelfNode node.
#
# @return [SelfNode] a new instance of SelfNode
#
- # source://prism//lib/prism/node.rb#16769
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#14619
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16843
+ # source://prism//lib/prism/node.rb#14676
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16776
+ # source://prism//lib/prism/node.rb#14627
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16781
+ # source://prism//lib/prism/node.rb#14632
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16791
+ # source://prism//lib/prism/node.rb#14642
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16786
+ # source://prism//lib/prism/node.rb#14637
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> SelfNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SelfNode
#
- # source://prism//lib/prism/node.rb#16796
- sig { params(location: Prism::Location).returns(Prism::SelfNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#14647
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SelfNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16781
+ # source://prism//lib/prism/node.rb#14632
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#16804
+ # source://prism//lib/prism/node.rb#14655
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -29734,38 +29995,20 @@ class Prism::SelfNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16809
+ # source://prism//lib/prism/node.rb#14660
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16827
+ # source://prism//lib/prism/node.rb#14665
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16837
+ # source://prism//lib/prism/node.rb#14670
def type; end
end
end
@@ -29783,154 +30026,154 @@ module Prism::Serialize
# Deserialize the tokens represented by the given string into a parse
# result.
#
- # source://prism//lib/prism/serialize.rb#40
+ # source://prism//lib/prism/serialize.rb#51
def load_tokens(source, serialized); end
end
end
-# source://prism//lib/prism/serialize.rb#44
+# source://prism//lib/prism/serialize.rb#55
class Prism::Serialize::Loader
# @return [Loader] a new instance of Loader
#
- # source://prism//lib/prism/serialize.rb#80
+ # source://prism//lib/prism/serialize.rb#91
def initialize(source, serialized); end
# Returns the value of attribute constant_pool.
#
- # source://prism//lib/prism/serialize.rb#77
+ # source://prism//lib/prism/serialize.rb#88
def constant_pool; end
# Returns the value of attribute constant_pool_offset.
#
- # source://prism//lib/prism/serialize.rb#77
+ # source://prism//lib/prism/serialize.rb#88
def constant_pool_offset; end
# Returns the value of attribute encoding.
#
- # source://prism//lib/prism/serialize.rb#76
+ # source://prism//lib/prism/serialize.rb#87
def encoding; end
# Returns the value of attribute input.
#
- # source://prism//lib/prism/serialize.rb#76
+ # source://prism//lib/prism/serialize.rb#87
def input; end
# Returns the value of attribute io.
#
- # source://prism//lib/prism/serialize.rb#76
+ # source://prism//lib/prism/serialize.rb#87
def io; end
- # source://prism//lib/prism/serialize.rb#118
+ # source://prism//lib/prism/serialize.rb#129
def load_comments; end
- # source://prism//lib/prism/serialize.rb#104
+ # source://prism//lib/prism/serialize.rb#115
def load_encoding; end
- # source://prism//lib/prism/serialize.rb#95
+ # source://prism//lib/prism/serialize.rb#106
def load_header; end
- # source://prism//lib/prism/serialize.rb#114
+ # source://prism//lib/prism/serialize.rb#125
def load_line_offsets; end
- # source://prism//lib/prism/serialize.rb#433
+ # source://prism//lib/prism/serialize.rb#462
def load_metadata; end
- # source://prism//lib/prism/serialize.rb#467
+ # source://prism//lib/prism/serialize.rb#496
def load_nodes; end
- # source://prism//lib/prism/serialize.rb#481
+ # source://prism//lib/prism/serialize.rb#510
def load_result; end
- # source://prism//lib/prism/serialize.rb#110
+ # source://prism//lib/prism/serialize.rb#121
def load_start_line; end
- # source://prism//lib/prism/serialize.rb#442
+ # source://prism//lib/prism/serialize.rb#471
def load_tokens; end
- # source://prism//lib/prism/serialize.rb#455
+ # source://prism//lib/prism/serialize.rb#484
def load_tokens_result; end
# Returns the value of attribute serialized.
#
- # source://prism//lib/prism/serialize.rb#76
+ # source://prism//lib/prism/serialize.rb#87
def serialized; end
# Returns the value of attribute source.
#
- # source://prism//lib/prism/serialize.rb#77
+ # source://prism//lib/prism/serialize.rb#88
def source; end
# Returns the value of attribute start_line.
#
- # source://prism//lib/prism/serialize.rb#78
+ # source://prism//lib/prism/serialize.rb#89
def start_line; end
private
- # source://prism//lib/prism/serialize.rb#567
+ # source://prism//lib/prism/serialize.rb#596
def load_constant(index); end
- # source://prism//lib/prism/serialize.rb#520
+ # source://prism//lib/prism/serialize.rb#549
def load_double; end
- # source://prism//lib/prism/serialize.rb#535
+ # source://prism//lib/prism/serialize.rb#564
def load_embedded_string; end
- # source://prism//lib/prism/serialize.rb#597
+ # source://prism//lib/prism/serialize.rb#626
def load_error_level; end
- # source://prism//lib/prism/serialize.rb#509
+ # source://prism//lib/prism/serialize.rb#538
def load_integer; end
- # source://prism//lib/prism/serialize.rb#551
+ # source://prism//lib/prism/serialize.rb#580
def load_location; end
- # source://prism//lib/prism/serialize.rb#555
+ # source://prism//lib/prism/serialize.rb#584
def load_location_object; end
- # source://prism//lib/prism/serialize.rb#626
+ # source://prism//lib/prism/serialize.rb#655
def load_node; end
- # source://prism//lib/prism/serialize.rb#592
+ # source://prism//lib/prism/serialize.rb#621
def load_optional_constant; end
- # source://prism//lib/prism/serialize.rb#559
+ # source://prism//lib/prism/serialize.rb#588
def load_optional_location; end
- # source://prism//lib/prism/serialize.rb#563
+ # source://prism//lib/prism/serialize.rb#592
def load_optional_location_object; end
- # source://prism//lib/prism/serialize.rb#528
+ # source://prism//lib/prism/serialize.rb#557
def load_optional_node; end
- # source://prism//lib/prism/serialize.rb#588
+ # source://prism//lib/prism/serialize.rb#617
def load_required_constant; end
- # source://prism//lib/prism/serialize.rb#539
+ # source://prism//lib/prism/serialize.rb#568
def load_string; end
- # source://prism//lib/prism/serialize.rb#524
+ # source://prism//lib/prism/serialize.rb#553
def load_uint32; end
- # source://prism//lib/prism/serialize.rb#504
+ # source://prism//lib/prism/serialize.rb#533
def load_varsint; end
# variable-length integer using https://en.wikipedia.org/wiki/LEB128
# This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints
#
- # source://prism//lib/prism/serialize.rb#490
+ # source://prism//lib/prism/serialize.rb#519
def load_varuint; end
- # source://prism//lib/prism/serialize.rb#612
+ # source://prism//lib/prism/serialize.rb#641
def load_warning_level; end
end
-# source://prism//lib/prism/serialize.rb#127
+# source://prism//lib/prism/serialize.rb#138
Prism::Serialize::Loader::DIAGNOSTIC_TYPES = T.let(T.unsafe(nil), Array)
# StringIO is synchronized and that adds a high overhead on TruffleRuby.
#
-# source://prism//lib/prism/serialize.rb#72
+# source://prism//lib/prism/serialize.rb#83
Prism::Serialize::Loader::FastStringIO = StringIO
# The major version of prism that we are expecting to find in the serialized
@@ -29953,7 +30196,7 @@ Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer)
# The token types that can be indexed by their enum values.
#
-# source://prism//lib/prism/serialize.rb#1850
+# source://prism//lib/prism/serialize.rb#1737
Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array)
# This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
@@ -29961,75 +30204,77 @@ Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array)
# C = { a: 1 }
# ^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#16853
+# source://prism//lib/prism/node.rb#14686
class Prism::ShareableConstantNode < ::Prism::Node
- # def initialize: (Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write, Location location) -> void
+ # Initialize a new ShareableConstantNode node.
#
# @return [ShareableConstantNode] a new instance of ShareableConstantNode
#
- # source://prism//lib/prism/node.rb#16855
+ # source://prism//lib/prism/node.rb#14688
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode),
- location: Prism::Location
+ write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode)
).void
end
- def initialize(source, flags, write, location); end
+ def initialize(source, node_id, location, flags, write); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#16953
+ # source://prism//lib/prism/node.rb#14764
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16864
+ # source://prism//lib/prism/node.rb#14697
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16869
+ # source://prism//lib/prism/node.rb#14702
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16879
+ # source://prism//lib/prism/node.rb#14712
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16874
+ # source://prism//lib/prism/node.rb#14707
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, ?location: Location) -> ShareableConstantNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode) -> ShareableConstantNode
#
- # source://prism//lib/prism/node.rb#16884
+ # source://prism//lib/prism/node.rb#14717
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
- write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode),
- location: Prism::Location
+ write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode)
).returns(Prism::ShareableConstantNode)
end
- def copy(flags: T.unsafe(nil), write: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), write: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16869
+ # source://prism//lib/prism/node.rb#14702
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode }
#
- # source://prism//lib/prism/node.rb#16892
+ # source://prism//lib/prism/node.rb#14725
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -30037,7 +30282,7 @@ class Prism::ShareableConstantNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16914
+ # source://prism//lib/prism/node.rb#14740
sig { returns(T::Boolean) }
def experimental_copy?; end
@@ -30045,7 +30290,7 @@ class Prism::ShareableConstantNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16909
+ # source://prism//lib/prism/node.rb#14735
sig { returns(T::Boolean) }
def experimental_everything?; end
@@ -30054,7 +30299,7 @@ class Prism::ShareableConstantNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#16919
+ # source://prism//lib/prism/node.rb#14748
sig { override.returns(String) }
def inspect; end
@@ -30062,76 +30307,50 @@ class Prism::ShareableConstantNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#16904
+ # source://prism//lib/prism/node.rb#14730
sig { returns(T::Boolean) }
def literal?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#16937
+ # source://prism//lib/prism/node.rb#14753
sig { override.returns(Symbol) }
def type; end
# The constant write that should be modified with the shareability state.
#
- # source://prism//lib/prism/node.rb#16901
+ # source://prism//lib/prism/node.rb#14745
sig do
returns(T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode))
end
def write; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#16897
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#16947
+ # source://prism//lib/prism/node.rb#14758
def type; end
end
end
# Flags for shareable constant nodes.
#
-# source://prism//lib/prism/node.rb#19331
+# source://prism//lib/prism/node.rb#16816
module Prism::ShareableConstantNodeFlags; end
# constant writes that should be modified with shareable constant value experimental copy
#
-# source://prism//lib/prism/node.rb#19339
+# source://prism//lib/prism/node.rb#16824
Prism::ShareableConstantNodeFlags::EXPERIMENTAL_COPY = T.let(T.unsafe(nil), Integer)
# constant writes that should be modified with shareable constant value experimental everything
#
-# source://prism//lib/prism/node.rb#19336
+# source://prism//lib/prism/node.rb#16821
Prism::ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING = T.let(T.unsafe(nil), Integer)
# constant writes that should be modified with shareable constant value literal
#
-# source://prism//lib/prism/node.rb#19333
+# source://prism//lib/prism/node.rb#16818
Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer)
# Represents a singleton class declaration involving the `class` keyword.
@@ -30139,119 +30358,123 @@ Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer)
# class << self end
# ^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#16964
+# source://prism//lib/prism/node.rb#14775
class Prism::SingletonClassNode < ::Prism::Node
- # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Prism::node expression, Prism::node? body, Location end_keyword_loc, Location location) -> void
+ # Initialize a new SingletonClassNode node.
#
# @return [SingletonClassNode] a new instance of SingletonClassNode
#
- # source://prism//lib/prism/node.rb#16966
+ # source://prism//lib/prism/node.rb#14777
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
class_keyword_loc: Prism::Location,
operator_loc: Prism::Location,
expression: Prism::Node,
- body: T.nilable(Prism::Node),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ end_keyword_loc: Prism::Location
).void
end
- def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17094
+ # source://prism//lib/prism/node.rb#14888
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#16979
+ # source://prism//lib/prism/node.rb#14791
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
- # attr_reader body: Prism::node?
+ # attr_reader body: StatementsNode | BeginNode | nil
#
- # source://prism//lib/prism/node.rb#17035
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#14847
+ sig { returns(T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode))) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16984
+ # source://prism//lib/prism/node.rb#14796
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def class_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#17045
+ # source://prism//lib/prism/node.rb#14857
sig { returns(String) }
def class_keyword; end
# attr_reader class_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#17018
+ # source://prism//lib/prism/node.rb#14830
sig { returns(Prism::Location) }
def class_keyword_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#16997
+ # source://prism//lib/prism/node.rb#14809
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#16989
+ # source://prism//lib/prism/node.rb#14801
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: Prism::node?, ?end_keyword_loc: Location, ?location: Location) -> SingletonClassNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?locals: Array[Symbol], ?class_keyword_loc: Location, ?operator_loc: Location, ?expression: Prism::node, ?body: StatementsNode | BeginNode | nil, ?end_keyword_loc: Location) -> SingletonClassNode
#
- # source://prism//lib/prism/node.rb#17002
+ # source://prism//lib/prism/node.rb#14814
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
locals: T::Array[Symbol],
class_keyword_loc: Prism::Location,
operator_loc: Prism::Location,
expression: Prism::Node,
- body: T.nilable(Prism::Node),
- end_keyword_loc: Prism::Location,
- location: Prism::Location
+ body: T.nilable(T.any(Prism::StatementsNode, Prism::BeginNode)),
+ end_keyword_loc: Prism::Location
).returns(Prism::SingletonClassNode)
end
- def copy(locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), locals: T.unsafe(nil), class_keyword_loc: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil), body: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#16984
+ # source://prism//lib/prism/node.rb#14796
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: Prism::node?, end_keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, locals: Array[Symbol], class_keyword_loc: Location, operator_loc: Location, expression: Prism::node, body: StatementsNode | BeginNode | nil, end_keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#17010
+ # source://prism//lib/prism/node.rb#14822
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# def end_keyword: () -> String
#
- # source://prism//lib/prism/node.rb#17055
+ # source://prism//lib/prism/node.rb#14867
sig { returns(String) }
def end_keyword; end
# attr_reader end_keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#17038
+ # source://prism//lib/prism/node.rb#14850
sig { returns(Prism::Location) }
def end_keyword_loc; end
# attr_reader expression: Prism::node
#
- # source://prism//lib/prism/node.rb#17032
+ # source://prism//lib/prism/node.rb#14844
sig { returns(Prism::Node) }
def expression; end
@@ -30260,56 +30483,38 @@ class Prism::SingletonClassNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17060
+ # source://prism//lib/prism/node.rb#14872
sig { override.returns(String) }
def inspect; end
# attr_reader locals: Array[Symbol]
#
- # source://prism//lib/prism/node.rb#17015
+ # source://prism//lib/prism/node.rb#14827
sig { returns(T::Array[Symbol]) }
def locals; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#17050
+ # source://prism//lib/prism/node.rb#14862
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#17025
+ # source://prism//lib/prism/node.rb#14837
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17078
+ # source://prism//lib/prism/node.rb#14877
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17088
+ # source://prism//lib/prism/node.rb#14882
def type; end
end
end
@@ -30324,26 +30529,37 @@ class Prism::Source
#
# @return [Source] a new instance of Source
#
- # source://prism//lib/prism/parse_result.rb#26
+ # source://prism//lib/prism/parse_result.rb#45
sig { params(source: String, start_line: Integer, offsets: T::Array[Integer]).void }
def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end
# Return the column number in characters for the given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#78
+ # source://prism//lib/prism/parse_result.rb#97
sig { params(byte_offset: Integer).returns(Integer) }
def character_column(byte_offset); end
# Return the character offset for the given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#73
+ # source://prism//lib/prism/parse_result.rb#92
sig { params(byte_offset: Integer).returns(Integer) }
def character_offset(byte_offset); end
+ # Generate a cache that targets a specific encoding for calculating code
+ # unit offsets.
+ #
+ # source://prism//lib/prism/parse_result.rb#125
+ sig do
+ params(
+ encoding: Encoding
+ ).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer)))
+ end
+ def code_units_cache(encoding); end
+
# Returns the column number in code units for the given encoding for the
# given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#95
+ # source://prism//lib/prism/parse_result.rb#131
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
def code_units_column(byte_offset, encoding); end
@@ -30354,71 +30570,77 @@ class Prism::Source
# concept of code units that differs from the number of characters in other
# encodings, it is not captured here.
#
- # source://prism//lib/prism/parse_result.rb#88
+ # We purposefully replace invalid and undefined characters with replacement
+ # characters in this conversion. This happens for two reasons. First, it's
+ # possible that the given byte offset will not occur on a character
+ # boundary. Second, it's possible that the source code will contain a
+ # character that has no equivalent in the given encoding.
+ #
+ # source://prism//lib/prism/parse_result.rb#113
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
def code_units_offset(byte_offset, encoding); end
# Return the column number for the given byte offset.
#
- # source://prism//lib/prism/parse_result.rb#68
+ # source://prism//lib/prism/parse_result.rb#87
sig { params(byte_offset: Integer).returns(Integer) }
def column(byte_offset); end
# Returns the encoding of the source code, which is set by parameters to the
# parser or by the encoding magic comment.
#
- # source://prism//lib/prism/parse_result.rb#34
+ # source://prism//lib/prism/parse_result.rb#53
sig { returns(Encoding) }
def encoding; end
# Binary search through the offsets to find the line number for the given
# byte offset.
#
- # source://prism//lib/prism/parse_result.rb#51
+ # source://prism//lib/prism/parse_result.rb#70
sig { params(byte_offset: Integer).returns(Integer) }
def line(byte_offset); end
# Returns the byte offset of the end of the line corresponding to the given
# byte offset.
#
- # source://prism//lib/prism/parse_result.rb#63
+ # source://prism//lib/prism/parse_result.rb#82
def line_end(byte_offset); end
# Return the byte offset of the start of the line corresponding to the given
# byte offset.
#
- # source://prism//lib/prism/parse_result.rb#57
+ # source://prism//lib/prism/parse_result.rb#76
sig { params(byte_offset: Integer).returns(Integer) }
def line_start(byte_offset); end
# Returns the lines of the source code as an array of strings.
#
- # source://prism//lib/prism/parse_result.rb#39
+ # source://prism//lib/prism/parse_result.rb#58
sig { returns(T::Array[String]) }
def lines; end
# The list of newline byte offsets in the source code.
#
- # source://prism//lib/prism/parse_result.rb#23
+ # source://prism//lib/prism/parse_result.rb#42
sig { returns(T::Array[Integer]) }
def offsets; end
# Perform a byteslice on the source code using the given byte offset and
# byte length.
#
- # source://prism//lib/prism/parse_result.rb#45
+ # source://prism//lib/prism/parse_result.rb#64
sig { params(byte_offset: Integer, length: Integer).returns(String) }
def slice(byte_offset, length); end
# The source code that this source object represents.
#
- # source://prism//lib/prism/parse_result.rb#17
+ # source://prism//lib/prism/parse_result.rb#36
sig { returns(String) }
def source; end
# The line number where this source starts.
#
- # source://prism//lib/prism/parse_result.rb#20
+ # source://prism//lib/prism/parse_result.rb#39
sig { returns(Integer) }
def start_line; end
@@ -30427,7 +30649,7 @@ class Prism::Source
# Binary search through the offsets to find the line number for the given
# byte offset.
#
- # source://prism//lib/prism/parse_result.rb#103
+ # source://prism//lib/prism/parse_result.rb#139
def find_line(byte_offset); end
class << self
@@ -30446,62 +30668,62 @@ end
# __ENCODING__
# ^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#17110
+# source://prism//lib/prism/node.rb#14904
class Prism::SourceEncodingNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new SourceEncodingNode node.
#
# @return [SourceEncodingNode] a new instance of SourceEncodingNode
#
- # source://prism//lib/prism/node.rb#17112
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#14906
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17186
+ # source://prism//lib/prism/node.rb#14963
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17119
+ # source://prism//lib/prism/node.rb#14914
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17124
+ # source://prism//lib/prism/node.rb#14919
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17134
+ # source://prism//lib/prism/node.rb#14929
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17129
+ # source://prism//lib/prism/node.rb#14924
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> SourceEncodingNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceEncodingNode
#
- # source://prism//lib/prism/node.rb#17139
- sig { params(location: Prism::Location).returns(Prism::SourceEncodingNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#14934
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SourceEncodingNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17124
+ # source://prism//lib/prism/node.rb#14919
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#17147
+ # source://prism//lib/prism/node.rb#14942
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -30510,38 +30732,20 @@ class Prism::SourceEncodingNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17152
+ # source://prism//lib/prism/node.rb#14947
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17170
+ # source://prism//lib/prism/node.rb#14952
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#17180
+ # source://prism//lib/prism/node.rb#14957
def type; end
end
end
@@ -30551,62 +30755,77 @@ end
# __FILE__
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#17195
+# source://prism//lib/prism/node.rb#14972
class Prism::SourceFileNode < ::Prism::Node
- # def initialize: (Integer flags, String filepath, Location location) -> void
+ # Initialize a new SourceFileNode node.
#
# @return [SourceFileNode] a new instance of SourceFileNode
#
- # source://prism//lib/prism/node.rb#17197
- sig { params(source: Prism::Source, flags: Integer, filepath: String, location: Prism::Location).void }
- def initialize(source, flags, filepath, location); end
+ # source://prism//lib/prism/node.rb#14974
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ filepath: String
+ ).void
+ end
+ def initialize(source, node_id, location, flags, filepath); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17300
+ # source://prism//lib/prism/node.rb#15055
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17206
+ # source://prism//lib/prism/node.rb#14983
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17211
+ # source://prism//lib/prism/node.rb#14988
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17221
+ # source://prism//lib/prism/node.rb#14998
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17216
+ # source://prism//lib/prism/node.rb#14993
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?filepath: String, ?location: Location) -> SourceFileNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?filepath: String) -> SourceFileNode
#
- # source://prism//lib/prism/node.rb#17226
- sig { params(flags: Integer, filepath: String, location: Prism::Location).returns(Prism::SourceFileNode) }
- def copy(flags: T.unsafe(nil), filepath: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#15003
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ filepath: String
+ ).returns(Prism::SourceFileNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), filepath: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17211
+ # source://prism//lib/prism/node.rb#14988
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, filepath: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, filepath: String }
#
- # source://prism//lib/prism/node.rb#17234
+ # source://prism//lib/prism/node.rb#15011
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -30615,7 +30834,7 @@ class Prism::SourceFileNode < ::Prism::Node
# Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs.
#
- # source://prism//lib/prism/node.rb#17243
+ # source://prism//lib/prism/node.rb#15036
sig { returns(String) }
def filepath; end
@@ -30623,7 +30842,7 @@ class Prism::SourceFileNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17251
+ # source://prism//lib/prism/node.rb#15021
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -30631,7 +30850,7 @@ class Prism::SourceFileNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17246
+ # source://prism//lib/prism/node.rb#15016
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -30639,13 +30858,13 @@ class Prism::SourceFileNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17256
+ # source://prism//lib/prism/node.rb#15026
sig { returns(T::Boolean) }
def frozen?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17266
+ # source://prism//lib/prism/node.rb#15039
sig { override.returns(String) }
def inspect; end
@@ -30653,46 +30872,20 @@ class Prism::SourceFileNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17261
+ # source://prism//lib/prism/node.rb#15031
sig { returns(T::Boolean) }
def mutable?; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17284
+ # source://prism//lib/prism/node.rb#15044
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#17239
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#17294
+ # source://prism//lib/prism/node.rb#15049
def type; end
end
end
@@ -30702,62 +30895,62 @@ end
# __LINE__
# ^^^^^^^^
#
-# source://prism//lib/prism/node.rb#17311
+# source://prism//lib/prism/node.rb#15066
class Prism::SourceLineNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new SourceLineNode node.
#
# @return [SourceLineNode] a new instance of SourceLineNode
#
- # source://prism//lib/prism/node.rb#17313
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#15068
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17387
+ # source://prism//lib/prism/node.rb#15125
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17320
+ # source://prism//lib/prism/node.rb#15076
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17325
+ # source://prism//lib/prism/node.rb#15081
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17335
+ # source://prism//lib/prism/node.rb#15091
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17330
+ # source://prism//lib/prism/node.rb#15086
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> SourceLineNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> SourceLineNode
#
- # source://prism//lib/prism/node.rb#17340
- sig { params(location: Prism::Location).returns(Prism::SourceLineNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#15096
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::SourceLineNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17325
+ # source://prism//lib/prism/node.rb#15081
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#17348
+ # source://prism//lib/prism/node.rb#15104
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -30766,38 +30959,20 @@ class Prism::SourceLineNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17353
+ # source://prism//lib/prism/node.rb#15109
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#17371
+ # source://prism//lib/prism/node.rb#15114
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17381
+ # source://prism//lib/prism/node.rb#15119
def type; end
end
end
@@ -30807,81 +30982,85 @@ end
# [*a]
# ^^
#
-# source://prism//lib/prism/node.rb#17396
+# source://prism//lib/prism/node.rb#15134
class Prism::SplatNode < ::Prism::Node
- # def initialize: (Location operator_loc, Prism::node? expression, Location location) -> void
+ # Initialize a new SplatNode node.
#
# @return [SplatNode] a new instance of SplatNode
#
- # source://prism//lib/prism/node.rb#17398
+ # source://prism//lib/prism/node.rb#15136
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- expression: T.nilable(Prism::Node),
- location: Prism::Location
+ expression: T.nilable(Prism::Node)
).void
end
- def initialize(source, operator_loc, expression, location); end
+ def initialize(source, node_id, location, flags, operator_loc, expression); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17491
+ # source://prism//lib/prism/node.rb#15212
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17407
+ # source://prism//lib/prism/node.rb#15146
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17412
+ # source://prism//lib/prism/node.rb#15151
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17424
+ # source://prism//lib/prism/node.rb#15163
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17417
+ # source://prism//lib/prism/node.rb#15156
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?operator_loc: Location, ?expression: Prism::node?, ?location: Location) -> SplatNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?operator_loc: Location, ?expression: Prism::node?) -> SplatNode
#
- # source://prism//lib/prism/node.rb#17429
+ # source://prism//lib/prism/node.rb#15168
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
operator_loc: Prism::Location,
- expression: T.nilable(Prism::Node),
- location: Prism::Location
+ expression: T.nilable(Prism::Node)
).returns(Prism::SplatNode)
end
- def copy(operator_loc: T.unsafe(nil), expression: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), operator_loc: T.unsafe(nil), expression: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17412
+ # source://prism//lib/prism/node.rb#15151
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Prism::node?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, operator_loc: Location, expression: Prism::node? }
#
- # source://prism//lib/prism/node.rb#17437
+ # source://prism//lib/prism/node.rb#15176
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
# attr_reader expression: Prism::node?
#
- # source://prism//lib/prism/node.rb#17449
+ # source://prism//lib/prism/node.rb#15188
sig { returns(T.nilable(Prism::Node)) }
def expression; end
@@ -30890,50 +31069,32 @@ class Prism::SplatNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17457
+ # source://prism//lib/prism/node.rb#15196
sig { override.returns(String) }
def inspect; end
# def operator: () -> String
#
- # source://prism//lib/prism/node.rb#17452
+ # source://prism//lib/prism/node.rb#15191
sig { returns(String) }
def operator; end
# attr_reader operator_loc: Location
#
- # source://prism//lib/prism/node.rb#17442
+ # source://prism//lib/prism/node.rb#15181
sig { returns(Prism::Location) }
def operator_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#17475
+ # source://prism//lib/prism/node.rb#15201
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17485
+ # source://prism//lib/prism/node.rb#15206
def type; end
end
end
@@ -30943,68 +31104,83 @@ end
# foo; bar; baz
# ^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#17502
+# source://prism//lib/prism/node.rb#15223
class Prism::StatementsNode < ::Prism::Node
- # def initialize: (Array[Prism::node] body, Location location) -> void
+ # Initialize a new StatementsNode node.
#
# @return [StatementsNode] a new instance of StatementsNode
#
- # source://prism//lib/prism/node.rb#17504
- sig { params(source: Prism::Source, body: T::Array[Prism::Node], location: Prism::Location).void }
- def initialize(source, body, location); end
+ # source://prism//lib/prism/node.rb#15225
+ sig do
+ params(
+ source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ body: T::Array[Prism::Node]
+ ).void
+ end
+ def initialize(source, node_id, location, flags, body); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17582
+ # source://prism//lib/prism/node.rb#15286
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17512
+ # source://prism//lib/prism/node.rb#15234
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader body: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#17545
+ # source://prism//lib/prism/node.rb#15267
sig { returns(T::Array[Prism::Node]) }
def body; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17517
+ # source://prism//lib/prism/node.rb#15239
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17527
+ # source://prism//lib/prism/node.rb#15249
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17522
+ # source://prism//lib/prism/node.rb#15244
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?body: Array[Prism::node], ?location: Location) -> StatementsNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?body: Array[Prism::node]) -> StatementsNode
#
- # source://prism//lib/prism/node.rb#17532
- sig { params(body: T::Array[Prism::Node], location: Prism::Location).returns(Prism::StatementsNode) }
- def copy(body: T.unsafe(nil), location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#15254
+ sig do
+ params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
+ body: T::Array[Prism::Node]
+ ).returns(Prism::StatementsNode)
+ end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), body: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17517
+ # source://prism//lib/prism/node.rb#15239
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Prism::node], location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, body: Array[Prism::node] }
#
- # source://prism//lib/prism/node.rb#17540
+ # source://prism//lib/prism/node.rb#15262
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -31013,61 +31189,43 @@ class Prism::StatementsNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17548
+ # source://prism//lib/prism/node.rb#15270
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#17566
+ # source://prism//lib/prism/node.rb#15275
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#17576
+ # source://prism//lib/prism/node.rb#15280
def type; end
end
end
# Flags for string nodes.
#
-# source://prism//lib/prism/node.rb#19343
+# source://prism//lib/prism/node.rb#16828
module Prism::StringFlags; end
# internal bytes forced the encoding to binary
#
-# source://prism//lib/prism/node.rb#19348
+# source://prism//lib/prism/node.rb#16833
Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to UTF-8
#
-# source://prism//lib/prism/node.rb#19345
+# source://prism//lib/prism/node.rb#16830
Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
-# source://prism//lib/prism/node.rb#19351
+# source://prism//lib/prism/node.rb#16836
Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer)
-# source://prism//lib/prism/node.rb#19354
+# source://prism//lib/prism/node.rb#16839
Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer)
# Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
@@ -31081,107 +31239,109 @@ Prism::StringFlags::MUTABLE = T.let(T.unsafe(nil), Integer)
# "foo #{bar} baz"
# ^^^^ ^^^^
#
-# source://prism//lib/prism/node.rb#17599
+# source://prism//lib/prism/node.rb#15303
class Prism::StringNode < ::Prism::Node
include ::Prism::HeredocQuery
- # def initialize: (Integer flags, Location? opening_loc, Location content_loc, Location? closing_loc, String unescaped, Location location) -> void
+ # Initialize a new StringNode node.
#
# @return [StringNode] a new instance of StringNode
#
- # source://prism//lib/prism/node.rb#17601
+ # source://prism//lib/prism/node.rb#15305
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
content_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).void
end
- def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end
+ def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17755
+ # source://prism//lib/prism/node.rb#15437
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17613
+ # source://prism//lib/prism/node.rb#15317
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17618
+ # source://prism//lib/prism/node.rb#15322
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#17716
+ # source://prism//lib/prism/node.rb#15416
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#17670
+ # source://prism//lib/prism/node.rb#15390
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17628
+ # source://prism//lib/prism/node.rb#15332
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17623
+ # source://prism//lib/prism/node.rb#15327
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
# def content: () -> String
#
- # source://prism//lib/prism/node.rb#17711
+ # source://prism//lib/prism/node.rb#15411
sig { returns(String) }
def content; end
# attr_reader content_loc: Location
#
- # source://prism//lib/prism/node.rb#17663
+ # source://prism//lib/prism/node.rb#15383
sig { returns(Prism::Location) }
def content_loc; end
- # def copy: (?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> StringNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?content_loc: Location, ?closing_loc: Location?, ?unescaped: String) -> StringNode
#
- # source://prism//lib/prism/node.rb#17633
+ # source://prism//lib/prism/node.rb#15337
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
content_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).returns(Prism::StringNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17618
+ # source://prism//lib/prism/node.rb#15322
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String }
#
- # source://prism//lib/prism/node.rb#17641
+ # source://prism//lib/prism/node.rb#15345
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -31192,7 +31352,7 @@ class Prism::StringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17691
+ # source://prism//lib/prism/node.rb#15355
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -31200,7 +31360,7 @@ class Prism::StringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17686
+ # source://prism//lib/prism/node.rb#15350
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -31208,7 +31368,7 @@ class Prism::StringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17696
+ # source://prism//lib/prism/node.rb#15360
sig { returns(T::Boolean) }
def frozen?; end
@@ -31217,7 +31377,7 @@ class Prism::StringNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17721
+ # source://prism//lib/prism/node.rb#15421
sig { override.returns(String) }
def inspect; end
@@ -31225,71 +31385,45 @@ class Prism::StringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#17701
+ # source://prism//lib/prism/node.rb#15365
sig { returns(T::Boolean) }
def mutable?; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#17706
+ # source://prism//lib/prism/node.rb#15406
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#17650
+ # source://prism//lib/prism/node.rb#15370
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
# Occasionally it's helpful to treat a string as if it were interpolated so
# that there's a consistent interface for working with strings.
#
- # source://prism//lib/prism/node_ext.rb#66
+ # source://prism//lib/prism/node_ext.rb#72
sig { returns(Prism::InterpolatedStringNode) }
def to_interpolated; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#17739
+ # source://prism//lib/prism/node.rb#15426
sig { override.returns(Symbol) }
def type; end
# attr_reader unescaped: String
#
- # source://prism//lib/prism/node.rb#17683
+ # source://prism//lib/prism/node.rb#15403
sig { returns(String) }
def unescaped; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#17646
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17749
+ # source://prism//lib/prism/node.rb#15431
def type; end
end
end
@@ -31302,93 +31436,97 @@ end
# super foo, bar
# ^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#17772
+# source://prism//lib/prism/node.rb#15454
class Prism::SuperNode < ::Prism::Node
- # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Prism::node? block, Location location) -> void
+ # Initialize a new SuperNode node.
#
# @return [SuperNode] a new instance of SuperNode
#
- # source://prism//lib/prism/node.rb#17774
+ # source://prism//lib/prism/node.rb#15456
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
lparen_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
rparen_loc: T.nilable(Prism::Location),
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
).void
end
- def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#17910
+ # source://prism//lib/prism/node.rb#15575
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17786
+ # source://prism//lib/prism/node.rb#15469
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#17842
+ # source://prism//lib/prism/node.rb#15525
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
- # attr_reader block: Prism::node?
+ # attr_reader block: BlockNode | BlockArgumentNode | nil
#
- # source://prism//lib/prism/node.rb#17858
- sig { returns(T.nilable(Prism::Node)) }
+ # source://prism//lib/prism/node.rb#15541
+ sig { returns(T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))) }
def block; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17791
+ # source://prism//lib/prism/node.rb#15474
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17804
+ # source://prism//lib/prism/node.rb#15487
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17796
+ # source://prism//lib/prism/node.rb#15479
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: Prism::node?, ?location: Location) -> SuperNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?block: BlockNode | BlockArgumentNode | nil) -> SuperNode
#
- # source://prism//lib/prism/node.rb#17809
+ # source://prism//lib/prism/node.rb#15492
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
lparen_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
rparen_loc: T.nilable(Prism::Location),
- block: T.nilable(Prism::Node),
- location: Prism::Location
+ block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))
).returns(Prism::SuperNode)
end
- def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), block: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17791
+ # source://prism//lib/prism/node.rb#15474
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Prism::node?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: BlockNode | BlockArgumentNode | nil }
#
- # source://prism//lib/prism/node.rb#17817
+ # source://prism//lib/prism/node.rb#15500
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -31397,96 +31535,78 @@ class Prism::SuperNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#17876
+ # source://prism//lib/prism/node.rb#15559
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#17861
+ # source://prism//lib/prism/node.rb#15544
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#17822
+ # source://prism//lib/prism/node.rb#15505
sig { returns(Prism::Location) }
def keyword_loc; end
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#17866
+ # source://prism//lib/prism/node.rb#15549
sig { returns(T.nilable(String)) }
def lparen; end
# attr_reader lparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#17829
+ # source://prism//lib/prism/node.rb#15512
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#17871
+ # source://prism//lib/prism/node.rb#15554
sig { returns(T.nilable(String)) }
def rparen; end
# attr_reader rparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#17845
+ # source://prism//lib/prism/node.rb#15528
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#17894
+ # source://prism//lib/prism/node.rb#15564
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#17904
+ # source://prism//lib/prism/node.rb#15569
def type; end
end
end
# Flags for symbol nodes.
#
-# source://prism//lib/prism/node.rb#19358
+# source://prism//lib/prism/node.rb#16843
module Prism::SymbolFlags; end
# internal bytes forced the encoding to binary
#
-# source://prism//lib/prism/node.rb#19363
+# source://prism//lib/prism/node.rb#16848
Prism::SymbolFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to US-ASCII
#
-# source://prism//lib/prism/node.rb#19366
+# source://prism//lib/prism/node.rb#16851
Prism::SymbolFlags::FORCED_US_ASCII_ENCODING = T.let(T.unsafe(nil), Integer)
# internal bytes forced the encoding to UTF-8
#
-# source://prism//lib/prism/node.rb#19360
+# source://prism//lib/prism/node.rb#16845
Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
# Represents a symbol literal or a symbol contained within a `%i` list.
@@ -31497,93 +31617,95 @@ Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer)
# %i[foo]
# ^^^
#
-# source://prism//lib/prism/node.rb#17927
+# source://prism//lib/prism/node.rb#15592
class Prism::SymbolNode < ::Prism::Node
- # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void
+ # Initialize a new SymbolNode node.
#
# @return [SymbolNode] a new instance of SymbolNode
#
- # source://prism//lib/prism/node.rb#17929
+ # source://prism//lib/prism/node.rb#15594
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
value_loc: T.nilable(Prism::Location),
closing_loc: T.nilable(Prism::Location),
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).void
end
- def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end
+ def initialize(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18084
+ # source://prism//lib/prism/node.rb#15727
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#17941
+ # source://prism//lib/prism/node.rb#15606
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17946
+ # source://prism//lib/prism/node.rb#15611
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#18045
+ # source://prism//lib/prism/node.rb#15706
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#18004
+ # source://prism//lib/prism/node.rb#15680
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#17956
+ # source://prism//lib/prism/node.rb#15621
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#17951
+ # source://prism//lib/prism/node.rb#15616
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String, ?location: Location) -> SymbolNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location?, ?value_loc: Location?, ?closing_loc: Location?, ?unescaped: String) -> SymbolNode
#
- # source://prism//lib/prism/node.rb#17961
+ # source://prism//lib/prism/node.rb#15626
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: T.nilable(Prism::Location),
value_loc: T.nilable(Prism::Location),
closing_loc: T.nilable(Prism::Location),
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).returns(Prism::SymbolNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), value_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#17946
+ # source://prism//lib/prism/node.rb#15611
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String }
#
- # source://prism//lib/prism/node.rb#17969
+ # source://prism//lib/prism/node.rb#15634
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -31594,7 +31716,7 @@ class Prism::SymbolNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18025
+ # source://prism//lib/prism/node.rb#15644
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -31602,7 +31724,7 @@ class Prism::SymbolNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18030
+ # source://prism//lib/prism/node.rb#15649
sig { returns(T::Boolean) }
def forced_us_ascii_encoding?; end
@@ -31610,131 +31732,110 @@ class Prism::SymbolNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18020
+ # source://prism//lib/prism/node.rb#15639
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18050
+ # source://prism//lib/prism/node.rb#15711
sig { override.returns(String) }
def inspect; end
# def opening: () -> String?
#
- # source://prism//lib/prism/node.rb#18035
+ # source://prism//lib/prism/node.rb#15696
sig { returns(T.nilable(String)) }
def opening; end
# attr_reader opening_loc: Location?
#
- # source://prism//lib/prism/node.rb#17978
+ # source://prism//lib/prism/node.rb#15654
sig { returns(T.nilable(Prism::Location)) }
def opening_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#18068
+ # source://prism//lib/prism/node.rb#15716
sig { override.returns(Symbol) }
def type; end
# attr_reader unescaped: String
#
- # source://prism//lib/prism/node.rb#18017
+ # source://prism//lib/prism/node.rb#15693
sig { returns(String) }
def unescaped; end
# def value: () -> String?
#
- # source://prism//lib/prism/node.rb#18040
+ # source://prism//lib/prism/node.rb#15701
sig { returns(T.nilable(String)) }
def value; end
# attr_reader value_loc: Location?
#
- # source://prism//lib/prism/node.rb#17991
+ # source://prism//lib/prism/node.rb#15667
sig { returns(T.nilable(Prism::Location)) }
def value_loc; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#17974
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18078
+ # source://prism//lib/prism/node.rb#15721
def type; end
end
end
# This represents a token from the Ruby source.
#
-# source://prism//lib/prism/parse_result.rb#628
+# source://prism//lib/prism/parse_result.rb#799
class Prism::Token
# Create a new token object with the given type, value, and location.
#
# @return [Token] a new instance of Token
#
- # source://prism//lib/prism/parse_result.rb#640
+ # source://prism//lib/prism/parse_result.rb#811
sig { params(source: Prism::Source, type: Symbol, value: String, location: T.any(Integer, Prism::Location)).void }
def initialize(source, type, value, location); end
# Returns true if the given other token is equal to this token.
#
- # source://prism//lib/prism/parse_result.rb#675
+ # source://prism//lib/prism/parse_result.rb#846
sig { params(other: T.untyped).returns(T::Boolean) }
def ==(other); end
# Implement the hash pattern matching interface for Token.
#
- # source://prism//lib/prism/parse_result.rb#648
+ # source://prism//lib/prism/parse_result.rb#819
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
+ # Returns a string representation of this token.
+ #
+ # source://prism//lib/prism/parse_result.rb#853
+ def inspect; end
+
# A Location object representing the location of this token in the source.
#
- # source://prism//lib/prism/parse_result.rb#653
+ # source://prism//lib/prism/parse_result.rb#824
sig { returns(Prism::Location) }
def location; end
# Implement the pretty print interface for Token.
#
- # source://prism//lib/prism/parse_result.rb#660
+ # source://prism//lib/prism/parse_result.rb#831
sig { params(q: T.untyped).void }
def pretty_print(q); end
# The type of token that this token is.
#
- # source://prism//lib/prism/parse_result.rb#634
+ # source://prism//lib/prism/parse_result.rb#805
sig { returns(Symbol) }
def type; end
# A byteslice of the source that this token represents.
#
- # source://prism//lib/prism/parse_result.rb#637
+ # source://prism//lib/prism/parse_result.rb#808
sig { returns(String) }
def value; end
@@ -31742,7 +31843,7 @@ class Prism::Token
# The Source object that represents the source this token came from.
#
- # source://prism//lib/prism/parse_result.rb#630
+ # source://prism//lib/prism/parse_result.rb#801
sig { returns(Prism::Source) }
def source; end
end
@@ -31758,52 +31859,52 @@ module Prism::Translation; end
# the parser gem, and overrides the parse* methods to parse with prism and
# then translate.
#
-# source://prism//lib/prism/translation/parser.rb#11
+# source://prism//lib/prism/translation/parser.rb#16
class Prism::Translation::Parser < ::Parser::Base
# The default encoding for Ruby files is UTF-8.
#
- # source://prism//lib/prism/translation/parser.rb#36
+ # source://prism//lib/prism/translation/parser.rb#41
def default_encoding; end
# Parses a source buffer and returns the AST.
#
- # source://prism//lib/prism/translation/parser.rb#44
+ # source://prism//lib/prism/translation/parser.rb#49
def parse(source_buffer); end
# Parses a source buffer and returns the AST and the source code comments.
#
- # source://prism//lib/prism/translation/parser.rb#57
+ # source://prism//lib/prism/translation/parser.rb#62
def parse_with_comments(source_buffer); end
# Parses a source buffer and returns the AST, the source code comments,
# and the tokens emitted by the lexer.
#
- # source://prism//lib/prism/translation/parser.rb#74
+ # source://prism//lib/prism/translation/parser.rb#79
def tokenize(source_buffer, recover = T.unsafe(nil)); end
# Since prism resolves num params for us, we don't need to support this
# kind of logic here.
#
- # source://prism//lib/prism/translation/parser.rb#100
+ # source://prism//lib/prism/translation/parser.rb#105
def try_declare_numparam(node); end
- # source://prism//lib/prism/translation/parser.rb#31
+ # source://prism//lib/prism/translation/parser.rb#36
sig { overridable.returns(Integer) }
def version; end
- # source://prism//lib/prism/translation/parser.rb#40
+ # source://prism//lib/prism/translation/parser.rb#45
def yyerror; end
private
# Build the parser gem AST from the prism AST.
#
- # source://prism//lib/prism/translation/parser.rb#258
+ # source://prism//lib/prism/translation/parser.rb#263
def build_ast(program, offset_cache); end
# Build the parser gem comments from the prism comments.
#
- # source://prism//lib/prism/translation/parser.rb#263
+ # source://prism//lib/prism/translation/parser.rb#268
def build_comments(comments, offset_cache); end
# Prism deals with offsets in bytes, while the parser gem deals with
@@ -31814,33 +31915,33 @@ class Prism::Translation::Parser < ::Parser::Base
# just use the offset directly. Otherwise, we build an array where the
# index is the byte offset and the value is the character offset.
#
- # source://prism//lib/prism/translation/parser.rb#241
+ # source://prism//lib/prism/translation/parser.rb#246
def build_offset_cache(source); end
# Build a range from a prism location.
#
- # source://prism//lib/prism/translation/parser.rb#275
+ # source://prism//lib/prism/translation/parser.rb#280
def build_range(location, offset_cache); end
# Build the parser gem tokens from the prism tokens.
#
- # source://prism//lib/prism/translation/parser.rb#270
+ # source://prism//lib/prism/translation/parser.rb#275
def build_tokens(tokens, offset_cache); end
# Converts the version format handled by Parser to the format handled by Prism.
#
- # source://prism//lib/prism/translation/parser.rb#284
+ # source://prism//lib/prism/translation/parser.rb#289
def convert_for_prism(version); end
# Build a diagnostic from the given prism parse error.
#
- # source://prism//lib/prism/translation/parser.rb#119
+ # source://prism//lib/prism/translation/parser.rb#124
def error_diagnostic(error, offset_cache); end
# If there was a error generated during the parse, then raise an
# appropriate syntax error. Otherwise return the result.
#
- # source://prism//lib/prism/translation/parser.rb#219
+ # source://prism//lib/prism/translation/parser.rb#224
def unwrap(result, offset_cache); end
# This is a hook to allow consumers to disable some errors if they don't
@@ -31848,7 +31949,7 @@ class Prism::Translation::Parser < ::Parser::Base
#
# @return [Boolean]
#
- # source://prism//lib/prism/translation/parser.rb#108
+ # source://prism//lib/prism/translation/parser.rb#113
def valid_error?(error); end
# This is a hook to allow consumers to disable some warnings if they don't
@@ -31856,12 +31957,12 @@ class Prism::Translation::Parser < ::Parser::Base
#
# @return [Boolean]
#
- # source://prism//lib/prism/translation/parser.rb#114
+ # source://prism//lib/prism/translation/parser.rb#119
def valid_warning?(warning); end
# Build a diagnostic from the given prism parse warning.
#
- # source://prism//lib/prism/translation/parser.rb#192
+ # source://prism//lib/prism/translation/parser.rb#197
def warning_diagnostic(warning, offset_cache); end
end
@@ -31961,7 +32062,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# foo(bar)
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#101
+ # source://prism//lib/prism/translation/parser/compiler.rb#105
def visit_arguments_node(node); end
# []
@@ -31979,7 +32080,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# { a: 1 }
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#107
+ # source://prism//lib/prism/translation/parser/compiler.rb#111
def visit_assoc_node(node); end
# def foo(**); bar(**); end
@@ -31988,49 +32089,49 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# { **foo }
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#148
+ # source://prism//lib/prism/translation/parser/compiler.rb#160
def visit_assoc_splat_node(node); end
# $+
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#158
+ # source://prism//lib/prism/translation/parser/compiler.rb#172
def visit_back_reference_read_node(node); end
# begin end
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#164
+ # source://prism//lib/prism/translation/parser/compiler.rb#178
def visit_begin_node(node); end
# foo(&bar)
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#202
+ # source://prism//lib/prism/translation/parser/compiler.rb#216
def visit_block_argument_node(node); end
# foo { |; bar| }
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#208
+ # source://prism//lib/prism/translation/parser/compiler.rb#222
def visit_block_local_variable_node(node); end
# A block on a keyword or method call.
#
# @raise [CompilationError]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#213
+ # source://prism//lib/prism/translation/parser/compiler.rb#227
def visit_block_node(node); end
# def foo(&bar); end
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#219
+ # source://prism//lib/prism/translation/parser/compiler.rb#233
def visit_block_parameter_node(node); end
# A block's parameters.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#224
+ # source://prism//lib/prism/translation/parser/compiler.rb#238
def visit_block_parameters_node(node); end
# break
@@ -32039,13 +32140,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# break foo
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#233
+ # source://prism//lib/prism/translation/parser/compiler.rb#247
def visit_break_node(node); end
# foo.bar &&= baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#338
+ # source://prism//lib/prism/translation/parser/compiler.rb#352
def visit_call_and_write_node(node); end
# foo
@@ -32057,133 +32158,133 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# foo.bar() {}
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#245
+ # source://prism//lib/prism/translation/parser/compiler.rb#259
def visit_call_node(node); end
# foo.bar += baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#319
+ # source://prism//lib/prism/translation/parser/compiler.rb#333
def visit_call_operator_write_node(node); end
# foo.bar ||= baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#357
+ # source://prism//lib/prism/translation/parser/compiler.rb#371
def visit_call_or_write_node(node); end
# foo.bar, = 1
# ^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#376
+ # source://prism//lib/prism/translation/parser/compiler.rb#390
def visit_call_target_node(node); end
# foo => bar => baz
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#388
+ # source://prism//lib/prism/translation/parser/compiler.rb#402
def visit_capture_pattern_node(node); end
# case foo; in bar; end
# ^^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#407
+ # source://prism//lib/prism/translation/parser/compiler.rb#421
def visit_case_match_node(node); end
# case foo; when bar; end
# ^^^^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#394
+ # source://prism//lib/prism/translation/parser/compiler.rb#408
def visit_case_node(node); end
# class Foo; end
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#420
+ # source://prism//lib/prism/translation/parser/compiler.rb#434
def visit_class_node(node); end
# @@foo &&= bar
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#459
+ # source://prism//lib/prism/translation/parser/compiler.rb#473
def visit_class_variable_and_write_node(node); end
# @@foo += bar
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#449
+ # source://prism//lib/prism/translation/parser/compiler.rb#463
def visit_class_variable_operator_write_node(node); end
# @@foo ||= bar
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#469
+ # source://prism//lib/prism/translation/parser/compiler.rb#483
def visit_class_variable_or_write_node(node); end
# @@foo
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#433
+ # source://prism//lib/prism/translation/parser/compiler.rb#447
def visit_class_variable_read_node(node); end
# @@foo, = bar
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#479
+ # source://prism//lib/prism/translation/parser/compiler.rb#493
def visit_class_variable_target_node(node); end
# @@foo = 1
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#439
+ # source://prism//lib/prism/translation/parser/compiler.rb#453
def visit_class_variable_write_node(node); end
# Foo &&= bar
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#510
+ # source://prism//lib/prism/translation/parser/compiler.rb#524
def visit_constant_and_write_node(node); end
# Foo += bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#500
+ # source://prism//lib/prism/translation/parser/compiler.rb#514
def visit_constant_operator_write_node(node); end
# Foo ||= bar
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#520
+ # source://prism//lib/prism/translation/parser/compiler.rb#534
def visit_constant_or_write_node(node); end
# Foo::Bar &&= baz
# ^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#576
+ # source://prism//lib/prism/translation/parser/compiler.rb#590
def visit_constant_path_and_write_node(node); end
# Foo::Bar
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#536
+ # source://prism//lib/prism/translation/parser/compiler.rb#550
def visit_constant_path_node(node); end
# Foo::Bar += baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#566
+ # source://prism//lib/prism/translation/parser/compiler.rb#580
def visit_constant_path_operator_write_node(node); end
# Foo::Bar ||= baz
# ^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#586
+ # source://prism//lib/prism/translation/parser/compiler.rb#600
def visit_constant_path_or_write_node(node); end
# Foo::Bar, = baz
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#596
+ # source://prism//lib/prism/translation/parser/compiler.rb#610
def visit_constant_path_target_node(node); end
# Foo::Bar = 1
@@ -32192,19 +32293,19 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# Foo::Foo, Bar::Bar = 1
# ^^^^^^^^ ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#556
+ # source://prism//lib/prism/translation/parser/compiler.rb#570
def visit_constant_path_write_node(node); end
# Foo
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#485
+ # source://prism//lib/prism/translation/parser/compiler.rb#499
def visit_constant_read_node(node); end
# Foo, = bar
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#530
+ # source://prism//lib/prism/translation/parser/compiler.rb#544
def visit_constant_target_node(node); end
# Foo = 1
@@ -32213,7 +32314,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# Foo, Bar = 1
# ^^^ ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#494
+ # source://prism//lib/prism/translation/parser/compiler.rb#508
def visit_constant_write_node(node); end
# def foo; end
@@ -32222,7 +32323,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# def self.foo; end
# ^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#605
+ # source://prism//lib/prism/translation/parser/compiler.rb#619
def visit_def_node(node); end
# defined? a
@@ -32231,25 +32332,25 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# defined?(a)
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#652
+ # source://prism//lib/prism/translation/parser/compiler.rb#666
def visit_defined_node(node); end
# if foo then bar else baz end
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#664
+ # source://prism//lib/prism/translation/parser/compiler.rb#678
def visit_else_node(node); end
# "foo #{bar}"
# ^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#670
+ # source://prism//lib/prism/translation/parser/compiler.rb#684
def visit_embedded_statements_node(node); end
# "foo #@bar"
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#680
+ # source://prism//lib/prism/translation/parser/compiler.rb#694
def visit_embedded_variable_node(node); end
# begin; foo; ensure; bar; end
@@ -32257,19 +32358,19 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
#
# @raise [CompilationError]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#686
+ # source://prism//lib/prism/translation/parser/compiler.rb#700
def visit_ensure_node(node); end
# false
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#692
+ # source://prism//lib/prism/translation/parser/compiler.rb#706
def visit_false_node(node); end
# foo => [*, bar, *]
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#698
+ # source://prism//lib/prism/translation/parser/compiler.rb#712
def visit_find_pattern_node(node); end
# 0..5
@@ -32277,31 +32378,31 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# if foo .. bar; end
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1494
+ # source://prism//lib/prism/translation/parser/compiler.rb#1475
def visit_flip_flop_node(node); end
# 1.0
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#710
+ # source://prism//lib/prism/translation/parser/compiler.rb#724
def visit_float_node(node); end
# for foo in bar do end
# ^^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#716
+ # source://prism//lib/prism/translation/parser/compiler.rb#730
def visit_for_node(node); end
# def foo(...); bar(...); end
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#734
+ # source://prism//lib/prism/translation/parser/compiler.rb#748
def visit_forwarding_arguments_node(node); end
# def foo(...); end
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#740
+ # source://prism//lib/prism/translation/parser/compiler.rb#754
def visit_forwarding_parameter_node(node); end
# super
@@ -32310,55 +32411,55 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# super {}
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#749
+ # source://prism//lib/prism/translation/parser/compiler.rb#763
def visit_forwarding_super_node(node); end
# $foo &&= bar
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#787
+ # source://prism//lib/prism/translation/parser/compiler.rb#801
def visit_global_variable_and_write_node(node); end
# $foo += bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#777
+ # source://prism//lib/prism/translation/parser/compiler.rb#791
def visit_global_variable_operator_write_node(node); end
# $foo ||= bar
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#797
+ # source://prism//lib/prism/translation/parser/compiler.rb#811
def visit_global_variable_or_write_node(node); end
# $foo
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#761
+ # source://prism//lib/prism/translation/parser/compiler.rb#775
def visit_global_variable_read_node(node); end
# $foo, = bar
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#807
+ # source://prism//lib/prism/translation/parser/compiler.rb#821
def visit_global_variable_target_node(node); end
# $foo = 1
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#767
+ # source://prism//lib/prism/translation/parser/compiler.rb#781
def visit_global_variable_write_node(node); end
# {}
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#813
+ # source://prism//lib/prism/translation/parser/compiler.rb#827
def visit_hash_node(node); end
# foo => {}
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#823
+ # source://prism//lib/prism/translation/parser/compiler.rb#837
def visit_hash_pattern_node(node); end
# if foo then bar end
@@ -32370,13 +32471,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# foo ? bar : baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#841
+ # source://prism//lib/prism/translation/parser/compiler.rb#855
def visit_if_node(node); end
# 1i
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#883
+ # source://prism//lib/prism/translation/parser/compiler.rb#897
def visit_imaginary_node(node); end
# { foo: }
@@ -32384,7 +32485,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
#
# @raise [CompilationError]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#889
+ # source://prism//lib/prism/translation/parser/compiler.rb#903
def visit_implicit_node(node); end
# foo { |bar,| }
@@ -32392,74 +32493,74 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
#
# @raise [CompilationError]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#895
+ # source://prism//lib/prism/translation/parser/compiler.rb#909
def visit_implicit_rest_node(node); end
# case foo; in bar; end
# ^^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#901
+ # source://prism//lib/prism/translation/parser/compiler.rb#915
def visit_in_node(node); end
# foo[bar] &&= baz
# ^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#945
+ # source://prism//lib/prism/translation/parser/compiler.rb#959
def visit_index_and_write_node(node); end
# foo[bar] += baz
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#927
+ # source://prism//lib/prism/translation/parser/compiler.rb#941
def visit_index_operator_write_node(node); end
# foo[bar] ||= baz
# ^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#963
+ # source://prism//lib/prism/translation/parser/compiler.rb#977
def visit_index_or_write_node(node); end
# foo[bar], = 1
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#981
+ # source://prism//lib/prism/translation/parser/compiler.rb#995
def visit_index_target_node(node); end
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1018
+ # source://prism//lib/prism/translation/parser/compiler.rb#1032
def visit_instance_variable_and_write_node(node); end
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1008
+ # source://prism//lib/prism/translation/parser/compiler.rb#1022
def visit_instance_variable_operator_write_node(node); end
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1028
+ # source://prism//lib/prism/translation/parser/compiler.rb#1042
def visit_instance_variable_or_write_node(node); end
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#992
+ # source://prism//lib/prism/translation/parser/compiler.rb#1006
def visit_instance_variable_read_node(node); end
# @foo, = bar
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1038
+ # source://prism//lib/prism/translation/parser/compiler.rb#1052
def visit_instance_variable_target_node(node); end
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#998
+ # source://prism//lib/prism/translation/parser/compiler.rb#1012
def visit_instance_variable_write_node(node); end
# 1
# ^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1044
+ # source://prism//lib/prism/translation/parser/compiler.rb#1058
def visit_integer_node(node); end
# /foo #{bar}/
@@ -32467,43 +32568,49 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# if /foo #{bar}/ then end
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1050
+ # source://prism//lib/prism/translation/parser/compiler.rb#1064
def visit_interpolated_match_last_line_node(node); end
# /foo #{bar}/
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1050
+ # source://prism//lib/prism/translation/parser/compiler.rb#1064
def visit_interpolated_regular_expression_node(node); end
# "foo #{bar}"
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1065
+ # source://prism//lib/prism/translation/parser/compiler.rb#1079
def visit_interpolated_string_node(node); end
# :"foo #{bar}"
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1128
+ # source://prism//lib/prism/translation/parser/compiler.rb#1113
def visit_interpolated_symbol_node(node); end
# `foo #{bar}`
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1138
+ # source://prism//lib/prism/translation/parser/compiler.rb#1123
def visit_interpolated_x_string_node(node); end
+ # -> { it }
+ # ^^
+ #
+ # source://prism//lib/prism/translation/parser/compiler.rb#1137
+ def visit_it_local_variable_read_node(node); end
+
# -> { it }
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1153
+ # source://prism//lib/prism/translation/parser/compiler.rb#1143
def visit_it_parameters_node(node); end
# foo(bar: baz)
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1159
+ # source://prism//lib/prism/translation/parser/compiler.rb#1149
def visit_keyword_hash_node(node); end
# def foo(**bar); end
@@ -32512,49 +32619,49 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# def foo(**); end
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1168
+ # source://prism//lib/prism/translation/parser/compiler.rb#1158
def visit_keyword_rest_parameter_node(node); end
# -> {}
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1177
+ # source://prism//lib/prism/translation/parser/compiler.rb#1167
def visit_lambda_node(node); end
# foo &&= bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1236
+ # source://prism//lib/prism/translation/parser/compiler.rb#1219
def visit_local_variable_and_write_node(node); end
# foo += bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1226
+ # source://prism//lib/prism/translation/parser/compiler.rb#1209
def visit_local_variable_operator_write_node(node); end
# foo ||= bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1246
+ # source://prism//lib/prism/translation/parser/compiler.rb#1229
def visit_local_variable_or_write_node(node); end
# foo
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1203
+ # source://prism//lib/prism/translation/parser/compiler.rb#1193
def visit_local_variable_read_node(node); end
# foo, = bar
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1256
+ # source://prism//lib/prism/translation/parser/compiler.rb#1239
def visit_local_variable_target_node(node); end
# foo = 1
# ^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1216
+ # source://prism//lib/prism/translation/parser/compiler.rb#1199
def visit_local_variable_write_node(node); end
# /foo/
@@ -32562,50 +32669,50 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# if /foo/ then end
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1528
+ # source://prism//lib/prism/translation/parser/compiler.rb#1509
def visit_match_last_line_node(node); end
# foo in bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1266
+ # source://prism//lib/prism/translation/parser/compiler.rb#1249
def visit_match_predicate_node(node); end
# foo => bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1276
+ # source://prism//lib/prism/translation/parser/compiler.rb#1259
def visit_match_required_node(node); end
# /(?foo)/ =~ bar
# ^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1286
+ # source://prism//lib/prism/translation/parser/compiler.rb#1269
def visit_match_write_node(node); end
# A node that is missing from the syntax tree. This is only used in the
# case of a syntax error. The parser gem doesn't have such a concept, so
# we invent our own here.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1297
+ # source://prism//lib/prism/translation/parser/compiler.rb#1280
def visit_missing_node(node); end
# module Foo; end
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1303
+ # source://prism//lib/prism/translation/parser/compiler.rb#1286
def visit_module_node(node); end
# foo, bar = baz
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1314
+ # source://prism//lib/prism/translation/parser/compiler.rb#1297
def visit_multi_target_node(node); end
# foo, bar = baz
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1328
+ # source://prism//lib/prism/translation/parser/compiler.rb#1307
def visit_multi_write_node(node); end
# next
@@ -32614,55 +32721,55 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# next foo
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1349
+ # source://prism//lib/prism/translation/parser/compiler.rb#1330
def visit_next_node(node); end
# nil
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1361
+ # source://prism//lib/prism/translation/parser/compiler.rb#1342
def visit_nil_node(node); end
# def foo(**nil); end
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1367
+ # source://prism//lib/prism/translation/parser/compiler.rb#1348
def visit_no_keywords_parameter_node(node); end
# -> { _1 + _2 }
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1377
+ # source://prism//lib/prism/translation/parser/compiler.rb#1358
def visit_numbered_parameters_node(node); end
# $1
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1383
+ # source://prism//lib/prism/translation/parser/compiler.rb#1364
def visit_numbered_reference_read_node(node); end
# def foo(bar: baz); end
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1389
+ # source://prism//lib/prism/translation/parser/compiler.rb#1370
def visit_optional_keyword_parameter_node(node); end
# def foo(bar = 1); end
# ^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1395
+ # source://prism//lib/prism/translation/parser/compiler.rb#1376
def visit_optional_parameter_node(node); end
# a or b
# ^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1401
+ # source://prism//lib/prism/translation/parser/compiler.rb#1382
def visit_or_node(node); end
# def foo(bar, *baz); end
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1407
+ # source://prism//lib/prism/translation/parser/compiler.rb#1388
def visit_parameters_node(node); end
# ()
@@ -32671,76 +32778,76 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# (1)
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1446
+ # source://prism//lib/prism/translation/parser/compiler.rb#1427
def visit_parentheses_node(node); end
# foo => ^(bar)
# ^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1456
+ # source://prism//lib/prism/translation/parser/compiler.rb#1437
def visit_pinned_expression_node(node); end
# foo = 1 and bar => ^foo
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1463
+ # source://prism//lib/prism/translation/parser/compiler.rb#1444
def visit_pinned_variable_node(node); end
# END {}
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1468
+ # source://prism//lib/prism/translation/parser/compiler.rb#1449
def visit_post_execution_node(node); end
# BEGIN {}
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1478
+ # source://prism//lib/prism/translation/parser/compiler.rb#1459
def visit_pre_execution_node(node); end
# The top-level program node.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1488
+ # source://prism//lib/prism/translation/parser/compiler.rb#1469
def visit_program_node(node); end
# 0..5
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1494
+ # source://prism//lib/prism/translation/parser/compiler.rb#1475
def visit_range_node(node); end
# 1r
# ^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1516
+ # source://prism//lib/prism/translation/parser/compiler.rb#1497
def visit_rational_node(node); end
# redo
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1522
+ # source://prism//lib/prism/translation/parser/compiler.rb#1503
def visit_redo_node(node); end
# /foo/
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1528
+ # source://prism//lib/prism/translation/parser/compiler.rb#1509
def visit_regular_expression_node(node); end
# def foo(bar:); end
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1543
+ # source://prism//lib/prism/translation/parser/compiler.rb#1535
def visit_required_keyword_parameter_node(node); end
# def foo(bar); end
# ^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1549
+ # source://prism//lib/prism/translation/parser/compiler.rb#1541
def visit_required_parameter_node(node); end
# foo rescue bar
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1555
+ # source://prism//lib/prism/translation/parser/compiler.rb#1547
def visit_rescue_modifier_node(node); end
# begin; rescue; end
@@ -32748,7 +32855,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
#
# @raise [CompilationError]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1573
+ # source://prism//lib/prism/translation/parser/compiler.rb#1565
def visit_rescue_node(node); end
# def foo(*bar); end
@@ -32757,13 +32864,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# def foo(*); end
# ^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1582
+ # source://prism//lib/prism/translation/parser/compiler.rb#1574
def visit_rest_parameter_node(node); end
# retry
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1588
+ # source://prism//lib/prism/translation/parser/compiler.rb#1580
def visit_retry_node(node); end
# return
@@ -32772,42 +32879,42 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# return 1
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1597
+ # source://prism//lib/prism/translation/parser/compiler.rb#1589
def visit_return_node(node); end
# self
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1609
+ # source://prism//lib/prism/translation/parser/compiler.rb#1601
def visit_self_node(node); end
# A shareable constant.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1614
+ # source://prism//lib/prism/translation/parser/compiler.rb#1606
def visit_shareable_constant_node(node); end
# class << self; end
# ^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1620
+ # source://prism//lib/prism/translation/parser/compiler.rb#1612
def visit_singleton_class_node(node); end
# __ENCODING__
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1632
+ # source://prism//lib/prism/translation/parser/compiler.rb#1624
def visit_source_encoding_node(node); end
# __FILE__
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1638
+ # source://prism//lib/prism/translation/parser/compiler.rb#1630
def visit_source_file_node(node); end
# __LINE__
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1644
+ # source://prism//lib/prism/translation/parser/compiler.rb#1636
def visit_source_line_node(node); end
# foo(*bar)
@@ -32819,42 +32926,42 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# def foo(*); bar(*); end
# ^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1656
+ # source://prism//lib/prism/translation/parser/compiler.rb#1648
def visit_splat_node(node); end
# A list of statements.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1669
+ # source://prism//lib/prism/translation/parser/compiler.rb#1661
def visit_statements_node(node); end
# "foo"
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1675
+ # source://prism//lib/prism/translation/parser/compiler.rb#1667
def visit_string_node(node); end
# super(foo)
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1716
+ # source://prism//lib/prism/translation/parser/compiler.rb#1709
def visit_super_node(node); end
# :foo
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1739
+ # source://prism//lib/prism/translation/parser/compiler.rb#1732
def visit_symbol_node(node); end
# true
# ^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1771
+ # source://prism//lib/prism/translation/parser/compiler.rb#1764
def visit_true_node(node); end
# undef foo
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1777
+ # source://prism//lib/prism/translation/parser/compiler.rb#1770
def visit_undef_node(node); end
# unless foo; bar end
@@ -32863,7 +32970,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# bar unless foo
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1786
+ # source://prism//lib/prism/translation/parser/compiler.rb#1779
def visit_unless_node(node); end
# until foo; bar end
@@ -32872,13 +32979,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# bar until foo
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1816
+ # source://prism//lib/prism/translation/parser/compiler.rb#1809
def visit_until_node(node); end
# case foo; when bar; end
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1838
+ # source://prism//lib/prism/translation/parser/compiler.rb#1831
def visit_when_node(node); end
# while foo; bar end
@@ -32887,13 +32994,13 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# bar while foo
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1856
+ # source://prism//lib/prism/translation/parser/compiler.rb#1849
def visit_while_node(node); end
# `foo`
# ^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1878
+ # source://prism//lib/prism/translation/parser/compiler.rb#1871
def visit_x_string_node(node); end
# yield
@@ -32902,29 +33009,34 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# yield 1
# ^^^^^^^
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1910
+ # source://prism//lib/prism/translation/parser/compiler.rb#1902
def visit_yield_node(node); end
private
+ # The parser gem automatically converts \r\n to \n, meaning our offsets
+ # need to be adjusted to always subtract 1 from the length.
+ #
+ # source://prism//lib/prism/translation/parser/compiler.rb#2045
+ def chomped_bytesize(line); end
+
# Initialize a new compiler with the given option overrides, used to
# visit a subtree with the given options.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1924
+ # source://prism//lib/prism/translation/parser/compiler.rb#1916
def copy_compiler(forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end
# When *, **, &, or ... are used as an argument in a method call, we
# check if they were allowed by the current context. To determine that
# we build this lookup table.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1931
+ # source://prism//lib/prism/translation/parser/compiler.rb#1923
def find_forwarding(node); end
- # Because we have mutated the AST to allow for newlines in the middle of
- # a rational, we need to manually handle the value here.
+ # Returns the set of targets for a MultiTargetNode or a MultiWriteNode.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1945
- def imaginary_value(node); end
+ # source://prism//lib/prism/translation/parser/compiler.rb#1936
+ def multi_target_elements(node); end
# Negate the value of a numeric node. This is a special case where you
# have a negative sign on one line and then a number on the next line.
@@ -32932,7 +33044,7 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# however, marks this as a numeric literal. We have to massage the tree
# here to get it into the correct form.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1954
+ # source://prism//lib/prism/translation/parser/compiler.rb#1948
def numeric_negate(message_loc, receiver); end
# Blocks can have a special set of parameters that automatically expand
@@ -32941,18 +33053,12 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
#
# @return [Boolean]
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1966
+ # source://prism//lib/prism/translation/parser/compiler.rb#1962
def procarg0?(parameters); end
- # Because we have mutated the AST to allow for newlines in the middle of
- # a rational, we need to manually handle the value here.
- #
- # source://prism//lib/prism/translation/parser/compiler.rb#1979
- def rational_value(node); end
-
# Constructs a new source range from the given start and end offsets.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1993
+ # source://prism//lib/prism/translation/parser/compiler.rb#1979
def srange(location); end
# Constructs a new source range by finding the given tokens between the
@@ -32962,37 +33068,37 @@ class Prism::Translation::Parser::Compiler < ::Prism::Compiler
# Note that end_offset is allowed to be nil, in which case this will
# search until the end of the string.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2008
+ # source://prism//lib/prism/translation/parser/compiler.rb#1994
def srange_find(start_offset, end_offset, tokens); end
# Constructs a new source range from the given start and end offsets.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#1998
+ # source://prism//lib/prism/translation/parser/compiler.rb#1984
def srange_offsets(start_offset, end_offset); end
# Transform a location into a token that the parser gem expects.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2018
+ # source://prism//lib/prism/translation/parser/compiler.rb#2004
def token(location); end
# Visit a block node on a call.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2023
+ # source://prism//lib/prism/translation/parser/compiler.rb#2009
def visit_block(call, block); end
# Visit a heredoc that can be either a string or an xstring.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2057
+ # source://prism//lib/prism/translation/parser/compiler.rb#2051
def visit_heredoc(node); end
# Visit a numeric node and account for the optional sign.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2103
+ # source://prism//lib/prism/translation/parser/compiler.rb#2123
def visit_numeric(node, value); end
# Within the given block, track that we're within a pattern.
#
- # source://prism//lib/prism/translation/parser/compiler.rb#2115
+ # source://prism//lib/prism/translation/parser/compiler.rb#2135
def within_pattern; end
end
@@ -33005,10 +33111,10 @@ class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError;
# store a reference to its constant to make it slightly faster to look
# up.
#
-# source://prism//lib/prism/translation/parser/compiler.rb#1990
+# source://prism//lib/prism/translation/parser/compiler.rb#1976
Prism::Translation::Parser::Compiler::Range = Parser::Source::Range
-# source://prism//lib/prism/translation/parser.rb#12
+# source://prism//lib/prism/translation/parser.rb#17
Prism::Translation::Parser::Diagnostic = Parser::Diagnostic
# Accepts a list of prism tokens and converts them into the expected
@@ -33021,50 +33127,50 @@ class Prism::Translation::Parser::Lexer
#
# @return [Lexer] a new instance of Lexer
#
- # source://prism//lib/prism/translation/parser/lexer.rb#204
+ # source://prism//lib/prism/translation/parser/lexer.rb#217
def initialize(source_buffer, lexed, offset_cache); end
# An array of tuples that contain prism tokens and their associated lex
# state when they were lexed.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#197
+ # source://prism//lib/prism/translation/parser/lexer.rb#210
def lexed; end
# A hash that maps offsets in bytes to offsets in characters.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#200
+ # source://prism//lib/prism/translation/parser/lexer.rb#213
def offset_cache; end
# The Parser::Source::Buffer that the tokens were lexed from.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#193
+ # source://prism//lib/prism/translation/parser/lexer.rb#206
def source_buffer; end
# Convert the prism tokens into the expected format for the parser gem.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#214
+ # source://prism//lib/prism/translation/parser/lexer.rb#227
def to_a; end
private
# Parse a complex from the string representation.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#387
+ # source://prism//lib/prism/translation/parser/lexer.rb#409
def parse_complex(value); end
# Parse a float from the string representation.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#380
+ # source://prism//lib/prism/translation/parser/lexer.rb#402
def parse_float(value); end
# Parse an integer from the string representation.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#373
+ # source://prism//lib/prism/translation/parser/lexer.rb#395
def parse_integer(value); end
# Parse a rational from the string representation.
#
- # source://prism//lib/prism/translation/parser/lexer.rb#402
+ # source://prism//lib/prism/translation/parser/lexer.rb#424
def parse_rational(value); end
end
@@ -33082,7 +33188,21 @@ Prism::Translation::Parser::Lexer::EXPR_BEG = T.let(T.unsafe(nil), Integer)
# source://prism//lib/prism/translation/parser/lexer.rb#188
Prism::Translation::Parser::Lexer::EXPR_LABEL = T.let(T.unsafe(nil), Integer)
-# source://prism//lib/prism/translation/parser/lexer.rb#210
+# It is used to determine whether `do` is of the token type `kDO` or `kDO_LAMBDA`.
+#
+# NOTE: In edge cases like `-> (foo = -> (bar) {}) do end`, please note that `kDO` is still returned
+# instead of `kDO_LAMBDA`, which is expected: https://github.com/ruby/prism/pull/3046
+#
+# source://prism//lib/prism/translation/parser/lexer.rb#194
+Prism::Translation::Parser::Lexer::LAMBDA_TOKEN_TYPES = T.let(T.unsafe(nil), Array)
+
+# The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem.
+# The following token types are listed as those classified as `tLPAREN`.
+#
+# source://prism//lib/prism/translation/parser/lexer.rb#198
+Prism::Translation::Parser::Lexer::LPAREN_CONVERSION_TOKEN_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://prism//lib/prism/translation/parser/lexer.rb#223
Prism::Translation::Parser::Lexer::Range = Parser::Source::Range
# The direct translating of types between the two lexers.
@@ -33094,22 +33214,22 @@ Prism::Translation::Parser::Lexer::TYPES = T.let(T.unsafe(nil), Hash)
# messages. We create our own diagnostic class in order to set our own
# error messages.
#
-# source://prism//lib/prism/translation/parser.rb#18
+# source://prism//lib/prism/translation/parser.rb#23
class Prism::Translation::Parser::PrismDiagnostic < ::Parser::Diagnostic
# Initialize a new diagnostic with the given message and location.
#
# @return [PrismDiagnostic] a new instance of PrismDiagnostic
#
- # source://prism//lib/prism/translation/parser.rb#23
+ # source://prism//lib/prism/translation/parser.rb#28
def initialize(message, level, reason, location); end
# This is the cached message coming from prism.
#
- # source://prism//lib/prism/translation/parser.rb#20
+ # source://prism//lib/prism/translation/parser.rb#25
def message; end
end
-# source://prism//lib/prism/translation/parser.rb#29
+# source://prism//lib/prism/translation/parser.rb#34
Prism::Translation::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass)
# This class provides a compatibility layer between prism and Ripper. It
@@ -33745,15 +33865,21 @@ class Prism::Translation::Ripper < ::Prism::Compiler
def visit_interpolated_x_string_node(node); end
# -> { it }
- # ^^^^^^^^^
+ # ^^
#
# source://prism//lib/prism/translation/ripper.rb#2222
+ def visit_it_local_variable_read_node(node); end
+
+ # -> { it }
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ripper.rb#2229
def visit_it_parameters_node(node); end
# foo(bar: baz)
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2227
+ # source://prism//lib/prism/translation/ripper.rb#2234
def visit_keyword_hash_node(node); end
# def foo(**bar); end
@@ -33762,96 +33888,96 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# def foo(**); end
# ^^
#
- # source://prism//lib/prism/translation/ripper.rb#2239
+ # source://prism//lib/prism/translation/ripper.rb#2246
def visit_keyword_rest_parameter_node(node); end
# -> {}
#
- # source://prism//lib/prism/translation/ripper.rb#2253
+ # source://prism//lib/prism/translation/ripper.rb#2260
def visit_lambda_node(node); end
# foo &&= bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2350
+ # source://prism//lib/prism/translation/ripper.rb#2352
def visit_local_variable_and_write_node(node); end
# foo += bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2336
+ # source://prism//lib/prism/translation/ripper.rb#2338
def visit_local_variable_operator_write_node(node); end
# foo ||= bar
# ^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2364
+ # source://prism//lib/prism/translation/ripper.rb#2366
def visit_local_variable_or_write_node(node); end
# foo
# ^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2313
+ # source://prism//lib/prism/translation/ripper.rb#2320
def visit_local_variable_read_node(node); end
# foo, = bar
# ^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2378
+ # source://prism//lib/prism/translation/ripper.rb#2380
def visit_local_variable_target_node(node); end
# foo = 1
# ^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2325
+ # source://prism//lib/prism/translation/ripper.rb#2327
def visit_local_variable_write_node(node); end
# if /foo/ then end
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2385
+ # source://prism//lib/prism/translation/ripper.rb#2387
def visit_match_last_line_node(node); end
# foo in bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2400
+ # source://prism//lib/prism/translation/ripper.rb#2402
def visit_match_predicate_node(node); end
# foo => bar
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2409
+ # source://prism//lib/prism/translation/ripper.rb#2411
def visit_match_required_node(node); end
# /(?foo)/ =~ bar
# ^^^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2418
+ # source://prism//lib/prism/translation/ripper.rb#2420
def visit_match_write_node(node); end
# A node that is missing from the syntax tree. This is only used in the
# case of a syntax error.
#
- # source://prism//lib/prism/translation/ripper.rb#2424
+ # source://prism//lib/prism/translation/ripper.rb#2426
def visit_missing_node(node); end
# module Foo; end
# ^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2430
+ # source://prism//lib/prism/translation/ripper.rb#2432
def visit_module_node(node); end
# (foo, bar), bar = qux
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2447
+ # source://prism//lib/prism/translation/ripper.rb#2449
def visit_multi_target_node(node); end
# foo, bar = baz
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2501
+ # source://prism//lib/prism/translation/ripper.rb#2503
def visit_multi_write_node(node); end
# next
@@ -33860,55 +33986,55 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# next foo
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2521
+ # source://prism//lib/prism/translation/ripper.rb#2523
def visit_next_node(node); end
# nil
# ^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2535
+ # source://prism//lib/prism/translation/ripper.rb#2537
def visit_nil_node(node); end
# def foo(**nil); end
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2542
+ # source://prism//lib/prism/translation/ripper.rb#2544
def visit_no_keywords_parameter_node(node); end
# -> { _1 + _2 }
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2551
+ # source://prism//lib/prism/translation/ripper.rb#2553
def visit_numbered_parameters_node(node); end
# $1
# ^^
#
- # source://prism//lib/prism/translation/ripper.rb#2556
+ # source://prism//lib/prism/translation/ripper.rb#2558
def visit_numbered_reference_read_node(node); end
# def foo(bar: baz); end
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2563
+ # source://prism//lib/prism/translation/ripper.rb#2565
def visit_optional_keyword_parameter_node(node); end
# def foo(bar = 1); end
# ^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2573
+ # source://prism//lib/prism/translation/ripper.rb#2575
def visit_optional_parameter_node(node); end
# a or b
# ^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2583
+ # source://prism//lib/prism/translation/ripper.rb#2585
def visit_or_node(node); end
# def foo(bar, *baz); end
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2593
+ # source://prism//lib/prism/translation/ripper.rb#2595
def visit_parameters_node(node); end
# ()
@@ -33917,84 +34043,84 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# (1)
# ^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2620
+ # source://prism//lib/prism/translation/ripper.rb#2622
def visit_parentheses_node(node); end
# foo => ^(bar)
# ^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2634
+ # source://prism//lib/prism/translation/ripper.rb#2636
def visit_pinned_expression_node(node); end
# foo = 1 and bar => ^foo
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2643
+ # source://prism//lib/prism/translation/ripper.rb#2645
def visit_pinned_variable_node(node); end
# END {}
# ^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2649
+ # source://prism//lib/prism/translation/ripper.rb#2651
def visit_post_execution_node(node); end
# BEGIN {}
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2664
+ # source://prism//lib/prism/translation/ripper.rb#2666
def visit_pre_execution_node(node); end
# The top-level program node.
#
- # source://prism//lib/prism/translation/ripper.rb#2678
+ # source://prism//lib/prism/translation/ripper.rb#2680
def visit_program_node(node); end
# 0..5
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2689
+ # source://prism//lib/prism/translation/ripper.rb#2691
def visit_range_node(node); end
# 1r
# ^^
#
- # source://prism//lib/prism/translation/ripper.rb#2703
+ # source://prism//lib/prism/translation/ripper.rb#2705
def visit_rational_node(node); end
# redo
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2709
+ # source://prism//lib/prism/translation/ripper.rb#2711
def visit_redo_node(node); end
# /foo/
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2716
+ # source://prism//lib/prism/translation/ripper.rb#2718
def visit_regular_expression_node(node); end
# def foo(bar:); end
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2738
+ # source://prism//lib/prism/translation/ripper.rb#2740
def visit_required_keyword_parameter_node(node); end
# def foo(bar); end
# ^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2745
+ # source://prism//lib/prism/translation/ripper.rb#2747
def visit_required_parameter_node(node); end
# foo rescue bar
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2752
+ # source://prism//lib/prism/translation/ripper.rb#2754
def visit_rescue_modifier_node(node); end
# begin; rescue; end
# ^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2762
+ # source://prism//lib/prism/translation/ripper.rb#2764
def visit_rescue_node(node); end
# def foo(*bar); end
@@ -34003,13 +34129,13 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# def foo(*); end
# ^
#
- # source://prism//lib/prism/translation/ripper.rb#2820
+ # source://prism//lib/prism/translation/ripper.rb#2822
def visit_rest_parameter_node(node); end
# retry
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2832
+ # source://prism//lib/prism/translation/ripper.rb#2834
def visit_retry_node(node); end
# return
@@ -34018,42 +34144,42 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# return 1
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2842
+ # source://prism//lib/prism/translation/ripper.rb#2844
def visit_return_node(node); end
# self
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2856
+ # source://prism//lib/prism/translation/ripper.rb#2858
def visit_self_node(node); end
# A shareable constant.
#
- # source://prism//lib/prism/translation/ripper.rb#2862
+ # source://prism//lib/prism/translation/ripper.rb#2864
def visit_shareable_constant_node(node); end
# class << self; end
# ^^^^^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2868
+ # source://prism//lib/prism/translation/ripper.rb#2870
def visit_singleton_class_node(node); end
# __ENCODING__
# ^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2878
+ # source://prism//lib/prism/translation/ripper.rb#2880
def visit_source_encoding_node(node); end
# __FILE__
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2885
+ # source://prism//lib/prism/translation/ripper.rb#2887
def visit_source_file_node(node); end
# __LINE__
# ^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2892
+ # source://prism//lib/prism/translation/ripper.rb#2894
def visit_source_line_node(node); end
# foo(*bar)
@@ -34065,42 +34191,42 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# def foo(*); bar(*); end
# ^
#
- # source://prism//lib/prism/translation/ripper.rb#2905
+ # source://prism//lib/prism/translation/ripper.rb#2907
def visit_splat_node(node); end
# A list of statements.
#
- # source://prism//lib/prism/translation/ripper.rb#2910
+ # source://prism//lib/prism/translation/ripper.rb#2912
def visit_statements_node(node); end
# "foo"
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#2927
+ # source://prism//lib/prism/translation/ripper.rb#2929
def visit_string_node(node); end
# super(foo)
# ^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3059
+ # source://prism//lib/prism/translation/ripper.rb#3061
def visit_super_node(node); end
# :foo
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3080
+ # source://prism//lib/prism/translation/ripper.rb#3082
def visit_symbol_node(node); end
# true
# ^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3104
+ # source://prism//lib/prism/translation/ripper.rb#3106
def visit_true_node(node); end
# undef foo
# ^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3111
+ # source://prism//lib/prism/translation/ripper.rb#3113
def visit_undef_node(node); end
# unless foo; bar end
@@ -34109,7 +34235,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# bar unless foo
# ^^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3123
+ # source://prism//lib/prism/translation/ripper.rb#3125
def visit_unless_node(node); end
# until foo; bar end
@@ -34118,13 +34244,13 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# bar until foo
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3151
+ # source://prism//lib/prism/translation/ripper.rb#3153
def visit_until_node(node); end
# case foo; when bar; end
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3175
+ # source://prism//lib/prism/translation/ripper.rb#3177
def visit_when_node(node); end
# while foo; bar end
@@ -34133,13 +34259,13 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# bar while foo
# ^^^^^^^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3196
+ # source://prism//lib/prism/translation/ripper.rb#3198
def visit_while_node(node); end
# `foo`
# ^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3220
+ # source://prism//lib/prism/translation/ripper.rb#3222
def visit_x_string_node(node); end
# yield
@@ -34148,32 +34274,32 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# yield 1
# ^^^^^^^
#
- # source://prism//lib/prism/translation/ripper.rb#3243
+ # source://prism//lib/prism/translation/ripper.rb#3245
def visit_yield_node(node); end
private
# :stopdoc:
#
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def _dispatch_0; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def _dispatch_1(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def _dispatch_2(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def _dispatch_3(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def _dispatch_4(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3392
+ # source://prism//lib/prism/translation/ripper.rb#3390
def _dispatch_5(_, _, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3393
+ # source://prism//lib/prism/translation/ripper.rb#3391
def _dispatch_7(_, _, _, _, _, _, _); end
# This method is responsible for updating lineno and column information
@@ -34182,7 +34308,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# This method could be drastically improved with some caching on the start
# of every line, but for now it's good enough.
#
- # source://prism//lib/prism/translation/ripper.rb#3377
+ # source://prism//lib/prism/translation/ripper.rb#3375
def bounds(location); end
# Returns true if the given node is a command node.
@@ -34194,7 +34320,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# This method is called when the parser found syntax error.
#
- # source://prism//lib/prism/translation/ripper.rb#3415
+ # source://prism//lib/prism/translation/ripper.rb#3413
def compile_error(msg); end
# This method is provided by the Ripper C extension. It is called when a
@@ -34202,589 +34328,589 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# that it will modify the string in place and return the number of bytes
# that were removed.
#
- # source://prism//lib/prism/translation/ripper.rb#3430
+ # source://prism//lib/prism/translation/ripper.rb#3428
def dedent_string(string, width); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_BEGIN(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_CHAR(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_END(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on___end__(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_alias(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_alias_error(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_aref(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_aref_field(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_arg_ambiguous(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_arg_paren(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_args_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_args_add_block(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_args_add_star(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_args_forward; end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_args_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_array(_); end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def on_aryptn(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_assign(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_assign_error(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_assoc_new(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_assoc_splat(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_assoclist_from_args(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_backref(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_backtick(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_bare_assoc_hash(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_begin(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_binary(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_block_var(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_blockarg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def on_bodystmt(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_brace_block(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_break(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_call(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_case(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_class(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_class_name_error(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_comma(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_command(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def on_command_call(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_comment(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_const(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_const_path_field(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_const_path_ref(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_const_ref(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_cvar(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_def(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_defined(_); end
- # source://prism//lib/prism/translation/ripper.rb#3392
+ # source://prism//lib/prism/translation/ripper.rb#3390
def on_defs(_, _, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_do_block(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_dot2(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_dot3(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_dyna_symbol(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_else(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_elsif(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embdoc(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embdoc_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embdoc_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embexpr_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embexpr_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_embvar(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_ensure(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_excessed_comma; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_fcall(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_field(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_float(_); end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def on_fndptn(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_for(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_gvar(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_hash(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_heredoc_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_heredoc_dedent(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_heredoc_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_hshptn(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_ident(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_if(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_if_mod(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_ifop(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_ignored_nl(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_ignored_sp(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_imaginary(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_in(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_int(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_ivar(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_kw(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_kwrest_param(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_label(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_label_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_lambda(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_lbrace(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_lbracket(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_lparen(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_magic_comment(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_massign(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_method_add_arg(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_method_add_block(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_mlhs_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_mlhs_add_post(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_mlhs_add_star(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_mlhs_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_mlhs_paren(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_module(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_mrhs_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_mrhs_add_star(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_mrhs_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_mrhs_new_from_args(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_next(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_nl(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_nokw_param(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_op(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_opassign(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_operator_ambiguous(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_param_error(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3393
+ # source://prism//lib/prism/translation/ripper.rb#3391
def on_params(_, _, _, _, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_paren(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_parse_error(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_period(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_program(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_qsymbols_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_qsymbols_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_qsymbols_new; end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_qwords_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_qwords_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_qwords_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_rational(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_rbrace(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_rbracket(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_redo; end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_regexp_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_regexp_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_regexp_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_regexp_literal(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_regexp_new; end
- # source://prism//lib/prism/translation/ripper.rb#3391
+ # source://prism//lib/prism/translation/ripper.rb#3389
def on_rescue(_, _, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_rescue_mod(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_rest_param(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_retry; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_return(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_return0; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_rparen(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_sclass(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_semicolon(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_sp(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_stmts_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_stmts_new; end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_string_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_string_concat(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_string_content; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_string_dvar(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_string_embexpr(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_string_literal(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_super(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_symbeg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_symbol(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_symbol_literal(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_symbols_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_symbols_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_symbols_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_tlambda(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_tlambeg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_top_const_field(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_top_const_ref(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_tstring_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_tstring_content(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_tstring_end(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_unary(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_undef(_); end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_unless(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_unless_mod(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_until(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_until_mod(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_var_alias(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_var_field(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_var_ref(_); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_vcall(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_void_stmt; end
- # source://prism//lib/prism/translation/ripper.rb#3390
+ # source://prism//lib/prism/translation/ripper.rb#3388
def on_when(_, _, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_while(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_while_mod(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_word_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_word_new; end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_words_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_words_beg(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_words_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_words_sep(_); end
- # source://prism//lib/prism/translation/ripper.rb#3389
+ # source://prism//lib/prism/translation/ripper.rb#3387
def on_xstring_add(_, _); end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_xstring_literal(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_xstring_new; end
- # source://prism//lib/prism/translation/ripper.rb#3388
+ # source://prism//lib/prism/translation/ripper.rb#3386
def on_yield(_); end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_yield0; end
- # source://prism//lib/prism/translation/ripper.rb#3387
+ # source://prism//lib/prism/translation/ripper.rb#3385
def on_zsuper; end
# Lazily initialize the parse result.
#
- # source://prism//lib/prism/translation/ripper.rb#3269
+ # source://prism//lib/prism/translation/ripper.rb#3271
def result; end
# Returns true if there is a comma between the two locations.
#
# @return [Boolean]
#
- # source://prism//lib/prism/translation/ripper.rb#3282
+ # source://prism//lib/prism/translation/ripper.rb#3280
def trailing_comma?(left, right); end
# Visit one side of an alias global variable node.
@@ -34821,12 +34947,12 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# Visit a destructured positional parameter node.
#
- # source://prism//lib/prism/translation/ripper.rb#2607
+ # source://prism//lib/prism/translation/ripper.rb#2609
def visit_destructured_parameter_node(node); end
# Visit a string that is expressed using a <<~ heredoc.
#
- # source://prism//lib/prism/translation/ripper.rb#2978
+ # source://prism//lib/prism/translation/ripper.rb#2980
def visit_heredoc_node(parts, base); end
# Ripper gives back the escaped string content but strips out the common
@@ -34835,28 +34961,28 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# work well together, so here we need to re-derive the common leading
# whitespace.
#
- # source://prism//lib/prism/translation/ripper.rb#2953
+ # source://prism//lib/prism/translation/ripper.rb#2955
def visit_heredoc_node_whitespace(parts); end
# Visit a heredoc node that is representing a string.
#
- # source://prism//lib/prism/translation/ripper.rb#3024
+ # source://prism//lib/prism/translation/ripper.rb#3026
def visit_heredoc_string_node(node); end
# Visit a heredoc node that is representing an xstring.
#
- # source://prism//lib/prism/translation/ripper.rb#3041
+ # source://prism//lib/prism/translation/ripper.rb#3043
def visit_heredoc_x_string_node(node); end
# Visit the targets of a multi-target node.
#
- # source://prism//lib/prism/translation/ripper.rb#2460
+ # source://prism//lib/prism/translation/ripper.rb#2462
def visit_multi_target_node_targets(lefts, rest, rights, skippable); end
# Visit a node that represents a number. We need to explicitly handle the
# unary - operator.
#
- # source://prism//lib/prism/translation/ripper.rb#3321
+ # source://prism//lib/prism/translation/ripper.rb#3319
def visit_number_node(node); end
# Visit a pattern within a pattern match. This is used to bypass the
@@ -34870,7 +34996,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# structure of the prism parse tree, but we manually add them here so that
# we can mirror Ripper's void stmt.
#
- # source://prism//lib/prism/translation/ripper.rb#2919
+ # source://prism//lib/prism/translation/ripper.rb#2921
def visit_statements_node_body(body); end
# Visit an individual part of a string-like node.
@@ -34881,7 +35007,7 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# Visit the string content of a particular node. This method is used to
# split into the various token types.
#
- # source://prism//lib/prism/translation/ripper.rb#3294
+ # source://prism//lib/prism/translation/ripper.rb#3292
def visit_token(token, allow_keywords = T.unsafe(nil)); end
# Dispatch a words_sep event that contains the space between the elements
@@ -34893,26 +35019,26 @@ class Prism::Translation::Ripper < ::Prism::Compiler
# Visit a node that represents a write value. This is used to handle the
# special case of an implicit array that is generated without brackets.
#
- # source://prism//lib/prism/translation/ripper.rb#3339
+ # source://prism//lib/prism/translation/ripper.rb#3337
def visit_write_value(node); end
# Returns true if there is a semicolon between the two locations.
#
# @return [Boolean]
#
- # source://prism//lib/prism/translation/ripper.rb#3287
+ # source://prism//lib/prism/translation/ripper.rb#3285
def void_stmt?(left, right, allow_newline); end
# This method is called when weak warning is produced by the parser.
# +fmt+ and +args+ is printf style.
#
- # source://prism//lib/prism/translation/ripper.rb#3406
+ # source://prism//lib/prism/translation/ripper.rb#3404
def warn(fmt, *args); end
# This method is called when strong warning is produced by the parser.
# +fmt+ and +args+ is printf style.
#
- # source://prism//lib/prism/translation/ripper.rb#3411
+ # source://prism//lib/prism/translation/ripper.rb#3409
def warning(fmt, *args); end
class << self
@@ -35693,32 +35819,1136 @@ class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::
# source://prism//lib/prism/translation/ripper/sexp.rb#92
def on_stmts_new; end
- # source://prism//lib/prism/translation/ripper/sexp.rb#96
- def on_string_add(list, item); end
+ # source://prism//lib/prism/translation/ripper/sexp.rb#96
+ def on_string_add(list, item); end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#96
+ def on_symbols_add(list, item); end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#92
+ def on_symbols_new; end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#96
+ def on_word_add(list, item); end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#92
+ def on_word_new; end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#96
+ def on_words_add(list, item); end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#92
+ def on_words_new; end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#96
+ def on_xstring_add(list, item); end
+
+ # source://prism//lib/prism/translation/ripper/sexp.rb#92
+ def on_xstring_new; end
+end
+
+# This module is the entry-point for converting a prism syntax tree into the
+# seattlerb/ruby_parser gem's syntax tree.
+#
+# source://prism//lib/prism/translation/ruby_parser.rb#14
+class Prism::Translation::RubyParser
+ # Parse the given source and translate it into the seattlerb/ruby_parser
+ # gem's Sexp format.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1598
+ def parse(source, filepath = T.unsafe(nil)); end
+
+ # Parse the given file and translate it into the seattlerb/ruby_parser
+ # gem's Sexp format.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1604
+ def parse_file(filepath); end
+
+ private
+
+ # Translate the given parse result and filepath into the
+ # seattlerb/ruby_parser gem's Sexp format.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1626
+ def translate(result, filepath); end
+
+ class << self
+ # Parse the given source and translate it into the seattlerb/ruby_parser
+ # gem's Sexp format.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1611
+ def parse(source, filepath = T.unsafe(nil)); end
+
+ # Parse the given file and translate it into the seattlerb/ruby_parser
+ # gem's Sexp format.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1617
+ def parse_file(filepath); end
+ end
+end
+
+# A prism visitor that builds Sexp objects.
+#
+# source://prism//lib/prism/translation/ruby_parser.rb#16
+class Prism::Translation::RubyParser::Compiler < ::Prism::Compiler
+ # Initialize a new compiler with the given file name.
+ #
+ # @return [Compiler] a new instance of Compiler
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#31
+ def initialize(file, in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end
+
+ # This is the name of the file that we are compiling. We set it on every
+ # Sexp object that is generated, and also use it to compile __FILE__
+ # nodes.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#20
+ def file; end
+
+ # Class variables will change their type based on if they are inside of
+ # a method definition or not, so we need to track that state.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#24
+ def in_def; end
+
+ # Some nodes will change their representation if they are inside of a
+ # pattern, so we need to track that state.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#28
+ def in_pattern; end
+
+ # alias $foo $bar
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#45
+ def visit_alias_global_variable_node(node); end
+
+ # alias foo bar
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#39
+ def visit_alias_method_node(node); end
+
+ # foo => bar | baz
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#51
+ def visit_alternation_pattern_node(node); end
+
+ # a and b
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#57
+ def visit_and_node(node); end
+
+ # foo(bar)
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#108
+ def visit_arguments_node(node); end
+
+ # []
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#75
+ def visit_array_node(node); end
+
+ # foo => [bar]
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#85
+ def visit_array_pattern_node(node); end
+
+ # { a: 1 }
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#114
+ def visit_assoc_node(node); end
+
+ # def foo(**); bar(**); end
+ # ^^
+ #
+ # { **foo }
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#123
+ def visit_assoc_splat_node(node); end
+
+ # $+
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#133
+ def visit_back_reference_read_node(node); end
+
+ # begin end
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#139
+ def visit_begin_node(node); end
+
+ # foo(&bar)
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#172
+ def visit_block_argument_node(node); end
+
+ # foo { |; bar| }
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#180
+ def visit_block_local_variable_node(node); end
+
+ # A block on a keyword or method call.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#185
+ def visit_block_node(node); end
+
+ # def foo(&bar); end
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#191
+ def visit_block_parameter_node(node); end
+
+ # A block's parameters.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#196
+ def visit_block_parameters_node(node); end
+
+ # break
+ # ^^^^^
+ #
+ # break foo
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#236
+ def visit_break_node(node); end
+
+ # foo.bar &&= baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#304
+ def visit_call_and_write_node(node); end
+
+ # foo
+ # ^^^
+ #
+ # foo.bar
+ # ^^^^^^^
+ #
+ # foo.bar() {}
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#254
+ def visit_call_node(node); end
+
+ # foo.bar += baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#294
+ def visit_call_operator_write_node(node); end
+
+ # foo.bar ||= baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#314
+ def visit_call_or_write_node(node); end
+
+ # foo.bar, = 1
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#337
+ def visit_call_target_node(node); end
+
+ # foo => bar => baz
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#343
+ def visit_capture_pattern_node(node); end
+
+ # case foo; in bar; end
+ # ^^^^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#355
+ def visit_case_match_node(node); end
+
+ # case foo; when bar; end
+ # ^^^^^^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#349
+ def visit_case_node(node); end
+
+ # class Foo; end
+ # ^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#361
+ def visit_class_node(node); end
+
+ # @@foo &&= bar
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#402
+ def visit_class_variable_and_write_node(node); end
+
+ # @@foo += bar
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#396
+ def visit_class_variable_operator_write_node(node); end
+
+ # @@foo ||= bar
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#408
+ def visit_class_variable_or_write_node(node); end
+
+ # @@foo
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#381
+ def visit_class_variable_read_node(node); end
+
+ # @@foo, = bar
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#414
+ def visit_class_variable_target_node(node); end
+
+ # @@foo = 1
+ # ^^^^^^^^^
+ #
+ # @@foo, @@bar = 1
+ # ^^^^^ ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#390
+ def visit_class_variable_write_node(node); end
+
+ # Foo &&= bar
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#447
+ def visit_constant_and_write_node(node); end
+
+ # Foo += bar
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#441
+ def visit_constant_operator_write_node(node); end
+
+ # Foo ||= bar
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#453
+ def visit_constant_or_write_node(node); end
+
+ # Foo::Bar &&= baz
+ # ^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#490
+ def visit_constant_path_and_write_node(node); end
+
+ # Foo::Bar
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#465
+ def visit_constant_path_node(node); end
+
+ # Foo::Bar += baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#484
+ def visit_constant_path_operator_write_node(node); end
+
+ # Foo::Bar ||= baz
+ # ^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#496
+ def visit_constant_path_or_write_node(node); end
+
+ # Foo::Bar, = baz
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#502
+ def visit_constant_path_target_node(node); end
+
+ # Foo::Bar = 1
+ # ^^^^^^^^^^^^
+ #
+ # Foo::Foo, Bar::Bar = 1
+ # ^^^^^^^^ ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#478
+ def visit_constant_path_write_node(node); end
+
+ # Foo
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#426
+ def visit_constant_read_node(node); end
+
+ # Foo, = bar
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#459
+ def visit_constant_target_node(node); end
+
+ # Foo = 1
+ # ^^^^^^^
+ #
+ # Foo, Bar = 1
+ # ^^^ ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#435
+ def visit_constant_write_node(node); end
+
+ # def foo; end
+ # ^^^^^^^^^^^^
+ #
+ # def self.foo; end
+ # ^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#518
+ def visit_def_node(node); end
+
+ # defined? a
+ # ^^^^^^^^^^
+ #
+ # defined?(a)
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#549
+ def visit_defined_node(node); end
+
+ # if foo then bar else baz end
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#555
+ def visit_else_node(node); end
+
+ # "foo #{bar}"
+ # ^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#561
+ def visit_embedded_statements_node(node); end
+
+ # "foo #@bar"
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#569
+ def visit_embedded_variable_node(node); end
+
+ # begin; foo; ensure; bar; end
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#575
+ def visit_ensure_node(node); end
+
+ # false
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#581
+ def visit_false_node(node); end
+
+ # foo => [*, bar, *]
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#587
+ def visit_find_pattern_node(node); end
+
+ # if foo .. bar; end
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#593
+ def visit_flip_flop_node(node); end
+
+ # 1.0
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#603
+ def visit_float_node(node); end
+
+ # for foo in bar do end
+ # ^^^^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#609
+ def visit_for_node(node); end
+
+ # def foo(...); bar(...); end
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#615
+ def visit_forwarding_arguments_node(node); end
+
+ # def foo(...); end
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#621
+ def visit_forwarding_parameter_node(node); end
+
+ # super
+ # ^^^^^
+ #
+ # super {}
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#630
+ def visit_forwarding_super_node(node); end
+
+ # $foo &&= bar
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#657
+ def visit_global_variable_and_write_node(node); end
+
+ # $foo += bar
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#651
+ def visit_global_variable_operator_write_node(node); end
+
+ # $foo ||= bar
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#663
+ def visit_global_variable_or_write_node(node); end
+
+ # $foo
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#636
+ def visit_global_variable_read_node(node); end
+
+ # $foo, = bar
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#669
+ def visit_global_variable_target_node(node); end
+
+ # $foo = 1
+ # ^^^^^^^^
+ #
+ # $foo, $bar = 1
+ # ^^^^ ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#645
+ def visit_global_variable_write_node(node); end
+
+ # {}
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#675
+ def visit_hash_node(node); end
+
+ # foo => {}
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#681
+ def visit_hash_pattern_node(node); end
+
+ # if foo then bar end
+ # ^^^^^^^^^^^^^^^^^^^
+ #
+ # bar if foo
+ # ^^^^^^^^^^
+ #
+ # foo ? bar : baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#702
+ def visit_if_node(node); end
+
+ # 1i
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#707
+ def visit_imaginary_node(node); end
+
+ # { foo: }
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#713
+ def visit_implicit_node(node); end
+
+ # foo { |bar,| }
+ # ^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#718
+ def visit_implicit_rest_node(node); end
+
+ # case foo; in bar; end
+ # ^^^^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#723
+ def visit_in_node(node); end
+
+ # foo[bar] &&= baz
+ # ^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#749
+ def visit_index_and_write_node(node); end
+
+ # foo[bar] += baz
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#736
+ def visit_index_operator_write_node(node); end
+
+ # foo[bar] ||= baz
+ # ^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#762
+ def visit_index_or_write_node(node); end
+
+ # foo[bar], = 1
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#775
+ def visit_index_target_node(node); end
+
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#805
+ def visit_instance_variable_and_write_node(node); end
+
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#799
+ def visit_instance_variable_operator_write_node(node); end
+
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#811
+ def visit_instance_variable_or_write_node(node); end
+
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#784
+ def visit_instance_variable_read_node(node); end
+
+ # @foo, = bar
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#817
+ def visit_instance_variable_target_node(node); end
+
+ # ^^^^^^^^
+ #
+ # @foo, @bar = 1
+ # ^^^^ ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#793
+ def visit_instance_variable_write_node(node); end
+
+ # 1
+ # ^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#823
+ def visit_integer_node(node); end
+
+ # if /foo #{bar}/ then end
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#829
+ def visit_interpolated_match_last_line_node(node); end
+
+ # /foo #{bar}/
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#846
+ def visit_interpolated_regular_expression_node(node); end
+
+ # "foo #{bar}"
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#861
+ def visit_interpolated_string_node(node); end
+
+ # :"foo #{bar}"
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#868
+ def visit_interpolated_symbol_node(node); end
+
+ # `foo #{bar}`
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#875
+ def visit_interpolated_x_string_node(node); end
+
+ # -> { it }
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#947
+ def visit_it_local_variable_read_node(node); end
+
+ # foo(bar: baz)
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#953
+ def visit_keyword_hash_node(node); end
+
+ # def foo(**bar); end
+ # ^^^^^
+ #
+ # def foo(**); end
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#962
+ def visit_keyword_rest_parameter_node(node); end
+
+ # -> {}
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#967
+ def visit_lambda_node(node); end
+
+ # foo &&= bar
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1010
+ def visit_local_variable_and_write_node(node); end
+
+ # foo += bar
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1004
+ def visit_local_variable_operator_write_node(node); end
+
+ # foo ||= bar
+ # ^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1016
+ def visit_local_variable_or_write_node(node); end
+
+ # foo
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#985
+ def visit_local_variable_read_node(node); end
+
+ # foo, = bar
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1022
+ def visit_local_variable_target_node(node); end
+
+ # foo = 1
+ # ^^^^^^^
+ #
+ # foo, bar = 1
+ # ^^^ ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#998
+ def visit_local_variable_write_node(node); end
+
+ # if /foo/ then end
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1028
+ def visit_match_last_line_node(node); end
+
+ # foo in bar
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1034
+ def visit_match_predicate_node(node); end
+
+ # foo => bar
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1040
+ def visit_match_required_node(node); end
+
+ # /(?foo)/ =~ bar
+ # ^^^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1046
+ def visit_match_write_node(node); end
+
+ # A node that is missing from the syntax tree. This is only used in the
+ # case of a syntax error. The parser gem doesn't have such a concept, so
+ # we invent our own here.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1053
+ def visit_missing_node(node); end
+
+ # module Foo; end
+ # ^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1059
+ def visit_module_node(node); end
+
+ # foo, bar = baz
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1079
+ def visit_multi_target_node(node); end
+
+ # foo, bar = baz
+ # ^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1089
+ def visit_multi_write_node(node); end
+
+ # next
+ # ^^^^
+ #
+ # next foo
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1113
+ def visit_next_node(node); end
+
+ # nil
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1126
+ def visit_nil_node(node); end
+
+ # def foo(**nil); end
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1132
+ def visit_no_keywords_parameter_node(node); end
+
+ # -> { _1 + _2 }
+ # ^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1138
+ def visit_numbered_parameters_node(node); end
+
+ # $1
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1144
+ def visit_numbered_reference_read_node(node); end
+
+ # def foo(bar: baz); end
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1150
+ def visit_optional_keyword_parameter_node(node); end
+
+ # def foo(bar = 1); end
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1156
+ def visit_optional_parameter_node(node); end
+
+ # a or b
+ # ^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1162
+ def visit_or_node(node); end
+
+ # def foo(bar, *baz); end
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1180
+ def visit_parameters_node(node); end
+
+ # ()
+ # ^^
+ #
+ # (1)
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1218
+ def visit_parentheses_node(node); end
+
+ # foo => ^(bar)
+ # ^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1228
+ def visit_pinned_expression_node(node); end
+
+ # foo = 1 and bar => ^foo
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1234
+ def visit_pinned_variable_node(node); end
+
+ # END {}
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1243
+ def visit_post_execution_node(node); end
+
+ # BEGIN {}
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1248
+ def visit_pre_execution_node(node); end
+
+ # The top-level program node.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1253
+ def visit_program_node(node); end
+
+ # 0..5
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1259
+ def visit_range_node(node); end
+
+ # 1r
+ # ^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1281
+ def visit_rational_node(node); end
+
+ # redo
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1287
+ def visit_redo_node(node); end
+
+ # /foo/
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1293
+ def visit_regular_expression_node(node); end
+
+ # def foo(bar:); end
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1299
+ def visit_required_keyword_parameter_node(node); end
+
+ # def foo(bar); end
+ # ^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1305
+ def visit_required_parameter_node(node); end
+
+ # foo rescue bar
+ # ^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1311
+ def visit_rescue_modifier_node(node); end
+
+ # begin; rescue; end
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1317
+ def visit_rescue_node(node); end
+
+ # def foo(*bar); end
+ # ^^^^
+ #
+ # def foo(*); end
+ # ^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1337
+ def visit_rest_parameter_node(node); end
+
+ # retry
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1343
+ def visit_retry_node(node); end
+
+ # return
+ # ^^^^^^
+ #
+ # return 1
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1352
+ def visit_return_node(node); end
+
+ # self
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1365
+ def visit_self_node(node); end
+
+ # A shareable constant.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1370
+ def visit_shareable_constant_node(node); end
+
+ # class << self; end
+ # ^^^^^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1376
+ def visit_singleton_class_node(node); end
+
+ # __ENCODING__
+ # ^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1384
+ def visit_source_encoding_node(node); end
+
+ # __FILE__
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1391
+ def visit_source_file_node(node); end
+
+ # __LINE__
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1397
+ def visit_source_line_node(node); end
+
+ # foo(*bar)
+ # ^^^^
+ #
+ # def foo((bar, *baz)); end
+ # ^^^^
+ #
+ # def foo(*); bar(*); end
+ # ^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1409
+ def visit_splat_node(node); end
+
+ # A list of statements.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1418
+ def visit_statements_node(node); end
+
+ # "foo"
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1430
+ def visit_string_node(node); end
+
+ # super(foo)
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1442
+ def visit_super_node(node); end
+
+ # :foo
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1456
+ def visit_symbol_node(node); end
+
+ # true
+ # ^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1462
+ def visit_true_node(node); end
+
+ # undef foo
+ # ^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1468
+ def visit_undef_node(node); end
+
+ # unless foo; bar end
+ # ^^^^^^^^^^^^^^^^^^^
+ #
+ # bar unless foo
+ # ^^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1478
+ def visit_unless_node(node); end
+
+ # until foo; bar end
+ # ^^^^^^^^^^^^^^^^^
+ #
+ # bar until foo
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1487
+ def visit_until_node(node); end
+
+ # case foo; when bar; end
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1493
+ def visit_when_node(node); end
+
+ # while foo; bar end
+ # ^^^^^^^^^^^^^^^^^^
+ #
+ # bar while foo
+ # ^^^^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1502
+ def visit_while_node(node); end
+
+ # `foo`
+ # ^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1508
+ def visit_x_string_node(node); end
+
+ # yield
+ # ^^^^^
+ #
+ # yield 1
+ # ^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1524
+ def visit_yield_node(node); end
+
+ private
+
+ # If a class variable is written within a method definition, it has a
+ # different type than everywhere else.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#420
+ def class_variable_write_type; end
+
+ # Create a new compiler with the given options.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1531
+ def copy_compiler(in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end
+
+ # Call nodes with operators following them will either be op_asgn or
+ # op_asgn2 nodes. That is determined by their call operator and their
+ # right-hand side.
+ #
+ # @return [Boolean]
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#325
+ def op_asgn?(node); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#96
- def on_symbols_add(list, item); end
+ # Call nodes with operators following them can use &. as an operator,
+ # which changes their type by prefixing "safe_".
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#331
+ def op_asgn_type(node, type); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#92
- def on_symbols_new; end
+ # Create a new Sexp object from the given prism node and arguments.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1536
+ def s(node, *arguments); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#96
- def on_word_add(list, item); end
+ # Visit a block node, which will modify the AST by wrapping the given
+ # visited node in an iter node.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1546
+ def visit_block(node, sexp, block); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#92
- def on_word_new; end
+ # def foo((bar, baz)); end
+ # ^^^^^^^^^^
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1195
+ def visit_destructured_parameter(node); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#96
- def on_words_add(list, item); end
+ # Visit the interpolated content of the string-like node.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#882
+ def visit_interpolated_parts(parts); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#92
- def on_words_new; end
+ # Pattern constants get wrapped in another layer of :const.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1567
+ def visit_pattern_constant(node); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#96
- def on_xstring_add(list, item); end
+ # If the bounds of a range node are empty parentheses, then they do not
+ # get replaced by their usual s(:nil), but instead are s(:begin).
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1271
+ def visit_range_bounds_node(node); end
- # source://prism//lib/prism/translation/ripper/sexp.rb#92
- def on_xstring_new; end
+ # Visit the value of a write, which will be on the right-hand side of
+ # a write operator. Because implicit arrays can have splats, those could
+ # potentially be wrapped in an svalue node.
+ #
+ # source://prism//lib/prism/translation/ruby_parser.rb#1581
+ def visit_write_value(node); end
end
# Represents the use of the literal `true` keyword.
@@ -35726,62 +36956,62 @@ end
# true
# ^^^^
#
-# source://prism//lib/prism/node.rb#18098
+# source://prism//lib/prism/node.rb#15741
class Prism::TrueNode < ::Prism::Node
- # def initialize: (Location location) -> void
+ # Initialize a new TrueNode node.
#
# @return [TrueNode] a new instance of TrueNode
#
- # source://prism//lib/prism/node.rb#18100
- sig { params(source: Prism::Source, location: Prism::Location).void }
- def initialize(source, location); end
+ # source://prism//lib/prism/node.rb#15743
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer).void }
+ def initialize(source, node_id, location, flags); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18174
+ # source://prism//lib/prism/node.rb#15800
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18107
+ # source://prism//lib/prism/node.rb#15751
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18112
+ # source://prism//lib/prism/node.rb#15756
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18122
+ # source://prism//lib/prism/node.rb#15766
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18117
+ # source://prism//lib/prism/node.rb#15761
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?location: Location) -> TrueNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer) -> TrueNode
#
- # source://prism//lib/prism/node.rb#18127
- sig { params(location: Prism::Location).returns(Prism::TrueNode) }
- def copy(location: T.unsafe(nil)); end
+ # source://prism//lib/prism/node.rb#15771
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer).returns(Prism::TrueNode) }
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18112
+ # source://prism//lib/prism/node.rb#15756
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location }
#
- # source://prism//lib/prism/node.rb#18135
+ # source://prism//lib/prism/node.rb#15779
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -35790,38 +37020,20 @@ class Prism::TrueNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18140
+ # source://prism//lib/prism/node.rb#15784
sig { override.returns(String) }
def inspect; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#18158
+ # source://prism//lib/prism/node.rb#15789
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#18168
+ # source://prism//lib/prism/node.rb#15794
def type; end
end
end
@@ -35831,75 +37043,79 @@ end
# undef :foo, :bar, :baz
# ^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#18183
+# source://prism//lib/prism/node.rb#15809
class Prism::UndefNode < ::Prism::Node
- # def initialize: (Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc, Location location) -> void
+ # Initialize a new UndefNode node.
#
# @return [UndefNode] a new instance of UndefNode
#
- # source://prism//lib/prism/node.rb#18185
+ # source://prism//lib/prism/node.rb#15811
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)],
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).void
end
- def initialize(source, names, keyword_loc, location); end
+ def initialize(source, node_id, location, flags, names, keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18276
+ # source://prism//lib/prism/node.rb#15885
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18194
+ # source://prism//lib/prism/node.rb#15821
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18199
+ # source://prism//lib/prism/node.rb#15826
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18209
+ # source://prism//lib/prism/node.rb#15836
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18204
+ # source://prism//lib/prism/node.rb#15831
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location, ?location: Location) -> UndefNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location) -> UndefNode
#
- # source://prism//lib/prism/node.rb#18214
+ # source://prism//lib/prism/node.rb#15841
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)],
- keyword_loc: Prism::Location,
- location: Prism::Location
+ keyword_loc: Prism::Location
).returns(Prism::UndefNode)
end
- def copy(names: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), names: T.unsafe(nil), keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18199
+ # source://prism//lib/prism/node.rb#15826
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location }
#
- # source://prism//lib/prism/node.rb#18222
+ # source://prism//lib/prism/node.rb#15849
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -35908,56 +37124,38 @@ class Prism::UndefNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18242
+ # source://prism//lib/prism/node.rb#15869
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#18237
+ # source://prism//lib/prism/node.rb#15864
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#18230
+ # source://prism//lib/prism/node.rb#15857
sig { returns(Prism::Location) }
def keyword_loc; end
# attr_reader names: Array[SymbolNode | InterpolatedSymbolNode]
#
- # source://prism//lib/prism/node.rb#18227
+ # source://prism//lib/prism/node.rb#15854
sig { returns(T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)]) }
def names; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#18260
+ # source://prism//lib/prism/node.rb#15874
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18270
+ # source://prism//lib/prism/node.rb#15879
def type; end
end
end
@@ -35970,98 +37168,108 @@ end
# unless foo then bar end
# ^^^^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#18291
+# source://prism//lib/prism/node.rb#15900
class Prism::UnlessNode < ::Prism::Node
- # def initialize: (Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void
+ # Initialize a new UnlessNode node.
#
# @return [UnlessNode] a new instance of UnlessNode
#
- # source://prism//lib/prism/node.rb#18293
+ # source://prism//lib/prism/node.rb#15902
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
predicate: Prism::Node,
then_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::ElseNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ else_clause: T.nilable(Prism::ElseNode),
+ end_keyword_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18461
+ # source://prism//lib/prism/node.rb#16051
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18306
+ # source://prism//lib/prism/node.rb#15916
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18315
+ # source://prism//lib/prism/node.rb#15921
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18329
+ # source://prism//lib/prism/node.rb#15935
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18320
+ # source://prism//lib/prism/node.rb#15926
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # The else clause of the unless expression, if present.
+ # Returns the else clause of the unless node. This method is deprecated in
+ # favor of #else_clause.
#
- # unless cond then bar else baz end
- # ^^^^^^^^
- #
- # source://prism//lib/prism/node.rb#18393
- sig { returns(T.nilable(Prism::ElseNode)) }
+ # source://prism//lib/prism/node_ext.rb#503
def consequent; end
- # def copy: (?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: ElseNode?, ?end_keyword_loc: Location?, ?location: Location) -> UnlessNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode
#
- # source://prism//lib/prism/node.rb#18334
+ # source://prism//lib/prism/node.rb#15940
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
predicate: Prism::Node,
then_keyword_loc: T.nilable(Prism::Location),
statements: T.nilable(Prism::StatementsNode),
- consequent: T.nilable(Prism::ElseNode),
- end_keyword_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ else_clause: T.nilable(Prism::ElseNode),
+ end_keyword_loc: T.nilable(Prism::Location)
).returns(Prism::UnlessNode)
end
- def copy(keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), consequent: T.unsafe(nil), end_keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), predicate: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), else_clause: T.unsafe(nil), end_keyword_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18315
+ # source://prism//lib/prism/node.rb#15921
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, predicate: Prism::node, then_keyword_loc: Location?, statements: StatementsNode?, else_clause: ElseNode?, end_keyword_loc: Location? }
#
- # source://prism//lib/prism/node.rb#18342
+ # source://prism//lib/prism/node.rb#15948
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
+ # The else clause of the unless expression, if present.
+ #
+ # unless cond then bar else baz end
+ # ^^^^^^^^
+ #
+ # source://prism//lib/prism/node.rb#16001
+ sig { returns(T.nilable(Prism::ElseNode)) }
+ def else_clause; end
+
# def end_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#18422
+ # source://prism//lib/prism/node.rb#16030
sig { returns(T.nilable(String)) }
def end_keyword; end
@@ -36070,7 +37278,7 @@ class Prism::UnlessNode < ::Prism::Node
# unless cond then bar end
# ^^^
#
- # source://prism//lib/prism/node.rb#18399
+ # source://prism//lib/prism/node.rb#16007
sig { returns(T.nilable(Prism::Location)) }
def end_keyword_loc; end
@@ -36079,13 +37287,13 @@ class Prism::UnlessNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18427
+ # source://prism//lib/prism/node.rb#16035
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#18412
+ # source://prism//lib/prism/node.rb#16020
sig { returns(String) }
def keyword; end
@@ -36097,10 +37305,13 @@ class Prism::UnlessNode < ::Prism::Node
# bar unless cond
# ^^^^^^
#
- # source://prism//lib/prism/node.rb#18353
+ # source://prism//lib/prism/node.rb#15959
sig { returns(Prism::Location) }
def keyword_loc; end
+ # source://prism//lib/prism/parse_result/newlines.rb#97
+ def newline_flag!(lines); end
+
# The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
#
# unless cond then bar end
@@ -36109,64 +37320,45 @@ class Prism::UnlessNode < ::Prism::Node
# bar unless cond
# ^^^^
#
- # source://prism//lib/prism/node.rb#18366
+ # source://prism//lib/prism/node.rb#15972
sig { returns(Prism::Node) }
def predicate; end
- # source://prism//lib/prism/node.rb#18310
- def set_newline_flag(newline_marked); end
-
# The body of statements that will executed if the unless condition is
# falsey. Will be `nil` if no body is provided.
#
# unless cond then bar end
# ^^^
#
- # source://prism//lib/prism/node.rb#18387
+ # source://prism//lib/prism/node.rb#15995
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
# def then_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#18417
+ # source://prism//lib/prism/node.rb#16025
sig { returns(T.nilable(String)) }
def then_keyword; end
# The location of the `then` keyword, if present.
- # unless cond then bar end ^^^^
#
- # source://prism//lib/prism/node.rb#18370
+ # unless cond then bar end
+ # ^^^^
+ #
+ # source://prism//lib/prism/node.rb#15978
sig { returns(T.nilable(Prism::Location)) }
def then_keyword_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18445
+ # source://prism//lib/prism/node.rb#16040
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#18455
+ # source://prism//lib/prism/node.rb#16045
def type; end
end
end
@@ -36179,35 +37371,36 @@ end
# until foo do bar end
# ^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#18479
+# source://prism//lib/prism/node.rb#16069
class Prism::UntilNode < ::Prism::Node
- # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void
+ # Initialize a new UntilNode node.
#
# @return [UntilNode] a new instance of UntilNode
#
- # source://prism//lib/prism/node.rb#18481
+ # source://prism//lib/prism/node.rb#16071
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).void
end
- def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18612
+ # source://prism//lib/prism/node.rb#16176
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18493
+ # source://prism//lib/prism/node.rb#16083
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -36215,65 +37408,66 @@ class Prism::UntilNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18563
+ # source://prism//lib/prism/node.rb#16119
sig { returns(T::Boolean) }
def begin_modifier?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18502
+ # source://prism//lib/prism/node.rb#16088
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#18573
+ # source://prism//lib/prism/node.rb#16155
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#18544
+ # source://prism//lib/prism/node.rb#16131
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18515
+ # source://prism//lib/prism/node.rb#16101
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18507
+ # source://prism//lib/prism/node.rb#16093
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> UntilNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
#
- # source://prism//lib/prism/node.rb#18520
+ # source://prism//lib/prism/node.rb#16106
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).returns(Prism::UntilNode)
end
- def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18502
+ # source://prism//lib/prism/node.rb#16088
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
#
- # source://prism//lib/prism/node.rb#18528
+ # source://prism//lib/prism/node.rb#16114
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -36282,73 +37476,47 @@ class Prism::UntilNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18578
+ # source://prism//lib/prism/node.rb#16160
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#18568
+ # source://prism//lib/prism/node.rb#16150
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#18537
+ # source://prism//lib/prism/node.rb#16124
sig { returns(Prism::Location) }
def keyword_loc; end
+ # source://prism//lib/prism/parse_result/newlines.rb#103
+ def newline_flag!(lines); end
+
# attr_reader predicate: Prism::node
#
- # source://prism//lib/prism/node.rb#18557
+ # source://prism//lib/prism/node.rb#16144
sig { returns(Prism::Node) }
def predicate; end
- # source://prism//lib/prism/node.rb#18497
- def set_newline_flag(newline_marked); end
-
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#18560
+ # source://prism//lib/prism/node.rb#16147
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18596
+ # source://prism//lib/prism/node.rb#16165
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#18533
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#18606
+ # source://prism//lib/prism/node.rb#16170
def type; end
end
end
@@ -36899,6 +38067,12 @@ class Prism::Visitor < ::Prism::BasicVisitor
sig { params(node: Prism::InterpolatedXStringNode).void }
def visit_interpolated_x_string_node(node); end
+ # Visit a ItLocalVariableReadNode node
+ #
+ # source://prism//lib/prism/visitor.rb#29
+ sig { params(node: Prism::ItLocalVariableReadNode).void }
+ def visit_it_local_variable_read_node(node); end
+
# Visit a ItParametersNode node
#
# source://prism//lib/prism/visitor.rb#29
@@ -37285,85 +38459,89 @@ end
# ^^^^^^^^^
# end
#
-# source://prism//lib/prism/node.rb#18628
+# source://prism//lib/prism/node.rb#16192
class Prism::WhenNode < ::Prism::Node
- # def initialize: (Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements, Location location) -> void
+ # Initialize a new WhenNode node.
#
# @return [WhenNode] a new instance of WhenNode
#
- # source://prism//lib/prism/node.rb#18630
+ # source://prism//lib/prism/node.rb#16194
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
conditions: T::Array[Prism::Node],
then_keyword_loc: T.nilable(Prism::Location),
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).void
end
- def initialize(source, keyword_loc, conditions, then_keyword_loc, statements, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18747
+ # source://prism//lib/prism/node.rb#16294
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18641
+ # source://prism//lib/prism/node.rb#16206
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18646
+ # source://prism//lib/prism/node.rb#16211
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18659
+ # source://prism//lib/prism/node.rb#16224
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18651
+ # source://prism//lib/prism/node.rb#16216
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
# attr_reader conditions: Array[Prism::node]
#
- # source://prism//lib/prism/node.rb#18684
+ # source://prism//lib/prism/node.rb#16249
sig { returns(T::Array[Prism::Node]) }
def conditions; end
- # def copy: (?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?location: Location) -> WhenNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode
#
- # source://prism//lib/prism/node.rb#18664
+ # source://prism//lib/prism/node.rb#16229
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
conditions: T::Array[Prism::Node],
then_keyword_loc: T.nilable(Prism::Location),
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).returns(Prism::WhenNode)
end
- def copy(keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), conditions: T.unsafe(nil), then_keyword_loc: T.unsafe(nil), statements: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18646
+ # source://prism//lib/prism/node.rb#16211
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode? }
#
- # source://prism//lib/prism/node.rb#18672
+ # source://prism//lib/prism/node.rb#16237
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -37372,68 +38550,50 @@ class Prism::WhenNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18713
+ # source://prism//lib/prism/node.rb#16278
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#18703
+ # source://prism//lib/prism/node.rb#16268
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#18677
+ # source://prism//lib/prism/node.rb#16242
sig { returns(Prism::Location) }
def keyword_loc; end
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#18700
+ # source://prism//lib/prism/node.rb#16265
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
# def then_keyword: () -> String?
#
- # source://prism//lib/prism/node.rb#18708
+ # source://prism//lib/prism/node.rb#16273
sig { returns(T.nilable(String)) }
def then_keyword; end
# attr_reader then_keyword_loc: Location?
#
- # source://prism//lib/prism/node.rb#18687
+ # source://prism//lib/prism/node.rb#16252
sig { returns(T.nilable(Prism::Location)) }
def then_keyword_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#18731
+ # source://prism//lib/prism/node.rb#16283
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18741
+ # source://prism//lib/prism/node.rb#16288
def type; end
end
end
@@ -37446,35 +38606,36 @@ end
# while foo do bar end
# ^^^^^^^^^^^^^^^^^^^^
#
-# source://prism//lib/prism/node.rb#18764
+# source://prism//lib/prism/node.rb#16311
class Prism::WhileNode < ::Prism::Node
- # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void
+ # Initialize a new WhileNode node.
#
# @return [WhileNode] a new instance of WhileNode
#
- # source://prism//lib/prism/node.rb#18766
+ # source://prism//lib/prism/node.rb#16313
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).void
end
- def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, closing_loc, predicate, statements); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#18897
+ # source://prism//lib/prism/node.rb#16418
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18778
+ # source://prism//lib/prism/node.rb#16325
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
@@ -37482,65 +38643,66 @@ class Prism::WhileNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18848
+ # source://prism//lib/prism/node.rb#16361
sig { returns(T::Boolean) }
def begin_modifier?; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18787
+ # source://prism//lib/prism/node.rb#16330
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String?
#
- # source://prism//lib/prism/node.rb#18858
+ # source://prism//lib/prism/node.rb#16397
sig { returns(T.nilable(String)) }
def closing; end
# attr_reader closing_loc: Location?
#
- # source://prism//lib/prism/node.rb#18829
+ # source://prism//lib/prism/node.rb#16373
sig { returns(T.nilable(Prism::Location)) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18800
+ # source://prism//lib/prism/node.rb#16343
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18792
+ # source://prism//lib/prism/node.rb#16335
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> WhileNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
#
- # source://prism//lib/prism/node.rb#18805
+ # source://prism//lib/prism/node.rb#16348
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
keyword_loc: Prism::Location,
closing_loc: T.nilable(Prism::Location),
predicate: Prism::Node,
- statements: T.nilable(Prism::StatementsNode),
- location: Prism::Location
+ statements: T.nilable(Prism::StatementsNode)
).returns(Prism::WhileNode)
end
- def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), predicate: T.unsafe(nil), statements: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18787
+ # source://prism//lib/prism/node.rb#16330
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
#
- # source://prism//lib/prism/node.rb#18813
+ # source://prism//lib/prism/node.rb#16356
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -37549,73 +38711,47 @@ class Prism::WhileNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#18863
+ # source://prism//lib/prism/node.rb#16402
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#18853
+ # source://prism//lib/prism/node.rb#16392
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#18822
+ # source://prism//lib/prism/node.rb#16366
sig { returns(Prism::Location) }
def keyword_loc; end
+ # source://prism//lib/prism/parse_result/newlines.rb#109
+ def newline_flag!(lines); end
+
# attr_reader predicate: Prism::node
#
- # source://prism//lib/prism/node.rb#18842
+ # source://prism//lib/prism/node.rb#16386
sig { returns(Prism::Node) }
def predicate; end
- # source://prism//lib/prism/node.rb#18782
- def set_newline_flag(newline_marked); end
-
# attr_reader statements: StatementsNode?
#
- # source://prism//lib/prism/node.rb#18845
+ # source://prism//lib/prism/node.rb#16389
sig { returns(T.nilable(Prism::StatementsNode)) }
def statements; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
- #
- # def type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # source://prism//lib/prism/node.rb#18881
+ # source://prism//lib/prism/node.rb#16407
sig { override.returns(Symbol) }
def type; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#18818
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # def self.type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#18891
+ # source://prism//lib/prism/node.rb#16412
def type; end
end
end
@@ -37625,107 +38761,109 @@ end
# `foo`
# ^^^^^
#
-# source://prism//lib/prism/node.rb#18911
+# source://prism//lib/prism/node.rb#16432
class Prism::XStringNode < ::Prism::Node
include ::Prism::HeredocQuery
- # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void
+ # Initialize a new XStringNode node.
#
# @return [XStringNode] a new instance of XStringNode
#
- # source://prism//lib/prism/node.rb#18913
+ # source://prism//lib/prism/node.rb#16434
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).void
end
- def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end
+ def initialize(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#19045
+ # source://prism//lib/prism/node.rb#16544
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#18925
+ # source://prism//lib/prism/node.rb#16446
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18930
+ # source://prism//lib/prism/node.rb#16451
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def closing: () -> String
#
- # source://prism//lib/prism/node.rb#19006
+ # source://prism//lib/prism/node.rb#16523
sig { returns(String) }
def closing; end
# attr_reader closing_loc: Location
#
- # source://prism//lib/prism/node.rb#18976
+ # source://prism//lib/prism/node.rb#16503
sig { returns(Prism::Location) }
def closing_loc; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#18940
+ # source://prism//lib/prism/node.rb#16461
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#18935
+ # source://prism//lib/prism/node.rb#16456
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
# def content: () -> String
#
- # source://prism//lib/prism/node.rb#19001
+ # source://prism//lib/prism/node.rb#16518
sig { returns(String) }
def content; end
# attr_reader content_loc: Location
#
- # source://prism//lib/prism/node.rb#18969
+ # source://prism//lib/prism/node.rb#16496
sig { returns(Prism::Location) }
def content_loc; end
- # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> XStringNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode
#
- # source://prism//lib/prism/node.rb#18945
+ # source://prism//lib/prism/node.rb#16466
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
flags: Integer,
opening_loc: Prism::Location,
content_loc: Prism::Location,
closing_loc: Prism::Location,
- unescaped: String,
- location: Prism::Location
+ unescaped: String
).returns(Prism::XStringNode)
end
- def copy(flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), opening_loc: T.unsafe(nil), content_loc: T.unsafe(nil), closing_loc: T.unsafe(nil), unescaped: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#18930
+ # source://prism//lib/prism/node.rb#16451
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String }
#
- # source://prism//lib/prism/node.rb#18953
+ # source://prism//lib/prism/node.rb#16474
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -37736,7 +38874,7 @@ class Prism::XStringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18991
+ # source://prism//lib/prism/node.rb#16484
sig { returns(T::Boolean) }
def forced_binary_encoding?; end
@@ -37744,7 +38882,7 @@ class Prism::XStringNode < ::Prism::Node
#
# @return [Boolean]
#
- # source://prism//lib/prism/node.rb#18986
+ # source://prism//lib/prism/node.rb#16479
sig { returns(T::Boolean) }
def forced_utf8_encoding?; end
@@ -37753,71 +38891,45 @@ class Prism::XStringNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#19011
+ # source://prism//lib/prism/node.rb#16528
sig { override.returns(String) }
def inspect; end
# def opening: () -> String
#
- # source://prism//lib/prism/node.rb#18996
+ # source://prism//lib/prism/node.rb#16513
sig { returns(String) }
def opening; end
# attr_reader opening_loc: Location
#
- # source://prism//lib/prism/node.rb#18962
+ # source://prism//lib/prism/node.rb#16489
sig { returns(Prism::Location) }
def opening_loc; end
# Occasionally it's helpful to treat a string as if it were interpolated so
# that there's a consistent interface for working with strings.
#
- # source://prism//lib/prism/node_ext.rb#83
+ # source://prism//lib/prism/node_ext.rb#90
sig { returns(Prism::InterpolatedXStringNode) }
def to_interpolated; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#19029
+ # source://prism//lib/prism/node.rb#16533
sig { override.returns(Symbol) }
def type; end
# attr_reader unescaped: String
#
- # source://prism//lib/prism/node.rb#18983
+ # source://prism//lib/prism/node.rb#16510
sig { returns(String) }
def unescaped; end
- protected
-
- # protected attr_reader flags: Integer
- #
- # source://prism//lib/prism/node.rb#18958
- sig { returns(Integer) }
- def flags; end
-
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#19039
+ # source://prism//lib/prism/node.rb#16538
def type; end
end
end
@@ -37827,85 +38939,89 @@ end
# yield 1
# ^^^^^^^
#
-# source://prism//lib/prism/node.rb#19059
+# source://prism//lib/prism/node.rb#16558
class Prism::YieldNode < ::Prism::Node
- # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void
+ # Initialize a new YieldNode node.
#
# @return [YieldNode] a new instance of YieldNode
#
- # source://prism//lib/prism/node.rb#19061
+ # source://prism//lib/prism/node.rb#16560
sig do
params(
source: Prism::Source,
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
lparen_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
- rparen_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ rparen_loc: T.nilable(Prism::Location)
).void
end
- def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, location); end
+ def initialize(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc); end
# Implements case-equality for the node. This is effectively == but without
# comparing the value of locations. Locations are checked only for presence.
#
- # source://prism//lib/prism/node.rb#19192
+ # source://prism//lib/prism/node.rb#16674
def ===(other); end
# def accept: (Visitor visitor) -> void
#
- # source://prism//lib/prism/node.rb#19072
+ # source://prism//lib/prism/node.rb#16572
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
def accept(visitor); end
# attr_reader arguments: ArgumentsNode?
#
- # source://prism//lib/prism/node.rb#19127
+ # source://prism//lib/prism/node.rb#16627
sig { returns(T.nilable(Prism::ArgumentsNode)) }
def arguments; end
# def child_nodes: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#19077
+ # source://prism//lib/prism/node.rb#16577
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def child_nodes; end
# def comment_targets: () -> Array[Node | Location]
#
- # source://prism//lib/prism/node.rb#19089
+ # source://prism//lib/prism/node.rb#16589
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
def comment_targets; end
# def compact_child_nodes: () -> Array[Node]
#
- # source://prism//lib/prism/node.rb#19082
+ # source://prism//lib/prism/node.rb#16582
sig { override.returns(T::Array[Prism::Node]) }
def compact_child_nodes; end
- # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?location: Location) -> YieldNode
+ # def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?) -> YieldNode
#
- # source://prism//lib/prism/node.rb#19094
+ # source://prism//lib/prism/node.rb#16594
sig do
params(
+ node_id: Integer,
+ location: Prism::Location,
+ flags: Integer,
keyword_loc: Prism::Location,
lparen_loc: T.nilable(Prism::Location),
arguments: T.nilable(Prism::ArgumentsNode),
- rparen_loc: T.nilable(Prism::Location),
- location: Prism::Location
+ rparen_loc: T.nilable(Prism::Location)
).returns(Prism::YieldNode)
end
- def copy(keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil), location: T.unsafe(nil)); end
+ def copy(node_id: T.unsafe(nil), location: T.unsafe(nil), flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), lparen_loc: T.unsafe(nil), arguments: T.unsafe(nil), rparen_loc: T.unsafe(nil)); end
# def child_nodes: () -> Array[nil | Node]
# def deconstruct: () -> Array[nil | Node]
#
- # source://prism//lib/prism/node.rb#19077
+ # source://prism//lib/prism/node.rb#16577
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
def deconstruct; end
- # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location }
+ # def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location? }
#
- # source://prism//lib/prism/node.rb#19102
+ # source://prism//lib/prism/node.rb#16602
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
def deconstruct_keys(keys); end
@@ -37914,74 +39030,56 @@ class Prism::YieldNode < ::Prism::Node
# def inspect -> String
#
- # source://prism//lib/prism/node.rb#19158
+ # source://prism//lib/prism/node.rb#16658
sig { override.returns(String) }
def inspect; end
# def keyword: () -> String
#
- # source://prism//lib/prism/node.rb#19143
+ # source://prism//lib/prism/node.rb#16643
sig { returns(String) }
def keyword; end
# attr_reader keyword_loc: Location
#
- # source://prism//lib/prism/node.rb#19107
+ # source://prism//lib/prism/node.rb#16607
sig { returns(Prism::Location) }
def keyword_loc; end
# def lparen: () -> String?
#
- # source://prism//lib/prism/node.rb#19148
+ # source://prism//lib/prism/node.rb#16648
sig { returns(T.nilable(String)) }
def lparen; end
# attr_reader lparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#19114
+ # source://prism//lib/prism/node.rb#16614
sig { returns(T.nilable(Prism::Location)) }
def lparen_loc; end
# def rparen: () -> String?
#
- # source://prism//lib/prism/node.rb#19153
+ # source://prism//lib/prism/node.rb#16653
sig { returns(T.nilable(String)) }
def rparen; end
# attr_reader rparen_loc: Location?
#
- # source://prism//lib/prism/node.rb#19130
+ # source://prism//lib/prism/node.rb#16630
sig { returns(T.nilable(Prism::Location)) }
def rparen_loc; end
- # Sometimes you want to check an instance of a node against a list of
- # classes to see what kind of behavior to perform. Usually this is done by
- # calling `[cls1, cls2].include?(node.class)` or putting the node into a
- # case statement and doing `case node; when cls1; when cls2; end`. Both of
- # these approaches are relatively slow because of the constant lookups,
- # method calls, and/or array allocations.
- #
- # Instead, you can call #type, which will return to you a symbol that you
- # can use for comparison. This is faster than the other approaches because
- # it uses a single integer comparison, but also because if you're on CRuby
- # you can take advantage of the fact that case statements with all symbol
- # keys will use a jump table.
+ # Return a symbol representation of this node type. See `Node#type`.
#
- # def type: () -> Symbol
- #
- # source://prism//lib/prism/node.rb#19176
+ # source://prism//lib/prism/node.rb#16663
sig { override.returns(Symbol) }
def type; end
class << self
- # Similar to #type, this method returns a symbol that you can use for
- # splitting on the type of the node without having to do a long === chain.
- # Note that like #type, it will still be slower than using == for a single
- # class, but should be faster in a case statement or an array comparison.
- #
- # def self.type: () -> Symbol
+ # Return a symbol representation of this node type. See `Node::type`.
#
- # source://prism//lib/prism/node.rb#19186
+ # source://prism//lib/prism/node.rb#16668
def type; end
end
end
diff --git a/sorbet/rbi/gems/racc@1.7.3.rbi b/sorbet/rbi/gems/racc@1.8.1.rbi
similarity index 70%
rename from sorbet/rbi/gems/racc@1.7.3.rbi
rename to sorbet/rbi/gems/racc@1.8.1.rbi
index 3e58f811..5d4f1618 100644
--- a/sorbet/rbi/gems/racc@1.7.3.rbi
+++ b/sorbet/rbi/gems/racc@1.8.1.rbi
@@ -4,35 +4,36 @@
# This is an autogenerated file for types exported from the `racc` gem.
# Please instead update this file by running `bin/tapioca gem racc`.
-# source://racc//lib/racc/parser.rb#23
+
+# source://racc//lib/racc/parser.rb#19
ParseError = Racc::ParseError
# source://racc//lib/racc/info.rb#17
Racc::Copyright = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#188
+# source://racc//lib/racc/parser.rb#184
class Racc::Parser
- # source://racc//lib/racc/parser.rb#283
+ # source://racc//lib/racc/parser.rb#279
def _racc_do_parse_rb(arg, in_debug); end
- # source://racc//lib/racc/parser.rb#483
+ # source://racc//lib/racc/parser.rb#479
def _racc_do_reduce(arg, act); end
# common
#
- # source://racc//lib/racc/parser.rb#386
+ # source://racc//lib/racc/parser.rb#382
def _racc_evalact(act, arg); end
- # source://racc//lib/racc/parser.rb#236
+ # source://racc//lib/racc/parser.rb#232
def _racc_init_sysvars; end
- # source://racc//lib/racc/parser.rb#224
+ # source://racc//lib/racc/parser.rb#220
def _racc_setup; end
- # source://racc//lib/racc/parser.rb#333
+ # source://racc//lib/racc/parser.rb#329
def _racc_yyparse_rb(recv, mid, arg, c_debug); end
- # source://racc//lib/racc/parser.rb#266
+ # source://racc//lib/racc/parser.rb#262
def do_parse; end
# The method to fetch next token.
@@ -46,7 +47,7 @@ class Racc::Parser
#
# @raise [NotImplementedError]
#
- # source://racc//lib/racc/parser.rb#279
+ # source://racc//lib/racc/parser.rb#275
def next_token; end
# This method is called when a parse error is found.
@@ -66,92 +67,92 @@ class Racc::Parser
#
# @raise [ParseError]
#
- # source://racc//lib/racc/parser.rb#539
+ # source://racc//lib/racc/parser.rb#535
def on_error(t, val, vstack); end
- # source://racc//lib/racc/parser.rb#588
+ # source://racc//lib/racc/parser.rb#584
def racc_accept; end
- # source://racc//lib/racc/parser.rb#593
+ # source://racc//lib/racc/parser.rb#589
def racc_e_pop(state, tstack, vstack); end
- # source://racc//lib/racc/parser.rb#600
+ # source://racc//lib/racc/parser.rb#596
def racc_next_state(curstate, state); end
- # source://racc//lib/racc/parser.rb#606
+ # source://racc//lib/racc/parser.rb#602
def racc_print_stacks(t, v); end
- # source://racc//lib/racc/parser.rb#615
+ # source://racc//lib/racc/parser.rb#611
def racc_print_states(s); end
# For debugging output
#
- # source://racc//lib/racc/parser.rb#562
+ # source://racc//lib/racc/parser.rb#558
def racc_read_token(t, tok, val); end
- # source://racc//lib/racc/parser.rb#575
+ # source://racc//lib/racc/parser.rb#571
def racc_reduce(toks, sim, tstack, vstack); end
- # source://racc//lib/racc/parser.rb#569
+ # source://racc//lib/racc/parser.rb#565
def racc_shift(tok, tstack, vstack); end
- # source://racc//lib/racc/parser.rb#622
+ # source://racc//lib/racc/parser.rb#618
def racc_token2str(tok); end
# Convert internal ID of token symbol to the string.
#
- # source://racc//lib/racc/parser.rb#628
+ # source://racc//lib/racc/parser.rb#624
def token_to_str(t); end
# Exit parser.
# Return value is +Symbol_Value_Stack[0]+.
#
- # source://racc//lib/racc/parser.rb#552
+ # source://racc//lib/racc/parser.rb#548
def yyaccept; end
# Leave error recovering mode.
#
- # source://racc//lib/racc/parser.rb#557
+ # source://racc//lib/racc/parser.rb#553
def yyerrok; end
# Enter error recovering mode.
# This method does not call #on_error.
#
- # source://racc//lib/racc/parser.rb#546
+ # source://racc//lib/racc/parser.rb#542
def yyerror; end
- # source://racc//lib/racc/parser.rb#328
+ # source://racc//lib/racc/parser.rb#324
def yyparse(recv, mid); end
class << self
- # source://racc//lib/racc/parser.rb#220
+ # source://racc//lib/racc/parser.rb#216
def racc_runtime_type; end
end
end
-# source://racc//lib/racc/parser.rb#209
+# source://racc//lib/racc/parser.rb#205
Racc::Parser::Racc_Main_Parsing_Routine = T.let(T.unsafe(nil), Symbol)
Racc::Parser::Racc_Runtime_Core_Id_C = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#211
+# source://racc//lib/racc/parser.rb#207
Racc::Parser::Racc_Runtime_Core_Version = T.let(T.unsafe(nil), String)
Racc::Parser::Racc_Runtime_Core_Version_C = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#191
+# source://racc//lib/racc/parser.rb#187
Racc::Parser::Racc_Runtime_Core_Version_R = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#212
+# source://racc//lib/racc/parser.rb#208
Racc::Parser::Racc_Runtime_Type = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#190
+# source://racc//lib/racc/parser.rb#186
Racc::Parser::Racc_Runtime_Version = T.let(T.unsafe(nil), String)
-# source://racc//lib/racc/parser.rb#210
+# source://racc//lib/racc/parser.rb#206
Racc::Parser::Racc_YY_Parse_Method = T.let(T.unsafe(nil), Symbol)
-# source://racc//lib/racc/parser.rb#185
+# source://racc//lib/racc/parser.rb#181
Racc::Racc_No_Extensions = T.let(T.unsafe(nil), FalseClass)
# source://racc//lib/racc/info.rb#15
diff --git a/sorbet/rbi/gems/rbi@0.2.2.rbi b/sorbet/rbi/gems/rbi@0.2.3.rbi
similarity index 95%
rename from sorbet/rbi/gems/rbi@0.2.2.rbi
rename to sorbet/rbi/gems/rbi@0.2.3.rbi
index dd11a178..9284a8ac 100644
--- a/sorbet/rbi/gems/rbi@0.2.2.rbi
+++ b/sorbet/rbi/gems/rbi@0.2.3.rbi
@@ -464,7 +464,7 @@ class RBI::File
sig { returns(T::Boolean) }
def empty?; end
- # source://rbi//lib/rbi/printer.rb#743
+ # source://rbi//lib/rbi/printer.rb#751
sig do
params(
out: T.any(::IO, ::StringIO),
@@ -475,11 +475,11 @@ class RBI::File
end
def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
- # source://rbi//lib/rbi/rbs_printer.rb#989
+ # source://rbi//lib/rbi/rbs_printer.rb#1040
sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void }
def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
- # source://rbi//lib/rbi/rbs_printer.rb#995
+ # source://rbi//lib/rbi/rbs_printer.rb#1046
sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) }
def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
@@ -501,14 +501,14 @@ class RBI::File
# source://rbi//lib/rbi/model.rb#146
def strictness=(_arg0); end
- # source://rbi//lib/rbi/printer.rb#749
+ # source://rbi//lib/rbi/printer.rb#757
sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) }
def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
end
# source://rbi//lib/rbi/formatter.rb#5
class RBI::Formatter
- # source://rbi//lib/rbi/formatter.rb#24
+ # source://rbi//lib/rbi/formatter.rb#21
sig do
params(
add_sig_templates: T::Boolean,
@@ -521,30 +521,26 @@ class RBI::Formatter
end
def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_members: T.unsafe(nil), sort_nodes: T.unsafe(nil)); end
- # source://rbi//lib/rbi/formatter.rb#47
+ # source://rbi//lib/rbi/formatter.rb#44
sig { params(file: ::RBI::File).void }
def format_file(file); end
- # source://rbi//lib/rbi/formatter.rb#52
+ # source://rbi//lib/rbi/formatter.rb#49
sig { params(tree: ::RBI::Tree).void }
def format_tree(tree); end
- # source://rbi//lib/rbi/formatter.rb#12
+ # source://rbi//lib/rbi/formatter.rb#9
sig { returns(T.nilable(::Integer)) }
def max_line_length; end
# @return [Integer, nil]
#
- # source://rbi//lib/rbi/formatter.rb#12
+ # source://rbi//lib/rbi/formatter.rb#9
def max_line_length=(_arg0); end
- # source://rbi//lib/rbi/formatter.rb#41
+ # source://rbi//lib/rbi/formatter.rb#38
sig { params(file: ::RBI::File).returns(::String) }
def print_file(file); end
-
- # source://rbi//lib/rbi/formatter.rb#9
- sig { params(sort_nodes: T::Boolean).returns(T::Boolean) }
- def sort_nodes=(sort_nodes); end
end
# source://rbi//lib/rbi/rewriters/group_nodes.rb#87
@@ -582,11 +578,11 @@ class RBI::GroupNodesError < ::RBI::Error; end
# Sorbet's misc.
#
-# source://rbi//lib/rbi/model.rb#1374
+# source://rbi//lib/rbi/model.rb#1377
class RBI::Helper < ::RBI::NodeWithComments
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1388
+ # source://rbi//lib/rbi/model.rb#1391
sig do
params(
name: ::String,
@@ -605,11 +601,11 @@ class RBI::Helper < ::RBI::NodeWithComments
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1378
+ # source://rbi//lib/rbi/model.rb#1381
sig { returns(::String) }
def name; end
- # source://rbi//lib/rbi/model.rb#1395
+ # source://rbi//lib/rbi/model.rb#1398
sig { override.returns(::String) }
def to_s; end
end
@@ -990,11 +986,11 @@ class RBI::Method < ::RBI::NodeWithComments
def visibility=(_arg0); end
end
-# source://rbi//lib/rbi/model.rb#1435
+# source://rbi//lib/rbi/model.rb#1438
class RBI::MixesInClassMethods < ::RBI::Mixin
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1447
+ # source://rbi//lib/rbi/model.rb#1450
sig do
params(
name: ::String,
@@ -1014,7 +1010,7 @@ class RBI::MixesInClassMethods < ::RBI::Mixin
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1453
+ # source://rbi//lib/rbi/model.rb#1456
sig { override.returns(::String) }
def to_s; end
end
@@ -1130,7 +1126,7 @@ class RBI::Node
# source://rbi//lib/rbi/model.rb#14
def parent_tree=(_arg0); end
- # source://rbi//lib/rbi/printer.rb#767
+ # source://rbi//lib/rbi/printer.rb#775
sig do
params(
out: T.any(::IO, ::StringIO),
@@ -1141,11 +1137,11 @@ class RBI::Node
end
def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
- # source://rbi//lib/rbi/rbs_printer.rb#1006
+ # source://rbi//lib/rbi/rbs_printer.rb#1057
sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void }
def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
- # source://rbi//lib/rbi/rbs_printer.rb#1012
+ # source://rbi//lib/rbi/rbs_printer.rb#1063
sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) }
def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
@@ -1159,7 +1155,7 @@ class RBI::Node
sig { params(version: ::Gem::Version).returns(T::Boolean) }
def satisfies_version?(version); end
- # source://rbi//lib/rbi/printer.rb#773
+ # source://rbi//lib/rbi/printer.rb#781
sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) }
def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
end
@@ -1294,7 +1290,7 @@ class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor
sig { returns(::RBI::Sig) }
def current; end
- # source://rbi//lib/rbi/parser.rb#887
+ # source://rbi//lib/rbi/parser.rb#903
sig { override.params(node: ::Prism::AssocNode).void }
def visit_assoc_node(node); end
@@ -1861,7 +1857,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
# source://rbi//lib/rbi/rbs_printer.rb#9
def print_locs=(_arg0); end
- # source://rbi//lib/rbi/rbs_printer.rb#350
+ # source://rbi//lib/rbi/rbs_printer.rb#363
sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void }
def print_method_sig(node, sig); end
@@ -1887,7 +1883,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(nodes: T::Array[::RBI::Node]).void }
def visit_all(nodes); end
- # source://rbi//lib/rbi/rbs_printer.rb#505
+ # source://rbi//lib/rbi/rbs_printer.rb#534
sig { override.params(node: ::RBI::Arg).void }
def visit_arg(node); end
@@ -1911,7 +1907,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::BlankLine).void }
def visit_blank_line(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#444
+ # source://rbi//lib/rbi/rbs_printer.rb#473
sig { override.params(node: ::RBI::BlockParam).void }
def visit_block_param(node); end
@@ -1923,7 +1919,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::Comment).void }
def visit_comment(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#625
+ # source://rbi//lib/rbi/rbs_printer.rb#654
sig { override.params(node: ::RBI::ConflictTree).void }
def visit_conflict_tree(node); end
@@ -1931,7 +1927,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::Const).void }
def visit_const(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#454
+ # source://rbi//lib/rbi/rbs_printer.rb#483
sig { override.params(node: ::RBI::Extend).void }
def visit_extend(node); end
@@ -1939,43 +1935,43 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(file: ::RBI::File).void }
def visit_file(file); end
- # source://rbi//lib/rbi/rbs_printer.rb#601
+ # source://rbi//lib/rbi/rbs_printer.rb#630
sig { override.params(node: ::RBI::Group).void }
def visit_group(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#591
+ # source://rbi//lib/rbi/rbs_printer.rb#620
sig { override.params(node: ::RBI::Helper).void }
def visit_helper(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#449
+ # source://rbi//lib/rbi/rbs_printer.rb#478
sig { override.params(node: ::RBI::Include).void }
def visit_include(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#510
+ # source://rbi//lib/rbi/rbs_printer.rb#539
sig { override.params(node: ::RBI::KwArg).void }
def visit_kw_arg(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#434
+ # source://rbi//lib/rbi/rbs_printer.rb#463
sig { override.params(node: ::RBI::KwOptParam).void }
def visit_kw_opt_param(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#429
+ # source://rbi//lib/rbi/rbs_printer.rb#458
sig { override.params(node: ::RBI::KwParam).void }
def visit_kw_param(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#439
+ # source://rbi//lib/rbi/rbs_printer.rb#468
sig { override.params(node: ::RBI::KwRestParam).void }
def visit_kw_rest_param(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#292
+ # source://rbi//lib/rbi/rbs_printer.rb#297
sig { override.params(node: ::RBI::Method).void }
def visit_method(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#596
+ # source://rbi//lib/rbi/rbs_printer.rb#625
sig { override.params(node: ::RBI::MixesInClassMethods).void }
def visit_mixes_in_class_methods(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#459
+ # source://rbi//lib/rbi/rbs_printer.rb#488
sig { params(node: ::RBI::Mixin).void }
def visit_mixin(node); end
@@ -1983,31 +1979,31 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::Module).void }
def visit_module(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#419
+ # source://rbi//lib/rbi/rbs_printer.rb#448
sig { override.params(node: ::RBI::OptParam).void }
def visit_opt_param(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#486
+ # source://rbi//lib/rbi/rbs_printer.rb#515
sig { override.params(node: ::RBI::Private).void }
def visit_private(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#481
+ # source://rbi//lib/rbi/rbs_printer.rb#510
sig { override.params(node: ::RBI::Protected).void }
def visit_protected(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#476
+ # source://rbi//lib/rbi/rbs_printer.rb#505
sig { override.params(node: ::RBI::Public).void }
def visit_public(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#414
+ # source://rbi//lib/rbi/rbs_printer.rb#443
sig { override.params(node: ::RBI::ReqParam).void }
def visit_req_param(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#620
+ # source://rbi//lib/rbi/rbs_printer.rb#649
sig { override.params(node: ::RBI::RequiresAncestor).void }
def visit_requires_ancestor(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#424
+ # source://rbi//lib/rbi/rbs_printer.rb#453
sig { override.params(node: ::RBI::RestParam).void }
def visit_rest_param(node); end
@@ -2019,7 +2015,7 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { params(node: ::RBI::Scope).void }
def visit_scope_body(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#634
+ # source://rbi//lib/rbi/rbs_printer.rb#663
sig { override.params(node: ::RBI::ScopeConflict).void }
def visit_scope_conflict(node); end
@@ -2027,10 +2023,18 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { params(node: ::RBI::Scope).void }
def visit_scope_header(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#500
+ # source://rbi//lib/rbi/rbs_printer.rb#529
sig { override.params(node: ::RBI::Send).void }
def visit_send(node); end
+ # source://rbi//lib/rbi/rbs_printer.rb#425
+ sig { params(node: ::RBI::Sig).void }
+ def visit_sig(node); end
+
+ # source://rbi//lib/rbi/rbs_printer.rb#438
+ sig { params(node: ::RBI::SigParam).void }
+ def visit_sig_param(node); end
+
# source://rbi//lib/rbi/rbs_printer.rb#133
sig { override.params(node: ::RBI::SingletonClass).void }
def visit_singleton_class(node); end
@@ -2039,11 +2043,11 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::Struct).void }
def visit_struct(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#563
+ # source://rbi//lib/rbi/rbs_printer.rb#592
sig { override.params(node: ::RBI::TEnum).void }
def visit_tenum(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#568
+ # source://rbi//lib/rbi/rbs_printer.rb#597
sig { override.params(node: ::RBI::TEnumBlock).void }
def visit_tenum_block(node); end
@@ -2051,33 +2055,33 @@ class RBI::RBSPrinter < ::RBI::Visitor
sig { override.params(node: ::RBI::Tree).void }
def visit_tree(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#515
+ # source://rbi//lib/rbi/rbs_printer.rb#544
sig { override.params(node: ::RBI::TStruct).void }
def visit_tstruct(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#549
+ # source://rbi//lib/rbi/rbs_printer.rb#578
sig { override.params(node: ::RBI::TStructConst).void }
def visit_tstruct_const(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#556
+ # source://rbi//lib/rbi/rbs_printer.rb#585
sig { override.params(node: ::RBI::TStructProp).void }
def visit_tstruct_prop(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#586
+ # source://rbi//lib/rbi/rbs_printer.rb#615
sig { override.params(node: ::RBI::TypeMember).void }
def visit_type_member(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#491
+ # source://rbi//lib/rbi/rbs_printer.rb#520
sig { params(node: ::RBI::Visibility).void }
def visit_visibility(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#607
+ # source://rbi//lib/rbi/rbs_printer.rb#636
sig { override.params(node: ::RBI::VisibilityGroup).void }
def visit_visibility_group(node); end
private
- # source://rbi//lib/rbi/rbs_printer.rb#725
+ # source://rbi//lib/rbi/rbs_printer.rb#754
sig { params(node: ::RBI::Node).returns(T::Boolean) }
def oneline?(node); end
@@ -2085,31 +2089,31 @@ class RBI::RBSPrinter < ::RBI::Visitor
#
# Returns `nil` is the string is not a `T.let`.
#
- # source://rbi//lib/rbi/rbs_printer.rb#759
+ # source://rbi//lib/rbi/rbs_printer.rb#788
sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) }
def parse_t_let(code); end
- # source://rbi//lib/rbi/rbs_printer.rb#747
+ # source://rbi//lib/rbi/rbs_printer.rb#776
sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) }
def parse_type(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#650
+ # source://rbi//lib/rbi/rbs_printer.rb#679
sig { params(node: ::RBI::Node).void }
def print_blank_line_before(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#669
+ # source://rbi//lib/rbi/rbs_printer.rb#698
sig { params(node: ::RBI::Node).void }
def print_loc(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#699
+ # source://rbi//lib/rbi/rbs_printer.rb#728
sig { params(node: ::RBI::Param, last: T::Boolean).void }
def print_param_comment_leading_space(node, last:); end
- # source://rbi//lib/rbi/rbs_printer.rb#675
+ # source://rbi//lib/rbi/rbs_printer.rb#704
sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void }
def print_sig_param(node, param); end
- # source://rbi//lib/rbi/rbs_printer.rb#717
+ # source://rbi//lib/rbi/rbs_printer.rb#746
sig { params(node: ::RBI::SigParam, last: T::Boolean).void }
def print_sig_param_comment_leading_space(node, last:); end
end
@@ -2138,11 +2142,11 @@ class RBI::ReqParam < ::RBI::Param
def ==(other); end
end
-# source://rbi//lib/rbi/model.rb#1458
+# source://rbi//lib/rbi/model.rb#1461
class RBI::RequiresAncestor < ::RBI::NodeWithComments
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1471
+ # source://rbi//lib/rbi/model.rb#1474
sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
@@ -2150,11 +2154,11 @@ class RBI::RequiresAncestor < ::RBI::NodeWithComments
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1462
+ # source://rbi//lib/rbi/model.rb#1465
sig { returns(::String) }
def name; end
- # source://rbi//lib/rbi/model.rb#1477
+ # source://rbi//lib/rbi/model.rb#1480
sig { override.returns(::String) }
def to_s; end
end
@@ -2884,7 +2888,7 @@ end
#
# source://rbi//lib/rbi/model.rb#1104
class RBI::Sig < ::RBI::NodeWithComments
- # source://rbi//lib/rbi/model.rb#1137
+ # source://rbi//lib/rbi/model.rb#1138
sig do
params(
params: T::Array[::RBI::SigParam],
@@ -2893,6 +2897,7 @@ class RBI::Sig < ::RBI::NodeWithComments
is_override: T::Boolean,
is_overridable: T::Boolean,
is_final: T::Boolean,
+ allow_incompatible_override: T::Boolean,
type_params: T::Array[::String],
checked: T.nilable(::Symbol),
loc: T.nilable(::RBI::Loc),
@@ -2900,20 +2905,30 @@ class RBI::Sig < ::RBI::NodeWithComments
block: T.nilable(T.proc.params(node: ::RBI::Sig).void)
).void
end
- def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
+ def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
- # source://rbi//lib/rbi/model.rb#1163
+ # source://rbi//lib/rbi/model.rb#1166
sig { params(param: ::RBI::SigParam).void }
def <<(param); end
- # source://rbi//lib/rbi/model.rb#1173
+ # source://rbi//lib/rbi/model.rb#1176
sig { params(other: ::Object).returns(T::Boolean) }
def ==(other); end
- # source://rbi//lib/rbi/model.rb#1168
+ # source://rbi//lib/rbi/model.rb#1171
sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void }
def add_param(name, type); end
+ # @return [Boolean]
+ #
+ # source://rbi//lib/rbi/model.rb#1114
+ def allow_incompatible_override; end
+
+ # @return [Boolean]
+ #
+ # source://rbi//lib/rbi/model.rb#1114
+ def allow_incompatible_override=(_arg0); end
+
# source://rbi//lib/rbi/model.rb#1120
sig { returns(T.nilable(::Symbol)) }
def checked; end
@@ -2980,9 +2995,9 @@ class RBI::Sig < ::RBI::NodeWithComments
def type_params; end
end
-# source://rbi//lib/rbi/model.rb#1182
+# source://rbi//lib/rbi/model.rb#1185
class RBI::SigParam < ::RBI::NodeWithComments
- # source://rbi//lib/rbi/model.rb#1200
+ # source://rbi//lib/rbi/model.rb#1203
sig do
params(
name: ::String,
@@ -2994,15 +3009,15 @@ class RBI::SigParam < ::RBI::NodeWithComments
end
def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
- # source://rbi//lib/rbi/model.rb#1208
+ # source://rbi//lib/rbi/model.rb#1211
sig { params(other: ::Object).returns(T::Boolean) }
def ==(other); end
- # source://rbi//lib/rbi/model.rb#1186
+ # source://rbi//lib/rbi/model.rb#1189
sig { returns(::String) }
def name; end
- # source://rbi//lib/rbi/model.rb#1189
+ # source://rbi//lib/rbi/model.rb#1192
sig { returns(T.any(::RBI::Type, ::String)) }
def type; end
end
@@ -3077,9 +3092,9 @@ end
# Sorbet's T::Enum
#
-# source://rbi//lib/rbi/model.rb#1329
+# source://rbi//lib/rbi/model.rb#1332
class RBI::TEnum < ::RBI::Class
- # source://rbi//lib/rbi/model.rb#1340
+ # source://rbi//lib/rbi/model.rb#1343
sig do
params(
name: ::String,
@@ -3091,9 +3106,9 @@ class RBI::TEnum < ::RBI::Class
def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
end
-# source://rbi//lib/rbi/model.rb#1346
+# source://rbi//lib/rbi/model.rb#1349
class RBI::TEnumBlock < ::RBI::Scope
- # source://rbi//lib/rbi/model.rb#1356
+ # source://rbi//lib/rbi/model.rb#1359
sig do
params(
loc: T.nilable(::RBI::Loc),
@@ -3103,7 +3118,7 @@ class RBI::TEnumBlock < ::RBI::Scope
end
def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
- # source://rbi//lib/rbi/model.rb#1362
+ # source://rbi//lib/rbi/model.rb#1365
sig { override.returns(::String) }
def fully_qualified_name; end
@@ -3111,16 +3126,16 @@ class RBI::TEnumBlock < ::RBI::Scope
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1367
+ # source://rbi//lib/rbi/model.rb#1370
sig { override.returns(::String) }
def to_s; end
end
# Sorbet's T::Struct
#
-# source://rbi//lib/rbi/model.rb#1215
+# source://rbi//lib/rbi/model.rb#1218
class RBI::TStruct < ::RBI::Class
- # source://rbi//lib/rbi/model.rb#1226
+ # source://rbi//lib/rbi/model.rb#1229
sig do
params(
name: ::String,
@@ -3132,11 +3147,11 @@ class RBI::TStruct < ::RBI::Class
def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
end
-# source://rbi//lib/rbi/model.rb#1267
+# source://rbi//lib/rbi/model.rb#1270
class RBI::TStructConst < ::RBI::TStructField
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1280
+ # source://rbi//lib/rbi/model.rb#1283
sig do
params(
name: ::String,
@@ -3153,7 +3168,7 @@ class RBI::TStructConst < ::RBI::TStructField
sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
def compatible_with?(other); end
- # source://rbi//lib/rbi/model.rb#1286
+ # source://rbi//lib/rbi/model.rb#1289
sig { override.returns(T::Array[::String]) }
def fully_qualified_names; end
@@ -3161,18 +3176,18 @@ class RBI::TStructConst < ::RBI::TStructField
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1292
+ # source://rbi//lib/rbi/model.rb#1295
sig { override.returns(::String) }
def to_s; end
end
# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
#
-# source://rbi//lib/rbi/model.rb#1232
+# source://rbi//lib/rbi/model.rb#1235
class RBI::TStructField < ::RBI::NodeWithComments
abstract!
- # source://rbi//lib/rbi/model.rb#1256
+ # source://rbi//lib/rbi/model.rb#1259
sig do
params(
name: ::String,
@@ -3188,45 +3203,45 @@ class RBI::TStructField < ::RBI::NodeWithComments
sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
def compatible_with?(other); end
- # source://rbi//lib/rbi/model.rb#1245
+ # source://rbi//lib/rbi/model.rb#1248
sig { returns(T.nilable(::String)) }
def default; end
# @return [String, nil]
#
- # source://rbi//lib/rbi/model.rb#1245
+ # source://rbi//lib/rbi/model.rb#1248
def default=(_arg0); end
# @abstract
#
- # source://rbi//lib/rbi/model.rb#1264
+ # source://rbi//lib/rbi/model.rb#1267
sig { abstract.returns(T::Array[::String]) }
def fully_qualified_names; end
- # source://rbi//lib/rbi/model.rb#1239
+ # source://rbi//lib/rbi/model.rb#1242
sig { returns(::String) }
def name; end
# @return [String]
#
- # source://rbi//lib/rbi/model.rb#1239
+ # source://rbi//lib/rbi/model.rb#1242
def name=(_arg0); end
- # source://rbi//lib/rbi/model.rb#1242
+ # source://rbi//lib/rbi/model.rb#1245
sig { returns(T.any(::RBI::Type, ::String)) }
def type; end
# @return [Type, String]
#
- # source://rbi//lib/rbi/model.rb#1242
+ # source://rbi//lib/rbi/model.rb#1245
def type=(_arg0); end
end
-# source://rbi//lib/rbi/model.rb#1297
+# source://rbi//lib/rbi/model.rb#1300
class RBI::TStructProp < ::RBI::TStructField
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1310
+ # source://rbi//lib/rbi/model.rb#1313
sig do
params(
name: ::String,
@@ -3243,7 +3258,7 @@ class RBI::TStructProp < ::RBI::TStructField
sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
def compatible_with?(other); end
- # source://rbi//lib/rbi/model.rb#1316
+ # source://rbi//lib/rbi/model.rb#1319
sig { override.returns(T::Array[::String]) }
def fully_qualified_names; end
@@ -3251,7 +3266,7 @@ class RBI::TStructProp < ::RBI::TStructField
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1322
+ # source://rbi//lib/rbi/model.rb#1325
sig { override.returns(::String) }
def to_s; end
end
@@ -3476,7 +3491,7 @@ class RBI::Type
sig { returns(::RBI::Type) }
def non_nilable; end
- # source://rbi//lib/rbi/rbs_printer.rb#1023
+ # source://rbi//lib/rbi/rbs_printer.rb#1074
sig { returns(::String) }
def rbs_string; end
@@ -4130,11 +4145,11 @@ class RBI::Type::Void < ::RBI::Type
def to_rbi; end
end
-# source://rbi//lib/rbi/model.rb#1400
+# source://rbi//lib/rbi/model.rb#1403
class RBI::TypeMember < ::RBI::NodeWithComments
include ::RBI::Indexable
- # source://rbi//lib/rbi/model.rb#1415
+ # source://rbi//lib/rbi/model.rb#1418
sig do
params(
name: ::String,
@@ -4146,7 +4161,7 @@ class RBI::TypeMember < ::RBI::NodeWithComments
end
def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
- # source://rbi//lib/rbi/model.rb#1423
+ # source://rbi//lib/rbi/model.rb#1426
sig { returns(::String) }
def fully_qualified_name; end
@@ -4154,109 +4169,109 @@ class RBI::TypeMember < ::RBI::NodeWithComments
sig { override.returns(T::Array[::String]) }
def index_ids; end
- # source://rbi//lib/rbi/model.rb#1404
+ # source://rbi//lib/rbi/model.rb#1407
sig { returns(::String) }
def name; end
- # source://rbi//lib/rbi/model.rb#1430
+ # source://rbi//lib/rbi/model.rb#1433
sig { override.returns(::String) }
def to_s; end
# @return [String]
#
- # source://rbi//lib/rbi/model.rb#1404
+ # source://rbi//lib/rbi/model.rb#1407
def value; end
end
-# source://rbi//lib/rbi/rbs_printer.rb#780
+# source://rbi//lib/rbi/rbs_printer.rb#809
class RBI::TypePrinter
- # source://rbi//lib/rbi/rbs_printer.rb#787
+ # source://rbi//lib/rbi/rbs_printer.rb#816
sig { void }
def initialize; end
- # source://rbi//lib/rbi/rbs_printer.rb#784
+ # source://rbi//lib/rbi/rbs_printer.rb#813
sig { returns(::String) }
def string; end
- # source://rbi//lib/rbi/rbs_printer.rb#792
+ # source://rbi//lib/rbi/rbs_printer.rb#821
sig { params(node: ::RBI::Type).void }
def visit(node); end
- # source://rbi//lib/rbi/rbs_printer.rb#900
+ # source://rbi//lib/rbi/rbs_printer.rb#936
sig { params(type: ::RBI::Type::All).void }
def visit_all(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#910
+ # source://rbi//lib/rbi/rbs_printer.rb#946
sig { params(type: ::RBI::Type::Any).void }
def visit_any(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#857
+ # source://rbi//lib/rbi/rbs_printer.rb#886
sig { params(type: ::RBI::Type::Anything).void }
def visit_anything(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#882
+ # source://rbi//lib/rbi/rbs_printer.rb#911
sig { params(type: ::RBI::Type::AttachedClass).void }
def visit_attached_class(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#841
+ # source://rbi//lib/rbi/rbs_printer.rb#870
sig { params(type: ::RBI::Type::Boolean).void }
def visit_boolean(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#962
+ # source://rbi//lib/rbi/rbs_printer.rb#1013
sig { params(type: ::RBI::Type::Class).void }
def visit_class(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#893
+ # source://rbi//lib/rbi/rbs_printer.rb#929
sig { params(type: ::RBI::Type::ClassOf).void }
def visit_class_of(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#846
+ # source://rbi//lib/rbi/rbs_printer.rb#875
sig { params(type: ::RBI::Type::Generic).void }
def visit_generic(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#887
+ # source://rbi//lib/rbi/rbs_printer.rb#916
sig { params(type: ::RBI::Type::Nilable).void }
def visit_nilable(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#867
+ # source://rbi//lib/rbi/rbs_printer.rb#896
sig { params(type: ::RBI::Type::NoReturn).void }
def visit_no_return(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#941
+ # source://rbi//lib/rbi/rbs_printer.rb#986
sig { params(type: ::RBI::Type::Proc).void }
def visit_proc(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#877
+ # source://rbi//lib/rbi/rbs_printer.rb#906
sig { params(type: ::RBI::Type::SelfType).void }
def visit_self_type(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#930
+ # source://rbi//lib/rbi/rbs_printer.rb#966
sig { params(type: ::RBI::Type::Shape).void }
def visit_shape(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#836
+ # source://rbi//lib/rbi/rbs_printer.rb#865
sig { params(type: ::RBI::Type::Simple).void }
def visit_simple(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#920
+ # source://rbi//lib/rbi/rbs_printer.rb#956
sig { params(type: ::RBI::Type::Tuple).void }
def visit_tuple(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#957
+ # source://rbi//lib/rbi/rbs_printer.rb#1008
sig { params(type: ::RBI::Type::TypeParameter).void }
def visit_type_parameter(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#872
+ # source://rbi//lib/rbi/rbs_printer.rb#901
sig { params(type: ::RBI::Type::Untyped).void }
def visit_untyped(type); end
- # source://rbi//lib/rbi/rbs_printer.rb#862
+ # source://rbi//lib/rbi/rbs_printer.rb#891
sig { params(type: ::RBI::Type::Void).void }
def visit_void(type); end
private
- # source://rbi//lib/rbi/rbs_printer.rb#971
+ # source://rbi//lib/rbi/rbs_printer.rb#1022
sig { params(type_name: ::String).returns(::String) }
def translate_t_type(type_name); end
end
diff --git a/sorbet/rbi/gems/regexp_parser@2.9.0.rbi b/sorbet/rbi/gems/regexp_parser@2.9.2.rbi
similarity index 99%
rename from sorbet/rbi/gems/regexp_parser@2.9.0.rbi
rename to sorbet/rbi/gems/regexp_parser@2.9.2.rbi
index 34ad4f2a..584c4553 100644
--- a/sorbet/rbi/gems/regexp_parser@2.9.0.rbi
+++ b/sorbet/rbi/gems/regexp_parser@2.9.2.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `regexp_parser` gem.
# Please instead update this file by running `bin/tapioca gem regexp_parser`.
+
# source://regexp_parser//lib/regexp_parser/expression/shared.rb#1
module Regexp::Expression; end
@@ -1132,7 +1133,7 @@ end
# source://regexp_parser//lib/regexp_parser/expression/classes/keep.rb#2
module Regexp::Expression::Keep; end
-# TOOD: in regexp_parser v3.0.0 this should possibly be a Subexpression
+# TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression
# that contains all expressions to its left.
#
# source://regexp_parser//lib/regexp_parser/expression/classes/keep.rb#5
@@ -2368,7 +2369,7 @@ class Regexp::Parser
# source://regexp_parser//lib/regexp_parser/parser.rb#262
def assign_effective_number(exp); end
- # Assigns referenced expressions to refering expressions, e.g. if there is
+ # Assigns referenced expressions to referring expressions, e.g. if there is
# an instance of Backreference::Number, its #referenced_expression is set to
# the instance of Group::Capture that it refers to via its number.
#
diff --git a/sorbet/rbi/gems/reline@0.5.0.rbi b/sorbet/rbi/gems/reline@0.5.10.rbi
similarity index 99%
rename from sorbet/rbi/gems/reline@0.5.0.rbi
rename to sorbet/rbi/gems/reline@0.5.10.rbi
index b8c01d40..13fa313b 100644
--- a/sorbet/rbi/gems/reline@0.5.0.rbi
+++ b/sorbet/rbi/gems/reline@0.5.10.rbi
@@ -4,5 +4,6 @@
# This is an autogenerated file for types exported from the `reline` gem.
# Please instead update this file by running `bin/tapioca gem reline`.
+
# THIS IS AN EMPTY RBI FILE.
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
diff --git a/sorbet/rbi/gems/rexml@3.2.6.rbi b/sorbet/rbi/gems/rexml@3.2.6.rbi
deleted file mode 100644
index c8d67b58..00000000
--- a/sorbet/rbi/gems/rexml@3.2.6.rbi
+++ /dev/null
@@ -1,4781 +0,0 @@
-# typed: true
-
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `rexml` gem.
-# Please instead update this file by running `bin/tapioca gem rexml`.
-
-# This class needs:
-# * Documentation
-# * Work! Not all types of attlists are intelligently parsed, so we just
-# spew back out what we get in. This works, but it would be better if
-# we formatted the output ourselves.
-#
-# AttlistDecls provide *just* enough support to allow namespace
-# declarations. If you need some sort of generalized support, or have an
-# interesting idea about how to map the hideous, terrible design of DTD
-# AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
-# for anything to make DTDs more palateable.
-#
-# source://rexml//lib/rexml/attlistdecl.rb#18
-class REXML::AttlistDecl < ::REXML::Child
- include ::Enumerable
-
- # Create an AttlistDecl, pulling the information from a Source. Notice
- # that this isn't very convenient; to create an AttlistDecl, you basically
- # have to format it yourself, and then have the initializer parse it.
- # Sorry, but for the foreseeable future, DTD support in REXML is pretty
- # weak on convenience. Have I mentioned how much I hate DTDs?
- #
- # @return [AttlistDecl] a new instance of AttlistDecl
- #
- # source://rexml//lib/rexml/attlistdecl.rb#29
- def initialize(source); end
-
- # Access the attlist attribute/value pairs.
- # value = attlist_decl[ attribute_name ]
- #
- # source://rexml//lib/rexml/attlistdecl.rb#38
- def [](key); end
-
- # Iterate over the key/value pairs:
- # attlist_decl.each { |attribute_name, attribute_value| ... }
- #
- # source://rexml//lib/rexml/attlistdecl.rb#50
- def each(&block); end
-
- # What is this? Got me.
- #
- # source://rexml//lib/rexml/attlistdecl.rb#22
- def element_name; end
-
- # Whether an attlist declaration includes the given attribute definition
- # if attlist_decl.include? "xmlns:foobar"
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/attlistdecl.rb#44
- def include?(key); end
-
- # source://rexml//lib/rexml/attlistdecl.rb#59
- def node_type; end
-
- # Write out exactly what we got in.
- #
- # source://rexml//lib/rexml/attlistdecl.rb#55
- def write(out, indent = T.unsafe(nil)); end
-end
-
-# Defines an Element Attribute; IE, a attribute=value pair, as in:
-# . Attributes can be in their own
-# namespaces. General users of REXML will not interact with the
-# Attribute class much.
-#
-# source://rexml//lib/rexml/attribute.rb#10
-class REXML::Attribute
- include ::REXML::Node
- include ::REXML::XMLTokens
- include ::REXML::Namespace
-
- # Constructor.
- # FIXME: The parser doesn't catch illegal characters in attributes
- #
- # first::
- # Either: an Attribute, which this new attribute will become a
- # clone of; or a String, which is the name of this attribute
- # second::
- # If +first+ is an Attribute, then this may be an Element, or nil.
- # If nil, then the Element parent of this attribute is the parent
- # of the +first+ Attribute. If the first argument is a String,
- # then this must also be a String, and is the content of the attribute.
- # If this is the content, it must be fully normalized (contain no
- # illegal characters).
- # parent::
- # Ignored unless +first+ is a String; otherwise, may be the Element
- # parent of this attribute, or nil.
- #
- #
- # Attribute.new( attribute_to_clone )
- # Attribute.new( attribute_to_clone, parent_element )
- # Attribute.new( "attr", "attr_value" )
- # Attribute.new( "attr", "attr_value", parent_element )
- #
- # @return [Attribute] a new instance of Attribute
- #
- # source://rexml//lib/rexml/attribute.rb#42
- def initialize(first, second = T.unsafe(nil), parent = T.unsafe(nil)); end
-
- # Returns true if other is an Attribute and has the same name and value,
- # false otherwise.
- #
- # source://rexml//lib/rexml/attribute.rb#106
- def ==(other); end
-
- # Returns a copy of this attribute
- #
- # source://rexml//lib/rexml/attribute.rb#163
- def clone; end
-
- # source://rexml//lib/rexml/attribute.rb#132
- def doctype; end
-
- # The element to which this attribute belongs
- #
- # source://rexml//lib/rexml/attribute.rb#15
- def element; end
-
- # Sets the element of which this object is an attribute. Normally, this
- # is not directly called.
- #
- # Returns this attribute
- #
- # source://rexml//lib/rexml/attribute.rb#171
- def element=(element); end
-
- # Creates (and returns) a hash from both the name and value
- #
- # source://rexml//lib/rexml/attribute.rb#111
- def hash; end
-
- # source://rexml//lib/rexml/attribute.rb#197
- def inspect; end
-
- # Returns the namespace URL, if defined, or nil otherwise
- #
- # e = Element.new("el")
- # e.add_namespace("ns", "http://url")
- # e.add_attribute("ns:a", "b")
- # e.add_attribute("nsx:a", "c")
- # e.attribute("ns:a").namespace # => "http://url"
- # e.attribute("nsx:a").namespace # => nil
- #
- # This method always returns "" for no namespace attribute. Because
- # the default namespace doesn't apply to attribute names.
- #
- # From https://www.w3.org/TR/xml-names/#uniqAttrs
- #
- # > the default namespace does not apply to attribute names
- #
- # e = REXML::Element.new("el")
- # e.add_namespace("", "http://example.com/")
- # e.namespace # => "http://example.com/"
- # e.add_attribute("a", "b")
- # e.attribute("a").namespace # => ""
- #
- # source://rexml//lib/rexml/attribute.rb#95
- def namespace(arg = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/attribute.rb#193
- def node_type; end
-
- # The normalized value of this attribute. That is, the attribute with
- # entities intact.
- #
- # source://rexml//lib/rexml/attribute.rb#157
- def normalized=(new_normalized); end
-
- # Returns the namespace of the attribute.
- #
- # e = Element.new( "elns:myelement" )
- # e.add_attribute( "nsa:a", "aval" )
- # e.add_attribute( "b", "bval" )
- # e.attributes.get_attribute( "a" ).prefix # -> "nsa"
- # e.attributes.get_attribute( "b" ).prefix # -> ""
- # a = Attribute.new( "x", "y" )
- # a.prefix # -> ""
- #
- # source://rexml//lib/rexml/attribute.rb#70
- def prefix; end
-
- # Removes this Attribute from the tree, and returns true if successful
- #
- # This method is usually not called directly.
- #
- # source://rexml//lib/rexml/attribute.rb#184
- def remove; end
-
- # Returns the attribute value, with entities replaced
- #
- # source://rexml//lib/rexml/attribute.rb#140
- def to_s; end
-
- # Returns this attribute out as XML source, expanding the name
- #
- # a = Attribute.new( "x", "y" )
- # a.to_string # -> "x='y'"
- # b = Attribute.new( "ns:x", "y" )
- # b.to_string # -> "ns:x='y'"
- #
- # source://rexml//lib/rexml/attribute.rb#121
- def to_string; end
-
- # Returns the UNNORMALIZED value of this attribute. That is, entities
- # have been expanded to their values
- #
- # source://rexml//lib/rexml/attribute.rb#149
- def value; end
-
- # Writes this attribute (EG, puts 'key="value"' to the output)
- #
- # source://rexml//lib/rexml/attribute.rb#189
- def write(output, indent = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/attribute.rb#203
- def xpath; end
-end
-
-# A class that defines the set of Attributes of an Element and provides
-# operations for accessing elements in that set.
-#
-# source://rexml//lib/rexml/element.rb#2141
-class REXML::Attributes < ::Hash
- # :call-seq:
- # new(element)
- #
- # Creates and returns a new \REXML::Attributes object.
- # The element given by argument +element+ is stored,
- # but its own attributes are not modified:
- #
- # ele = REXML::Element.new('foo')
- # attrs = REXML::Attributes.new(ele)
- # attrs.object_id == ele.attributes.object_id # => false
- #
- # Other instance methods in class \REXML::Attributes may refer to:
- #
- # - +element.document+.
- # - +element.prefix+.
- # - +element.expanded_name+.
- #
- # @return [Attributes] a new instance of Attributes
- #
- # source://rexml//lib/rexml/element.rb#2160
- def initialize(element); end
-
- # :call-seq:
- # add(attribute) -> attribute
- #
- # Adds attribute +attribute+, replacing the previous
- # attribute of the same name if it exists;
- # returns +attribute+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}}
- # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2'
- # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3'
- # attrs.include?('baz') # => true
- #
- # source://rexml//lib/rexml/element.rb#2537
- def <<(attribute); end
-
- # :call-seq:
- # [name] -> attribute_value or nil
- #
- # Returns the value for the attribute given by +name+,
- # if it exists; otherwise +nil+.
- # The value returned is the unnormalized attribute value,
- # with entities expanded:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.elements['//ele'] # =>
- # ele.attributes['att'] # => "<"
- # ele.attributes['bar:att'] # => "2"
- # ele.attributes['nosuch'] # => nil
- #
- # Related: get_attribute (returns an \Attribute object).
- #
- # source://rexml//lib/rexml/element.rb#2185
- def [](name); end
-
- # :call-seq:
- # [name] = value -> value
- #
- # When +value+ is non-+nil+,
- # assigns that to the attribute for the given +name+,
- # overwriting the previous value if it exists:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs['foo:att'] = '2' # => "2"
- # attrs['baz:att'] = '3' # => "3"
- #
- # When +value+ is +nil+, deletes the attribute if it exists:
- #
- # attrs['baz:att'] = nil
- # attrs.include?('baz:att') # => false
- #
- # source://rexml//lib/rexml/element.rb#2369
- def []=(name, value); end
-
- # :call-seq:
- # add(attribute) -> attribute
- #
- # Adds attribute +attribute+, replacing the previous
- # attribute of the same name if it exists;
- # returns +attribute+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}}
- # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2'
- # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3'
- # attrs.include?('baz') # => true
- #
- # source://rexml//lib/rexml/element.rb#2537
- def add(attribute); end
-
- # :call-seq:
- # delete(name) -> element
- # delete(attribute) -> element
- #
- # Removes a specified attribute if it exists;
- # returns the attributes' element.
- #
- # When string argument +name+ is given,
- # removes the attribute of that name if it exists:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs.delete('foo:att') # =>
- # attrs.delete('foo:att') # =>
- #
- # When attribute argument +attribute+ is given,
- # removes that attribute if it exists:
- #
- # attr = REXML::Attribute.new('bar:att', '2')
- # attrs.delete(attr) # => # =>
- # attrs.delete(attr) # => # =>
- #
- # source://rexml//lib/rexml/element.rb#2490
- def delete(attribute); end
-
- # :call-seq:
- # delete_all(name) -> array_of_removed_attributes
- #
- # Removes all attributes matching the given +name+;
- # returns an array of the removed attributes:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs.delete_all('att') # => [att='<']
- #
- # source://rexml//lib/rexml/element.rb#2559
- def delete_all(name); end
-
- # :call-seq:
- # each {|expanded_name, value| ... }
- #
- # Calls the given block with each expanded-name/value pair:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # ele.attributes.each do |expanded_name, value|
- # p [expanded_name, value]
- # end
- #
- # Output:
- #
- # ["foo:att", "1"]
- # ["bar:att", "2"]
- # ["att", "<"]
- #
- # source://rexml//lib/rexml/element.rb#2287
- def each; end
-
- # :call-seq:
- # each_attribute {|attr| ... }
- #
- # Calls the given block with each \REXML::Attribute object:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # ele.attributes.each_attribute do |attr|
- # p [attr.class, attr]
- # end
- #
- # Output:
- #
- # [REXML::Attribute, foo:att='1']
- # [REXML::Attribute, bar:att='2']
- # [REXML::Attribute, att='<']
- #
- # source://rexml//lib/rexml/element.rb#2254
- def each_attribute; end
-
- # :call-seq:
- # get_attribute(name) -> attribute_object or nil
- #
- # Returns the \REXML::Attribute object for the given +name+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs.get_attribute('foo:att') # => foo:att='1'
- # attrs.get_attribute('foo:att').class # => REXML::Attribute
- # attrs.get_attribute('bar:att') # => bar:att='2'
- # attrs.get_attribute('att') # => att='<'
- # attrs.get_attribute('nosuch') # => nil
- #
- # source://rexml//lib/rexml/element.rb#2313
- def get_attribute(name); end
-
- # :call-seq:
- # get_attribute_ns(namespace, name)
- #
- # Returns the \REXML::Attribute object among the attributes
- # that matches the given +namespace+ and +name+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes
- # attrs.get_attribute_ns('http://foo', 'att') # => foo:att='1'
- # attrs.get_attribute_ns('http://foo', 'nosuch') # => nil
- #
- # source://rexml//lib/rexml/element.rb#2585
- def get_attribute_ns(namespace, name); end
-
- # :call-seq:
- # length
- #
- # Returns the count of attributes:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # ele.attributes.length # => 3
- #
- # source://rexml//lib/rexml/element.rb#2225
- def length; end
-
- # :call-seq:
- # namespaces
- #
- # Returns a hash of name/value pairs for the namespaces:
- #
- # xml_string = ''
- # d = REXML::Document.new(xml_string)
- # d.root.attributes.namespaces # => {"xmlns"=>"foo", "x"=>"bar", "y"=>"twee"}
- #
- # source://rexml//lib/rexml/element.rb#2446
- def namespaces; end
-
- # :call-seq:
- # prefixes -> array_of_prefix_strings
- #
- # Returns an array of prefix strings in the attributes.
- # The array does not include the default
- # namespace declaration, if one exists.
- #
- # xml_string = ''
- # d = REXML::Document.new(xml_string)
- # d.root.attributes.prefixes # => ["x", "y"]
- #
- # source://rexml//lib/rexml/element.rb#2421
- def prefixes; end
-
- # :call-seq:
- # length
- #
- # Returns the count of attributes:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # ele.attributes.length # => 3
- #
- # source://rexml//lib/rexml/element.rb#2225
- def size; end
-
- # :call-seq:
- # to_a -> array_of_attribute_objects
- #
- # Returns an array of \REXML::Attribute objects representing
- # the attributes:
- #
- # xml_string = <<-EOT
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # ele = d.root.elements['//ele'] # =>
- # attrs = ele.attributes.to_a # => [foo:att='1', bar:att='2', att='<']
- # attrs.first.class # => REXML::Attribute
- #
- # source://rexml//lib/rexml/element.rb#2207
- def to_a; end
-end
-
-# source://rexml//lib/rexml/cdata.rb#5
-class REXML::CData < ::REXML::Text
- # Constructor. CData is data between
- #
- # _Examples_
- # CData.new( source )
- # CData.new( "Here is some CDATA" )
- # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element )
- #
- # @return [CData] a new instance of CData
- #
- # source://rexml//lib/rexml/cdata.rb#16
- def initialize(first, whitespace = T.unsafe(nil), parent = T.unsafe(nil)); end
-
- # Make a copy of this object
- #
- # _Examples_
- # c = CData.new( "Some text" )
- # d = c.clone
- # d.to_s # -> "Some text"
- #
- # source://rexml//lib/rexml/cdata.rb#26
- def clone; end
-
- # Returns the content of this CData object
- #
- # _Examples_
- # c = CData.new( "Some text" )
- # c.to_s # -> "Some text"
- #
- # source://rexml//lib/rexml/cdata.rb#35
- def to_s; end
-
- # source://rexml//lib/rexml/cdata.rb#39
- def value; end
-
- # == DEPRECATED
- # See the rexml/formatters package
- #
- # Generates XML output of this object
- #
- # output::
- # Where to write the string. Defaults to $stdout
- # indent::
- # The amount to indent this node by
- # transitive::
- # Ignored
- # ie_hack::
- # Ignored
- #
- # _Examples_
- # c = CData.new( " Some text " )
- # c.write( $stdout ) #->
- #
- # source://rexml//lib/rexml/cdata.rb#60
- def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-end
-
-# A Child object is something contained by a parent, and this class
-# contains methods to support that. Most user code will not use this
-# class directly.
-#
-# source://rexml//lib/rexml/child.rb#9
-class REXML::Child
- include ::REXML::Node
-
- # Constructor. Any inheritors of this class should call super to make
- # sure this method is called.
- # parent::
- # if supplied, the parent of this child will be set to the
- # supplied value, and self will be added to the parent
- #
- # @return [Child] a new instance of Child
- #
- # source://rexml//lib/rexml/child.rb#18
- def initialize(parent = T.unsafe(nil)); end
-
- # This doesn't yet handle encodings
- #
- # source://rexml//lib/rexml/child.rb#91
- def bytes; end
-
- # Returns:: the document this child belongs to, or nil if this child
- # belongs to no document
- #
- # source://rexml//lib/rexml/child.rb#85
- def document; end
-
- # source://rexml//lib/rexml/node.rb#11
- def next_sibling; end
-
- # Sets the next sibling of this child. This can be used to insert a child
- # after some other child.
- # a = Element.new("a")
- # b = a.add_element("b")
- # c = Element.new("c")
- # b.next_sibling = c
- # # =>
- #
- # source://rexml//lib/rexml/child.rb#68
- def next_sibling=(other); end
-
- # The Parent of this object
- #
- # source://rexml//lib/rexml/child.rb#11
- def parent; end
-
- # Sets the parent of this child to the supplied argument.
- #
- # other::
- # Must be a Parent object. If this object is the same object as the
- # existing parent of this child, no action is taken. Otherwise, this
- # child is removed from the current parent (if one exists), and is added
- # to the new parent.
- # Returns:: The parent added
- #
- # source://rexml//lib/rexml/child.rb#52
- def parent=(other); end
-
- # source://rexml//lib/rexml/node.rb#17
- def previous_sibling; end
-
- # Sets the previous sibling of this child. This can be used to insert a
- # child before some other child.
- # a = Element.new("a")
- # b = a.add_element("b")
- # c = Element.new("c")
- # b.previous_sibling = c
- # # =>
- #
- # source://rexml//lib/rexml/child.rb#79
- def previous_sibling=(other); end
-
- # Removes this child from the parent.
- #
- # Returns:: self
- #
- # source://rexml//lib/rexml/child.rb#37
- def remove; end
-
- # Replaces this object with another object. Basically, calls
- # Parent.replace_child
- #
- # Returns:: self
- #
- # source://rexml//lib/rexml/child.rb#29
- def replace_with(child); end
-end
-
-# Represents an XML comment; that is, text between \
-#
-# source://rexml//lib/rexml/comment.rb#7
-class REXML::Comment < ::REXML::Child
- include ::Comparable
-
- # Constructor. The first argument can be one of three types:
- # argument. If Comment, the argument is duplicated. If
- # Source, the argument is scanned for a comment.
- # should be nil, not supplied, or a Parent to be set as the parent
- # of this object
- #
- # @param first If String, the contents of this comment are set to the
- # @param second If the first argument is a Source, this argument
- # @return [Comment] a new instance of Comment
- #
- # source://rexml//lib/rexml/comment.rb#24
- def initialize(first, second = T.unsafe(nil)); end
-
- # Compares this Comment to another; the contents of the comment are used
- # in the comparison.
- #
- # source://rexml//lib/rexml/comment.rb#63
- def <=>(other); end
-
- # Compares this Comment to another; the contents of the comment are used
- # in the comparison.
- #
- # source://rexml//lib/rexml/comment.rb#70
- def ==(other); end
-
- # source://rexml//lib/rexml/comment.rb#33
- def clone; end
-
- # source://rexml//lib/rexml/comment.rb#75
- def node_type; end
-
- # The content text
- #
- # source://rexml//lib/rexml/comment.rb#14
- def string; end
-
- # The content text
- #
- # source://rexml//lib/rexml/comment.rb#14
- def string=(_arg0); end
-
- # The content text
- #
- # source://rexml//lib/rexml/comment.rb#14
- def to_s; end
-
- # == DEPRECATED
- # See REXML::Formatters
- #
- # output::
- # Where to write the string
- # indent::
- # An integer. If -1, no indenting will be used; otherwise, the
- # indentation will be this number of spaces, and children will be
- # indented an additional amount.
- # transitive::
- # Ignored by this class. The contents of comments are never modified.
- # ie_hack::
- # Needed for conformity to the child API, but not used by this class.
- #
- # source://rexml//lib/rexml/comment.rb#50
- def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-end
-
-# source://rexml//lib/rexml/xpath_parser.rb#11
-module REXML::DClonable; end
-
-# This is an abstract class. You never use this directly; it serves as a
-# parent class for the specific declarations.
-#
-# source://rexml//lib/rexml/doctype.rb#242
-class REXML::Declaration < ::REXML::Child
- # @return [Declaration] a new instance of Declaration
- #
- # source://rexml//lib/rexml/doctype.rb#243
- def initialize(src); end
-
- # source://rexml//lib/rexml/doctype.rb#248
- def to_s; end
-
- # == DEPRECATED
- # See REXML::Formatters
- #
- # source://rexml//lib/rexml/doctype.rb#255
- def write(output, indent); end
-end
-
-# Represents an XML DOCTYPE declaration; that is, the contents of . DOCTYPES can be used to declare the DTD of a document, as well as
-# being used to declare entities used in the document.
-#
-# source://rexml//lib/rexml/doctype.rb#51
-class REXML::DocType < ::REXML::Parent
- include ::REXML::XMLTokens
-
- # Constructor
- #
- # dt = DocType.new( 'foo', '-//I/Hate/External/IDs' )
- # #
- # dt = DocType.new( doctype_to_clone )
- # # Incomplete. Shallow clone of doctype
- #
- # +Note+ that the constructor:
- #
- # Doctype.new( Source.new( "" ) )
- #
- # is _deprecated_. Do not use it. It will probably disappear.
- #
- # @return [DocType] a new instance of DocType
- #
- # source://rexml//lib/rexml/doctype.rb#80
- def initialize(first, parent = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/doctype.rb#185
- def add(child); end
-
- # source://rexml//lib/rexml/doctype.rb#125
- def attribute_of(element, attribute); end
-
- # source://rexml//lib/rexml/doctype.rb#115
- def attributes_of(element); end
-
- # source://rexml//lib/rexml/doctype.rb#135
- def clone; end
-
- # source://rexml//lib/rexml/doctype.rb#173
- def context; end
-
- # name is the name of the doctype
- # external_id is the referenced DTD, if given
- #
- # source://rexml//lib/rexml/doctype.rb#66
- def entities; end
-
- # source://rexml//lib/rexml/doctype.rb#181
- def entity(name); end
-
- # name is the name of the doctype
- # external_id is the referenced DTD, if given
- #
- # source://rexml//lib/rexml/doctype.rb#66
- def external_id; end
-
- # name is the name of the doctype
- # external_id is the referenced DTD, if given
- #
- # source://rexml//lib/rexml/doctype.rb#66
- def name; end
-
- # name is the name of the doctype
- # external_id is the referenced DTD, if given
- #
- # source://rexml//lib/rexml/doctype.rb#66
- def namespaces; end
-
- # source://rexml//lib/rexml/doctype.rb#111
- def node_type; end
-
- # Retrieves a named notation. Only notations declared in the internal
- # DTD subset can be retrieved.
- #
- # Method contributed by Henrik Martensson
- #
- # source://rexml//lib/rexml/doctype.rb#229
- def notation(name); end
-
- # This method returns a list of notations that have been declared in the
- # _internal_ DTD subset. Notations in the external DTD subset are not
- # listed.
- #
- # Method contributed by Henrik Martensson
- #
- # source://rexml//lib/rexml/doctype.rb#221
- def notations; end
-
- # This method retrieves the public identifier identifying the document's
- # DTD.
- #
- # Method contributed by Henrik Martensson
- #
- # source://rexml//lib/rexml/doctype.rb#195
- def public; end
-
- # This method retrieves the system identifier identifying the document's DTD
- #
- # Method contributed by Henrik Martensson
- #
- # source://rexml//lib/rexml/doctype.rb#207
- def system; end
-
- # output::
- # Where to write the string
- # indent::
- # An integer. If -1, no indentation will be used; otherwise, the
- # indentation will be this number of spaces, and children will be
- # indented an additional amount.
- # transitive::
- # Ignored
- # ie_hack::
- # Ignored
- #
- # source://rexml//lib/rexml/doctype.rb#149
- def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-end
-
-# Represents an XML document.
-#
-# A document may have:
-#
-# - A single child that may be accessed via method #root.
-# - An XML declaration.
-# - A document type.
-# - Processing instructions.
-#
-# == In a Hurry?
-#
-# If you're somewhat familiar with XML
-# and have a particular task in mind,
-# you may want to see the
-# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
-# and in particular, the
-# {tasks page for documents}[../doc/rexml/tasks/tocs/document_toc_rdoc.html].
-#
-# source://rexml//lib/rexml/document.rb#35
-class REXML::Document < ::REXML::Element
- # :call-seq:
- # new(string = nil, context = {}) -> new_document
- # new(io_stream = nil, context = {}) -> new_document
- # new(document = nil, context = {}) -> new_document
- #
- # Returns a new \REXML::Document object.
- #
- # When no arguments are given,
- # returns an empty document:
- #
- # d = REXML::Document.new
- # d.to_s # => ""
- #
- # When argument +string+ is given, it must be a string
- # containing a valid XML document:
- #
- # xml_string = 'FooBar'
- # d = REXML::Document.new(xml_string)
- # d.to_s # => "FooBar"
- #
- # When argument +io_stream+ is given, it must be an \IO object
- # that is opened for reading, and when read must return a valid XML document:
- #
- # File.write('t.xml', xml_string)
- # d = File.open('t.xml', 'r') do |io|
- # REXML::Document.new(io)
- # end
- # d.to_s # => "FooBar"
- #
- # When argument +document+ is given, it must be an existing
- # document object, whose context and attributes (but not children)
- # are cloned into the new document:
- #
- # d = REXML::Document.new(xml_string)
- # d.children # => [ ... >]
- # d.context = {raw: :all, compress_whitespace: :all}
- # d.add_attributes({'bar' => 0, 'baz' => 1})
- # d1 = REXML::Document.new(d)
- # d1.children # => []
- # d1.context # => {:raw=>:all, :compress_whitespace=>:all}
- # d1.attributes # => {"bar"=>bar='0', "baz"=>baz='1'}
- #
- # When argument +context+ is given, it must be a hash
- # containing context entries for the document;
- # see {Element Context}[../doc/rexml/context_rdoc.html]:
- #
- # context = {raw: :all, compress_whitespace: :all}
- # d = REXML::Document.new(xml_string, context)
- # d.context # => {:raw=>:all, :compress_whitespace=>:all}
- #
- # @return [Document] a new instance of Document
- #
- # source://rexml//lib/rexml/document.rb#92
- def initialize(source = T.unsafe(nil), context = T.unsafe(nil)); end
-
- # :call-seq:
- # add(xml_decl) -> self
- # add(doc_type) -> self
- # add(object) -> self
- #
- # Adds an object to the document; returns +self+.
- #
- # When argument +xml_decl+ is given,
- # it must be an REXML::XMLDecl object,
- # which becomes the XML declaration for the document,
- # replacing the previous XML declaration if any:
- #
- # d = REXML::Document.new
- # d.xml_decl.to_s # => ""
- # d.add(REXML::XMLDecl.new('2.0'))
- # d.xml_decl.to_s # => ""
- #
- # When argument +doc_type+ is given,
- # it must be an REXML::DocType object,
- # which becomes the document type for the document,
- # replacing the previous document type, if any:
- #
- # d = REXML::Document.new
- # d.doctype.to_s # => ""
- # d.add(REXML::DocType.new('foo'))
- # d.doctype.to_s # => ""
- #
- # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object)
- # is given it is added as the last child:
- #
- # d = REXML::Document.new
- # d.add(REXML::Element.new('foo'))
- # d.to_s # => ""
- #
- # source://rexml//lib/rexml/document.rb#170
- def <<(child); end
-
- # :call-seq:
- # add(xml_decl) -> self
- # add(doc_type) -> self
- # add(object) -> self
- #
- # Adds an object to the document; returns +self+.
- #
- # When argument +xml_decl+ is given,
- # it must be an REXML::XMLDecl object,
- # which becomes the XML declaration for the document,
- # replacing the previous XML declaration if any:
- #
- # d = REXML::Document.new
- # d.xml_decl.to_s # => ""
- # d.add(REXML::XMLDecl.new('2.0'))
- # d.xml_decl.to_s # => ""
- #
- # When argument +doc_type+ is given,
- # it must be an REXML::DocType object,
- # which becomes the document type for the document,
- # replacing the previous document type, if any:
- #
- # d = REXML::Document.new
- # d.doctype.to_s # => ""
- # d.add(REXML::DocType.new('foo'))
- # d.doctype.to_s # => ""
- #
- # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object)
- # is given it is added as the last child:
- #
- # d = REXML::Document.new
- # d.add(REXML::Element.new('foo'))
- # d.to_s # => ""
- #
- # source://rexml//lib/rexml/document.rb#170
- def add(child); end
-
- # :call-seq:
- # add_element(name_or_element = nil, attributes = nil) -> new_element
- #
- # Adds an element to the document by calling REXML::Element.add_element:
- #
- # REXML::Element.add_element(name_or_element, attributes)
- #
- # source://rexml//lib/rexml/document.rb#209
- def add_element(arg = T.unsafe(nil), arg2 = T.unsafe(nil)); end
-
- # :call-seq:
- # clone -> new_document
- #
- # Returns the new document resulting from executing
- # Document.new(self). See Document.new.
- #
- # source://rexml//lib/rexml/document.rb#120
- def clone; end
-
- # :call-seq:
- # doctype -> doc_type or nil
- #
- # Returns the DocType object for the document, if it exists, otherwise +nil+:
- #
- # d = REXML::Document.new('')
- # d.doctype.class # => REXML::DocType
- # d = REXML::Document.new('')
- # d.doctype.class # => nil
- #
- # source://rexml//lib/rexml/document.rb#241
- def doctype; end
-
- # source://rexml//lib/rexml/document.rb#442
- def document; end
-
- # :call-seq:
- # encoding -> encoding_string
- #
- # Returns the XMLDecl encoding of the document,
- #
- # d = REXML::Document.new('')
- # d.encoding # => "UTF-16"
- # d = REXML::Document.new('')
- # d.encoding # => "UTF-8"
- #
- # source://rexml//lib/rexml/document.rb#290
- def encoding; end
-
- # Returns the value of attribute entity_expansion_count.
- #
- # source://rexml//lib/rexml/document.rb#433
- def entity_expansion_count; end
-
- # :call-seq:
- # expanded_name -> empty_string
- #
- # Returns an empty string.
- #
- # source://rexml//lib/rexml/document.rb#129
- def expanded_name; end
-
- # :call-seq:
- # expanded_name -> empty_string
- #
- # Returns an empty string.
- # d = doc_type
- # d ? d.name : "UNDEFINED"
- #
- # source://rexml//lib/rexml/document.rb#129
- def name; end
-
- # :call-seq:
- # node_type -> :document
- #
- # Returns the symbol +:document+.
- #
- # source://rexml//lib/rexml/document.rb#110
- def node_type; end
-
- # source://rexml//lib/rexml/document.rb#435
- def record_entity_expansion; end
-
- # :call-seq:
- # root -> root_element or nil
- #
- # Returns the root element of the document, if it exists, otherwise +nil+:
- #
- # d = REXML::Document.new('')
- # d.root # =>
- # d = REXML::Document.new('')
- # d.root # => nil
- #
- # source://rexml//lib/rexml/document.rb#225
- def root; end
-
- # :call-seq:
- # stand_alone?
- #
- # Returns the XMLDecl standalone value of the document as a string,
- # if it has been set, otherwise the default standalone value:
- #
- # d = REXML::Document.new('')
- # d.stand_alone? # => "yes"
- # d = REXML::Document.new('')
- # d.stand_alone? # => nil
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/document.rb#305
- def stand_alone?; end
-
- # :call-seq:
- # version -> version_string
- #
- # Returns the XMLDecl version of this document as a string,
- # if it has been set, otherwise the default version:
- #
- # d = REXML::Document.new('')
- # d.version # => "2.0"
- # d = REXML::Document.new('')
- # d.version # => "1.0"
- #
- # source://rexml//lib/rexml/document.rb#275
- def version; end
-
- # :call-seq:
- # doc.write(output=$stdout, indent=-1, transtive=false, ie_hack=false, encoding=nil)
- # doc.write(options={:output => $stdout, :indent => -1, :transtive => false, :ie_hack => false, :encoding => nil})
- #
- # Write the XML tree out, optionally with indent. This writes out the
- # entire XML document, including XML declarations, doctype declarations,
- # and processing instructions (if any are given).
- #
- # A controversial point is whether Document should always write the XML
- # declaration () whether or not one is given by the
- # user (or source document). REXML does not write one if one was not
- # specified, because it adds unnecessary bandwidth to applications such
- # as XML-RPC.
- #
- # Accept Nth argument style and options Hash style as argument.
- # The recommended style is options Hash style for one or more
- # arguments case.
- #
- # _Examples_
- # Document.new("").write
- #
- # output = ""
- # Document.new("").write(output)
- #
- # output = ""
- # Document.new("").write(:output => output, :indent => 2)
- #
- # See also the classes in the rexml/formatters package for the proper way
- # to change the default formatting of XML output.
- #
- # _Examples_
- #
- # output = ""
- # tr = Transitive.new
- # tr.write(Document.new(""), output)
- #
- # output::
- # output an object which supports '<< string'; this is where the
- # document will be written.
- # indent::
- # An integer. If -1, no indenting will be used; otherwise, the
- # indentation will be twice this number of spaces, and children will be
- # indented an additional amount. For a value of 3, every item will be
- # indented 3 more levels, or 6 more spaces (2 * 3). Defaults to -1
- # transitive::
- # If transitive is true and indent is >= 0, then the output will be
- # pretty-printed in such a way that the added whitespace does not affect
- # the absolute *value* of the document -- that is, it leaves the value
- # and number of Text nodes in the document unchanged.
- # ie_hack::
- # This hack inserts a space before the /> on empty tags to address
- # a limitation of Internet Explorer. Defaults to false
- # Encoding name as String. Change output encoding to specified encoding
- # instead of encoding in XML declaration.
- # Defaults to nil. It means encoding in XML declaration is used.
- #
- # source://rexml//lib/rexml/document.rb#365
- def write(*arguments); end
-
- # :call-seq:
- # xml_decl -> xml_decl
- #
- # Returns the XMLDecl object for the document, if it exists,
- # otherwise the default XMLDecl object:
- #
- # d = REXML::Document.new('')
- # d.xml_decl.class # => REXML::XMLDecl
- # d.xml_decl.to_s # => ""
- # d = REXML::Document.new('')
- # d.xml_decl.class # => REXML::XMLDecl
- # d.xml_decl.to_s # => ""
- #
- # source://rexml//lib/rexml/document.rb#258
- def xml_decl; end
-
- private
-
- # source://rexml//lib/rexml/document.rb#447
- def build(source); end
-
- class << self
- # Get the entity expansion limit. By default the limit is set to 10000.
- #
- # Deprecated. Use REXML::Security.entity_expansion_limit= instead.
- #
- # source://rexml//lib/rexml/document.rb#415
- def entity_expansion_limit; end
-
- # Set the entity expansion limit. By default the limit is set to 10000.
- #
- # Deprecated. Use REXML::Security.entity_expansion_limit= instead.
- #
- # source://rexml//lib/rexml/document.rb#408
- def entity_expansion_limit=(val); end
-
- # Get the entity expansion limit. By default the limit is set to 10240.
- #
- # Deprecated. Use REXML::Security.entity_expansion_text_limit instead.
- #
- # source://rexml//lib/rexml/document.rb#429
- def entity_expansion_text_limit; end
-
- # Set the entity expansion limit. By default the limit is set to 10240.
- #
- # Deprecated. Use REXML::Security.entity_expansion_text_limit= instead.
- #
- # source://rexml//lib/rexml/document.rb#422
- def entity_expansion_text_limit=(val); end
-
- # source://rexml//lib/rexml/document.rb#401
- def parse_stream(source, listener); end
- end
-end
-
-# An \REXML::Element object represents an XML element.
-#
-# An element:
-#
-# - Has a name (string).
-# - May have a parent (another element).
-# - Has zero or more children
-# (other elements, text, CDATA, processing instructions, and comments).
-# - Has zero or more siblings
-# (other elements, text, CDATA, processing instructions, and comments).
-# - Has zero or more named attributes.
-#
-# == In a Hurry?
-#
-# If you're somewhat familiar with XML
-# and have a particular task in mind,
-# you may want to see the
-# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html],
-# and in particular, the
-# {tasks page for elements}[../doc/rexml/tasks/tocs/element_toc_rdoc.html].
-#
-# === Name
-#
-# An element has a name, which is initially set when the element is created:
-#
-# e = REXML::Element.new('foo')
-# e.name # => "foo"
-#
-# The name may be changed:
-#
-# e.name = 'bar'
-# e.name # => "bar"
-#
-#
-# === \Parent
-#
-# An element may have a parent.
-#
-# Its parent may be assigned explicitly when the element is created:
-#
-# e0 = REXML::Element.new('foo')
-# e1 = REXML::Element.new('bar', e0)
-# e1.parent # => ... >
-#
-# Note: the representation of an element always shows the element's name.
-# If the element has children, the representation indicates that
-# by including an ellipsis (...).
-#
-# The parent may be assigned explicitly at any time:
-#
-# e2 = REXML::Element.new('baz')
-# e1.parent = e2
-# e1.parent # =>
-#
-# When an element is added as a child, its parent is set automatically:
-#
-# e1.add_element(e0)
-# e0.parent # => ... >
-#
-# For an element that has no parent, method +parent+ returns +nil+.
-#
-# === Children
-#
-# An element has zero or more children.
-# The children are an ordered collection
-# of all objects whose parent is the element itself.
-#
-# The children may include any combination of elements, text, comments,
-# processing instructions, and CDATA.
-# (This example keeps things clean by controlling whitespace
-# via a +context+ setting.)
-#
-# xml_string = <<-EOT
-#
-#
-# text 0
-#
-#
-#
-#
-# text 1
-#
-#
-#
-#
-# EOT
-# context = {ignore_whitespace_nodes: :all, compress_whitespace: :all}
-# d = REXML::Document.new(xml_string, context)
-# root = d.root
-# root.children.size # => 10
-# root.each {|child| p "#{child.class}: #{child}" }
-#
-# Output:
-#
-# "REXML::Element: "
-# "REXML::Text: \n text 0\n "
-# "REXML::Comment: comment 0"
-# "REXML::Instruction: "
-# "REXML::CData: cdata 0"
-# "REXML::Element: "
-# "REXML::Text: \n text 1\n "
-# "REXML::Comment: comment 1"
-# "REXML::Instruction: "
-# "REXML::CData: cdata 1"
-#
-# A child may be added using inherited methods
-# Parent#insert_before or Parent#insert_after:
-#
-# xml_string = ''
-# d = REXML::Document.new(xml_string)
-# root = d.root
-# c = d.root[1] # =>
-# root.insert_before(c, REXML::Element.new('b'))
-# root.to_a # => [, , , ]
-#
-# A child may be replaced using Parent#replace_child:
-#
-# root.replace_child(c, REXML::Element.new('x'))
-# root.to_a # => [, , , ]
-#
-# A child may be removed using Parent#delete:
-#
-# x = root[2] # =>
-# root.delete(x)
-# root.to_a # => [, , ]
-#
-# === Siblings
-#
-# An element has zero or more siblings,
-# which are the other children of the element's parent.
-#
-# In the example above, element +ele_1+ is between a CDATA sibling
-# and a text sibling:
-#
-# ele_1 = root[5] # =>
-# ele_1.previous_sibling # => "cdata 0"
-# ele_1.next_sibling # => "\n text 1\n "
-#
-# === \Attributes
-#
-# An element has zero or more named attributes.
-#
-# A new element has no attributes:
-#
-# e = REXML::Element.new('foo')
-# e.attributes # => {}
-#
-# Attributes may be added:
-#
-# e.add_attribute('bar', 'baz')
-# e.add_attribute('bat', 'bam')
-# e.attributes.size # => 2
-# e['bar'] # => "baz"
-# e['bat'] # => "bam"
-#
-# An existing attribute may be modified:
-#
-# e.add_attribute('bar', 'bad')
-# e.attributes.size # => 2
-# e['bar'] # => "bad"
-#
-# An existing attribute may be deleted:
-#
-# e.delete_attribute('bar')
-# e.attributes.size # => 1
-# e['bar'] # => nil
-#
-# == What's Here
-#
-# To begin with, what's elsewhere?
-#
-# \Class \REXML::Element inherits from its ancestor classes:
-#
-# - REXML::Child
-# - REXML::Parent
-#
-# \REXML::Element itself and its ancestors also include modules:
-#
-# - {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html]
-# - REXML::Namespace
-# - REXML::Node
-# - REXML::XMLTokens
-#
-# === Methods for Creating an \Element
-#
-# ::new:: Returns a new empty element.
-# #clone:: Returns a clone of another element.
-#
-# === Methods for Attributes
-#
-# {[attribute_name]}[#method-i-5B-5D]:: Returns an attribute value.
-# #add_attribute:: Adds a new attribute.
-# #add_attributes:: Adds multiple new attributes.
-# #attribute:: Returns the attribute value for a given name and optional namespace.
-# #delete_attribute:: Removes an attribute.
-#
-# === Methods for Children
-#
-# {[index]}[#method-i-5B-5D]:: Returns the child at the given offset.
-# #add_element:: Adds an element as the last child.
-# #delete_element:: Deletes a child element.
-# #each_element:: Calls the given block with each child element.
-# #each_element_with_attribute:: Calls the given block with each child element
-# that meets given criteria,
-# which can include the attribute name.
-# #each_element_with_text:: Calls the given block with each child element
-# that meets given criteria,
-# which can include text.
-# #get_elements:: Returns an array of element children that match a given xpath.
-#
-# === Methods for \Text Children
-#
-# #add_text:: Adds a text node to the element.
-# #get_text:: Returns a text node that meets specified criteria.
-# #text:: Returns the text string from the first node that meets specified criteria.
-# #texts:: Returns an array of the text children of the element.
-# #text=:: Adds, removes, or replaces the first text child of the element
-#
-# === Methods for Other Children
-#
-# #cdatas:: Returns an array of the cdata children of the element.
-# #comments:: Returns an array of the comment children of the element.
-# #instructions:: Returns an array of the instruction children of the element.
-#
-# === Methods for Namespaces
-#
-# #add_namespace:: Adds a namespace to the element.
-# #delete_namespace:: Removes a namespace from the element.
-# #namespace:: Returns the string namespace URI for the element.
-# #namespaces:: Returns a hash of all defined namespaces in the element.
-# #prefixes:: Returns an array of the string prefixes (names)
-# of all defined namespaces in the element
-#
-# === Methods for Querying
-#
-# #document:: Returns the document, if any, that the element belongs to.
-# #root:: Returns the most distant element (not document) ancestor of the element.
-# #root_node:: Returns the most distant ancestor of the element.
-# #xpath:: Returns the string xpath to the element
-# relative to the most distant parent
-# #has_attributes?:: Returns whether the element has attributes.
-# #has_elements?:: Returns whether the element has elements.
-# #has_text?:: Returns whether the element has text.
-# #next_element:: Returns the next sibling that is an element.
-# #previous_element:: Returns the previous sibling that is an element.
-# #raw:: Returns whether raw mode is set for the element.
-# #whitespace:: Returns whether whitespace is respected for the element.
-# #ignore_whitespace_nodes:: Returns whether whitespace nodes
-# are to be ignored for the element.
-# #node_type:: Returns symbol :element.
-#
-# === One More Method
-#
-# #inspect:: Returns a string representation of the element.
-#
-# === Accessors
-#
-# #elements:: Returns the REXML::Elements object for the element.
-# #attributes:: Returns the REXML::Attributes object for the element.
-# #context:: Returns or sets the context hash for the element.
-#
-# source://rexml//lib/rexml/element.rb#279
-class REXML::Element < ::REXML::Parent
- include ::REXML::XMLTokens
- include ::REXML::Namespace
-
- # :call-seq:
- # Element.new(name = 'UNDEFINED', parent = nil, context = nil) -> new_element
- # Element.new(element, parent = nil, context = nil) -> new_element
- #
- # Returns a new \REXML::Element object.
- #
- # When no arguments are given,
- # returns an element with name 'UNDEFINED':
- #
- # e = REXML::Element.new # =>
- # e.class # => REXML::Element
- # e.name # => "UNDEFINED"
- #
- # When only argument +name+ is given,
- # returns an element of the given name:
- #
- # REXML::Element.new('foo') # =>
- #
- # When only argument +element+ is given, it must be an \REXML::Element object;
- # returns a shallow copy of the given element:
- #
- # e0 = REXML::Element.new('foo')
- # e1 = REXML::Element.new(e0) # =>
- #
- # When argument +parent+ is also given, it must be an REXML::Parent object:
- #
- # e = REXML::Element.new('foo', REXML::Parent.new)
- # e.parent # => #]>
- #
- # When argument +context+ is also given, it must be a hash
- # representing the context for the element;
- # see {Element Context}[../doc/rexml/context_rdoc.html]:
- #
- # e = REXML::Element.new('foo', nil, {raw: :all})
- # e.context # => {:raw=>:all}
- #
- # @return [Element] a new instance of Element
- #
- # source://rexml//lib/rexml/element.rb#327
- def initialize(arg = T.unsafe(nil), parent = T.unsafe(nil), context = T.unsafe(nil)); end
-
- # :call-seq:
- # [index] -> object
- # [attr_name] -> attr_value
- # [attr_sym] -> attr_value
- #
- # With integer argument +index+ given,
- # returns the child at offset +index+, or +nil+ if none:
- #
- # d = REXML::Document.new '>textmore'
- # root = d.root
- # (0..root.size).each do |index|
- # node = root[index]
- # p "#{index}: #{node} (#{node.class})"
- # end
- #
- # Output:
- #
- # "0: (REXML::Element)"
- # "1: text (REXML::Text)"
- # "2: (REXML::Element)"
- # "3: more (REXML::Text)"
- # "4: (REXML::Element)"
- # "5: (NilClass)"
- #
- # With string argument +attr_name+ given,
- # returns the string value for the given attribute name if it exists,
- # otherwise +nil+:
- #
- # d = REXML::Document.new('')
- # root = d.root
- # root['attr'] # => "value"
- # root['nosuch'] # => nil
- #
- # With symbol argument +attr_sym+ given,
- # returns [attr_sym.to_s]:
- #
- # root[:attr] # => "value"
- # root[:nosuch] # => nil
- #
- # source://rexml//lib/rexml/element.rb#1245
- def [](name_or_index); end
-
- # :call-seq:
- # add_attribute(name, value) -> value
- # add_attribute(attribute) -> attribute
- #
- # Adds an attribute to this element, overwriting any existing attribute
- # by the same name.
- #
- # With string argument +name+ and object +value+ are given,
- # adds the attribute created with that name and value:
- #
- # e = REXML::Element.new
- # e.add_attribute('attr', 'value') # => "value"
- # e['attr'] # => "value"
- # e.add_attribute('attr', 'VALUE') # => "VALUE"
- # e['attr'] # => "VALUE"
- #
- # With only attribute object +attribute+ given,
- # adds the given attribute:
- #
- # a = REXML::Attribute.new('attr', 'value')
- # e.add_attribute(a) # => attr='value'
- # e['attr'] # => "value"
- # a = REXML::Attribute.new('attr', 'VALUE')
- # e.add_attribute(a) # => attr='VALUE'
- # e['attr'] # => "VALUE"
- #
- # source://rexml//lib/rexml/element.rb#1349
- def add_attribute(key, value = T.unsafe(nil)); end
-
- # :call-seq:
- # add_attributes(hash) -> hash
- # add_attributes(array)
- #
- # Adds zero or more attributes to the element;
- # returns the argument.
- #
- # If hash argument +hash+ is given,
- # each key must be a string;
- # adds each attribute created with the key/value pair:
- #
- # e = REXML::Element.new
- # h = {'foo' => 'bar', 'baz' => 'bat'}
- # e.add_attributes(h)
- #
- # If argument +array+ is given,
- # each array member must be a 2-element array [name, value];
- # each name must be a string:
- #
- # e = REXML::Element.new
- # a = [['foo' => 'bar'], ['baz' => 'bat']]
- # e.add_attributes(a)
- #
- # source://rexml//lib/rexml/element.rb#1380
- def add_attributes(hash); end
-
- # :call-seq:
- # add_element(name, attributes = nil) -> new_element
- # add_element(element, attributes = nil) -> element
- #
- # Adds a child element, optionally setting attributes
- # on the added element; returns the added element.
- #
- # With string argument +name+, creates a new element with that name
- # and adds the new element as a child:
- #
- # e0 = REXML::Element.new('foo')
- # e0.add_element('bar')
- # e0[0] # =>
- #
- #
- # With argument +name+ and hash argument +attributes+,
- # sets attributes on the new element:
- #
- # e0.add_element('baz', {'bat' => '0', 'bam' => '1'})
- # e0[1] # =>
- #
- # With element argument +element+, adds that element as a child:
- #
- # e0 = REXML::Element.new('foo')
- # e1 = REXML::Element.new('bar')
- # e0.add_element(e1)
- # e0[0] # =>
- #
- # With argument +element+ and hash argument +attributes+,
- # sets attributes on the added element:
- #
- # e0.add_element(e1, {'bat' => '0', 'bam' => '1'})
- # e0[1] # =>
- #
- # source://rexml//lib/rexml/element.rb#731
- def add_element(element, attrs = T.unsafe(nil)); end
-
- # :call-seq:
- # add_namespace(prefix, uri = nil) -> self
- #
- # Adds a namespace to the element; returns +self+.
- #
- # With the single argument +prefix+,
- # adds a namespace using the given +prefix+ and the namespace URI:
- #
- # e = REXML::Element.new('foo')
- # e.add_namespace('bar')
- # e.namespaces # => {"xmlns"=>"bar"}
- #
- # With both arguments +prefix+ and +uri+ given,
- # adds a namespace using both arguments:
- #
- # e.add_namespace('baz', 'bat')
- # e.namespaces # => {"xmlns"=>"bar", "baz"=>"bat"}
- #
- # source://rexml//lib/rexml/element.rb#654
- def add_namespace(prefix, uri = T.unsafe(nil)); end
-
- # :call-seq:
- # add_text(string) -> nil
- # add_text(text_node) -> self
- #
- # Adds text to the element.
- #
- # When string argument +string+ is given, returns +nil+.
- #
- # If the element has no child text node,
- # creates a \REXML::Text object using the string,
- # honoring the current settings for whitespace and raw,
- # then adds that node to the element:
- #
- # d = REXML::Document.new('')
- # a = d.root
- # a.add_text('foo')
- # a.to_a # => [, "foo"]
- #
- # If the element has child text nodes,
- # appends the string to the _last_ text node:
- #
- # d = REXML::Document.new('foobar')
- # a = d.root
- # a.add_text('baz')
- # a.to_a # => ["foo", , "barbaz"]
- # a.add_text('baz')
- # a.to_a # => ["foo", , "barbazbaz"]
- #
- # When text node argument +text_node+ is given,
- # appends the node as the last text node in the element;
- # returns +self+:
- #
- # d = REXML::Document.new('foobar')
- # a = d.root
- # a.add_text(REXML::Text.new('baz'))
- # a.to_a # => ["foo", , "bar", "baz"]
- # a.add_text(REXML::Text.new('baz'))
- # a.to_a # => ["foo", , "bar", "baz", "baz"]
- #
- # source://rexml//lib/rexml/element.rb#1146
- def add_text(text); end
-
- # :call-seq:
- # attribute(name, namespace = nil)
- #
- # Returns the string value for the given attribute name.
- #
- # With only argument +name+ given,
- # returns the value of the named attribute if it exists, otherwise +nil+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # root = d.root
- # a = root[1] # =>
- # a.attribute('attr') # => attr='value'
- # a.attribute('nope') # => nil
- #
- # With arguments +name+ and +namespace+ given,
- # returns the value of the named attribute if it exists, otherwise +nil+:
- #
- # xml_string = ""
- # document = REXML::Document.new(xml_string)
- # document.root.attribute("x") # => x='x'
- # document.root.attribute("x", "a") # => a:x='a:x'
- #
- # source://rexml//lib/rexml/element.rb#1286
- def attribute(name, namespace = T.unsafe(nil)); end
-
- # Mechanisms for accessing attributes and child elements of this
- # element.
- #
- # source://rexml//lib/rexml/element.rb#286
- def attributes; end
-
- # :call-seq:
- # cdatas -> array_of_cdata_children
- #
- # Returns a frozen array of the REXML::CData children of the element:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # cds = d.root.cdatas # => ["foo", "bar"]
- # cds.frozen? # => true
- # cds.map {|cd| cd.class } # => [REXML::CData, REXML::CData]
- #
- # source://rexml//lib/rexml/element.rb#1424
- def cdatas; end
-
- # :call-seq:
- # clone -> new_element
- #
- # Returns a shallow copy of the element, containing the name and attributes,
- # but not the parent or children:
- #
- # e = REXML::Element.new('foo')
- # e.add_attributes({'bar' => 0, 'baz' => 1})
- # e.clone # =>
- #
- # source://rexml//lib/rexml/element.rb#391
- def clone; end
-
- # :call-seq:
- # comments -> array_of_comment_children
- #
- # Returns a frozen array of the REXML::Comment children of the element:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # cs = d.root.comments
- # cs.frozen? # => true
- # cs.map {|c| c.class } # => [REXML::Comment, REXML::Comment]
- # cs.map {|c| c.to_s } # => ["foo", "bar"]
- #
- # source://rexml//lib/rexml/element.rb#1445
- def comments; end
-
- # The context holds information about the processing environment, such as
- # whitespace handling.
- #
- # source://rexml//lib/rexml/element.rb#289
- def context; end
-
- # The context holds information about the processing environment, such as
- # whitespace handling.
- #
- # source://rexml//lib/rexml/element.rb#289
- def context=(_arg0); end
-
- # :call-seq:
- # delete_attribute(name) -> removed_attribute or nil
- #
- # Removes a named attribute if it exists;
- # returns the removed attribute if found, otherwise +nil+:
- #
- # e = REXML::Element.new('foo')
- # e.add_attribute('bar', 'baz')
- # e.delete_attribute('bar') # =>
- # e.delete_attribute('bar') # => nil
- #
- # source://rexml//lib/rexml/element.rb#1399
- def delete_attribute(key); end
-
- # :call-seq:
- # delete_element(index) -> removed_element or nil
- # delete_element(element) -> removed_element or nil
- # delete_element(xpath) -> removed_element or nil
- #
- # Deletes a child element.
- #
- # When 1-based integer argument +index+ is given,
- # removes and returns the child element at that offset if it exists;
- # indexing does not include text nodes;
- # returns +nil+ if the element does not exist:
- #
- # d = REXML::Document.new 'text'
- # a = d.root # => ... >
- # a.delete_element(1) # =>
- # a.delete_element(1) # =>
- # a.delete_element(1) # => nil
- #
- # When element argument +element+ is given,
- # removes and returns that child element if it exists,
- # otherwise returns +nil+:
- #
- # d = REXML::Document.new 'text'
- # a = d.root # => ... >
- # c = a[2] # =>
- # a.delete_element(c) # =>
- # a.delete_element(c) # => nil
- #
- # When xpath argument +xpath+ is given,
- # removes and returns the element at xpath if it exists,
- # otherwise returns +nil+:
- #
- # d = REXML::Document.new 'text'
- # a = d.root # => ... >
- # a.delete_element('//c') # =>
- # a.delete_element('//c') # => nil
- #
- # source://rexml//lib/rexml/element.rb#777
- def delete_element(element); end
-
- # :call-seq:
- # delete_namespace(namespace = 'xmlns') -> self
- #
- # Removes a namespace from the element.
- #
- # With no argument, removes the default namespace:
- #
- # d = REXML::Document.new ""
- # d.to_s # => ""
- # d.root.delete_namespace # =>
- # d.to_s # => ""
- #
- # With argument +namespace+, removes the specified namespace:
- #
- # d.root.delete_namespace('foo')
- # d.to_s # => ""
- #
- # Does nothing if no such namespace is found:
- #
- # d.root.delete_namespace('nosuch')
- # d.to_s # => ""
- #
- # source://rexml//lib/rexml/element.rb#686
- def delete_namespace(namespace = T.unsafe(nil)); end
-
- # :call-seq:
- # document -> document or nil
- #
- # If the element is part of a document, returns that document:
- #
- # d = REXML::Document.new('')
- # top_element = d.first
- # child = top_element.first
- # top_element.document == d # => true
- # child.document == d # => true
- #
- # If the element is not part of a document, returns +nil+:
- #
- # REXML::Element.new.document # => nil
- #
- # For a document, returns +self+:
- #
- # d.document == d # => true
- #
- # Related: #root, #root_node.
- #
- # source://rexml//lib/rexml/element.rb#478
- def document; end
-
- # :call-seq:
- # each_element {|e| ... }
- #
- # Calls the given block with each child element:
- #
- # d = REXML::Document.new 'bbd'
- # a = d.root
- # a.each_element {|e| p e }
- #
- # Output:
- #
- # ... >
- # ... >
- # ... >
- #
- #
- # source://rexml//lib/rexml/element.rb#929
- def each_element(xpath = T.unsafe(nil), &block); end
-
- # :call-seq:
- # each_element_with_attribute(attr_name, value = nil, max = 0, xpath = nil) {|e| ... }
- #
- # Calls the given block with each child element that meets given criteria.
- #
- # When only string argument +attr_name+ is given,
- # calls the block with each child element that has that attribute:
- #
- # d = REXML::Document.new ''
- # a = d.root
- # a.each_element_with_attribute('id') {|e| p e }
- #
- # Output:
- #
- #
- #
- #
- #
- # With argument +attr_name+ and string argument +value+ given,
- # calls the block with each child element that has that attribute
- # with that value:
- #
- # a.each_element_with_attribute('id', '1') {|e| p e }
- #
- # Output:
- #
- #
- #
- #
- # With arguments +attr_name+, +value+, and integer argument +max+ given,
- # calls the block with at most +max+ child elements:
- #
- # a.each_element_with_attribute('id', '1', 1) {|e| p e }
- #
- # Output:
- #
- #
- #
- # With all arguments given, including +xpath+,
- # calls the block with only those child elements
- # that meet the first three criteria,
- # and also match the given +xpath+:
- #
- # a.each_element_with_attribute('id', '1', 2, '//d') {|e| p e }
- #
- # Output:
- #
- #
- #
- # source://rexml//lib/rexml/element.rb#846
- def each_element_with_attribute(key, value = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end
-
- # :call-seq:
- # each_element_with_text(text = nil, max = 0, xpath = nil) {|e| ... }
- #
- # Calls the given block with each child element that meets given criteria.
- #
- # With no arguments, calls the block with each child element that has text:
- #
- # d = REXML::Document.new 'bbd'
- # a = d.root
- # a.each_element_with_text {|e| p e }
- #
- # Output:
- #
- # ... >
- # ... >
- # ... >
- #
- # With the single string argument +text+,
- # calls the block with each element that has exactly that text:
- #
- # a.each_element_with_text('b') {|e| p e }
- #
- # Output:
- #
- # ... >
- # ... >
- #
- # With argument +text+ and integer argument +max+,
- # calls the block with at most +max+ elements:
- #
- # a.each_element_with_text('b', 1) {|e| p e }
- #
- # Output:
- #
- # ... >
- #
- # With all arguments given, including +xpath+,
- # calls the block with only those child elements
- # that meet the first two criteria,
- # and also match the given +xpath+:
- #
- # a.each_element_with_text('b', 2, '//c') {|e| p e }
- #
- # Output:
- #
- # ... >
- #
- # source://rexml//lib/rexml/element.rb#903
- def each_element_with_text(text = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end
-
- # Mechanisms for accessing attributes and child elements of this
- # element.
- #
- # source://rexml//lib/rexml/element.rb#286
- def elements; end
-
- # :call-seq:
- # get_elements(xpath)
- #
- # Returns an array of the elements that match the given +xpath+:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # d.root.get_elements('//a') # => [ ... >, ]
- #
- # source://rexml//lib/rexml/element.rb#948
- def get_elements(xpath); end
-
- # :call-seq:
- # get_text(xpath = nil) -> text_node or nil
- #
- # Returns the first text node child in a specified element, if it exists,
- # +nil+ otherwise.
- #
- # With no argument, returns the first text node from +self+:
- #
- # d = REXML::Document.new "some text this is bold! more text
"
- # d.root.get_text.class # => REXML::Text
- # d.root.get_text # => "some text "
- #
- # With argument +xpath+, returns the first text node from the element
- # that matches +xpath+:
- #
- # d.root.get_text(1) # => "this is bold!"
- #
- # source://rexml//lib/rexml/element.rb#1052
- def get_text(path = T.unsafe(nil)); end
-
- # :call-seq:
- # has_attributes? -> true or false
- #
- # Returns +true+ if the element has attributes, +false+ otherwise:
- #
- # d = REXML::Document.new('')
- # a, b = *d.root
- # a.has_attributes? # => true
- # b.has_attributes? # => false
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/element.rb#1319
- def has_attributes?; end
-
- # :call-seq:
- # has_elements?
- #
- # Returns +true+ if the element has one or more element children,
- # +false+ otherwise:
- #
- # d = REXML::Document.new 'text'
- # a = d.root # => ... >
- # a.has_elements? # => true
- # b = a[0] # =>
- # b.has_elements? # => false
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/element.rb#793
- def has_elements?; end
-
- # :call-seq:
- # has_text? -> true or false
- #
- # Returns +true+ if the element has one or more text noded,
- # +false+ otherwise:
- #
- # d = REXML::Document.new 'text'
- # a = d.root
- # a.has_text? # => true
- # b = a[0]
- # b.has_text? # => false
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/element.rb#1001
- def has_text?; end
-
- # :call-seq:
- # ignore_whitespace_nodes
- #
- # Returns +true+ if whitespace nodes are ignored for the element.
- #
- # See {Element Context}[../doc/rexml/context_rdoc.html].
- #
- # source://rexml//lib/rexml/element.rb#516
- def ignore_whitespace_nodes; end
-
- # :call-seq:
- # inspect -> string
- #
- # Returns a string representation of the element.
- #
- # For an element with no attributes and no children, shows the element name:
- #
- # REXML::Element.new.inspect # => ""
- #
- # Shows attributes, if any:
- #
- # e = REXML::Element.new('foo')
- # e.add_attributes({'bar' => 0, 'baz' => 1})
- # e.inspect # => ""
- #
- # Shows an ellipsis (...), if there are child elements:
- #
- # e.add_element(REXML::Element.new('bar'))
- # e.add_element(REXML::Element.new('baz'))
- # e.inspect # => " ... >"
- #
- # source://rexml//lib/rexml/element.rb#366
- def inspect; end
-
- # :call-seq:
- # instructions -> array_of_instruction_children
- #
- # Returns a frozen array of the REXML::Instruction children of the element:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # is = d.root.instructions
- # is.frozen? # => true
- # is.map {|i| i.class } # => [REXML::Instruction, REXML::Instruction]
- # is.map {|i| i.to_s } # => ["", ""]
- #
- # source://rexml//lib/rexml/element.rb#1466
- def instructions; end
-
- # :call-seq:
- # namespace(prefix = nil) -> string_uri or nil
- #
- # Returns the string namespace URI for the element,
- # possibly deriving from one of its ancestors.
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # b = d.elements['//b']
- # b.namespace # => "1"
- # b.namespace('y') # => "2"
- # b.namespace('nosuch') # => nil
- #
- # source://rexml//lib/rexml/element.rb#621
- def namespace(prefix = T.unsafe(nil)); end
-
- # :call-seq:
- # namespaces -> array_of_namespace_names
- #
- # Returns a hash of all defined namespaces
- # in the element and its ancestors:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string)
- # d.elements['//a'].namespaces # => {"x"=>"1", "y"=>"2"}
- # d.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
- # d.elements['//c'].namespaces # => {"x"=>"1", "y"=>"2", "z"=>"3"}
- #
- # source://rexml//lib/rexml/element.rb#594
- def namespaces; end
-
- # :call-seq:
- # next_element
- #
- # Returns the next sibling that is an element if it exists,
- # +niL+ otherwise:
- #
- # d = REXML::Document.new 'text'
- # d.root.elements['b'].next_element #->
- # d.root.elements['c'].next_element #-> nil
- #
- # source://rexml//lib/rexml/element.rb#962
- def next_element; end
-
- # :call-seq:
- # node_type -> :element
- #
- # Returns symbol :element:
- #
- # d = REXML::Document.new('')
- # a = d.root # =>
- # a.node_type # => :element
- #
- # source://rexml//lib/rexml/element.rb#1167
- def node_type; end
-
- # :call-seq:
- # prefixes -> array_of_namespace_prefixes
- #
- # Returns an array of the string prefixes (names) of all defined namespaces
- # in the element and its ancestors:
- #
- # xml_string = <<-EOT
- #
- #
- #
- #
- #
- #
- # EOT
- # d = REXML::Document.new(xml_string, {compress_whitespace: :all})
- # d.elements['//a'].prefixes # => ["x", "y"]
- # d.elements['//b'].prefixes # => ["x", "y"]
- # d.elements['//c'].prefixes # => ["x", "y", "z"]
- #
- # source://rexml//lib/rexml/element.rb#568
- def prefixes; end
-
- # :call-seq:
- # previous_element
- #
- # Returns the previous sibling that is an element if it exists,
- # +niL+ otherwise:
- #
- # d = REXML::Document.new 'text'
- # d.root.elements['c'].previous_element #->
- # d.root.elements['b'].previous_element #-> nil
- #
- # source://rexml//lib/rexml/element.rb#978
- def previous_element; end
-
- # :call-seq:
- # raw
- #
- # Returns +true+ if raw mode is set for the element.
- #
- # See {Element Context}[../doc/rexml/context_rdoc.html].
- #
- # The evaluation is tested against +expanded_name+, and so is namespace
- # sensitive.
- #
- # source://rexml//lib/rexml/element.rb#536
- def raw; end
-
- # :call-seq:
- # root -> element
- #
- # Returns the most distant _element_ (not document) ancestor of the element:
- #
- # d = REXML::Document.new('')
- # top_element = d.first
- # child = top_element.first
- # top_element.root == top_element # => true
- # child.root == top_element # => true
- #
- # For a document, returns the topmost element:
- #
- # d.root == top_element # => true
- #
- # Related: #root_node, #document.
- #
- # source://rexml//lib/rexml/element.rb#451
- def root; end
-
- # :call-seq:
- # root_node -> document or element
- #
- # Returns the most distant ancestor of +self+.
- #
- # When the element is part of a document,
- # returns the root node of the document.
- # Note that the root node is different from the document element;
- # in this example +a+ is document element and the root node is its parent:
- #
- # d = REXML::Document.new('')
- # top_element = d.first # => ... >
- # child = top_element.first # => ... >
- # d.root_node == d # => true
- # top_element.root_node == d # => true
- # child.root_node == d # => true
- #
- # When the element is not part of a document, but does have ancestor elements,
- # returns the most distant ancestor element:
- #
- # e0 = REXML::Element.new('foo')
- # e1 = REXML::Element.new('bar')
- # e1.parent = e0
- # e2 = REXML::Element.new('baz')
- # e2.parent = e1
- # e2.root_node == e0 # => true
- #
- # When the element has no ancestor elements,
- # returns +self+:
- #
- # e = REXML::Element.new('foo')
- # e.root_node == e # => true
- #
- # Related: #root, #document.
- #
- # source://rexml//lib/rexml/element.rb#430
- def root_node; end
-
- # :call-seq:
- # text(xpath = nil) -> text_string or nil
- #
- # Returns the text string from the first text node child
- # in a specified element, if it exists, +nil+ otherwise.
- #
- # With no argument, returns the text from the first text node in +self+:
- #
- # d = REXML::Document.new "some text this is bold! more text
"
- # d.root.text.class # => String
- # d.root.text # => "some text "
- #
- # With argument +xpath+, returns text from the first text node
- # in the element that matches +xpath+:
- #
- # d.root.text(1) # => "this is bold!"
- #
- # Note that an element may have multiple text nodes,
- # possibly separated by other non-text children, as above.
- # Even so, the returned value is the string text from the first such node.
- #
- # Note also that the text note is retrieved by method get_text,
- # and so is always normalized text.
- #
- # source://rexml//lib/rexml/element.rb#1029
- def text(path = T.unsafe(nil)); end
-
- # :call-seq:
- # text = string -> string
- # text = nil -> nil
- #
- # Adds, replaces, or removes the first text node child in the element.
- #
- # With string argument +string+,
- # creates a new \REXML::Text node containing that string,
- # honoring the current settings for whitespace and row,
- # then places the node as the first text child in the element;
- # returns +string+.
- #
- # If the element has no text child, the text node is added:
- #
- # d = REXML::Document.new ''
- # d.root.text = 'foo' #-> 'foo'
- #
- # If the element has a text child, it is replaced:
- #
- # d.root.text = 'bar' #-> 'bar'
- #
- # With argument +nil+, removes the first text child:
- #
- # d.root.text = nil #-> ''
- #
- # source://rexml//lib/rexml/element.rb#1088
- def text=(text); end
-
- # :call-seq:
- # texts -> array_of_text_children
- #
- # Returns a frozen array of the REXML::Text children of the element:
- #
- # xml_string = 'textmore'
- # d = REXML::Document.new(xml_string)
- # ts = d.root.texts
- # ts.frozen? # => true
- # ts.map {|t| t.class } # => [REXML::Text, REXML::Text]
- # ts.map {|t| t.to_s } # => ["text", "more"]
- #
- # source://rexml//lib/rexml/element.rb#1482
- def texts; end
-
- # :call-seq:
- # whitespace
- #
- # Returns +true+ if whitespace is respected for this element,
- # +false+ otherwise.
- #
- # See {Element Context}[../doc/rexml/context_rdoc.html].
- #
- # The evaluation is tested against the element's +expanded_name+,
- # and so is namespace-sensitive.
- #
- # source://rexml//lib/rexml/element.rb#493
- def whitespace; end
-
- # == DEPRECATED
- # See REXML::Formatters
- #
- # Writes out this element, and recursively, all children.
- # output::
- # output an object which supports '<< string'; this is where the
- # document will be written.
- # indent::
- # An integer. If -1, no indenting will be used; otherwise, the
- # indentation will be this number of spaces, and children will be
- # indented an additional amount. Defaults to -1
- # transitive::
- # If transitive is true and indent is >= 0, then the output will be
- # pretty-printed in such a way that the added whitespace does not affect
- # the parse tree of the document
- # ie_hack::
- # This hack inserts a space before the /> on empty tags to address
- # a limitation of Internet Explorer. Defaults to false
- #
- # out = ''
- # doc.write( out ) #-> doc is written to the string 'out'
- # doc.write( $stdout ) #-> doc written to the console
- #
- # source://rexml//lib/rexml/element.rb#1508
- def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-
- # :call-seq:
- # xpath -> string_xpath
- #
- # Returns the string xpath to the element
- # relative to the most distant parent:
- #
- # d = REXML::Document.new('')
- # a = d.root # => ... >
- # b = a[0] # => ... >
- # c = b[0] # =>
- # d.xpath # => ""
- # a.xpath # => "/a"
- # b.xpath # => "/a/b"
- # c.xpath # => "/a/b/c"
- #
- # If there is no parent, returns the expanded name of the element:
- #
- # e = REXML::Element.new('foo')
- # e.xpath # => "foo"
- #
- # source://rexml//lib/rexml/element.rb#1191
- def xpath; end
-
- private
-
- # source://rexml//lib/rexml/element.rb#1525
- def __to_xpath_helper(node); end
-
- # A private helper method
- #
- # source://rexml//lib/rexml/element.rb#1540
- def each_with_something(test, max = T.unsafe(nil), name = T.unsafe(nil)); end
-end
-
-# source://rexml//lib/rexml/doctype.rb#261
-class REXML::ElementDecl < ::REXML::Declaration
- # @return [ElementDecl] a new instance of ElementDecl
- #
- # source://rexml//lib/rexml/doctype.rb#262
- def initialize(src); end
-end
-
-# A class which provides filtering of children for Elements, and
-# XPath search support. You are expected to only encounter this class as
-# the element.elements object. Therefore, you are
-# _not_ expected to instantiate this yourself.
-#
-# xml_string = <<-EOT
-#
-#
-#
-# Everyday Italian
-# Giada De Laurentiis
-# 2005
-# 30.00
-#
-#
-# Harry Potter
-# J K. Rowling
-# 2005
-# 29.99
-#
-#
-# XQuery Kick Start
-# James McGovern
-# Per Bothner
-# Kurt Cagle
-# James Linn
-# Vaidyanathan Nagarajan
-# 2003
-# 49.99
-#
-#
-# Learning XML
-# Erik T. Ray
-# 2003
-# 39.95
-#
-#
-# EOT
-# d = REXML::Document.new(xml_string)
-# elements = d.root.elements
-# elements # => # ... >>
-#
-# source://rexml//lib/rexml/element.rb#1595
-class REXML::Elements
- include ::Enumerable
-
- # :call-seq:
- # new(parent) -> new_elements_object
- #
- # Returns a new \Elements object with the given +parent+.
- # Does _not_ assign parent.elements = self:
- #
- # d = REXML::Document.new(xml_string)
- # eles = REXML::Elements.new(d.root)
- # eles # => # ... >>
- # eles == d.root.elements # => false
- #
- # @return [Elements] a new instance of Elements
- #
- # source://rexml//lib/rexml/element.rb#1608
- def initialize(parent); end
-
- # :call-seq:
- # add -> new_element
- # add(name) -> new_element
- # add(element) -> element
- #
- # Adds an element; returns the element added.
- #
- # With no argument, creates and adds a new element.
- # The new element has:
- #
- # - No name.
- # - \Parent from the \Elements object.
- # - Context from the that parent.
- #
- # Example:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # parent = elements.parent # => ... >
- # parent.context = {raw: :all}
- # elements.size # => 4
- # new_element = elements.add # => >
- # elements.size # => 5
- # new_element.name # => nil
- # new_element.parent # => ... >
- # new_element.context # => {:raw=>:all}
- #
- # With string argument +name+, creates and adds a new element.
- # The new element has:
- #
- # - Name +name+.
- # - \Parent from the \Elements object.
- # - Context from the that parent.
- #
- # Example:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # parent = elements.parent # => ... >
- # parent.context = {raw: :all}
- # elements.size # => 4
- # new_element = elements.add('foo') # =>
- # elements.size # => 5
- # new_element.name # => "foo"
- # new_element.parent # => ... >
- # new_element.context # => {:raw=>:all}
- #
- # With argument +element+,
- # creates and adds a clone of the given +element+.
- # The new element has name, parent, and context from the given +element+.
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.size # => 4
- # e0 = REXML::Element.new('foo')
- # e1 = REXML::Element.new('bar', e0, {raw: :all})
- # element = elements.add(e1) # =>
- # elements.size # => 5
- # element.name # => "bar"
- # element.parent # => ... >
- # element.context # => {:raw=>:all}
- #
- # source://rexml//lib/rexml/element.rb#1925
- def <<(element = T.unsafe(nil)); end
-
- # :call-seq:
- # elements[index] -> element or nil
- # elements[xpath] -> element or nil
- # elements[n, name] -> element or nil
- #
- # Returns the first \Element object selected by the arguments,
- # if any found, or +nil+ if none found.
- #
- # Notes:
- # - The +index+ is 1-based, not 0-based, so that:
- # - The first element has index 1
- # - The _nth_ element has index +n+.
- # - The selection ignores non-\Element nodes.
- #
- # When the single argument +index+ is given,
- # returns the element given by the index, if any; otherwise, +nil+:
- #
- # d = REXML::Document.new(xml_string)
- # eles = d.root.elements
- # eles # => # ... >>
- # eles[1] # => ... >
- # eles.size # => 4
- # eles[4] # => ... >
- # eles[5] # => nil
- #
- # The node at this index is not an \Element, and so is not returned:
- #
- # eles = d.root.first.first # => ... >
- # eles.to_a # => ["Everyday Italian"]
- # eles[1] # => nil
- #
- # When the single argument +xpath+ is given,
- # returns the first element found via that +xpath+, if any; otherwise, +nil+:
- #
- # eles = d.root.elements # => # ... >>
- # eles['/bookstore'] # => ... >
- # eles['//book'] # => ... >
- # eles['//book [@category="children"]'] # => ... >
- # eles['/nosuch'] # => nil
- # eles['//nosuch'] # => nil
- # eles['//book [@category="nosuch"]'] # => nil
- # eles['.'] # => ... >
- # eles['..'].class # => REXML::Document
- #
- # With arguments +n+ and +name+ given,
- # returns the _nth_ found element that has the given +name+,
- # or +nil+ if there is no such _nth_ element:
- #
- # eles = d.root.elements # => # ... >>
- # eles[1, 'book'] # => ... >
- # eles[4, 'book'] # => ... >
- # eles[5, 'book'] # => nil
- #
- # source://rexml//lib/rexml/element.rb#1680
- def [](index, name = T.unsafe(nil)); end
-
- # :call-seq:
- # elements[] = index, replacement_element -> replacement_element or nil
- #
- # Replaces or adds an element.
- #
- # When eles[index] exists, replaces it with +replacement_element+
- # and returns +replacement_element+:
- #
- # d = REXML::Document.new(xml_string)
- # eles = d.root.elements # => # ... >>
- # eles[1] # => ... >
- # eles[1] = REXML::Element.new('foo')
- # eles[1] # =>
- #
- # Does nothing (or raises an exception)
- # if +replacement_element+ is not an \Element:
- # eles[2] # => ... >
- # eles[2] = REXML::Text.new('bar')
- # eles[2] # => ... >
- #
- # When eles[index] does not exist,
- # adds +replacement_element+ to the element and returns
- #
- # d = REXML::Document.new(xml_string)
- # eles = d.root.elements # => # ... >>
- # eles.size # => 4
- # eles[50] = REXML::Element.new('foo') # =>
- # eles.size # => 5
- # eles[5] # =>
- #
- # Does nothing (or raises an exception)
- # if +replacement_element+ is not an \Element:
- #
- # eles[50] = REXML::Text.new('bar') # => "bar"
- # eles.size # => 5
- #
- # source://rexml//lib/rexml/element.rb#1735
- def []=(index, element); end
-
- # :call-seq:
- # add -> new_element
- # add(name) -> new_element
- # add(element) -> element
- #
- # Adds an element; returns the element added.
- #
- # With no argument, creates and adds a new element.
- # The new element has:
- #
- # - No name.
- # - \Parent from the \Elements object.
- # - Context from the that parent.
- #
- # Example:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # parent = elements.parent # => ... >
- # parent.context = {raw: :all}
- # elements.size # => 4
- # new_element = elements.add # => >
- # elements.size # => 5
- # new_element.name # => nil
- # new_element.parent # => ... >
- # new_element.context # => {:raw=>:all}
- #
- # With string argument +name+, creates and adds a new element.
- # The new element has:
- #
- # - Name +name+.
- # - \Parent from the \Elements object.
- # - Context from the that parent.
- #
- # Example:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # parent = elements.parent # => ... >
- # parent.context = {raw: :all}
- # elements.size # => 4
- # new_element = elements.add('foo') # =>
- # elements.size # => 5
- # new_element.name # => "foo"
- # new_element.parent # => ... >
- # new_element.context # => {:raw=>:all}
- #
- # With argument +element+,
- # creates and adds a clone of the given +element+.
- # The new element has name, parent, and context from the given +element+.
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.size # => 4
- # e0 = REXML::Element.new('foo')
- # e1 = REXML::Element.new('bar', e0, {raw: :all})
- # element = elements.add(e1) # =>
- # elements.size # => 5
- # element.name # => "bar"
- # element.parent # => ... >
- # element.context # => {:raw=>:all}
- #
- # source://rexml//lib/rexml/element.rb#1925
- def add(element = T.unsafe(nil)); end
-
- # :call-seq:
- # collect(xpath = nil) {|element| ... } -> array
- #
- # Iterates over the elements; returns the array of block return values.
- #
- # With no argument, iterates over all elements:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.collect {|element| element.size } # => [9, 9, 17, 9]
- #
- # With argument +xpath+, iterates over elements that match
- # the given +xpath+:
- #
- # xpath = '//book [@category="web"]'
- # elements.collect(xpath) {|element| element.size } # => [17, 9]
- #
- # source://rexml//lib/rexml/element.rb#1988
- def collect(xpath = T.unsafe(nil)); end
-
- # :call-seq:
- # delete(index) -> removed_element or nil
- # delete(element) -> removed_element or nil
- # delete(xpath) -> removed_element or nil
- #
- # Removes an element; returns the removed element, or +nil+ if none removed.
- #
- # With integer argument +index+ given,
- # removes the child element at that offset:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.size # => 4
- # elements[2] # => ... >
- # elements.delete(2) # => ... >
- # elements.size # => 3
- # elements[2] # => ... >
- # elements.delete(50) # => nil
- #
- # With element argument +element+ given,
- # removes that child element:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # ele_1, ele_2, ele_3, ele_4 = *elements
- # elements.size # => 4
- # elements[2] # => ... >
- # elements.delete(ele_2) # => ... >
- # elements.size # => 3
- # elements[2] # => ... >
- # elements.delete(ele_2) # => nil
- #
- # With string argument +xpath+ given,
- # removes the first element found via that xpath:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.delete('//book') # => ... >
- # elements.delete('//book [@category="children"]') # => ... >
- # elements.delete('//nosuch') # => nil
- #
- # source://rexml//lib/rexml/element.rb#1825
- def delete(element); end
-
- # :call-seq:
- # delete_all(xpath)
- #
- # Removes all elements found via the given +xpath+;
- # returns the array of removed elements, if any, else +nil+.
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.size # => 4
- # deleted_elements = elements.delete_all('//book [@category="web"]')
- # deleted_elements.size # => 2
- # elements.size # => 2
- # deleted_elements = elements.delete_all('//book')
- # deleted_elements.size # => 2
- # elements.size # => 0
- # elements.delete_all('//book') # => []
- #
- # source://rexml//lib/rexml/element.rb#1851
- def delete_all(xpath); end
-
- # :call-seq:
- # each(xpath = nil) {|element| ... } -> self
- #
- # Iterates over the elements.
- #
- # With no argument, calls the block with each element:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.each {|element| p element }
- #
- # Output:
- #
- # ... >
- # ... >
- # ... >
- # ... >
- #
- # With argument +xpath+, calls the block with each element
- # that matches the given +xpath+:
- #
- # elements.each('//book [@category="web"]') {|element| p element }
- #
- # Output:
- #
- # ... >
- # ... >
- #
- # source://rexml//lib/rexml/element.rb#1967
- def each(xpath = T.unsafe(nil)); end
-
- # :call-seq:
- # empty? -> true or false
- #
- # Returns +true+ if there are no children, +false+ otherwise.
- #
- # d = REXML::Document.new('')
- # d.elements.empty? # => true
- # d = REXML::Document.new(xml_string)
- # d.elements.empty? # => false
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/element.rb#1755
- def empty?; end
-
- # :call-seq:
- # index(element)
- #
- # Returns the 1-based index of the given +element+, if found;
- # otherwise, returns -1:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # ele_1, ele_2, ele_3, ele_4 = *elements
- # elements.index(ele_4) # => 4
- # elements.delete(ele_3)
- # elements.index(ele_4) # => 3
- # elements.index(ele_3) # => -1
- #
- # source://rexml//lib/rexml/element.rb#1773
- def index(element); end
-
- # :call-seq:
- # inject(xpath = nil, initial = nil) -> object
- #
- # Calls the block with elements; returns the last block return value.
- #
- # With no argument, iterates over the elements, calling the block
- # elements.size - 1 times.
- #
- # - The first call passes the first and second elements.
- # - The second call passes the first block return value and the third element.
- # - The third call passes the second block return value and the fourth element.
- # - And so on.
- #
- # In this example, the block returns the passed element,
- # which is then the object argument to the next call:
- #
- # d = REXML::Document.new(xml_string)
- # elements = d.root.elements
- # elements.inject do |object, element|
- # p [elements.index(object), elements.index(element)]
- # element
- # end
- #
- # Output:
- #
- # [1, 2]
- # [2, 3]
- # [3, 4]
- #
- # With the single argument +xpath+, calls the block only with
- # elements matching that xpath:
- #
- # elements.inject('//book [@category="web"]') do |object, element|
- # p [elements.index(object), elements.index(element)]
- # element
- # end
- #
- # Output:
- #
- # [3, 4]
- #
- # With argument +xpath+ given as +nil+
- # and argument +initial+ also given,
- # calls the block once for each element.
- #
- # - The first call passes the +initial+ and the first element.
- # - The second call passes the first block return value and the second element.
- # - The third call passes the second block return value and the third element.
- # - And so on.
- #
- # In this example, the first object index is -1
- #
- # elements.inject(nil, 'Initial') do |object, element|
- # p [elements.index(object), elements.index(element)]
- # element
- # end
- #
- # Output:
- #
- # [-1, 1]
- # [1, 2]
- # [2, 3]
- # [3, 4]
- #
- # In this form the passed object can be used as an accumulator:
- #
- # elements.inject(nil, 0) do |total, element|
- # total += element.size
- # end # => 44
- #
- # With both arguments +xpath+ and +initial+ are given,
- # calls the block only with elements matching that xpath:
- #
- # elements.inject('//book [@category="web"]', 0) do |total, element|
- # total += element.size
- # end # => 26
- #
- # source://rexml//lib/rexml/element.rb#2073
- def inject(xpath = T.unsafe(nil), initial = T.unsafe(nil)); end
-
- # :call-seq:
- # parent
- #
- # Returns the parent element cited in creating the \Elements object.
- # This element is also the default starting point for searching
- # in the \Elements object.
- #
- # d = REXML::Document.new(xml_string)
- # elements = REXML::Elements.new(d.root)
- # elements.parent == d.root # => true
- #
- # source://rexml//lib/rexml/element.rb#1623
- def parent; end
-
- # :call-seq:
- # size -> integer
- #
- # Returns the count of \Element children:
- #
- # d = REXML::Document.new 'seanelliottrussell'
- # d.root.elements.size # => 3 # Three elements.
- # d.root.size # => 6 # Three elements plus three text nodes..
- #
- # source://rexml//lib/rexml/element.rb#2097
- def size; end
-
- # :call-seq:
- # to_a(xpath = nil) -> array_of_elements
- #
- # Returns an array of element children (not including non-element children).
- #
- # With no argument, returns an array of all element children:
- #
- # d = REXML::Document.new 'seanelliott'
- # elements = d.root.elements
- # elements.to_a # => [, ] # Omits non-element children.
- # children = d.root.children
- # children # => ["sean", , "elliott", ] # Includes non-element children.
- #
- # With argument +xpath+, returns an array of element children
- # that match the xpath:
- #
- # elements.to_a('//c') # => []
- #
- # source://rexml//lib/rexml/element.rb#2121
- def to_a(xpath = T.unsafe(nil)); end
-
- private
-
- # Private helper class. Removes quotes from quoted strings
- #
- # source://rexml//lib/rexml/element.rb#2129
- def literalize(name); end
-end
-
-# source://rexml//lib/rexml/encoding.rb#4
-module REXML::Encoding
- # source://rexml//lib/rexml/encoding.rb#29
- def decode(string); end
-
- # source://rexml//lib/rexml/encoding.rb#25
- def encode(string); end
-
- # ID ---> Encoding name
- #
- # source://rexml//lib/rexml/encoding.rb#6
- def encoding; end
-
- # source://rexml//lib/rexml/encoding.rb#7
- def encoding=(encoding); end
-
- private
-
- # source://rexml//lib/rexml/encoding.rb#34
- def find_encoding(name); end
-end
-
-# source://rexml//lib/rexml/entity.rb#7
-class REXML::Entity < ::REXML::Child
- include ::REXML::XMLTokens
-
- # Create a new entity. Simple entities can be constructed by passing a
- # name, value to the constructor; this creates a generic, plain entity
- # reference. For anything more complicated, you have to pass a Source to
- # the constructor with the entity definition, or use the accessor methods.
- # +WARNING+: There is no validation of entity state except when the entity
- # is read from a stream. If you start poking around with the accessors,
- # you can easily create a non-conformant Entity.
- #
- # e = Entity.new( 'amp', '&' )
- #
- # @return [Entity] a new instance of Entity
- #
- # source://rexml//lib/rexml/entity.rb#33
- def initialize(stream, value = T.unsafe(nil), parent = T.unsafe(nil), reference = T.unsafe(nil)); end
-
- # Returns the value of attribute external.
- #
- # source://rexml//lib/rexml/entity.rb#22
- def external; end
-
- # Returns the value of attribute name.
- #
- # source://rexml//lib/rexml/entity.rb#22
- def name; end
-
- # Returns the value of attribute ndata.
- #
- # source://rexml//lib/rexml/entity.rb#22
- def ndata; end
-
- # Returns the value of this entity unprocessed -- raw. This is the
- # normalized value; that is, with all %ent; and &ent; entities intact
- #
- # source://rexml//lib/rexml/entity.rb#85
- def normalized; end
-
- # source://rexml//lib/rexml/entity.rb#138
- def parent=(other); end
-
- # Returns the value of attribute pubid.
- #
- # source://rexml//lib/rexml/entity.rb#22
- def pubid; end
-
- # Returns the value of attribute ref.
- #
- # source://rexml//lib/rexml/entity.rb#22
- def ref; end
-
- # Returns this entity as a string. See write().
- #
- # source://rexml//lib/rexml/entity.rb#119
- def to_s; end
-
- # Evaluates to the unnormalized value of this entity; that is, replacing
- # all entities -- both %ent; and &ent; entities. This differs from
- # +value()+ in that +value+ only replaces %ent; entities.
- #
- # source://rexml//lib/rexml/entity.rb#73
- def unnormalized; end
-
- # Returns the value of this entity. At the moment, only internal entities
- # are processed. If the value contains internal references (IE,
- # %blah;), those are replaced with their values. IE, if the doctype
- # contains:
- #
- #
- # then:
- # doctype.entity('yada').value #-> "nanoo bar nanoo"
- #
- # source://rexml//lib/rexml/entity.rb#134
- def value; end
-
- # Write out a fully formed, correct entity definition (assuming the Entity
- # object itself is valid.)
- #
- # out::
- # An object implementing << to which the entity will be
- # output
- # indent::
- # *DEPRECATED* and ignored
- #
- # source://rexml//lib/rexml/entity.rb#97
- def write(out, indent = T.unsafe(nil)); end
-
- private
-
- # source://rexml//lib/rexml/entity.rb#144
- def resolve_value; end
-
- class << self
- # Evaluates whether the given string matches an entity definition,
- # returning true if so, and false otherwise.
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/entity.rb#66
- def matches?(string); end
- end
-end
-
-# source://rexml//lib/rexml/doctype.rb#267
-class REXML::ExternalEntity < ::REXML::Child
- # @return [ExternalEntity] a new instance of ExternalEntity
- #
- # source://rexml//lib/rexml/doctype.rb#268
- def initialize(src); end
-
- # source://rexml//lib/rexml/doctype.rb#272
- def to_s; end
-
- # source://rexml//lib/rexml/doctype.rb#275
- def write(output, indent); end
-end
-
-# source://rexml//lib/rexml/formatters/default.rb#5
-class REXML::Formatters::Default
- # Prints out the XML document with no formatting -- except if ie_hack is
- # set.
- #
- # ie_hack::
- # If set to true, then inserts whitespace before the close of an empty
- # tag, so that IE's bad XML parser doesn't choke.
- #
- # @return [Default] a new instance of Default
- #
- # source://rexml//lib/rexml/formatters/default.rb#12
- def initialize(ie_hack = T.unsafe(nil)); end
-
- # Writes the node to some output.
- #
- # node::
- # The node to write
- # output::
- # A class implementing <<. Pass in an Output object to
- # change the output encoding.
- #
- # source://rexml//lib/rexml/formatters/default.rb#23
- def write(node, output); end
-
- protected
-
- # source://rexml//lib/rexml/formatters/default.rb#98
- def write_cdata(node, output); end
-
- # source://rexml//lib/rexml/formatters/default.rb#92
- def write_comment(node, output); end
-
- # source://rexml//lib/rexml/formatters/default.rb#61
- def write_document(node, output); end
-
- # source://rexml//lib/rexml/formatters/default.rb#65
- def write_element(node, output); end
-
- # source://rexml//lib/rexml/formatters/default.rb#104
- def write_instruction(node, output); end
-
- # source://rexml//lib/rexml/formatters/default.rb#88
- def write_text(node, output); end
-end
-
-# Pretty-prints an XML document. This destroys whitespace in text nodes
-# and will insert carriage returns and indentations.
-#
-# TODO: Add an option to print attributes on new lines
-#
-# source://rexml//lib/rexml/formatters/pretty.rb#10
-class REXML::Formatters::Pretty < ::REXML::Formatters::Default
- # Create a new pretty printer.
- #
- # output::
- # An object implementing '<<(String)', to which the output will be written.
- # indentation::
- # An integer greater than 0. The indentation of each level will be
- # this number of spaces. If this is < 1, the behavior of this object
- # is undefined. Defaults to 2.
- # ie_hack::
- # If true, the printer will insert whitespace before closing empty
- # tags, thereby allowing Internet Explorer's XML parser to
- # function. Defaults to false.
- #
- # @return [Pretty] a new instance of Pretty
- #
- # source://rexml//lib/rexml/formatters/pretty.rb#30
- def initialize(indentation = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-
- # If compact is set to true, then the formatter will attempt to use as
- # little space as possible
- #
- # source://rexml//lib/rexml/formatters/pretty.rb#14
- def compact; end
-
- # If compact is set to true, then the formatter will attempt to use as
- # little space as possible
- #
- # source://rexml//lib/rexml/formatters/pretty.rb#14
- def compact=(_arg0); end
-
- # The width of a page. Used for formatting text
- #
- # source://rexml//lib/rexml/formatters/pretty.rb#16
- def width; end
-
- # The width of a page. Used for formatting text
- #
- # source://rexml//lib/rexml/formatters/pretty.rb#16
- def width=(_arg0); end
-
- protected
-
- # source://rexml//lib/rexml/formatters/pretty.rb#102
- def write_cdata(node, output); end
-
- # source://rexml//lib/rexml/formatters/pretty.rb#97
- def write_comment(node, output); end
-
- # source://rexml//lib/rexml/formatters/pretty.rb#107
- def write_document(node, output); end
-
- # source://rexml//lib/rexml/formatters/pretty.rb#39
- def write_element(node, output); end
-
- # source://rexml//lib/rexml/formatters/pretty.rb#88
- def write_text(node, output); end
-
- private
-
- # source://rexml//lib/rexml/formatters/pretty.rb#124
- def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/formatters/pretty.rb#129
- def wrap(string, width); end
-end
-
-# A Source that wraps an IO. See the Source class for method
-# documentation
-#
-# source://rexml//lib/rexml/source.rb#159
-class REXML::IOSource < ::REXML::Source
- # block_size has been deprecated
- #
- # @return [IOSource] a new instance of IOSource
- #
- # source://rexml//lib/rexml/source.rb#163
- def initialize(arg, block_size = T.unsafe(nil), encoding = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/source.rb#215
- def consume(pattern); end
-
- # @return the current line in the source
- #
- # source://rexml//lib/rexml/source.rb#244
- def current_line; end
-
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/source.rb#235
- def empty?; end
-
- # source://rexml//lib/rexml/source.rb#219
- def match(pattern, cons = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/source.rb#239
- def position; end
-
- # source://rexml//lib/rexml/source.rb#207
- def read; end
-
- # source://rexml//lib/rexml/source.rb#184
- def scan(pattern, cons = T.unsafe(nil)); end
-
- private
-
- # source://rexml//lib/rexml/source.rb#286
- def encoding_updated; end
-
- # source://rexml//lib/rexml/source.rb#266
- def readline; end
-end
-
-# Represents an XML Instruction; IE, ... ?>
-# TODO: Add parent arg (3rd arg) to constructor
-#
-# source://rexml//lib/rexml/instruction.rb#9
-class REXML::Instruction < ::REXML::Child
- # Constructs a new Instruction
- # the target of this instruction is set to this. If an Instruction,
- # then the Instruction is shallowly cloned (target and content are
- # copied).
- # be a Parent if the target argument is a Source. Otherwise, this
- # String is set as the content of this instruction.
- #
- # @param target can be one of a number of things. If String, then
- # @param content Must be either a String, or a Parent. Can only
- # @return [Instruction] a new instance of Instruction
- #
- # source://rexml//lib/rexml/instruction.rb#25
- def initialize(target, content = T.unsafe(nil)); end
-
- # of the other matches the target and content of this object.
- #
- # @return true if other is an Instruction, and the content and target
- #
- # source://rexml//lib/rexml/instruction.rb#65
- def ==(other); end
-
- # source://rexml//lib/rexml/instruction.rb#44
- def clone; end
-
- # target is the "name" of the Instruction; IE, the "tag" in
- # content is everything else.
- #
- # source://rexml//lib/rexml/instruction.rb#15
- def content; end
-
- # target is the "name" of the Instruction; IE, the "tag" in
- # content is everything else.
- #
- # source://rexml//lib/rexml/instruction.rb#15
- def content=(_arg0); end
-
- # source://rexml//lib/rexml/instruction.rb#75
- def inspect; end
-
- # source://rexml//lib/rexml/instruction.rb#71
- def node_type; end
-
- # target is the "name" of the Instruction; IE, the "tag" in
- # content is everything else.
- #
- # source://rexml//lib/rexml/instruction.rb#15
- def target; end
-
- # target is the "name" of the Instruction; IE, the "tag" in
- # content is everything else.
- #
- # source://rexml//lib/rexml/instruction.rb#15
- def target=(_arg0); end
-
- # == DEPRECATED
- # See the rexml/formatters package
- #
- # source://rexml//lib/rexml/instruction.rb#51
- def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-end
-
-# Adds named attributes to an object.
-#
-# source://rexml//lib/rexml/namespace.rb#7
-module REXML::Namespace
- include ::REXML::XMLTokens
-
- # The name of the object, valid if set
- #
- # source://rexml//lib/rexml/namespace.rb#9
- def expanded_name; end
-
- # Fully expand the name, even if the prefix wasn't specified in the
- # source file.
- #
- # source://rexml//lib/rexml/namespace.rb#57
- def fully_expanded_name; end
-
- # Compares names optionally WITH namespaces
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/namespace.rb#43
- def has_name?(other, ns = T.unsafe(nil)); end
-
- # The name of the object, valid if set
- #
- # source://rexml//lib/rexml/namespace.rb#9
- def name; end
-
- # Sets the name and the expanded name
- #
- # source://rexml//lib/rexml/namespace.rb#17
- def name=(name); end
-
- # The expanded name of the object, valid if name is set
- #
- # source://rexml//lib/rexml/namespace.rb#11
- def prefix; end
-
- # The expanded name of the object, valid if name is set
- #
- # source://rexml//lib/rexml/namespace.rb#11
- def prefix=(_arg0); end
-end
-
-# source://rexml//lib/rexml/namespace.rb#13
-REXML::Namespace::NAME_WITHOUT_NAMESPACE = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/doctype.rb#280
-class REXML::NotationDecl < ::REXML::Child
- # @return [NotationDecl] a new instance of NotationDecl
- #
- # source://rexml//lib/rexml/doctype.rb#282
- def initialize(name, middle, pub, sys); end
-
- # This method retrieves the name of the notation.
- #
- # Method contributed by Henrik Martensson
- #
- # source://rexml//lib/rexml/doctype.rb#307
- def name; end
-
- # Returns the value of attribute public.
- #
- # source://rexml//lib/rexml/doctype.rb#281
- def public; end
-
- # Sets the attribute public
- #
- # @param value the value to set the attribute public to.
- #
- # source://rexml//lib/rexml/doctype.rb#281
- def public=(_arg0); end
-
- # Returns the value of attribute system.
- #
- # source://rexml//lib/rexml/doctype.rb#281
- def system; end
-
- # Sets the attribute system
- #
- # @param value the value to set the attribute system to.
- #
- # source://rexml//lib/rexml/doctype.rb#281
- def system=(_arg0); end
-
- # source://rexml//lib/rexml/doctype.rb#290
- def to_s; end
-
- # source://rexml//lib/rexml/doctype.rb#300
- def write(output, indent = T.unsafe(nil)); end
-end
-
-# source://rexml//lib/rexml/output.rb#5
-class REXML::Output
- include ::REXML::Encoding
-
- # @return [Output] a new instance of Output
- #
- # source://rexml//lib/rexml/output.rb#10
- def initialize(real_IO, encd = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/output.rb#22
- def <<(content); end
-
- # Returns the value of attribute encoding.
- #
- # source://rexml//lib/rexml/output.rb#8
- def encoding; end
-
- # source://rexml//lib/rexml/output.rb#26
- def to_s; end
-end
-
-# A parent has children, and has methods for accessing them. The Parent
-# class is never encountered except as the superclass for some other
-# object.
-#
-# source://rexml//lib/rexml/parent.rb#8
-class REXML::Parent < ::REXML::Child
- include ::Enumerable
-
- # Constructor
- #
- # @param parent if supplied, will be set as the parent of this object
- # @return [Parent] a new instance of Parent
- #
- # source://rexml//lib/rexml/parent.rb#13
- def initialize(parent = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/parent.rb#18
- def <<(object); end
-
- # Fetches a child at a given index
- #
- # @param index the Integer index of the child to fetch
- #
- # source://rexml//lib/rexml/parent.rb#57
- def [](index); end
-
- # Set an index entry. See Array.[]=
- #
- # @param index the index of the element to set
- # @param opt either the object to set, or an Integer length
- # @param child if opt is an Integer, this is the child to set
- # @return the parent (self)
- #
- # source://rexml//lib/rexml/parent.rb#70
- def []=(*args); end
-
- # source://rexml//lib/rexml/parent.rb#18
- def add(object); end
-
- # source://rexml//lib/rexml/parent.rb#115
- def children; end
-
- # Deeply clones this object. This creates a complete duplicate of this
- # Parent, including all descendants.
- #
- # source://rexml//lib/rexml/parent.rb#148
- def deep_clone; end
-
- # source://rexml//lib/rexml/parent.rb#32
- def delete(object); end
-
- # source://rexml//lib/rexml/parent.rb#47
- def delete_at(index); end
-
- # source://rexml//lib/rexml/parent.rb#43
- def delete_if(&block); end
-
- # source://rexml//lib/rexml/parent.rb#39
- def each(&block); end
-
- # source://rexml//lib/rexml/parent.rb#39
- def each_child(&block); end
-
- # source://rexml//lib/rexml/parent.rb#51
- def each_index(&block); end
-
- # Fetches the index of a given child
- # of this parent.
- #
- # @param child the child to get the index of
- # @return the index of the child, or nil if the object is not a child
- #
- # source://rexml//lib/rexml/parent.rb#123
- def index(child); end
-
- # Inserts an child after another child
- # child2 will be inserted after child1 in the child list of the parent.
- # If an xpath, child2 will be inserted after the first child to match
- # the xpath.
- #
- # @param child1 this is either an xpath or an Element. If an Element,
- # @param child2 the child to insert
- # @return the parent (self)
- #
- # source://rexml//lib/rexml/parent.rb#102
- def insert_after(child1, child2); end
-
- # Inserts an child before another child
- # child2 will be inserted before child1 in the child list of the parent.
- # If an xpath, child2 will be inserted before the first child to match
- # the xpath.
- #
- # @param child1 this is either an xpath or an Element. If an Element,
- # @param child2 the child to insert
- # @return the parent (self)
- #
- # source://rexml//lib/rexml/parent.rb#82
- def insert_before(child1, child2); end
-
- # @return the number of children of this parent
- #
- # source://rexml//lib/rexml/parent.rb#130
- def length; end
-
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/parent.rb#162
- def parent?; end
-
- # source://rexml//lib/rexml/parent.rb#18
- def push(object); end
-
- # Replaces one child with another, making sure the nodelist is correct
- # Child)
- #
- # @param to_replace the child to replace (must be a Child)
- # @param replacement the child to insert into the nodelist (must be a
- #
- # source://rexml//lib/rexml/parent.rb#140
- def replace_child(to_replace, replacement); end
-
- # @return the number of children of this parent
- #
- # source://rexml//lib/rexml/parent.rb#130
- def size; end
-
- # source://rexml//lib/rexml/parent.rb#115
- def to_a; end
-
- # source://rexml//lib/rexml/parent.rb#27
- def unshift(object); end
-end
-
-# source://rexml//lib/rexml/parseexception.rb#3
-class REXML::ParseException < ::RuntimeError
- # @return [ParseException] a new instance of ParseException
- #
- # source://rexml//lib/rexml/parseexception.rb#6
- def initialize(message, source = T.unsafe(nil), parser = T.unsafe(nil), exception = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/parseexception.rb#48
- def context; end
-
- # Returns the value of attribute continued_exception.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def continued_exception; end
-
- # Sets the attribute continued_exception
- #
- # @param value the value to set the attribute continued_exception to.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def continued_exception=(_arg0); end
-
- # source://rexml//lib/rexml/parseexception.rb#43
- def line; end
-
- # Returns the value of attribute parser.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def parser; end
-
- # Sets the attribute parser
- #
- # @param value the value to set the attribute parser to.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def parser=(_arg0); end
-
- # source://rexml//lib/rexml/parseexception.rb#38
- def position; end
-
- # Returns the value of attribute source.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def source; end
-
- # Sets the attribute source
- #
- # @param value the value to set the attribute source to.
- #
- # source://rexml//lib/rexml/parseexception.rb#4
- def source=(_arg0); end
-
- # source://rexml//lib/rexml/parseexception.rb#13
- def to_s; end
-end
-
-# = Using the Pull Parser
-# This API is experimental, and subject to change.
-# parser = PullParser.new( "texttxet" )
-# while parser.has_next?
-# res = parser.next
-# puts res[1]['att'] if res.start_tag? and res[0] == 'b'
-# end
-# See the PullEvent class for information on the content of the results.
-# The data is identical to the arguments passed for the various events to
-# the StreamListener API.
-#
-# Notice that:
-# parser = PullParser.new( "BAD DOCUMENT" )
-# while parser.has_next?
-# res = parser.next
-# raise res[1] if res.error?
-# end
-#
-# Nat Price gave me some good ideas for the API.
-#
-# source://rexml//lib/rexml/parsers/baseparser.rb#29
-class REXML::Parsers::BaseParser
- # @return [BaseParser] a new instance of BaseParser
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#115
- def initialize(source); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#120
- def add_listener(listener); end
-
- # Returns true if there are no more events
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#146
- def empty?; end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#438
- def entity(reference, entities); end
-
- # Returns true if there are more events. Synonymous with !empty?
- #
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#151
- def has_next?; end
-
- # Escapes all possible entities
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#449
- def normalize(input, entities = T.unsafe(nil), entity_filter = T.unsafe(nil)); end
-
- # Peek at the +depth+ event in the stack. The first element on the stack
- # is at depth 0. If +depth+ is -1, will parse to the end of the input
- # stream and return the last event, which is always :end_document.
- # Be aware that this causes the stream to be parsed up to the +depth+
- # event, so you can effectively pre-parse the entire document (pull the
- # entire thing into memory) using this method.
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#167
- def peek(depth = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#136
- def position; end
-
- # Returns the next event. This is a +PullEvent+ object.
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#182
- def pull; end
-
- # Returns the value of attribute source.
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#124
- def source; end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#126
- def stream=(source); end
-
- # Unescapes all possible entities
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#465
- def unnormalize(string, entities = T.unsafe(nil), filter = T.unsafe(nil)); end
-
- # Push an event back on the head of the stream. This method
- # has (theoretically) infinite depth.
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#157
- def unshift(token); end
-
- private
-
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/parsers/baseparser.rb#495
- def need_source_encoding_update?(xml_declaration_encoding); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#589
- def parse_attributes(prefixes, curr_ns); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#514
- def parse_id(base_error_message, accept_external_id:, accept_public_id:); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#542
- def parse_id_invalid_details(accept_external_id:, accept_public_id:); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#501
- def parse_name(base_error_message); end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#580
- def process_instruction; end
-
- # source://rexml//lib/rexml/parsers/baseparser.rb#190
- def pull_event; end
-end
-
-# source://rexml//lib/rexml/parsers/baseparser.rb#102
-REXML::Parsers::BaseParser::EXTERNAL_ID_PUBLIC = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/parsers/baseparser.rb#103
-REXML::Parsers::BaseParser::EXTERNAL_ID_SYSTEM = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/parsers/baseparser.rb#104
-REXML::Parsers::BaseParser::PUBLIC_ID = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/parsers/baseparser.rb#38
-REXML::Parsers::BaseParser::QNAME = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/parsers/baseparser.rb#37
-REXML::Parsers::BaseParser::QNAME_STR = T.let(T.unsafe(nil), String)
-
-# source://rexml//lib/rexml/parsers/streamparser.rb#6
-class REXML::Parsers::StreamParser
- # @return [StreamParser] a new instance of StreamParser
- #
- # source://rexml//lib/rexml/parsers/streamparser.rb#7
- def initialize(source, listener); end
-
- # source://rexml//lib/rexml/parsers/streamparser.rb#13
- def add_listener(listener); end
-
- # source://rexml//lib/rexml/parsers/streamparser.rb#17
- def parse; end
-end
-
-# source://rexml//lib/rexml/parsers/treeparser.rb#7
-class REXML::Parsers::TreeParser
- # @return [TreeParser] a new instance of TreeParser
- #
- # source://rexml//lib/rexml/parsers/treeparser.rb#8
- def initialize(source, build_context = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/parsers/treeparser.rb#13
- def add_listener(listener); end
-
- # source://rexml//lib/rexml/parsers/treeparser.rb#17
- def parse; end
-end
-
-# You don't want to use this class. Really. Use XPath, which is a wrapper
-# for this class. Believe me. You don't want to poke around in here.
-# There is strange, dark magic at work in this code. Beware. Go back! Go
-# back while you still can!
-#
-# source://rexml//lib/rexml/parsers/xpathparser.rb#12
-class REXML::Parsers::XPathParser
- include ::REXML::XMLTokens
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#42
- def abbreviate(path_or_parsed); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#132
- def expand(path_or_parsed); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#16
- def namespaces=(namespaces); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#21
- def parse(path); end
-
- # For backward compatibility
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#174
- def preciate_to_string(parsed, &block); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#36
- def predicate(path); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#174
- def predicate_to_path(parsed, &block); end
-
- private
-
- # | AdditiveExpr ('+' | '-') MultiplicativeExpr
- # | MultiplicativeExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#505
- def AdditiveExpr(path, parsed); end
-
- # | AndExpr S 'and' S EqualityExpr
- # | EqualityExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#438
- def AndExpr(path, parsed); end
-
- # | EqualityExpr ('=' | '!=') RelationalExpr
- # | RelationalExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#457
- def EqualityExpr(path, parsed); end
-
- # | FilterExpr Predicate
- # | PrimaryExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#608
- def FilterExpr(path, parsed); end
-
- # | FUNCTION_NAME '(' ( expr ( ',' expr )* )? ')'
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#663
- def FunctionCall(rest, parsed); end
-
- # LocationPath
- # | RelativeLocationPath
- # | '/' RelativeLocationPath?
- # | '//' RelativeLocationPath
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#243
- def LocationPath(path, parsed); end
-
- # | MultiplicativeExpr ('*' | S ('div' | 'mod') S) UnaryExpr
- # | UnaryExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#528
- def MultiplicativeExpr(path, parsed); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#343
- def NodeTest(path, parsed); end
-
- # | OrExpr S 'or' S AndExpr
- # | AndExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#419
- def OrExpr(path, parsed); end
-
- # | LocationPath
- # | FilterExpr ('/' | '//') RelativeLocationPath
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#590
- def PathExpr(path, parsed); end
-
- # Filters the supplied nodeset on the predicate(s)
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#395
- def Predicate(path, parsed); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#626
- def PrimaryExpr(path, parsed); end
-
- # | RelationalExpr ('<' | '>' | '<=' | '>=') AdditiveExpr
- # | AdditiveExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#480
- def RelationalExpr(path, parsed); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#267
- def RelativeLocationPath(path, parsed); end
-
- # | '-' UnaryExpr
- # | UnionExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#553
- def UnaryExpr(path, parsed); end
-
- # | UnionExpr '|' PathExpr
- # | PathExpr
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#571
- def UnionExpr(path, parsed); end
-
- # get_group( '[foo]bar' ) -> ['bar', '[foo]']
- #
- # source://rexml//lib/rexml/parsers/xpathparser.rb#676
- def get_group(string); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#694
- def parse_args(string); end
-
- # source://rexml//lib/rexml/parsers/xpathparser.rb#224
- def quote_literal(literal); end
-end
-
-# source://rexml//lib/rexml/parsers/xpathparser.rb#339
-REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD = T.let(T.unsafe(nil), Regexp)
-
-# Returns a 1-1 map of the nodeset
-# The contents of the resulting array are either:
-# true/false, if a positive match
-# String, if a name match
-# NodeTest
-# | ('*' | NCNAME ':' '*' | QNAME) NameTest
-# | '*' ':' NCNAME NameTest since XPath 2.0
-# | NODE_TYPE '(' ')' NodeType
-# | PI '(' LITERAL ')' PI
-# | '[' expr ']' Predicate
-#
-# source://rexml//lib/rexml/parsers/xpathparser.rb#338
-REXML::Parsers::XPathParser::PREFIX_WILDCARD = T.let(T.unsafe(nil), Regexp)
-
-# source://rexml//lib/rexml/doctype.rb#10
-class REXML::ReferenceWriter
- # @return [ReferenceWriter] a new instance of ReferenceWriter
- #
- # source://rexml//lib/rexml/doctype.rb#11
- def initialize(id_type, public_id_literal, system_literal, context = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/doctype.rb#25
- def write(output); end
-end
-
-# A Source can be searched for patterns, and wraps buffers and other
-# objects and provides consumption of text
-#
-# source://rexml//lib/rexml/source.rb#31
-class REXML::Source
- include ::REXML::Encoding
-
- # Constructor
- # value, overriding all encoding detection
- #
- # @param arg must be a String, and should be a valid XML document
- # @param encoding if non-null, sets the encoding of the source to this
- # @return [Source] a new instance of Source
- #
- # source://rexml//lib/rexml/source.rb#43
- def initialize(arg, encoding = T.unsafe(nil)); end
-
- # The current buffer (what we're going to read next)
- #
- # source://rexml//lib/rexml/source.rb#34
- def buffer; end
-
- # source://rexml//lib/rexml/source.rb#87
- def consume(pattern); end
-
- # @return the current line in the source
- #
- # source://rexml//lib/rexml/source.rb#117
- def current_line; end
-
- # @return [Boolean] true if the Source is exhausted
- #
- # source://rexml//lib/rexml/source.rb#108
- def empty?; end
-
- # Returns the value of attribute encoding.
- #
- # source://rexml//lib/rexml/source.rb#37
- def encoding; end
-
- # Inherited from Encoding
- # Overridden to support optimized en/decoding
- #
- # source://rexml//lib/rexml/source.rb#56
- def encoding=(enc); end
-
- # The line number of the last consumed text
- #
- # source://rexml//lib/rexml/source.rb#36
- def line; end
-
- # source://rexml//lib/rexml/source.rb#101
- def match(pattern, cons = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/source.rb#91
- def match_to(char, pattern); end
-
- # source://rexml//lib/rexml/source.rb#95
- def match_to_consume(char, pattern); end
-
- # source://rexml//lib/rexml/source.rb#112
- def position; end
-
- # source://rexml//lib/rexml/source.rb#84
- def read; end
-
- # Scans the source for a given pattern. Note, that this is not your
- # usual scan() method. For one thing, the pattern argument has some
- # requirements; for another, the source can be consumed. You can easily
- # confuse this method. Originally, the patterns were easier
- # to construct and this method more robust, because this method
- # generated search regexps on the fly; however, this was
- # computationally expensive and slowed down the entire REXML package
- # considerably, since this is by far the most commonly called method.
- # /^\s*(#{your pattern, with no groups})(.*)/. The first group
- # will be returned; the second group is used if the consume flag is
- # set.
- # everything after it in the Source.
- # pattern is not found.
- #
- # @param pattern must be a Regexp, and must be in the form of
- # @param consume if true, the pattern returned will be consumed, leaving
- # @return the pattern, if found, or nil if the Source is empty or the
- #
- # source://rexml//lib/rexml/source.rb#77
- def scan(pattern, cons = T.unsafe(nil)); end
-
- private
-
- # source://rexml//lib/rexml/source.rb#125
- def detect_encoding; end
-
- # source://rexml//lib/rexml/source.rb#146
- def encoding_updated; end
-end
-
-# Represents text nodes in an XML document
-#
-# source://rexml//lib/rexml/text.rb#11
-class REXML::Text < ::REXML::Child
- include ::Comparable
-
- # Constructor
- # +arg+ if a String, the content is set to the String. If a Text,
- # the object is shallowly cloned.
- #
- # +respect_whitespace+ (boolean, false) if true, whitespace is
- # respected
- #
- # +parent+ (nil) if this is a Parent object, the parent
- # will be set to this.
- #
- # +raw+ (nil) This argument can be given three values.
- # If true, then the value of used to construct this object is expected to
- # contain no unescaped XML markup, and REXML will not change the text. If
- # this value is false, the string may contain any characters, and REXML will
- # escape any and all defined entities whose values are contained in the
- # text. If this value is nil (the default), then the raw value of the
- # parent will be used as the raw value for this node. If there is no raw
- # value for the parent, and no value is supplied, the default is false.
- # Use this field if you have entities defined for some text, and you don't
- # want REXML to escape that text in output.
- # Text.new( "<&", false, nil, false ) #-> "<&"
- # Text.new( "<&", false, nil, false ) #-> "<&"
- # Text.new( "<&", false, nil, true ) #-> Parse exception
- # Text.new( "<&", false, nil, true ) #-> "<&"
- # # Assume that the entity "s" is defined to be "sean"
- # # and that the entity "r" is defined to be "russell"
- # Text.new( "sean russell" ) #-> "&s; &r;"
- # Text.new( "sean russell", false, nil, true ) #-> "sean russell"
- #
- # +entity_filter+ (nil) This can be an array of entities to match in the
- # supplied text. This argument is only useful if +raw+ is set to false.
- # Text.new( "sean russell", false, nil, false, ["s"] ) #-> "&s; russell"
- # Text.new( "sean russell", false, nil, true, ["s"] ) #-> "sean russell"
- # In the last example, the +entity_filter+ argument is ignored.
- #
- # +illegal+ INTERNAL USE ONLY
- #
- # @return [Text] a new instance of Text
- #
- # source://rexml//lib/rexml/text.rb#94
- def initialize(arg, respect_whitespace = T.unsafe(nil), parent = T.unsafe(nil), raw = T.unsafe(nil), entity_filter = T.unsafe(nil), illegal = T.unsafe(nil)); end
-
- # Appends text to this text node. The text is appended in the +raw+ mode
- # of this text node.
- #
- # +returns+ the text itself to enable method chain like
- # 'text << "XXX" << "YYY"'.
- #
- # source://rexml//lib/rexml/text.rb#194
- def <<(to_append); end
-
- # +other+ a String or a Text
- # +returns+ the result of (to_s <=> arg.to_s)
- #
- # source://rexml//lib/rexml/text.rb#203
- def <=>(other); end
-
- # source://rexml//lib/rexml/text.rb#184
- def clone; end
-
- # source://rexml//lib/rexml/text.rb#207
- def doctype; end
-
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/text.rb#179
- def empty?; end
-
- # source://rexml//lib/rexml/text.rb#278
- def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/text.rb#233
- def inspect; end
-
- # source://rexml//lib/rexml/text.rb#175
- def node_type; end
-
- # source://rexml//lib/rexml/text.rb#125
- def parent=(parent); end
-
- # If +raw+ is true, then REXML leaves the value alone
- #
- # source://rexml//lib/rexml/text.rb#21
- def raw; end
-
- # If +raw+ is true, then REXML leaves the value alone
- #
- # source://rexml//lib/rexml/text.rb#21
- def raw=(_arg0); end
-
- # Returns the string value of this text node. This string is always
- # escaped, meaning that it is a valid XML text node string, and all
- # entities that can be escaped, have been inserted. This method respects
- # the entity filter set in the constructor.
- #
- # # Assume that the entity "s" is defined to be "sean", and that the
- # # entity "r" is defined to be "russell"
- # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
- # t.to_s #-> "< & &s; russell"
- # t = Text.new( "< & &s; russell", false, nil, false )
- # t.to_s #-> "< & &s; russell"
- # u = Text.new( "sean russell", false, nil, true )
- # u.to_s #-> "sean russell"
- #
- # source://rexml//lib/rexml/text.rb#228
- def to_s; end
-
- # Returns the string value of this text. This is the text without
- # entities, as it might be used programmatically, or printed to the
- # console. This ignores the 'raw' attribute setting, and any
- # entity_filter.
- #
- # # Assume that the entity "s" is defined to be "sean", and that the
- # # entity "r" is defined to be "russell"
- # t = Text.new( "< & sean russell", false, nil, false, ['s'] )
- # t.value #-> "< & sean russell"
- # t = Text.new( "< & &s; russell", false, nil, false )
- # t.value #-> "< & sean russell"
- # u = Text.new( "sean russell", false, nil, true )
- # u.value #-> "sean russell"
- #
- # source://rexml//lib/rexml/text.rb#250
- def value; end
-
- # Sets the contents of this text node. This expects the text to be
- # unnormalized. It returns self.
- #
- # e = Element.new( "a" )
- # e.add_text( "foo" ) # foo
- # e[0].value = "bar" # bar
- # e[0].value = "" # <a>
- #
- # source://rexml//lib/rexml/text.rb#261
- def value=(val); end
-
- # source://rexml//lib/rexml/text.rb#267
- def wrap(string, width, addnewline = T.unsafe(nil)); end
-
- # == DEPRECATED
- # See REXML::Formatters
- #
- # source://rexml//lib/rexml/text.rb#293
- def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-
- # Writes out text, substituting special characters beforehand.
- # +out+ A String, IO, or any other object supporting <<( String )
- # +input+ the text to substitute and the write out
- #
- # z=utf8.unpack("U*")
- # ascOut=""
- # z.each{|r|
- # if r < 0x100
- # ascOut.concat(r.chr)
- # else
- # ascOut.concat(sprintf("%x;", r))
- # end
- # }
- # puts ascOut
- #
- # source://rexml//lib/rexml/text.rb#325
- def write_with_substitution(out, input); end
-
- # FIXME
- # This probably won't work properly
- #
- # source://rexml//lib/rexml/text.rb#305
- def xpath; end
-
- private
-
- # source://rexml//lib/rexml/text.rb#338
- def clear_cache; end
-
- class << self
- # check for illegal characters
- #
- # source://rexml//lib/rexml/text.rb#131
- def check(string, pattern, doctype); end
-
- # source://rexml//lib/rexml/text.rb#407
- def expand(ref, doctype, filter); end
-
- # Escapes all possible entities
- #
- # source://rexml//lib/rexml/text.rb#370
- def normalize(input, doctype = T.unsafe(nil), entity_filter = T.unsafe(nil)); end
-
- # Reads text, substituting entities
- #
- # source://rexml//lib/rexml/text.rb#344
- def read_with_substitution(input, illegal = T.unsafe(nil)); end
-
- # Unescapes all possible entities
- #
- # source://rexml//lib/rexml/text.rb#394
- def unnormalize(string, doctype = T.unsafe(nil), filter = T.unsafe(nil), illegal = T.unsafe(nil)); end
- end
-end
-
-# source://rexml//lib/rexml/undefinednamespaceexception.rb#4
-class REXML::UndefinedNamespaceException < ::REXML::ParseException
- # @return [UndefinedNamespaceException] a new instance of UndefinedNamespaceException
- #
- # source://rexml//lib/rexml/undefinednamespaceexception.rb#5
- def initialize(prefix, source, parser); end
-end
-
-# source://rexml//lib/rexml/validation/validationexception.rb#4
-class REXML::Validation::ValidationException < ::RuntimeError
- # @return [ValidationException] a new instance of ValidationException
- #
- # source://rexml//lib/rexml/validation/validationexception.rb#5
- def initialize(msg); end
-end
-
-# NEEDS DOCUMENTATION
-#
-# source://rexml//lib/rexml/xmldecl.rb#8
-class REXML::XMLDecl < ::REXML::Child
- include ::REXML::Encoding
-
- # @return [XMLDecl] a new instance of XMLDecl
- #
- # source://rexml//lib/rexml/xmldecl.rb#20
- def initialize(version = T.unsafe(nil), encoding = T.unsafe(nil), standalone = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/xmldecl.rb#56
- def ==(other); end
-
- # source://rexml//lib/rexml/xmldecl.rb#39
- def clone; end
-
- # source://rexml//lib/rexml/xmldecl.rb#102
- def dowrite; end
-
- # source://rexml//lib/rexml/xmldecl.rb#76
- def encoding=(enc); end
-
- # source://rexml//lib/rexml/xmldecl.rb#106
- def inspect; end
-
- # source://rexml//lib/rexml/xmldecl.rb#69
- def node_type; end
-
- # source://rexml//lib/rexml/xmldecl.rb#98
- def nowrite; end
-
- # source://rexml//lib/rexml/encoding.rb#7
- def old_enc=(encoding); end
-
- # Returns the value of attribute standalone.
- #
- # source://rexml//lib/rexml/xmldecl.rb#17
- def stand_alone?; end
-
- # Returns the value of attribute standalone.
- #
- # source://rexml//lib/rexml/xmldecl.rb#17
- def standalone; end
-
- # Sets the attribute standalone
- #
- # @param value the value to set the attribute standalone to.
- #
- # source://rexml//lib/rexml/xmldecl.rb#17
- def standalone=(_arg0); end
-
- # Returns the value of attribute version.
- #
- # source://rexml//lib/rexml/xmldecl.rb#17
- def version; end
-
- # Sets the attribute version
- #
- # @param value the value to set the attribute version to.
- #
- # source://rexml//lib/rexml/xmldecl.rb#17
- def version=(_arg0); end
-
- # indent::
- # Ignored. There must be no whitespace before an XML declaration
- # transitive::
- # Ignored
- # ie_hack::
- # Ignored
- #
- # source://rexml//lib/rexml/xmldecl.rb#49
- def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-
- # Returns the value of attribute writeencoding.
- #
- # source://rexml//lib/rexml/xmldecl.rb#18
- def writeencoding; end
-
- # Returns the value of attribute writethis.
- #
- # source://rexml//lib/rexml/xmldecl.rb#18
- def writethis; end
-
- # source://rexml//lib/rexml/xmldecl.rb#63
- def xmldecl(version, encoding, standalone); end
-
- private
-
- # source://rexml//lib/rexml/xmldecl.rb#111
- def content(enc); end
-
- class << self
- # Only use this if you do not want the XML declaration to be written;
- # this object is ignored by the XML writer. Otherwise, instantiate your
- # own XMLDecl and add it to the document.
- #
- # Note that XML 1.1 documents *must* include an XML declaration
- #
- # source://rexml//lib/rexml/xmldecl.rb#92
- def default; end
- end
-end
-
-# @private
-#
-# source://rexml//lib/rexml/xpath_parser.rb#959
-class REXML::XPathNode
- # @return [XPathNode] a new instance of XPathNode
- #
- # source://rexml//lib/rexml/xpath_parser.rb#961
- def initialize(node, context = T.unsafe(nil)); end
-
- # Returns the value of attribute context.
- #
- # source://rexml//lib/rexml/xpath_parser.rb#960
- def context; end
-
- # source://rexml//lib/rexml/xpath_parser.rb#970
- def position; end
-
- # Returns the value of attribute raw_node.
- #
- # source://rexml//lib/rexml/xpath_parser.rb#960
- def raw_node; end
-end
-
-# You don't want to use this class. Really. Use XPath, which is a wrapper
-# for this class. Believe me. You don't want to poke around in here.
-# There is strange, dark magic at work in this code. Beware. Go back! Go
-# back while you still can!
-#
-# source://rexml//lib/rexml/xpath_parser.rb#54
-class REXML::XPathParser
- include ::REXML::XMLTokens
-
- # @return [XPathParser] a new instance of XPathParser
- #
- # source://rexml//lib/rexml/xpath_parser.rb#60
- def initialize(strict: T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#94
- def []=(variable_name, value); end
-
- # Performs a depth-first (document order) XPath search, and returns the
- # first match. This is the fastest, lightest way to return a single result.
- #
- # FIXME: This method is incomplete!
- #
- # source://rexml//lib/rexml/xpath_parser.rb#103
- def first(path_stack, node); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#84
- def get_first(path, nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#139
- def match(path_stack, nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#69
- def namespaces=(namespaces = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#79
- def parse(path, nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#89
- def predicate(path, nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#74
- def variables=(vars = T.unsafe(nil)); end
-
- private
-
- # source://rexml//lib/rexml/xpath_parser.rb#775
- def child(nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#916
- def compare(a, operator, b); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#678
- def descendant(nodeset, include_self); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#689
- def descendant_recursive(raw_node, new_nodeset, new_nodes, include_self); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#938
- def each_unnode(nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#637
- def enter(tag, *args); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#815
- def equality_relational_compare(set1, op, set2); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#591
- def evaluate_predicate(expression, nodesets); end
-
- # Expr takes a stack of path elements and a set of nodes (either a Parent
- # or an Array and returns an Array of matching nodes
- #
- # source://rexml//lib/rexml/xpath_parser.rb#175
- def expr(path_stack, nodeset, context = T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#582
- def filter_nodeset(nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#745
- def following(node); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#756
- def following_node_of(node); end
-
- # Returns a String namespace for a node, given a prefix
- # The rules are:
- #
- # 1. Use the supplied namespace mapping first.
- # 2. If no mapping was supplied, use the context node to look up the namespace
- #
- # source://rexml//lib/rexml/xpath_parser.rb#163
- def get_namespace(node, prefix); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#642
- def leave(tag, *args); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#763
- def next_sibling_node(node); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#477
- def node_test(path_stack, nodesets, any_type: T.unsafe(nil)); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#802
- def norm(b); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#890
- def normalize_compare_values(a, operator, b); end
-
- # Builds a nodeset of all of the preceding nodes of the supplied node,
- # in reverse document order
- # preceding:: includes every element in the document that precedes this node,
- # except for ancestors
- #
- # source://rexml//lib/rexml/xpath_parser.rb#708
- def preceding(node); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#730
- def preceding_node_of(node); end
-
- # Reorders an array of nodes so that they are in document order
- # It tries to do this efficiently.
- #
- # FIXME: I need to get rid of this, but the issue is that most of the XPath
- # interpreter functions as a filter, which means that we lose context going
- # in and out of function calls. If I knew what the index of the nodes was,
- # I wouldn't have to do this. Maybe add a document IDX for each node?
- # Problems with mutable documents. Or, rewrite everything.
- #
- # source://rexml//lib/rexml/xpath_parser.rb#655
- def sort(array_of_nodes, order); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#441
- def step(path_stack, any_type: T.unsafe(nil), order: T.unsafe(nil)); end
-
- # @return [Boolean]
- #
- # source://rexml//lib/rexml/xpath_parser.rb#154
- def strict?; end
-
- # source://rexml//lib/rexml/xpath_parser.rb#630
- def trace(*args); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#950
- def unnode(nodeset); end
-
- # source://rexml//lib/rexml/xpath_parser.rb#877
- def value_type(value); end
-end
-
-# source://rexml//lib/rexml/xpath_parser.rb#58
-REXML::XPathParser::DEBUG = T.let(T.unsafe(nil), FalseClass)
diff --git a/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi b/sorbet/rbi/gems/rubocop-ast@1.35.0.rbi
similarity index 79%
rename from sorbet/rbi/gems/rubocop-ast@1.31.3.rbi
rename to sorbet/rbi/gems/rubocop-ast@1.35.0.rbi
index 08a626eb..a855c91c 100644
--- a/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi
+++ b/sorbet/rbi/gems/rubocop-ast@1.35.0.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `rubocop-ast` gem.
# Please instead update this file by running `bin/tapioca gem rubocop-ast`.
+
class Parser::Source::Range
include ::RuboCop::AST::Ext::Range
end
@@ -159,12 +160,16 @@ class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node
#
# @return [Boolean] whether the array is enclosed in percent or square
#
- # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#60
+ # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#64
def bracketed?; end
- # @deprecated Use `values.each` (a.k.a. `children.each`)
+ # Calls the given block for each `value` node in the `array` literal.
+ # If no block is given, an `Enumerator` is returned.
+ #
+ # @return [self] if a block is given
+ # @return [Enumerator] if no block is given
#
- # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#25
def each_value(&block); end
# Checks whether the `array` literal is delimited by percent brackets.
@@ -173,14 +178,14 @@ class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node
# @overload percent_literal?
# @return [Boolean] whether the array is enclosed in percent brackets
#
- # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#47
+ # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#51
def percent_literal?(type = T.unsafe(nil)); end
# Checks whether the `array` literal is delimited by square brackets.
#
# @return [Boolean] whether the array is enclosed in square brackets
#
- # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#32
+ # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#36
def square_brackets?; end
# Returns an array of all value nodes in the `array` literal.
@@ -204,19 +209,33 @@ class RuboCop::AST::AsgnNode < ::RuboCop::AST::Node
#
# @return [Node] the expression being assigned.
#
- # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#19
+ # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#20
def expression; end
+ # The name of the variable being assigned as a symbol.
+ #
+ # @return [Symbol] the name of the variable being assigned
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#12
+ def lhs; end
+
# The name of the variable being assigned as a symbol.
#
# @return [Symbol] the name of the variable being assigned
#
# source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#12
def name; end
+
+ # The expression being assigned to the variable.
+ #
+ # @return [Node] the expression being assigned.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#20
+ def rhs; end
end
# Common functionality for primitive literal nodes: `sym`, `str`,
-# `int`, `float`, ...
+# `int`, `float`, `rational`...
#
# source://rubocop-ast//lib/rubocop/ast/node/mixin/basic_literal_node.rb#7
module RuboCop::AST::BasicLiteralNode
@@ -438,18 +457,18 @@ class RuboCop::AST::Builder < ::Parser::Builders::Default
#
# @return [Node] the generated node
#
- # source://rubocop-ast//lib/rubocop/ast/builder.rb#98
+ # source://rubocop-ast//lib/rubocop/ast/builder.rb#106
def n(type, children, source_map); end
# TODO: Figure out what to do about literal encoding handling...
# More details here https://github.com/whitequark/parser/issues/283
#
- # source://rubocop-ast//lib/rubocop/ast/builder.rb#104
+ # source://rubocop-ast//lib/rubocop/ast/builder.rb#112
def string_value(token); end
private
- # source://rubocop-ast//lib/rubocop/ast/builder.rb#110
+ # source://rubocop-ast//lib/rubocop/ast/builder.rb#118
def node_klass(type); end
end
@@ -569,26 +588,27 @@ end
#
# source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#8
class RuboCop::AST::CasgnNode < ::RuboCop::AST::Node
+ include ::RuboCop::AST::ConstantNode
+
# The expression being assigned to the variable.
#
# @return [Node] the expression being assigned.
#
- # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#26
+ # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#17
def expression; end
- # The name of the variable being assigned as a symbol.
- #
- # @return [Symbol] the name of the variable being assigned
- #
- # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#19
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#14
+ def lhs; end
+
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#14
def name; end
- # The namespace of the constant being assigned.
+ # The expression being assigned to the variable.
#
- # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...)
+ # @return [Node] the expression being assigned.
#
- # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#12
- def namespace; end
+ # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#17
+ def rhs; end
end
# A node extension for `class` nodes. This will be used in place of a plain
@@ -623,412 +643,412 @@ end
#
# source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#6
module RuboCop::AST::CollectionNode
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
- # source://forwardable/1.3.3/forwardable.rb#231
- def &(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def &(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def *(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def *(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def +(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def +(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def -(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def -(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def <<(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def <<(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def [](*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def [](*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def []=(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def []=(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def all?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def all?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def any?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def any?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def append(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def append(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def assoc(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def assoc(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def at(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def at(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def bsearch(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def bsearch(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def bsearch_index(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def bsearch_index(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def chain(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def chain(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def chunk(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def chunk(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def chunk_while(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def chunk_while(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def clear(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def clear(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def collect(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def collect(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def collect!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def collect!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def collect_concat(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def collect_concat(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def combination(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def combination(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def compact(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def compact(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def compact!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def compact!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def concat(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def concat(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def count(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def count(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def cycle(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def cycle(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def deconstruct(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def deconstruct(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def delete(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def delete(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def delete_at(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def delete_at(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def delete_if(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def delete_if(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def detect(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def detect(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def difference(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def difference(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def dig(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def dig(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def drop(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def drop(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def drop_while(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def drop_while(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_cons(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_cons(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_entry(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_entry(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_index(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_index(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_slice(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_slice(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_with_index(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_with_index(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_with_object(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_with_object(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def empty?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def empty?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def entries(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def entries(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def fetch(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def fetch(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def fill(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def fill(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def filter(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def filter(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def filter!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def filter!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def filter_map(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def filter_map(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def find(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def find(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def find_all(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def find_all(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def find_index(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def find_index(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def first(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def first(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def flat_map(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def flat_map(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def flatten(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def flatten(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def flatten!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def flatten!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def grep(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def grep(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def grep_v(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def grep_v(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def group_by(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def group_by(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def include?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def include?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def index(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def index(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def inject(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def inject(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def insert(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def insert(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def intersect?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def intersect?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def intersection(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def intersection(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def join(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def join(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def keep_if(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def keep_if(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def last(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def last(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def lazy(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def lazy(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def length(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def length(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def map(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def map(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def map!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def map!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def max(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def max(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def max_by(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def max_by(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def member?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def member?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def min(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def min(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def min_by(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def min_by(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def minmax(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def minmax(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def minmax_by(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def minmax_by(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def none?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def none?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def one?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def one?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def pack(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def pack(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def partition(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def partition(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def permutation(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def permutation(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def place(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def place(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def pop(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def pop(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def prepend(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def prepend(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def product(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def product(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def push(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def push(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def rassoc(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def rassoc(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reduce(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reduce(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reject(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reject(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reject!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reject!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def repeated_combination(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def repeated_combination(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def repeated_permutation(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def repeated_permutation(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def replace(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def replace(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reverse(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reverse(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reverse!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reverse!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def reverse_each(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def reverse_each(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def rindex(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def rindex(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def rotate(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def rotate(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def rotate!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def rotate!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sample(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sample(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def select(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def select(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def select!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def select!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def shelljoin(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def shelljoin(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def shift(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def shift(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def shuffle(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def shuffle(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def shuffle!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def shuffle!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def size(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def size(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def slice(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def slice(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def slice!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def slice!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def slice_after(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def slice_after(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def slice_before(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def slice_before(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def slice_when(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def slice_when(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sort(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sort(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sort!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sort!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sort_by(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sort_by(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sort_by!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sort_by!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def sum(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def sum(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def take(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def take(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def take_while(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def take_while(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def tally(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def tally(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def to_ary(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_ary(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def to_h(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_h(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def to_set(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_set(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def transpose(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def transpose(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def union(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def union(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def uniq(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def uniq(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def uniq!(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def uniq!(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def unshift(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def unshift(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def values_at(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def values_at(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def zip(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def zip(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def |(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def |(*_arg0, **_arg1, &_arg2); end
end
# source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#9
@@ -1079,16 +1099,24 @@ end
#
# source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#6
class RuboCop::AST::ConstNode < ::RuboCop::AST::Node
+ include ::RuboCop::AST::ConstantNode
+end
+
+# Common functionality for nodes that deal with constants:
+# `const`, `casgn`.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#7
+module RuboCop::AST::ConstantNode
# @return [Boolean] if the constant starts with `::` (aka s(:cbase))
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#26
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#27
def absolute?; end
# @return [Boolean] if the constant is a Module / Class, according to the standard convention.
# Note: some classes might have uppercase in which case this method
# returns false
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#20
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#21
def class_name?; end
# Yield nodes for the namespace
@@ -1098,29 +1126,29 @@ class RuboCop::AST::ConstNode < ::RuboCop::AST::Node
# s(:const, :Foo), then
# s(:const, s(:const, :Foo), :Bar)
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#43
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#44
def each_path(&block); end
# @return [Boolean] if the constant is a Module / Class, according to the standard convention.
# Note: some classes might have uppercase in which case this method
# returns false
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#20
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#21
def module_name?; end
# @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...)
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#8
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#9
def namespace; end
# @return [Boolean] if the constant does not start with `::` (aka s(:cbase))
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#33
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#34
def relative?; end
# @return [Symbol] the demodulized name of the constant: "::Foo::Bar" => :Bar
#
- # source://rubocop-ast//lib/rubocop/ast/node/const_node.rb#13
+ # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#14
def short_name; end
end
@@ -1310,6 +1338,21 @@ class RuboCop::AST::EnsureNode < ::RuboCop::AST::Node
#
# source://rubocop-ast//lib/rubocop/ast/node/ensure_node.rb#12
def body; end
+
+ # Returns the `rescue` node of the `ensure`, if present.
+ #
+ # @return [Node, nil] The `rescue` node.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/ensure_node.rb#19
+ def rescue_node; end
+
+ # Checks whether this node body is a void context.
+ # Always `true` for `ensure`.
+ #
+ # @return [true] whether the `ensure` node body is a void context
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/ensure_node.rb#27
+ def void_context?; end
end
# source://rubocop-ast//lib/rubocop/ast/ext/range.rb#5
@@ -1337,11 +1380,6 @@ module RuboCop::AST::Ext::Range
def line_span(exclude_end: T.unsafe(nil)); end
end
-# Refinement to circumvent broken `Range#minmax` for infinity ranges in 2.6-
-#
-# source://rubocop-ast//lib/rubocop/ast/ext/range_min_max.rb#7
-module RuboCop::AST::Ext::RangeMinMax; end
-
# A node extension for `float` nodes. This will be used in place of a plain
# node when the builder constructs the AST, making its methods available to
# all `float` nodes within RuboCop.
@@ -1916,6 +1954,35 @@ class RuboCop::AST::IntNode < ::RuboCop::AST::Node
include ::RuboCop::AST::NumericNode
end
+# A node extension for `kwbegin` nodes. This will be used in place of a plain
+# node when the builder constructs the AST, making its methods available
+# to all `kwbegin` nodes within RuboCop.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/keyword_begin_node.rb#8
+class RuboCop::AST::KeywordBeginNode < ::RuboCop::AST::Node
+ # Returns the body of the `kwbegin` block. Returns `self` if the `kwbegin` contains
+ # multiple nodes.
+ #
+ # @return [Node, nil] The body of the `kwbegin`.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/keyword_begin_node.rb#13
+ def body; end
+
+ # Returns the `rescue` node of the `kwbegin` block, if one is present.
+ #
+ # @return [Node, nil] The `rescue` node within `kwbegin`.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/keyword_begin_node.rb#30
+ def ensure_node; end
+
+ # Returns the `rescue` node of the `kwbegin` block, if one is present.
+ #
+ # @return [Node, nil] The `rescue` node within `kwbegin`.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/keyword_begin_node.rb#37
+ def rescue_node; end
+end
+
# A node extension for `kwsplat` and `forwarded_kwrestarg` nodes. This will be used in
# place of a plain node when the builder constructs the AST, making its methods available to
# all `kwsplat` and `forwarded_kwrestarg` nodes within RuboCop.
@@ -2038,6 +2105,71 @@ class RuboCop::AST::LambdaNode < ::RuboCop::AST::Node
def first_argument_index; end
end
+# A node extension for `masgn` nodes.
+# This will be used in place of a plain node when the builder constructs
+# the AST, making its methods available to all assignment nodes within RuboCop.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#8
+class RuboCop::AST::MasgnNode < ::RuboCop::AST::Node
+ # @return [Array] the assignment nodes of the multiple assignment
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#16
+ def assignments; end
+
+ # The RHS (right hand side) of the multiple assignment. This returns
+ # the nodes as parsed: either a single node if the RHS has a single value,
+ # or an `array` node containing multiple nodes.
+ #
+ # NOTE: Due to how parsing works, `expression` will return the same for
+ # `a, b = x, y` and `a, b = [x, y]`.
+ #
+ # @return [Node] the right hand side of a multiple assignment.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#39
+ def expression; end
+
+ # @return [MlhsNode] the `mlhs` node
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#10
+ def lhs; end
+
+ # @return [Array] names of all the variables being assigned
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#21
+ def names; end
+
+ # The RHS (right hand side) of the multiple assignment. This returns
+ # the nodes as parsed: either a single node if the RHS has a single value,
+ # or an `array` node containing multiple nodes.
+ #
+ # NOTE: Due to how parsing works, `expression` will return the same for
+ # `a, b = x, y` and `a, b = [x, y]`.
+ #
+ # @return [Node] the right hand side of a multiple assignment.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#39
+ def rhs; end
+
+ # In contrast to `expression`, `values` always returns a Ruby array
+ # containing all the nodes being assigned on the RHS.
+ #
+ # Literal arrays are considered a singular value; but unlike `expression`,
+ # implied `array` nodes from assigning multiple values on the RHS are treated
+ # as separate.
+ #
+ # @return [Array] individual values being assigned on the RHS of the multiple assignment
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#52
+ def values; end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#58
+ def multiple_rhs?; end
+end
+
# Common functionality for nodes that are a kind of method dispatch:
# `send`, `csend`, `super`, `zsuper`, `yield`, `defined?`,
# and (modern only): `index`, `indexasgn`, `lambda`
@@ -2470,6 +2602,22 @@ RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_UNARY_OPERATOR_METHODS = T
# source://rubocop-ast//lib/rubocop/ast/node/mixin/method_identifier_predicates.rb#20
RuboCop::AST::MethodIdentifierPredicates::OPERATOR_METHODS = T.let(T.unsafe(nil), Set)
+# A node extension for `mlhs` nodes.
+# This will be used in place of a plain node when the builder constructs
+# the AST, making its methods available to all assignment nodes within RuboCop.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/mlhs_node.rb#8
+class RuboCop::AST::MlhsNode < ::RuboCop::AST::Node
+ # Returns all the assignment nodes on the left hand side (LHS) of a multiple assignment.
+ # These are generally assignment nodes (`lvasgn`, `ivasgn`, `cvasgn`, `gvasgn`, `casgn`)
+ # but can also be `send` nodes in case of `foo.bar, ... =` or `foo[:bar], ... =`.
+ #
+ # @return [Array] the assignment nodes of the multiple assignment LHS
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/mlhs_node.rb#14
+ def assignments; end
+end
+
# Common functionality for nodes that can be used as modifiers:
# `if`, `while`, `until`
#
@@ -2540,19 +2688,19 @@ class RuboCop::AST::Node < ::Parser::AST::Node
# @return [Node] a new instance of Node
# @see https://www.rubydoc.info/gems/ast/AST/Node:initialize
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#92
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#141
def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def __ENCODING___type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def __FILE___type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def __LINE___type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def alias_type?; end
# Returns an array of ancestor nodes.
@@ -2560,173 +2708,173 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Array] an array of ancestor nodes
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#247
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#306
def ancestors; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def and_asgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def and_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def arg_expr_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def arg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def args_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#464
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#511
def argument?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#468
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#515
def argument_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def array_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def array_pattern_with_tail_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def array_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#416
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#463
def assignment?; end
# Some cops treat the shovel operator as a kind of assignment.
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#355
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#413
def assignment_or_similar?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def back_ref_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#420
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#467
def basic_conditional?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#363
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#421
def basic_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def begin_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def block_pass_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def block_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def blockarg_expr_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def blockarg_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#472
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#519
def boolean_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def break_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#456
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#503
def call_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def case_match_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def case_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def casgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def cbase_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#460
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#507
def chained?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#512
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#559
def class_constructor?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#530
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#577
def class_definition?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def class_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#144
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#203
def complete!; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#149
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#208
def complete?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def complex_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#424
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#471
def conditional?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#293
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#352
def const_name; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def const_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def const_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def csend_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def cvar_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def cvasgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def def_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#314
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#372
def defined_module; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#319
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#377
def defined_module_name; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def defined_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def defs_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def dstr_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def dsym_type?; end
# Calls the given block for each ancestor node from parent to root.
@@ -2739,163 +2887,163 @@ class RuboCop::AST::Node < ::Parser::AST::Node
# @return [Enumerator] if no block is given
# @yieldparam node [Node] each ancestor node
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#235
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#294
def each_ancestor(*types, &block); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def eflipflop_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def empty_else_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#349
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#407
def empty_source?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def ensure_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#408
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#455
def equals_asgn?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def erange_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def false_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#371
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#429
def falsey_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def find_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#261
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#320
def first_line; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def float_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def for_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def forward_arg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def forward_args_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def forwarded_args_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def forwarded_kwrestarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def forwarded_restarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#509
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#556
def global_const?(param0 = T.unsafe(nil), param1); end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#484
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#531
def guard_clause?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def gvar_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def gvasgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def hash_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def hash_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def ident_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def if_guard_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def if_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def iflipflop_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#379
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#437
def immutable_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def in_match_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def in_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def index_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def indexasgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def int_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def irange_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def ivar_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def ivasgn_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#437
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#484
def keyword?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwargs_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwbegin_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwnilarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwoptarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwrestarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def kwsplat_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#503
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#550
def lambda?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#506
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#553
def lambda_or_proc?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def lambda_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#265
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#324
def last_line; end
# Use is discouraged, this is a potentially slow method and can lead
@@ -2903,7 +3051,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Node, nil] the left (aka previous) sibling
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#187
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#246
def left_sibling; end
# Use is discouraged, this is a potentially slow method and can lead
@@ -2911,94 +3059,94 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Array] the left (aka previous) siblings
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#197
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#256
def left_siblings; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#269
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#328
def line_count; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#359
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#417
def literal?; end
# NOTE: `loop { }` is a normal method call and thus not a loop keyword.
#
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#433
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#480
def loop_keyword?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def lvar_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def lvasgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def masgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_alt_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_as_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_current_line_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#491
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#538
def match_guard_clause?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_nil_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_pattern_p_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_pattern_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_rest_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_var_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_with_lvasgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def match_with_trailing_comma_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def mlhs_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#537
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#584
def module_definition?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def module_type?; end
# Predicates
#
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#341
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#399
def multiline?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#375
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#433
def mutable_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#671
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#716
def new_class_or_module_block?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def next_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def nil_type?; end
# Common destructuring method. This can be used to normalize
@@ -3011,95 +3159,95 @@ class RuboCop::AST::Node < ::Parser::AST::Node
# source://ast/2.4.2/lib/ast/node.rb#56
def node_parts; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#275
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#334
def nonempty_line_count; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def not_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def nth_ref_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def numargs_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def numblock_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#476
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#523
def numeric_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def objc_kwarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def objc_restarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def objc_varargs_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def op_asgn_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#448
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#495
def operator_keyword?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def optarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def or_asgn_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def or_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def pair_type?; end
# Returns the parent node, or `nil` if the receiver is a root node.
#
# @return [Node, nil] the parent node or `nil`
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#126
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#185
def parent; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#135
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#194
def parent?; end
# Searching the AST
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#325
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#383
def parent_module_name; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#452
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#499
def parenthesized_call?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def pin_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#428
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#475
def post_condition_loop?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def postexe_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def preexe_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#496
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#543
def proc?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def procarg0_type?; end
# Some expressions are evaluated for their value, some for their side
@@ -3112,56 +3260,60 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#582
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#627
def pure?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#480
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#527
def range_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def rational_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#286
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#345
def receiver(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#386
+ # @return [Boolean]
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#125
def recursive_basic_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#386
+ # @return [Boolean]
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#125
def recursive_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def redo_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#404
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#451
def reference?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def regexp_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def regopt_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def resbody_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def rescue_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def restarg_expr_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def restarg_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def retry_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def return_type?; end
# Use is discouraged, this is a potentially slow method and can lead
@@ -3169,7 +3321,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Node, nil] the right (aka next) sibling
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#178
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#237
def right_sibling; end
# Use is discouraged, this is a potentially slow method and can lead
@@ -3177,18 +3329,18 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Array] the right (aka next) siblings
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#206
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#265
def right_siblings; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#140
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#199
def root?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def sclass_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def self_type?; end
# Most nodes are of 'send' type, so this method is defined
@@ -3196,15 +3348,15 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#119
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#178
def send_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def shadowarg_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#412
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#459
def shorthand_asgn?; end
# Returns the index of the receiver node in its siblings. (Sibling index
@@ -3213,70 +3365,79 @@ class RuboCop::AST::Node < ::Parser::AST::Node
#
# @return [Integer, nil] the index of the receiver node in its siblings
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#171
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#230
def sibling_index; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#345
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#403
def single_line?; end
# NOTE: Some rare nodes may have no source, like `s(:args)` in `foo {}`
#
# @return [String, nil]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#253
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#312
def source; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#279
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#338
def source_length; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#257
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#316
def source_range; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#444
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#491
def special_keyword?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def splat_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#291
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#350
def str_content(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def str_type?; end
# @deprecated Use `:class_constructor?`
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#525
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#572
def struct_constructor?(param0 = T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def super_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def sym_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def true_type?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#367
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#425
def truthy_literal?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # Determine if the node is one of several node types in a single query
+ # Allows specific single node types, as well as "grouped" types
+ # (e.g. `:boolean` for `:true` or `:false`)
+ #
+ # @return [Boolean]
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#160
+ def type?(*types); end
+
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def undef_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def unless_guard_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def until_post_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def until_type?; end
# Override `AST::Node#updated` so that `AST::Processor` does not try to
@@ -3285,7 +3446,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node
# identical subtrees. Rather, the entire AST must be copied any time any
# part of it is changed.
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#160
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#219
def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end
# Some expressions are evaluated for their value, some for their side
@@ -3296,76 +3457,82 @@ class RuboCop::AST::Node < ::Parser::AST::Node
# So, does the return value of this node matter? If we changed it to
# `(...; nil)`, might that affect anything?
#
- #
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#551
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#597
def value_used?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#400
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#447
def variable?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def when_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def while_post_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def while_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def xstr_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def yield_type?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#111
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#170
def zsuper_type?; end
protected
- # source://rubocop-ast//lib/rubocop/ast/node.rb#130
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#189
def parent=(node); end
private
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#610
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#655
def begin_value_used?; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#621
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#666
def case_if_value_used?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#305
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#363
def defined_module0(param0 = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#615
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#660
def for_value_used?; end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#657
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#702
def parent_module_name_for_block(ancestor); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#645
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#690
def parent_module_name_for_sclass(sclass_node); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#632
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#677
def parent_module_name_part(node); end
- # source://rubocop-ast//lib/rubocop/ast/node.rb#600
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#645
def visit_ancestors(types); end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node.rb#627
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#672
def while_until_value_used?; end
+
+ class << self
+ private
+
+ # source://rubocop-ast//lib/rubocop/ast/node.rb#120
+ def def_recursive_literal_predicate(kind); end
+ end
end
# @api private
@@ -3421,6 +3588,11 @@ RuboCop::AST::Node::EQUALS_ASSIGNMENTS = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node.rb#35
RuboCop::AST::Node::FALSEY_LITERALS = T.let(T.unsafe(nil), Set)
+# @api private
+#
+# source://rubocop-ast//lib/rubocop/ast/node.rb#92
+RuboCop::AST::Node::GROUP_FOR_TYPE = T.let(T.unsafe(nil), Hash)
+
# @api private
#
# source://rubocop-ast//lib/rubocop/ast/node.rb#47
@@ -3509,7 +3681,7 @@ RuboCop::AST::Node::VARIABLES = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/method_definer.rb#5
class RuboCop::AST::NodePattern
include ::RuboCop::AST::NodePattern::MethodDefiner
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [NodePattern] a new instance of NodePattern
#
@@ -3527,8 +3699,8 @@ class RuboCop::AST::NodePattern
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73
def ast; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def captures(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def captures(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#111
def encode_with(coder); end
@@ -3556,16 +3728,16 @@ class RuboCop::AST::NodePattern
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73
def match_code; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def named_parameters(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def named_parameters(*_arg0, **_arg1, &_arg2); end
# Returns the value of attribute pattern.
#
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73
def pattern; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def positional_parameters(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def positional_parameters(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#95
def to_s; end
@@ -3670,15 +3842,15 @@ end
#
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler.rb#11
class RuboCop::AST::NodePattern::Compiler
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [Compiler] a new instance of Compiler
#
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler.rb#15
def initialize; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def bind(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def bind(*_arg0, **_arg1, &_arg2); end
# Returns the value of attribute binding.
#
@@ -3803,7 +3975,10 @@ class RuboCop::AST::NodePattern::Compiler::Binding
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/binding.rb#16
def bind(name); end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/binding.rb#30
+ # Yields for each branch of the given union, forbidding unification of
+ # bindings which only appear in a subset of the union.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/binding.rb#31
def union_bind(enum); end
private
@@ -3821,8 +3996,8 @@ class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern::
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#123
def initialize; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def comments(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def comments(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#128
def named_parameters; end
@@ -3835,8 +4010,8 @@ class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern::
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#132
def parser; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def tokens(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def tokens(*_arg0, **_arg1, &_arg2); end
end
# @api private
@@ -4151,7 +4326,6 @@ end
# Doc on how this fits in the compiling process:
# /docs/modules/ROOT/pages/node_pattern.adoc
#
-#
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#17
class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler
# Calls `compile_sequence`; the actual `compile` method
@@ -4305,6 +4479,8 @@ class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST:
def within_loop; end
end
+# Shift of 1 from standard Ruby indices
+#
# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#18
RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler::DELTA = T.let(T.unsafe(nil), Integer)
@@ -4437,7 +4613,7 @@ class RuboCop::AST::NodePattern::LexerRex
# The current location in the parse.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#104
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#103
def location; end
# The StringScanner for this lexer.
@@ -4452,22 +4628,22 @@ class RuboCop::AST::NodePattern::LexerRex
# Lex the next token.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#113
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#112
def next_token; end
# Parse the given string.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#84
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#83
def parse(str); end
# Read in and parse the file at +path+.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#94
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#93
def parse_file(path); end
# The current scanner class. Must be overridden in subclasses.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#77
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#76
def scanner_class; end
# The StringScanner for this lexer.
@@ -4611,218 +4787,218 @@ end
# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#7
class RuboCop::AST::NodePattern::Node < ::Parser::AST::Node
include ::RuboCop::AST::Descendence
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# Note: `arity.end` may be `Float::INFINITY`
#
# @return [Integer, Range] An Integer for fixed length terms, otherwise a Range.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#29
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#28
def arity; end
# @return [Range] arity as a Range
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#69
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#68
def arity_range; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#23
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#22
def capture?; end
# @return [Node] most nodes have only one child
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#48
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#47
def child; end
# @return [Array]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#43
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#42
def children_nodes; end
# @return [Array, nil] replace node with result, or `nil` if no change requested.
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#34
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#33
def in_sequence_head; end
# that matches within a Set (e.g. `42`, `:sym` but not `/regexp/`)
#
# @return [Boolean] returns true for nodes having a Ruby literal equivalent
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#64
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#63
def matches_within_set?; end
# @return [Integer] nb of captures of that node and its descendants
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#53
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#52
def nb_captures; end
# To be overridden by subclasses
#
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#19
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#18
def rest?; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#78
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#77
def source_range; end
# @return [Boolean] returns whether it matches a variable number of elements
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#58
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#57
def variadic?; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#74
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#73
def with(type: T.unsafe(nil), children: T.unsafe(nil), location: T.unsafe(nil)); end
end
# Node class for ``
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#180
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#179
class RuboCop::AST::NodePattern::Node::AnyOrder < ::RuboCop::AST::NodePattern::Node
include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#198
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#197
def arity; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#190
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#189
def ends_with_rest?; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#194
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#193
def rest_node; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#186
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#185
def term_nodes; end
end
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#183
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#182
RuboCop::AST::NodePattern::Node::AnyOrder::ARITIES = T.let(T.unsafe(nil), Hash)
# Node class for `$something`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#97
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#96
class RuboCop::AST::NodePattern::Node::Capture < ::RuboCop::AST::NodePattern::Node
- # source://forwardable/1.3.3/forwardable.rb#231
- def arity(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def arity(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#101
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#100
def capture?; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#109
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#108
def in_sequence_head; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#105
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#104
def nb_captures; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def rest?(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def rest?(*_arg0, **_arg1, &_arg2); end
end
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#86
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#85
module RuboCop::AST::NodePattern::Node::ForbidInSeqHead
# @raise [NodePattern::Invalid]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#87
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#86
def in_sequence_head; end
end
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#140
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#139
RuboCop::AST::NodePattern::Node::FunctionCall = RuboCop::AST::NodePattern::Node::Predicate
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#82
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#81
RuboCop::AST::NodePattern::Node::INT_TO_RANGE = T.let(T.unsafe(nil), Hash)
# Registry
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#250
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#249
RuboCop::AST::NodePattern::Node::MAP = T.let(T.unsafe(nil), Hash)
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#12
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#11
RuboCop::AST::NodePattern::Node::MATCHES_WITHIN_SET = T.let(T.unsafe(nil), Set)
# Node class for `predicate?(:arg, :list)`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#131
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#130
class RuboCop::AST::NodePattern::Node::Predicate < ::RuboCop::AST::NodePattern::Node
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#136
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#135
def arg_list; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#132
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#131
def method_name; end
end
# Node class for `int+`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#143
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#142
class RuboCop::AST::NodePattern::Node::Repetition < ::RuboCop::AST::NodePattern::Node
include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#156
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#155
def arity; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#146
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#145
def operator; end
end
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#150
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#149
RuboCop::AST::NodePattern::Node::Repetition::ARITIES = T.let(T.unsafe(nil), Hash)
# Node class for `...`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#162
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#161
class RuboCop::AST::NodePattern::Node::Rest < ::RuboCop::AST::NodePattern::Node
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#170
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#169
def arity; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#174
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#173
def in_sequence_head; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#166
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#165
def rest?; end
end
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#163
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#162
RuboCop::AST::NodePattern::Node::Rest::ARITY = T.let(T.unsafe(nil), Range)
# Node class for `(type first second ...)`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#118
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#117
class RuboCop::AST::NodePattern::Node::Sequence < ::RuboCop::AST::NodePattern::Node
include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead
# @return [Sequence] a new instance of Sequence
#
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#121
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#120
def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end
end
# A list (potentially empty) of nodes; part of a Union
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#206
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#205
class RuboCop::AST::NodePattern::Node::Subsequence < ::RuboCop::AST::NodePattern::Node
include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#209
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#208
def arity; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#214
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#213
def in_sequence_head; end
end
# Node class for `{ ... }`
#
-# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#224
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#223
class RuboCop::AST::NodePattern::Node::Union < ::RuboCop::AST::NodePattern::Node
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#225
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#224
def arity; end
- # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#232
+ # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#231
def in_sequence_head; end
end
@@ -4834,7 +5010,7 @@ end
#
# source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.racc.rb#12
class RuboCop::AST::NodePattern::Parser < ::Racc::Parser
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [Parser] a new instance of Parser
#
@@ -4953,29 +5129,29 @@ class RuboCop::AST::NodePattern::Parser < ::Racc::Parser
# source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.racc.rb#465
def _reduce_none(val, _values); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_atom(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_atom(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_call(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_call(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_capture(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_capture(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_list(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_list(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_unary_op(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_unary_op(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def emit_union(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def emit_union(*_arg0, **_arg1, &_arg2); end
# source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#40
def inspect; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def next_token(*args, **_arg1, &block); end
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def next_token(*_arg0, **_arg1, &_arg2); end
# (Similar API to `parser` gem)
# Parses a source and returns the AST.
@@ -5248,6 +5424,9 @@ RuboCop::AST::NodePattern::Sets::SET_LOAD_RESTORE = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
RuboCop::AST::NodePattern::Sets::SET_MAP_COLLECT = T.let(T.unsafe(nil), Set)
+# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
+RuboCop::AST::NodePattern::Sets::SET_MAP_FILTER_MAP = T.let(T.unsafe(nil), Set)
+
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
RuboCop::AST::NodePattern::Sets::SET_MODULE_FUNCTION_RUBY2_KEYWORDS = T.let(T.unsafe(nil), Set)
@@ -5297,7 +5476,7 @@ RuboCop::AST::NodePattern::Sets::SET_READ_BINREAD = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_REDUCE_INJECT = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
-RuboCop::AST::NodePattern::Sets::SET_REJECT_DELETE_IF_REJECT = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET_REJECT_REJECT = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(nil), Set)
@@ -5306,7 +5485,7 @@ RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(n
RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER_FIND_ALL = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
-RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT_FILTER_FILTER = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10
RuboCop::AST::NodePattern::Sets::SET_SEND_PUBLIC_SEND___SEND__ = T.let(T.unsafe(nil), Set)
@@ -5425,7 +5604,7 @@ RuboCop::AST::NodePattern::Sets::SET_____2 = T.let(T.unsafe(nil), Set)
# source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#55
RuboCop::AST::NodePattern::VAR = T.let(T.unsafe(nil), String)
-# Common functionality for primitive numeric nodes: `int`, `float`, ...
+# Common functionality for primitive numeric nodes: `int`, `float`, `rational`...
#
# source://rubocop-ast//lib/rubocop/ast/node/mixin/numeric_node.rb#6
module RuboCop::AST::NumericNode
@@ -5458,22 +5637,34 @@ class RuboCop::AST::OpAsgnNode < ::RuboCop::AST::Node
#
# @return [Node] the expression being assigned.
#
- # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#31
+ # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#32
def expression; end
+ # @return [AsgnNode] the assignment node
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#10
+ def lhs; end
+
# The name of the variable being assigned as a symbol.
#
# @return [Symbol] the name of the variable being assigned
#
- # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#17
+ # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#18
def name; end
# The operator being used for assignment as a symbol.
#
# @return [Symbol] the assignment operator
#
- # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#24
+ # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#25
def operator; end
+
+ # The expression being assigned to the variable.
+ #
+ # @return [Node] the expression being assigned.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#32
+ def rhs; end
end
# A node extension for `op_asgn` nodes.
@@ -5762,42 +5953,42 @@ end
# and other information such as disabled lines for cops.
# It also provides a convenient way to access source lines.
#
-# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#11
+# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#10
class RuboCop::AST::ProcessedSource
# @return [ProcessedSource] a new instance of ProcessedSource
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#29
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#28
def initialize(source, ruby_version, path = T.unsafe(nil), parser_engine: T.unsafe(nil)); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#73
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#72
def [](*args); end
# Returns the value of attribute ast.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def ast; end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#51
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#50
def ast_with_comments; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#112
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#111
def blank?; end
# Returns the value of attribute buffer.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def buffer; end
# Raw source checksum for tracking infinite loops.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#84
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#83
def checksum; end
# @return [Comment, nil] the comment at that line, if any.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#117
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#116
def comment_at_line(line); end
# Consider using `each_comment_in_lines` instead
@@ -5805,181 +5996,181 @@ class RuboCop::AST::ProcessedSource
# @deprecated use contains_comment?
# @return [Boolean] if any of the lines in the given `source_range` has a comment.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#139
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#138
def commented?(source_range); end
# Returns the value of attribute comments.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def comments; end
# Should have been called `comments_before_or_at_line`. Doubtful it has of any valid use.
#
# @deprecated Use `each_comment_in_lines`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#147
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#146
def comments_before_line(line); end
# Consider using `each_comment_in_lines` instead
#
# @return [Boolean] if any of the lines in the given `source_range` has a comment.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#139
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#138
def contains_comment?(source_range); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#161
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#160
def current_line(token); end
# Returns the value of attribute diagnostics.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def diagnostics; end
# @deprecated Use `comments.each`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#89
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#88
def each_comment(&block); end
# Enumerates on the comments contained with the given `line_range`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#127
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#126
def each_comment_in_lines(line_range); end
# @deprecated Use `tokens.each`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#99
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#98
def each_token(&block); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#108
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#107
def file_path; end
# @deprecated Use `comment_at_line`, `each_comment_in_lines`, or `comments.find`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#94
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#93
def find_comment(&block); end
# @deprecated Use `tokens.find`
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#104
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#103
def find_token(&block); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#182
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#181
def first_token_of(range_or_node); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#165
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#164
def following_line(token); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#186
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#185
def last_token_of(range_or_node); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#169
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#168
def line_indentation(line_number); end
# @return [Boolean] if the given line number has a comment.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#122
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#121
def line_with_comment?(line); end
# Returns the source lines, line break characters removed, excluding a
# possible __END__ and everything that comes after.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#59
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#58
def lines; end
# Returns the value of attribute parser_engine.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def parser_engine; end
# Returns the value of attribute parser_error.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def parser_error; end
# Returns the value of attribute path.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def path; end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#157
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#156
def preceding_line(token); end
# Returns the value of attribute raw_source.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def raw_source; end
# Returns the value of attribute ruby_version.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def ruby_version; end
# The tokens list is always sorted by token position, except for cases when heredoc
# is passed as a method argument. In this case tokens are interleaved by
# heredoc contents' tokens.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#193
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#192
def sorted_tokens; end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#151
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#150
def start_with?(string); end
# Returns the value of attribute tokens.
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#21
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#20
def tokens; end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#176
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#175
def tokens_within(range_or_node); end
# @return [Boolean]
#
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#77
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#76
def valid_syntax?; end
private
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#200
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#199
def comment_index; end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#312
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#309
def create_parser(ruby_version, parser_engine); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#328
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#325
def first_token_index(range_or_node); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#333
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#330
def last_token_index(range_or_node); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#206
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#205
def parse(source, ruby_version, parser_engine); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#240
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#238
def parser_class(ruby_version, parser_engine); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#338
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#335
def source_range(range_or_node); end
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#223
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#222
def tokenize(parser); end
class << self
- # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#24
+ # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#23
def from_file(path, ruby_version, parser_engine: T.unsafe(nil)); end
end
end
-# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#15
+# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#14
RuboCop::AST::ProcessedSource::INVALID_LEVELS = T.let(T.unsafe(nil), Array)
-# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#18
+# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#17
RuboCop::AST::ProcessedSource::PARSER_ENGINES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#13
+# source://rubocop-ast//lib/rubocop/ast/processed_source.rb#12
RuboCop::AST::ProcessedSource::STRING_SOURCE_NAME = T.let(T.unsafe(nil), String)
# A node extension for `irange` and `erange` nodes. This will be used in
@@ -5995,6 +6186,16 @@ class RuboCop::AST::RangeNode < ::RuboCop::AST::Node
def end; end
end
+# A node extension for `rational` nodes. This will be used in place of a plain
+# node when the builder constructs the AST, making its methods available to
+# all `rational` nodes within RuboCop.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/rational_node.rb#8
+class RuboCop::AST::RationalNode < ::RuboCop::AST::Node
+ include ::RuboCop::AST::BasicLiteralNode
+ include ::RuboCop::AST::NumericNode
+end
+
# A node extension for `regexp` nodes. This will be used in place of a plain
# node when the builder constructs the AST, making its methods available
# to all `regexp` nodes within RuboCop.
@@ -6937,6 +7138,18 @@ class RuboCop::AST::UntilNode < ::RuboCop::AST::Node
def keyword; end
end
+# A node extension for `lvar`, `ivar`, `cvar` and `gvar` nodes.
+# This will be used in place of a plain node when the builder constructs
+# the AST, making its methods available to all assignment nodes within RuboCop.
+#
+# source://rubocop-ast//lib/rubocop/ast/node/var_node.rb#8
+class RuboCop::AST::VarNode < ::RuboCop::AST::Node
+ # @return [Symbol] The name of the variable.
+ #
+ # source://rubocop-ast//lib/rubocop/ast/node/var_node.rb#10
+ def name; end
+end
+
# source://rubocop-ast//lib/rubocop/ast/version.rb#5
module RuboCop::AST::Version; end
@@ -7036,3 +7249,340 @@ class RuboCop::AST::YieldNode < ::RuboCop::AST::Node
# source://rubocop-ast//lib/rubocop/ast/node/yield_node.rb#16
def node_parts; end
end
+
+class RuboCop::CommentConfig
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#34
+ def initialize(processed_source); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#63
+ def comment_only_line?(line_number); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def config(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#51
+ def cop_disabled_line_ranges; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#39
+ def cop_enabled_at_line?(cop, line_number); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#47
+ def cop_opted_in?(cop); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#55
+ def extra_enabled_comments; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#30
+ def processed_source; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def registry(*_arg0, **_arg1, &_arg2); end
+
+ private
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#96
+ def analyze; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#124
+ def analyze_cop(analysis, directive); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#144
+ def analyze_disabled(analysis, directive); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#155
+ def analyze_rest(analysis, directive); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#135
+ def analyze_single_line(analysis, directive); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#164
+ def cop_line_ranges(analysis); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#170
+ def each_directive; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#69
+ def extra_enabled_comments_with_names(extras:, names:); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#190
+ def handle_enable_all(directive, names, extras); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#204
+ def handle_switch(directive, names, extras); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#115
+ def inject_disabled_cops_directives(analyses); end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#183
+ def non_comment_token_line_numbers; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#83
+ def opt_in_cops; end
+
+ # source://rubocop/1.68.0/lib/rubocop/comment_config.rb#179
+ def qualified_cop_name(cop_name); end
+end
+
+class RuboCop::Config
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#30
+ def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def [](*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def []=(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#170
+ def active_support_extensions_enabled?; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#96
+ def add_excludes_from_higher_level(highest_config); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#197
+ def allowed_camel_case_file?(file); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#241
+ def base_dir_for_path_parameters; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#271
+ def bundler_lock_file_path; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#51
+ def check; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#142
+ def clusivity_config_for_badge?(badge); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def delete(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#108
+ def deprecation_check; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def dig(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#162
+ def disabled_new_cops?; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_key(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#166
+ def enabled_new_cops?; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def fetch(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#219
+ def file_to_exclude?(file); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#178
+ def file_to_include?(file); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#158
+ def for_all_cops; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#128
+ def for_badge(badge); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#122
+ def for_cop(cop); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#153
+ def for_department(department_name); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#296
+ def gem_versions_in_target; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#300
+ def inspect; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#76
+ def internal?; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def key?(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def keys(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#47
+ def loaded_features; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#20
+ def loaded_path; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#81
+ def make_excludes_absolute; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def map(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def merge(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#251
+ def parser_engine; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#232
+ def path_relative_to_config(path); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#228
+ def patterns_to_exclude; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#224
+ def patterns_to_include; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#282
+ def pending_cops; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#211
+ def possibly_include_hidden?; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def replace(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#71
+ def signature; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#266
+ def smart_loaded_path; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#174
+ def string_literals_frozen_by_default?; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#255
+ def target_rails_version; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def target_ruby_version(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_h(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_hash(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#67
+ def to_s; end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def transform_values(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def validate(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#58
+ def validate_after_resolution; end
+
+ private
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#350
+ def department_of(qualified_cop_name); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#338
+ def enable_cop?(qualified_cop_name, cop_options); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#325
+ def gem_version_to_major_minor_float(gem_version); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#331
+ def read_gem_versions_from_target_lockfile; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#312
+ def read_rails_version_from_bundler_lock_file; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#307
+ def target_rails_version_from_bundler_lock_file; end
+
+ class << self
+ # source://rubocop/1.68.0/lib/rubocop/config.rb#22
+ def create(hash, path, check: T.unsafe(nil)); end
+ end
+end
+
+class RuboCop::ConfigValidator
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#27
+ def initialize(config); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def for_all_cops(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def smart_loaded_path(*_arg0, **_arg1, &_arg2); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#63
+ def target_ruby_version; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#33
+ def validate; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#59
+ def validate_after_resolution; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#67
+ def validate_section_presence(name); end
+
+ private
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#104
+ def alert_about_unrecognized_cops(invalid_cop_names); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#254
+ def check_cop_config_value(hash, parent = T.unsafe(nil)); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#77
+ def check_obsoletions; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#84
+ def check_target_ruby; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#195
+ def each_invalid_parameter(cop_name); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#120
+ def list_unknown_cops(invalid_cop_names); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#274
+ def param_error_message(parent, key, value, supposed_values); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#242
+ def reject_conflicting_safe_settings; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#233
+ def reject_mutually_exclusive_defaults; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#142
+ def suggestion(name); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#75
+ def target_ruby; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#207
+ def validate_enforced_styles(valid_cop_names); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#169
+ def validate_new_cops_parameter; end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#180
+ def validate_parameter_names(valid_cop_names); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#227
+ def validate_support_and_has_list(name, formats, valid); end
+
+ # source://rubocop/1.68.0/lib/rubocop/config_validator.rb#158
+ def validate_syntax_cop; end
+end
+
+# Similar to `Forwardable#def_delegators`, but simpler & faster
+#
+# source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#5
+module RuboCop::SimpleForwardable
+ # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#6
+ def def_delegators(accessor, *methods); end
+end
diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi
similarity index 91%
rename from sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi
rename to sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi
index 69266e92..ce85893f 100644
--- a/sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi
+++ b/sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `rubocop-sorbet` gem.
# Please instead update this file by running `bin/tapioca gem rubocop-sorbet`.
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#3
module RuboCop; end
@@ -230,7 +231,7 @@ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.un
# sig { void }
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#19
-class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::Sorbet::SignatureHelp
@@ -275,6 +276,9 @@ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), Str
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#36
class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Base
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#46
+ def on_csend(node); end
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#46
def on_send(node); end
end
@@ -321,10 +325,12 @@ end
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#22
RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String)
-# Checks that the Sorbet sigil comes as the first magic comment in the file.
+# Checks that the Sorbet sigil comes as the first magic comment in the file, after the encoding comment if any.
#
# The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
#
+# The ordering is for consistency only, except for the encoding comment which must be first, if present.
+#
# For example, the following bad ordering:
#
# ```ruby
@@ -340,42 +346,42 @@ RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String)
# Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
# other comments or magic comments are left in the same place.
#
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#32
class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
include ::RuboCop::Cop::RangeHelp
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42
- def autocorrect(_node); end
-
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33
- def investigate(processed_source); end
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#35
+ def on_new_investigation; end
protected
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#93
+ def autocorrect(corrector); end
+
# checks
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#92
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
def check_magic_comments_order(tokens); end
# Get all the tokens in `processed_source` that match `MAGIC_REGEX`
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#84
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#62
def extract_magic_comments(processed_source); end
end
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#46
RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#48
RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#47
RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#79
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#57
RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#72
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#50
RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
# Checks that every method definition and attribute accessor has a Sorbet signature.
@@ -399,87 +405,88 @@ RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil),
# * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#27
-class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Sorbet::SignatureHelp
+ extend ::RuboCop::Cop::AutoCorrector
# @return [EnforceSignatures] a new instance of EnforceSignatures
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#31
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#36
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#37
def accessor?(param0 = T.unsafe(nil)); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#56
- def autocorrect(node); end
-
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#40
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#41
def on_def(node); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#44
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#45
def on_defs(node); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#48
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#49
def on_send(node); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#52
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#53
def on_signature(node); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#75
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#57
def scope(node); end
private
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#84
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#79
+ def autocorrect(corrector, node); end
+
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#66
def check_node(node); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#95
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#96
def param_type_placeholder; end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#99
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#100
def return_type_placeholder; end
end
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#103
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
# @return [SigSuggestion] a new instance of SigSuggestion
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#106
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#107
def initialize(indent, param_placeholder, return_placeholder); end
# Returns the value of attribute params.
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
def params; end
# Sets the attribute params
#
# @param value the value to set the attribute params to.
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
def params=(_arg0); end
# Returns the value of attribute returns.
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
def returns; end
# Sets the attribute returns
#
# @param value the value to set the attribute returns to.
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
def returns=(_arg0); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#114
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#115
def to_autocorrect; end
private
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#126
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#127
def generate_params; end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#138
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#139
def generate_return; end
end
@@ -503,15 +510,15 @@ end
class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
include ::RuboCop::Cop::RangeHelp
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#40
- def autocorrect(_node); end
-
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
- def investigate(processed_source); end
+ def on_new_investigation; end
protected
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#56
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#50
+ def autocorrect(corrector); end
+
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#44
def extract_all_sigils(processed_source); end
end
@@ -666,15 +673,15 @@ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsa
# # sorbet/rbi/any/path/for/file.rbi
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
-class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
- def investigate(processed_source); end
+ def on_new_investigation; end
private
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#48
def allowed_paths; end
end
@@ -995,6 +1002,25 @@ end
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#6
+module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#9
+ def gem_version_annotations; end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#17
+ def gem_version_annotation?(comment); end
+
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#21
+ def gem_versions(comment); end
+end
+
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#7
+RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String)
+
# Makes the Sorbet typed sigil mandatory in all files.
#
# Options:
@@ -1008,7 +1034,7 @@ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), Strin
class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
# @return [Boolean]
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#18
def require_sigil_on_all_files?; end
end
@@ -1083,7 +1109,7 @@ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsaf
# def foo(b:, a: 1); end
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20
-class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Sorbet::SignatureHelp
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
@@ -1231,6 +1257,46 @@ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33
RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+# Checks for the use of Ruby Refinements library. Refinements add
+# complexity and incur a performance penalty that can be significant
+# for large code bases. Good examples are cases of unrelated
+# methods that happen to have the same name as these module methods.
+#
+# @example
+# # bad
+# module Foo
+# refine(Date) do
+# end
+# end
+#
+# # bad
+# module Foo
+# using(Date) do
+# end
+# end
+#
+# # good
+# module Foo
+# bar.refine(Date)
+# end
+#
+# # good
+# module Foo
+# bar.using(Date)
+# end
+#
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#34
+class RuboCop::Cop::Sorbet::Refinement < ::RuboCop::Cop::Base
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#38
+ def on_send(node); end
+end
+
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#35
+RuboCop::Cop::Sorbet::Refinement::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#36
+RuboCop::Cop::Sorbet::Refinement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks for the correct order of `sig` builder methods.
#
# Options:
@@ -1444,6 +1510,42 @@ end
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
+# Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification.
+#
+# @example
+# # bad
+# # @version > not a version number
+#
+# # good
+# # @version = 1
+#
+# # good
+# # @version > 1.2.3
+#
+# # good
+# # @version <= 4.3-preview
+#
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#21
+class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
+
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#27
+ def on_new_investigation; end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#50
+ def valid_version?(version_string); end
+end
+
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#24
+RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#25
+RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array)
+
# Checks that every Ruby file contains a valid Sorbet sigil.
# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
#
@@ -1458,69 +1560,69 @@ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
#
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20
-class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#36
- def autocorrect(_node); end
+class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
- # So we can properly subclass this cop
- #
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23
- def investigate(processed_source); end
+ def on_new_investigation; end
protected
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#150
+ def autocorrect(corrector); end
+
# checks
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#71
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55
def check_sigil_present(sigil); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#131
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#118
def check_strictness_level(sigil, strictness); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#109
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#94
def check_strictness_not_empty(sigil, strictness); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#120
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#106
def check_strictness_valid(sigil, strictness); end
# Default is `nil`
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#181
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#184
def exact_strictness; end
# extraction
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#59
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#43
def extract_sigil(processed_source); end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#65
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#49
def extract_strictness(sigil); end
# Default is `nil`
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#175
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#178
def minimum_strictness; end
# Default is `false`
#
# @return [Boolean]
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#164
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#167
def require_sigil_on_all_files?; end
# Default is `'false'`
#
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#169
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#172
def suggested_strictness; end
- # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#87
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#72
def suggested_strictness_level; end
end
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#39
RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54
+# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#38
RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
# Disallows the usage of `.void.checked(:tests)`.
diff --git a/sorbet/rbi/gems/rubocop@1.63.4.rbi b/sorbet/rbi/gems/rubocop@1.68.0.rbi
similarity index 94%
rename from sorbet/rbi/gems/rubocop@1.63.4.rbi
rename to sorbet/rbi/gems/rubocop@1.68.0.rbi
index 32336740..6ed7bfae 100644
--- a/sorbet/rbi/gems/rubocop@1.63.4.rbi
+++ b/sorbet/rbi/gems/rubocop@1.68.0.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `rubocop` gem.
# Please instead update this file by running `bin/tapioca gem rubocop`.
+
class Parser::Source::Comment
include ::RuboCop::Ext::Comment
end
@@ -97,44 +98,44 @@ class RuboCop::CLI
private
- # source://rubocop//lib/rubocop/cli.rb#152
+ # source://rubocop//lib/rubocop/cli.rb#156
def act_on_options; end
- # source://rubocop//lib/rubocop/cli.rb#194
+ # source://rubocop//lib/rubocop/cli.rb#198
def apply_default_formatter; end
- # source://rubocop//lib/rubocop/cli.rb#121
+ # source://rubocop//lib/rubocop/cli.rb#125
def execute_runners; end
- # source://rubocop//lib/rubocop/cli.rb#178
+ # source://rubocop//lib/rubocop/cli.rb#182
def handle_editor_mode; end
# @raise [Finished]
#
- # source://rubocop//lib/rubocop/cli.rb#183
+ # source://rubocop//lib/rubocop/cli.rb#187
def handle_exiting_options; end
- # source://rubocop//lib/rubocop/cli.rb#140
+ # source://rubocop//lib/rubocop/cli.rb#144
def parallel_by_default!; end
- # source://rubocop//lib/rubocop/cli.rb#76
+ # source://rubocop//lib/rubocop/cli.rb#80
def profile_if_needed; end
- # source://rubocop//lib/rubocop/cli.rb#109
+ # source://rubocop//lib/rubocop/cli.rb#113
def require_gem(name); end
- # source://rubocop//lib/rubocop/cli.rb#117
+ # source://rubocop//lib/rubocop/cli.rb#121
def run_command(name); end
- # source://rubocop//lib/rubocop/cli.rb#170
+ # source://rubocop//lib/rubocop/cli.rb#174
def set_options_to_config_loader; end
- # source://rubocop//lib/rubocop/cli.rb#129
+ # source://rubocop//lib/rubocop/cli.rb#133
def suggest_extensions; end
# @raise [OptionArgumentError]
#
- # source://rubocop//lib/rubocop/cli.rb#133
+ # source://rubocop//lib/rubocop/cli.rb#137
def validate_options_vs_config; end
end
@@ -221,12 +222,6 @@ class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base
# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#73
def only_exclude?; end
- # @api private
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#162
- def options_config_in_root?; end
-
# @api private
# @return [Boolean]
#
@@ -439,11 +434,11 @@ RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String)
#
# @api private
#
-# source://rubocop//lib/rubocop/cli/command/lsp.rb#10
+# source://rubocop//lib/rubocop/cli/command/lsp.rb#8
class RuboCop::CLI::Command::LSP < ::RuboCop::CLI::Command::Base
# @api private
#
- # source://rubocop//lib/rubocop/cli/command/lsp.rb#13
+ # source://rubocop//lib/rubocop/cli/command/lsp.rb#11
def run; end
end
@@ -746,8 +741,8 @@ class RuboCop::CachedData
# @api private
#
- # source://rubocop//lib/rubocop/cached_data.rb#56
- def location_from_source_buffer(offense, source_buffer); end
+ # source://rubocop//lib/rubocop/cached_data.rb#54
+ def location_from_source_buffer(offense); end
# @api private
#
@@ -758,13 +753,22 @@ class RuboCop::CachedData
#
# source://rubocop//lib/rubocop/cached_data.rb#23
def serialize_offense(offense); end
+
+ # Delay creation until needed. Some type of offenses will have no buffer associated with them
+ # and be global only. For these, trying to create the buffer will likely fail, for example
+ # because of unknown encoding comments.
+ #
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cached_data.rb#67
+ def source_buffer; end
end
# and provides a way to check if each cop is enabled at arbitrary line.
#
# source://rubocop//lib/rubocop/comment_config.rb#6
class RuboCop::CommentConfig
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [CommentConfig] a new instance of CommentConfig
#
@@ -776,8 +780,8 @@ class RuboCop::CommentConfig
# source://rubocop//lib/rubocop/comment_config.rb#63
def comment_only_line?(line_number); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def config(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def config(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/comment_config.rb#51
def cop_disabled_line_ranges; end
@@ -800,8 +804,8 @@ class RuboCop::CommentConfig
# source://rubocop//lib/rubocop/comment_config.rb#30
def processed_source; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def registry(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def registry(*_arg0, **_arg1, &_arg2); end
private
@@ -969,18 +973,18 @@ end
class RuboCop::Config
include ::RuboCop::PathUtil
include ::RuboCop::FileFinder
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [Config] a new instance of Config
#
# source://rubocop//lib/rubocop/config.rb#30
def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def [](*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def [](*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def []=(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def []=(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
@@ -992,7 +996,7 @@ class RuboCop::Config
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/config.rb#193
+ # source://rubocop//lib/rubocop/config.rb#197
def allowed_camel_case_file?(file); end
# Paths specified in configuration files starting with .rubocop are
@@ -1001,12 +1005,12 @@ class RuboCop::Config
# config/default.yml, for example, are not relative to RuboCop's config
# directory since that wouldn't work.
#
- # source://rubocop//lib/rubocop/config.rb#237
+ # source://rubocop//lib/rubocop/config.rb#241
def base_dir_for_path_parameters; end
# @return [String, nil]
#
- # source://rubocop//lib/rubocop/config.rb#267
+ # source://rubocop//lib/rubocop/config.rb#271
def bundler_lock_file_path; end
# source://rubocop//lib/rubocop/config.rb#51
@@ -1018,42 +1022,42 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#142
def clusivity_config_for_badge?(badge); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def delete(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def delete(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#108
def deprecation_check; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def dig(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def dig(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
# source://rubocop//lib/rubocop/config.rb#162
def disabled_new_cops?; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def each_key(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def each_key(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
# source://rubocop//lib/rubocop/config.rb#166
def enabled_new_cops?; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def fetch(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def fetch(*_arg0, **_arg1, &_arg2); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/config.rb#215
+ # source://rubocop//lib/rubocop/config.rb#219
def file_to_exclude?(file); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/config.rb#174
+ # source://rubocop//lib/rubocop/config.rb#178
def file_to_include?(file); end
# source://rubocop//lib/rubocop/config.rb#158
@@ -1084,10 +1088,10 @@ class RuboCop::Config
# Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked)
#
- # source://rubocop//lib/rubocop/config.rb#292
+ # source://rubocop//lib/rubocop/config.rb#296
def gem_versions_in_target; end
- # source://rubocop//lib/rubocop/config.rb#296
+ # source://rubocop//lib/rubocop/config.rb#300
def inspect; end
# True if this is a config file that is shipped with RuboCop
@@ -1097,11 +1101,11 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#76
def internal?; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def key?(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def key?(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def keys(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def keys(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#47
def loaded_features; end
@@ -1114,25 +1118,25 @@ class RuboCop::Config
# source://rubocop//lib/rubocop/config.rb#81
def make_excludes_absolute; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def map(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def map(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def merge(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def merge(*_arg0, **_arg1, &_arg2); end
- # source://rubocop//lib/rubocop/config.rb#247
+ # source://rubocop//lib/rubocop/config.rb#251
def parser_engine; end
- # source://rubocop//lib/rubocop/config.rb#228
+ # source://rubocop//lib/rubocop/config.rb#232
def path_relative_to_config(path); end
- # source://rubocop//lib/rubocop/config.rb#224
+ # source://rubocop//lib/rubocop/config.rb#228
def patterns_to_exclude; end
- # source://rubocop//lib/rubocop/config.rb#220
+ # source://rubocop//lib/rubocop/config.rb#224
def patterns_to_include; end
- # source://rubocop//lib/rubocop/config.rb#278
+ # source://rubocop//lib/rubocop/config.rb#282
def pending_cops; end
# Returns true if there's a chance that an Include pattern matches hidden
@@ -1140,69 +1144,74 @@ class RuboCop::Config
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/config.rb#207
+ # source://rubocop//lib/rubocop/config.rb#211
def possibly_include_hidden?; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def replace(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def replace(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#71
def signature; end
- # source://rubocop//lib/rubocop/config.rb#262
+ # source://rubocop//lib/rubocop/config.rb#266
def smart_loaded_path; end
- # source://rubocop//lib/rubocop/config.rb#251
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/config.rb#174
+ def string_literals_frozen_by_default?; end
+
+ # source://rubocop//lib/rubocop/config.rb#255
def target_rails_version; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def target_ruby_version(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def target_ruby_version(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def to_h(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_h(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def to_hash(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def to_hash(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#67
def to_s; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def transform_values(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def transform_values(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def validate(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def validate(*_arg0, **_arg1, &_arg2); end
# source://rubocop//lib/rubocop/config.rb#58
def validate_after_resolution; end
private
- # source://rubocop//lib/rubocop/config.rb#347
+ # source://rubocop//lib/rubocop/config.rb#350
def department_of(qualified_cop_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/config.rb#335
+ # source://rubocop//lib/rubocop/config.rb#338
def enable_cop?(qualified_cop_name, cop_options); end
# @param gem_version [Gem::Version] an object like `Gem::Version.new("7.1.2.3")`
# @return [Float] The major and minor version, like `7.1`
#
- # source://rubocop//lib/rubocop/config.rb#321
+ # source://rubocop//lib/rubocop/config.rb#325
def gem_version_to_major_minor_float(gem_version); end
- # source://rubocop//lib/rubocop/config.rb#328
+ # source://rubocop//lib/rubocop/config.rb#331
def read_gem_versions_from_target_lockfile; end
# @return [Float, nil] The Rails version as a `major.minor` Float.
#
- # source://rubocop//lib/rubocop/config.rb#308
+ # source://rubocop//lib/rubocop/config.rb#312
def read_rails_version_from_bundler_lock_file; end
# @return [Float, nil] The Rails version as a `major.minor` Float.
#
- # source://rubocop//lib/rubocop/config.rb#303
+ # source://rubocop//lib/rubocop/config.rb#307
def target_rails_version_from_bundler_lock_file; end
class << self
@@ -1519,10 +1528,10 @@ class RuboCop::ConfigLoader
def resolver; end
# source://rubocop//lib/rubocop/config_loader.rb#238
- def yaml_safe_load(yaml_code, filename); end
+ def yaml_tree_to_hash(yaml_tree); end
# source://rubocop//lib/rubocop/config_loader.rb#248
- def yaml_safe_load!(yaml_code, filename); end
+ def yaml_tree_to_hash!(yaml_tree); end
end
end
@@ -1629,12 +1638,12 @@ class RuboCop::ConfigLoaderResolver
# @api private
#
- # source://rubocop//lib/rubocop/config_loader_resolver.rb#268
+ # source://rubocop//lib/rubocop/config_loader_resolver.rb#267
def gem_config_path(gem_name, relative_config_path); end
# @api private
#
- # source://rubocop//lib/rubocop/config_loader_resolver.rb#246
+ # source://rubocop//lib/rubocop/config_loader_resolver.rb#245
def handle_disabled_by_default(config, new_default_configuration); end
# @api private
@@ -1674,7 +1683,7 @@ class RuboCop::ConfigLoaderResolver
# @api private
#
- # source://rubocop//lib/rubocop/config_loader_resolver.rb#264
+ # source://rubocop//lib/rubocop/config_loader_resolver.rb#263
def transform(config, &block); end
# @api private
@@ -2256,23 +2265,23 @@ end
#
# source://rubocop//lib/rubocop/config_validator.rb#6
class RuboCop::ConfigValidator
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [ConfigValidator] a new instance of ConfigValidator
#
- # source://rubocop//lib/rubocop/config_validator.rb#26
+ # source://rubocop//lib/rubocop/config_validator.rb#27
def initialize(config); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def for_all_cops(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def for_all_cops(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def smart_loaded_path(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def smart_loaded_path(*_arg0, **_arg1, &_arg2); end
- # source://rubocop//lib/rubocop/config_validator.rb#62
+ # source://rubocop//lib/rubocop/config_validator.rb#63
def target_ruby_version; end
- # source://rubocop//lib/rubocop/config_validator.rb#32
+ # source://rubocop//lib/rubocop/config_validator.rb#33
def validate; end
# Validations that should only be run after all config resolving has
@@ -2281,76 +2290,76 @@ class RuboCop::ConfigValidator
# chain has been loaded so that only the final value is validated, and
# any obsolete but overridden values are ignored.
#
- # source://rubocop//lib/rubocop/config_validator.rb#58
+ # source://rubocop//lib/rubocop/config_validator.rb#59
def validate_after_resolution; end
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#66
+ # source://rubocop//lib/rubocop/config_validator.rb#67
def validate_section_presence(name); end
private
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#103
+ # source://rubocop//lib/rubocop/config_validator.rb#104
def alert_about_unrecognized_cops(invalid_cop_names); end
- # source://rubocop//lib/rubocop/config_validator.rb#253
+ # source://rubocop//lib/rubocop/config_validator.rb#254
def check_cop_config_value(hash, parent = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/config_validator.rb#76
+ # source://rubocop//lib/rubocop/config_validator.rb#77
def check_obsoletions; end
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#83
+ # source://rubocop//lib/rubocop/config_validator.rb#84
def check_target_ruby; end
- # source://rubocop//lib/rubocop/config_validator.rb#194
+ # source://rubocop//lib/rubocop/config_validator.rb#195
def each_invalid_parameter(cop_name); end
- # source://rubocop//lib/rubocop/config_validator.rb#119
+ # source://rubocop//lib/rubocop/config_validator.rb#120
def list_unknown_cops(invalid_cop_names); end
# FIXME: Handling colors in exception messages like this is ugly.
#
- # source://rubocop//lib/rubocop/config_validator.rb#273
+ # source://rubocop//lib/rubocop/config_validator.rb#274
def param_error_message(parent, key, value, supposed_values); end
- # source://rubocop//lib/rubocop/config_validator.rb#241
+ # source://rubocop//lib/rubocop/config_validator.rb#242
def reject_conflicting_safe_settings; end
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#232
+ # source://rubocop//lib/rubocop/config_validator.rb#233
def reject_mutually_exclusive_defaults; end
- # source://rubocop//lib/rubocop/config_validator.rb#141
+ # source://rubocop//lib/rubocop/config_validator.rb#142
def suggestion(name); end
# Returns the value of attribute target_ruby.
#
- # source://rubocop//lib/rubocop/config_validator.rb#74
+ # source://rubocop//lib/rubocop/config_validator.rb#75
def target_ruby; end
- # source://rubocop//lib/rubocop/config_validator.rb#206
+ # source://rubocop//lib/rubocop/config_validator.rb#207
def validate_enforced_styles(valid_cop_names); end
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#168
+ # source://rubocop//lib/rubocop/config_validator.rb#169
def validate_new_cops_parameter; end
- # source://rubocop//lib/rubocop/config_validator.rb#179
+ # source://rubocop//lib/rubocop/config_validator.rb#180
def validate_parameter_names(valid_cop_names); end
- # source://rubocop//lib/rubocop/config_validator.rb#226
+ # source://rubocop//lib/rubocop/config_validator.rb#227
def validate_support_and_has_list(name, formats, valid); end
# @raise [ValidationError]
#
- # source://rubocop//lib/rubocop/config_validator.rb#157
+ # source://rubocop//lib/rubocop/config_validator.rb#158
def validate_syntax_cop; end
end
@@ -2359,25 +2368,25 @@ end
# source://rubocop//lib/rubocop/config_validator.rb#10
RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/config_validator.rb#21
+# source://rubocop//lib/rubocop/config_validator.rb#22
RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/config_validator.rb#20
+# source://rubocop//lib/rubocop/config_validator.rb#21
RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/config_validator.rb#19
+# source://rubocop//lib/rubocop/config_validator.rb#20
RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set)
# @api private
#
-# source://rubocop//lib/rubocop/config_validator.rb#12
+# source://rubocop//lib/rubocop/config_validator.rb#13
RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/config_validator.rb#16
+# source://rubocop//lib/rubocop/config_validator.rb#17
RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array)
# source://rubocop//lib/rubocop/cop/util.rb#4
@@ -2411,7 +2420,7 @@ module RuboCop::Cop::Alignment
# source://rubocop//lib/rubocop/cop/mixin/alignment.rb#45
def each_bad_alignment(items, base_column); end
- # @deprecated Use processed_source.comment_at_line(line)
+ # @deprecated Use processed_source.line_with_comment?(line)
#
# source://rubocop//lib/rubocop/cop/mixin/alignment.rb#69
def end_of_line_comment(line); end
@@ -2424,7 +2433,7 @@ module RuboCop::Cop::Alignment
# @api private
#
- # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#74
+ # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#78
def register_offense(offense_node, message_node); end
# @api public
@@ -2460,7 +2469,7 @@ class RuboCop::Cop::AlignmentCorrector
private
- # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#124
+ # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#113
def alignment_column(align_to); end
# source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#40
@@ -2485,7 +2494,7 @@ class RuboCop::Cop::AlignmentCorrector
# source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#75
def delimited_string_literal?(node); end
- # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#110
+ # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#99
def each_line(expr); end
# source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#60
@@ -2494,10 +2503,7 @@ class RuboCop::Cop::AlignmentCorrector
# source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#54
def inside_string_ranges(node); end
- # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#99
- def remove(range, corrector); end
-
- # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#118
+ # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#107
def whitespace_range(node); end
end
end
@@ -2537,21 +2543,20 @@ module RuboCop::Cop::AllowedMethods
# @api public
#
- # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#21
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#27
def allowed_methods; end
- # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#29
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#35
def cop_config_allowed_methods; end
- # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#33
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#39
def cop_config_deprecated_values; end
- # @api public
# @deprecated Use allowed_method? instead
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#13
- def ignored_method?(name); end
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#18
+ def ignored_method?; end
end
# This module encapsulates the ability to ignore certain lines when
@@ -2566,31 +2571,31 @@ module RuboCop::Cop::AllowedPattern
# source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#10
def allowed_line?(line); end
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#30
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#42
def allowed_patterns; end
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#46
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#58
def cop_config_deprecated_methods_values; end
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#40
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#52
def cop_config_patterns_values; end
# @deprecated Use allowed_line? instead
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#10
- def ignored_line?(line); end
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#21
+ def ignored_line?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#23
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#29
def matches_allowed_pattern?(line); end
- # @deprecated Use matches_allowed_pattern?? instead
+ # @deprecated Use matches_allowed_pattern? instead
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#23
- def matches_ignored_pattern?(line); end
+ # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#34
+ def matches_ignored_pattern?; end
end
# This module encapsulates the ability to allow certain receivers in a cop.
@@ -2627,85 +2632,83 @@ RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String)
#
# source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#6
class RuboCop::Cop::AnnotationComment
- extend ::Forwardable
-
# @param comment [Parser::Source::Comment]
# @param keywords [Array]
# @return [AnnotationComment] a new instance of AnnotationComment
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#13
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#11
def initialize(comment, keywords); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#19
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#17
def annotation?; end
# Returns the range bounds for just the annotation
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#31
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#29
def bounds; end
# Returns the value of attribute colon.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def colon; end
# Returns the value of attribute comment.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def comment; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#23
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#21
def correct?(colon:); end
# Returns the value of attribute keyword.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def keyword; end
# Returns the value of attribute margin.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def margin; end
# Returns the value of attribute note.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def note; end
# Returns the value of attribute space.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#9
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7
def space; end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#67
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#65
def just_keyword_of_sentence?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#63
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#61
def keyword_appearance?; end
# Returns the value of attribute keywords.
#
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#39
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#37
def keywords; end
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#53
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#51
def regex; end
- # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#41
+ # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#39
def split_comment(comment); end
end
-# source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#50
+# source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#48
RuboCop::Cop::AnnotationComment::KEYWORDS_REGEX_CACHE = T.let(T.unsafe(nil), Hash)
# Handles the `MinSize` configuration option for array-based cops
@@ -2801,31 +2804,44 @@ module RuboCop::Cop::AutocorrectLogic
# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#51
def disable_offense(offense_range); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#118
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#138
def disable_offense_at_end_of_line(range, eol_comment); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#122
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#142
def disable_offense_before_and_after(range_by_lines); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#61
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63
def disable_offense_with_eol_or_surround_comment(range); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#114
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#134
def max_line_length; end
# Expand the given range to include all of any lines it covers. Does not
# include newline at end of the last line.
#
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#104
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#124
def range_by_lines(range); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#95
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#115
def range_of_first_line(range); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#72
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#107
+ def range_overlaps_offense?(offense_range, range); end
+
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#97
+ def string_continuation(offense_range); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#111
+ def string_continuation?(node); end
+
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#74
def surrounding_heredoc(offense_range); end
- # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#83
+ # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#85
def surrounding_percent_array(offense_range); end
end
@@ -2938,18 +2954,18 @@ class RuboCop::Cop::Base
# @return [Base] a new instance of Base
#
- # source://rubocop//lib/rubocop/cop/base.rb#153
+ # source://rubocop//lib/rubocop/cop/base.rb#156
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#269
+ # source://rubocop//lib/rubocop/cop/base.rb#272
def active_support_extensions_enabled?; end
# Adds an offense that has no particular location.
# No correction can be applied to global offenses
#
- # source://rubocop//lib/rubocop/cop/base.rb#186
+ # source://rubocop//lib/rubocop/cop/base.rb#189
def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end
# Adds an offense on the specified range (or node with an expression)
@@ -2957,25 +2973,25 @@ class RuboCop::Cop::Base
# to provide the cop the opportunity to autocorrect the offense.
# If message is not specified, the method `message` will be called.
#
- # source://rubocop//lib/rubocop/cop/base.rb#198
+ # source://rubocop//lib/rubocop/cop/base.rb#201
def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#340
+ # source://rubocop//lib/rubocop/cop/base.rb#351
def always_autocorrect?; end
# Called before any investigation
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/base.rb#326
+ # source://rubocop//lib/rubocop/cop/base.rb#337
def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/base.rb#311
+ # source://rubocop//lib/rubocop/cop/base.rb#318
def callbacks_needed; end
# Returns the value of attribute config.
@@ -2983,29 +2999,29 @@ class RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/base.rb#43
def config; end
- # source://rubocop//lib/rubocop/cop/base.rb#249
+ # source://rubocop//lib/rubocop/cop/base.rb#252
def config_to_allow_offenses; end
- # source://rubocop//lib/rubocop/cop/base.rb#253
+ # source://rubocop//lib/rubocop/cop/base.rb#256
def config_to_allow_offenses=(hash); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#346
+ # source://rubocop//lib/rubocop/cop/base.rb#357
def contextual_autocorrect?; end
# Configuration Helpers
#
- # source://rubocop//lib/rubocop/cop/base.rb#243
+ # source://rubocop//lib/rubocop/cop/base.rb#246
def cop_config; end
- # source://rubocop//lib/rubocop/cop/base.rb#235
+ # source://rubocop//lib/rubocop/cop/base.rb#238
def cop_name; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#282
+ # source://rubocop//lib/rubocop/cop/base.rb#289
def excluded_file?(file); end
# This method should be overridden when a cop's behavior depends
@@ -3024,51 +3040,51 @@ class RuboCop::Cop::Base
# ResultCache system when those external dependencies change,
# ie when the ResultCache should be invalidated.
#
- # source://rubocop//lib/rubocop/cop/base.rb#231
+ # source://rubocop//lib/rubocop/cop/base.rb#234
def external_dependency_checksum; end
- # source://rubocop//lib/rubocop/cop/base.rb#350
+ # source://rubocop//lib/rubocop/cop/base.rb#361
def inspect; end
# Gets called if no message is specified when calling `add_offense` or
# `add_global_offense`
# Cops are discouraged to override this; instead pass your message directly
#
- # source://rubocop//lib/rubocop/cop/base.rb#180
+ # source://rubocop//lib/rubocop/cop/base.rb#183
def message(_range = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/base.rb#235
+ # source://rubocop//lib/rubocop/cop/base.rb#238
def name; end
# @deprecated Make potential errors with previous API more obvious
#
- # source://rubocop//lib/rubocop/cop/base.rb#302
+ # source://rubocop//lib/rubocop/cop/base.rb#309
def offenses; end
# Called after all on_... have been called
# When refining this method, always call `super`
#
- # source://rubocop//lib/rubocop/cop/base.rb#167
+ # source://rubocop//lib/rubocop/cop/base.rb#170
def on_investigation_end; end
# Called before all on_... have been called
# When refining this method, always call `super`
#
- # source://rubocop//lib/rubocop/cop/base.rb#161
+ # source://rubocop//lib/rubocop/cop/base.rb#164
def on_new_investigation; end
# Called instead of all on_... callbacks for unrecognized files / syntax errors
# When refining this method, always call `super`
#
- # source://rubocop//lib/rubocop/cop/base.rb#173
+ # source://rubocop//lib/rubocop/cop/base.rb#176
def on_other_file; end
# There should be very limited reasons for a Cop to do it's own parsing
#
- # source://rubocop//lib/rubocop/cop/base.rb#287
+ # source://rubocop//lib/rubocop/cop/base.rb#294
def parse(source, path = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/base.rb#261
+ # source://rubocop//lib/rubocop/cop/base.rb#264
def parser_engine; end
# Returns the value of attribute processed_source.
@@ -3080,104 +3096,111 @@ class RuboCop::Cop::Base
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/base.rb#293
+ # source://rubocop//lib/rubocop/cop/base.rb#300
def ready; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#273
+ # source://rubocop//lib/rubocop/cop/base.rb#280
def relevant_file?(file); end
- # source://rubocop//lib/rubocop/cop/base.rb#265
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/base.rb#276
+ def string_literals_frozen_by_default?; end
+
+ # source://rubocop//lib/rubocop/cop/base.rb#268
def target_rails_version; end
- # source://rubocop//lib/rubocop/cop/base.rb#257
+ # source://rubocop//lib/rubocop/cop/base.rb#260
def target_ruby_version; end
private
- # source://rubocop//lib/rubocop/cop/base.rb#478
+ # source://rubocop//lib/rubocop/cop/base.rb#479
def annotate(message); end
- # source://rubocop//lib/rubocop/cop/base.rb#362
+ # source://rubocop//lib/rubocop/cop/base.rb#373
def apply_correction(corrector); end
# @return [Symbol] offense status
#
- # source://rubocop//lib/rubocop/cop/base.rb#442
+ # source://rubocop//lib/rubocop/cop/base.rb#443
def attempt_correction(range, corrector); end
# Reserved for Cop::Cop
#
- # source://rubocop//lib/rubocop/cop/base.rb#358
+ # source://rubocop//lib/rubocop/cop/base.rb#369
def callback_argument(range); end
# Called to complete an investigation
#
- # source://rubocop//lib/rubocop/cop/base.rb#391
+ # source://rubocop//lib/rubocop/cop/base.rb#402
def complete_investigation; end
# @return [Symbol, Corrector] offense status
#
- # source://rubocop//lib/rubocop/cop/base.rb#416
+ # source://rubocop//lib/rubocop/cop/base.rb#417
def correct(range); end
- # source://rubocop//lib/rubocop/cop/base.rb#376
+ # source://rubocop//lib/rubocop/cop/base.rb#387
def current_corrector; end
# Reserved for Commissioner:
#
- # source://rubocop//lib/rubocop/cop/base.rb#368
+ # source://rubocop//lib/rubocop/cop/base.rb#379
def current_offense_locations; end
- # source://rubocop//lib/rubocop/cop/base.rb#380
+ # source://rubocop//lib/rubocop/cop/base.rb#391
def current_offenses; end
- # source://rubocop//lib/rubocop/cop/base.rb#372
+ # source://rubocop//lib/rubocop/cop/base.rb#383
def currently_disabled_lines; end
- # source://rubocop//lib/rubocop/cop/base.rb#506
+ # source://rubocop//lib/rubocop/cop/base.rb#507
def custom_severity; end
- # source://rubocop//lib/rubocop/cop/base.rb#502
+ # source://rubocop//lib/rubocop/cop/base.rb#503
def default_severity; end
- # source://rubocop//lib/rubocop/cop/base.rb#456
+ # source://rubocop//lib/rubocop/cop/base.rb#457
def disable_uncorrectable(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#492
+ # source://rubocop//lib/rubocop/cop/base.rb#493
def enabled_line?(line_number); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#484
+ # source://rubocop//lib/rubocop/cop/base.rb#485
def file_name_matches_any?(file, parameter, default_result); end
- # source://rubocop//lib/rubocop/cop/base.rb#474
+ # source://rubocop//lib/rubocop/cop/base.rb#475
def find_message(range, message); end
- # source://rubocop//lib/rubocop/cop/base.rb#498
+ # source://rubocop//lib/rubocop/cop/base.rb#499
def find_severity(_range, severity); end
- # source://rubocop//lib/rubocop/cop/base.rb#519
+ # source://rubocop//lib/rubocop/cop/base.rb#520
def range_for_original(range); end
- # source://rubocop//lib/rubocop/cop/base.rb#463
+ # source://rubocop//lib/rubocop/cop/base.rb#464
def range_from_node_or_range(node_or_range); end
- # source://rubocop//lib/rubocop/cop/base.rb#411
+ # Actually private methods
+ #
+ # source://rubocop//lib/rubocop/cop/base.rb#412
def reset_investigation; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#527
+ # source://rubocop//lib/rubocop/cop/base.rb#528
def target_satisfies_all_gem_version_requirements?; end
# @return [Symbol] offense status
#
- # source://rubocop//lib/rubocop/cop/base.rb#431
+ # source://rubocop//lib/rubocop/cop/base.rb#432
def use_corrector(range, corrector); end
class << self
@@ -3192,51 +3215,54 @@ class RuboCop::Cop::Base
# Naming
#
- # source://rubocop//lib/rubocop/cop/base.rb#90
+ # source://rubocop//lib/rubocop/cop/base.rb#93
def badge; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/base.rb#316
+ # source://rubocop//lib/rubocop/cop/base.rb#323
def callbacks_needed; end
- # source://rubocop//lib/rubocop/cop/base.rb#94
+ # source://rubocop//lib/rubocop/cop/base.rb#97
def cop_name; end
- # source://rubocop//lib/rubocop/cop/base.rb#98
+ # source://rubocop//lib/rubocop/cop/base.rb#101
def department; end
- # Cops (other than builtin) are encouraged to implement this
+ # Returns an url to view this cops documentation online.
+ # Requires 'DocumentationBaseURL' to be set for your department.
+ # Will follow the convention of RuboCops own documentation structure,
+ # overwrite this method to accommodate your custom layout.
#
# @api public
# @return [String, nil]
#
- # source://rubocop//lib/rubocop/cop/base.rb#67
- def documentation_url; end
+ # source://rubocop//lib/rubocop/cop/base.rb#70
+ def documentation_url(config = T.unsafe(nil)); end
# Call for abstract Cop classes
#
- # source://rubocop//lib/rubocop/cop/base.rb#78
+ # source://rubocop//lib/rubocop/cop/base.rb#81
def exclude_from_registry; end
# Returns the value of attribute gem_requirements.
#
- # source://rubocop//lib/rubocop/cop/base.rb#135
+ # source://rubocop//lib/rubocop/cop/base.rb#138
def gem_requirements; end
# @private
#
- # source://rubocop//lib/rubocop/cop/base.rb#71
+ # source://rubocop//lib/rubocop/cop/base.rb#74
def inherited(subclass); end
# Override and return the Force class(es) you need to join
#
- # source://rubocop//lib/rubocop/cop/base.rb#115
+ # source://rubocop//lib/rubocop/cop/base.rb#118
def joining_forces; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#102
+ # source://rubocop//lib/rubocop/cop/base.rb#105
def lint?; end
# Returns true if the cop name or the cop namespace matches any of the
@@ -3244,7 +3270,7 @@ class RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#108
+ # source://rubocop//lib/rubocop/cop/base.rb#111
def match?(given_names); end
# Register a version requirement for the given gem name.
@@ -3259,7 +3285,7 @@ class RuboCop::Cop::Base
#
# https://guides.rubygems.org/patterns/#declaring-dependencies
#
- # source://rubocop//lib/rubocop/cop/base.rb#148
+ # source://rubocop//lib/rubocop/cop/base.rb#151
def requires_gem(gem_name, *version_requirements); end
# Returns if class supports autocorrect.
@@ -3267,7 +3293,7 @@ class RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#84
+ # source://rubocop//lib/rubocop/cop/base.rb#87
def support_autocorrect?; end
# Override if your cop should be called repeatedly for multiple investigations
@@ -3280,22 +3306,17 @@ class RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/base.rb#126
+ # source://rubocop//lib/rubocop/cop/base.rb#129
def support_multiple_source?; end
private
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/base.rb#402
- def builtin?; end
-
- # source://rubocop//lib/rubocop/cop/base.rb#384
+ # source://rubocop//lib/rubocop/cop/base.rb#395
def restrict_on_send; end
end
end
-# source://rubocop//lib/rubocop/cop/base.rb#388
+# source://rubocop//lib/rubocop/cop/base.rb#399
RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array)
# Reports of an investigation.
@@ -3813,56 +3834,56 @@ class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::GemDeclaration
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#67
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#68
def includes_commit_reference?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#62
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#63
def includes_version_specification?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#71
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#72
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#85
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#86
def allowed_gem?(node); end
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#89
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#90
def allowed_gems; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#113
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#112
def forbidden_offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#119
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#118
def forbidden_style?; end
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#93
- def message(range); end
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#94
+ def message(_range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#103
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#102
def offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#107
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#106
def required_offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#123
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#122
def required_style?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#127
+ # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#126
def version_specification?(expression); end
end
@@ -3873,6 +3894,9 @@ RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#59
+RuboCop::Cop::Bundler::GemVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#60
RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp)
# Passing symbol arguments to `source` (e.g. `source :rubygems`) is
@@ -4079,64 +4103,69 @@ module RuboCop::Cop::CheckLineBreakable
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#200
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#202
def all_on_same_line?(nodes); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#220
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#222
def already_on_multiple_lines?(node); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#133
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#135
def breakable_collection?(node, elements); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#228
+ def chained_to_heredoc?(node); end
+
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#187
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#189
def children_could_be_broken_up?(children); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#150
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#152
def contained_by_breakable_collection_on_same_line?(node); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#170
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#172
def contained_by_multiline_collection_that_could_be_broken_up?(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#60
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#62
def extract_breakable_node_from_elements(node, elements, max); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#72
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#74
def extract_first_element_over_column_limit(node, elements, max); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#92
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#94
def first_argument_is_heredoc?(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#207
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#209
def process_args(args); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#117
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#119
def safe_to_ignore?(node); end
# If a send node contains a heredoc argument, splitting cannot happen
@@ -4144,13 +4173,13 @@ module RuboCop::Cop::CheckLineBreakable
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#101
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#103
def shift_elements_for_heredoc_arg(node, elements, index); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#112
+ # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#114
def within_column_limit?(element, max, line); end
end
@@ -4859,7 +4888,7 @@ end
# Handles `Max` configuration parameters, especially setting them to an
# appropriate value with --auto-gen-config.
#
-# @deprecated Use `exclude_limit ParameterName` instead.
+# @deprecated Use `exclude_limit ` instead.
#
# source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#8
module RuboCop::Cop::ConfigurableMax
@@ -4868,7 +4897,7 @@ module RuboCop::Cop::ConfigurableMax
# source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#11
def max=(value); end
- # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#19
+ # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#23
def max_parameter_name; end
end
@@ -4901,22 +4930,22 @@ RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash)
#
# source://rubocop//lib/rubocop/cop/cop.rb#11
class RuboCop::Cop::Cop < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/cop.rb#53
+ # source://rubocop//lib/rubocop/cop/cop.rb#73
def add_offense(node_or_range, location: T.unsafe(nil), message: T.unsafe(nil), severity: T.unsafe(nil), &block); end
# Called before any investigation
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/cop.rb#103
+ # source://rubocop//lib/rubocop/cop/cop.rb#129
def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end
# @deprecated
#
- # source://rubocop//lib/rubocop/cop/cop.rb#82
+ # source://rubocop//lib/rubocop/cop/cop.rb#105
def corrections; end
- # source://rubocop//lib/rubocop/cop/cop.rb#70
+ # source://rubocop//lib/rubocop/cop/cop.rb#90
def find_location(node, loc); end
# Returns the value of attribute offenses.
@@ -4926,71 +4955,76 @@ class RuboCop::Cop::Cop < ::RuboCop::Cop::Base
# Called after all on_... have been called
#
- # source://rubocop//lib/rubocop/cop/cop.rb#96
+ # source://rubocop//lib/rubocop/cop/cop.rb#122
def on_investigation_end; end
# Called before all on_... have been called
#
- # source://rubocop//lib/rubocop/cop/cop.rb#90
+ # source://rubocop//lib/rubocop/cop/cop.rb#116
def on_new_investigation; end
# @deprecated Use class method
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/cop.rb#76
+ # source://rubocop//lib/rubocop/cop/cop.rb#96
def support_autocorrect?; end
private
- # source://rubocop//lib/rubocop/cop/cop.rb#121
+ # source://rubocop//lib/rubocop/cop/cop.rb#147
def apply_correction(corrector); end
# Override Base
#
- # source://rubocop//lib/rubocop/cop/cop.rb#117
+ # source://rubocop//lib/rubocop/cop/cop.rb#143
def callback_argument(_range); end
- # source://rubocop//lib/rubocop/cop/cop.rb#138
+ # source://rubocop//lib/rubocop/cop/cop.rb#164
def correction_lambda; end
- # source://rubocop//lib/rubocop/cop/cop.rb#144
+ # source://rubocop//lib/rubocop/cop/cop.rb#170
def dedupe_on_node(node); end
# Just for legacy
#
# @yield [corrector]
#
- # source://rubocop//lib/rubocop/cop/cop.rb#126
+ # source://rubocop//lib/rubocop/cop/cop.rb#152
def emulate_v0_callsequence(corrector); end
- # source://rubocop//lib/rubocop/cop/cop.rb#157
+ # source://rubocop//lib/rubocop/cop/cop.rb#183
def range_for_original(range); end
- # source://rubocop//lib/rubocop/cop/cop.rb#151
+ # source://rubocop//lib/rubocop/cop/cop.rb#177
def suppress_clobbering; end
class << self
# @deprecated Use Registry.all
#
- # source://rubocop//lib/rubocop/cop/cop.rb#44
+ # source://rubocop//lib/rubocop/cop/cop.rb#56
def all; end
- # source://rubocop//lib/rubocop/cop/cop.rb#29
+ # @private
+ #
+ # source://rubocop//lib/rubocop/cop/cop.rb#25
+ def inherited(_subclass); end
+
+ # source://rubocop//lib/rubocop/cop/cop.rb#37
def joining_forces; end
# @deprecated Use Registry.qualified_cop_name
#
- # source://rubocop//lib/rubocop/cop/cop.rb#49
+ # source://rubocop//lib/rubocop/cop/cop.rb#65
def qualified_cop_name(name, origin); end
# @deprecated Use Registry.global
#
- # source://rubocop//lib/rubocop/cop/cop.rb#39
+ # source://rubocop//lib/rubocop/cop/cop.rb#47
def registry; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/cop.rb#25
+ # source://rubocop//lib/rubocop/cop/cop.rb#33
def support_autocorrect?; end
end
end
@@ -5092,7 +5126,7 @@ class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter
# Legacy
#
- # source://parser/3.3.1.0/lib/parser/source/tree_rewriter.rb#252
+ # source://parser/3.3.6.0/lib/parser/source/tree_rewriter.rb#252
def rewrite; end
# Swaps sources at the given ranges.
@@ -5158,19 +5192,34 @@ module RuboCop::Cop::Documentation
# @api private
#
- # source://rubocop//lib/rubocop/cop/documentation.rb#24
+ # source://rubocop//lib/rubocop/cop/documentation.rb#25
def base_url_for(cop_class, config); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/documentation.rb#34
+ # source://rubocop//lib/rubocop/cop/documentation.rb#57
+ def builtin?(cop_class); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#47
def default_base_url; end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#52
+ def default_extension; end
+
# @api private
#
# source://rubocop//lib/rubocop/cop/documentation.rb#10
def department_to_basename(department); end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#36
+ def extension_for(cop_class, config); end
+
# @api private
#
# source://rubocop//lib/rubocop/cop/documentation.rb#15
@@ -5179,19 +5228,35 @@ module RuboCop::Cop::Documentation
class << self
# @api private
#
- # source://rubocop//lib/rubocop/cop/documentation.rb#24
+ # source://rubocop//lib/rubocop/cop/documentation.rb#25
def base_url_for(cop_class, config); end
# @api private
+ # @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/documentation.rb#34
+ # source://rubocop//lib/rubocop/cop/documentation.rb#57
+ def builtin?(cop_class); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#47
def default_base_url; end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#52
+ def default_extension; end
+
# @api private
#
# source://rubocop//lib/rubocop/cop/documentation.rb#10
def department_to_basename(department); end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/documentation.rb#36
+ def extension_for(cop_class, config); end
+
# @api private
#
# source://rubocop//lib/rubocop/cop/documentation.rb#15
@@ -5406,6 +5471,19 @@ end
# source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#10
RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String)
+# Common functionality for rewriting endless methods to normal method definitions
+#
+# source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#6
+module RuboCop::Cop::EndlessMethodRewriter
+ # source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#7
+ def correct_to_multiline(corrector, node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#19
+ def arguments(node, missing = T.unsafe(nil)); end
+end
+
# Common functionality for enforcing a specific superclass.
#
# IMPORTANT: RuboCop core depended on this module when it supported Rails department.
@@ -5524,44 +5602,60 @@ RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Force
# @return [Force] a new instance of Force
#
- # source://rubocop//lib/rubocop/cop/force.rb#22
+ # source://rubocop//lib/rubocop/cop/force.rb#32
def initialize(cops); end
# Returns the value of attribute cops.
#
- # source://rubocop//lib/rubocop/cop/force.rb#7
+ # source://rubocop//lib/rubocop/cop/force.rb#17
def cops; end
- # source://rubocop//lib/rubocop/cop/force.rb#38
+ # source://rubocop//lib/rubocop/cop/force.rb#50
def investigate(_processed_source); end
- # source://rubocop//lib/rubocop/cop/force.rb#26
+ # source://rubocop//lib/rubocop/cop/force.rb#36
def name; end
- # source://rubocop//lib/rubocop/cop/force.rb#30
+ # source://rubocop//lib/rubocop/cop/force.rb#40
def run_hook(method_name, *args); end
class << self
- # source://rubocop//lib/rubocop/cop/force.rb#9
+ # source://rubocop//lib/rubocop/cop/force.rb#19
def all; end
- # source://rubocop//lib/rubocop/cop/force.rb#18
+ # source://rubocop//lib/rubocop/cop/force.rb#28
def force_name; end
# @private
#
- # source://rubocop//lib/rubocop/cop/force.rb#13
+ # source://rubocop//lib/rubocop/cop/force.rb#23
def inherited(subclass); end
end
end
+# @api private
+#
+# source://rubocop//lib/rubocop/cop/force.rb#8
+class RuboCop::Cop::Force::HookError < ::StandardError
+ # @api private
+ # @return [HookError] a new instance of HookError
+ #
+ # source://rubocop//lib/rubocop/cop/force.rb#11
+ def initialize(joining_cop); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/force.rb#9
+ def joining_cop; end
+end
+
# Common functionality for dealing with frozen string literals.
#
# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#6
module RuboCop::Cop::FrozenStringLiteral
private
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#35
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#37
def frozen_heredoc?(node); end
# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#21
@@ -5570,21 +5664,24 @@ module RuboCop::Cop::FrozenStringLiteral
# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#15
def frozen_string_literal_comment_exists?; end
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#66
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#78
def frozen_string_literal_specified?; end
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#60
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#72
def frozen_string_literals_disabled?; end
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#41
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#44
def frozen_string_literals_enabled?; end
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#76
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#88
def leading_comment_lines; end
- # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#72
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#84
def leading_magic_comments; end
+ # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#37
+ def uninterpolated_heredoc?(node); end
+
# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#31
def uninterpolated_string?(node); end
@@ -5615,9 +5712,38 @@ module RuboCop::Cop::GemDeclaration
def gem_declaration?(param0 = T.unsafe(nil)); end
end
-# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#5
+# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#5
module RuboCop::Cop::Gemspec; end
+# Prefer `add_dependency` over `add_runtime_dependency` as the latter is
+# considered soft-deprecated.
+#
+# @example
+#
+# # bad
+# Gem::Specification.new do |spec|
+# spec.add_runtime_dependency('rubocop')
+# end
+#
+# # good
+# Gem::Specification.new do |spec|
+# spec.add_dependency('rubocop')
+# end
+#
+# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#21
+class RuboCop::Cop::Gemspec::AddRuntimeDependency < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#28
+ def on_send(node); end
+end
+
+# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#24
+RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#26
+RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Enforce that gem dependency version specifications or a commit reference (branch,
# ref, or tag) are either required or forbidden.
#
@@ -5685,7 +5811,7 @@ class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#120
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#118
def add_dependency_method?(method_name); end
# @return [Boolean]
@@ -5698,40 +5824,40 @@ class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#134
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#132
def forbidden_offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#140
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#138
def forbidden_style?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#114
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#112
def match_block_variable_name?(receiver_name); end
# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#104
- def message(range); end
+ def message(_range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#124
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#122
def offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#128
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#126
def required_offense?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#144
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#142
def required_style?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#148
+ # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#146
def version_specification?(expression); end
end
@@ -5920,8 +6046,8 @@ RuboCop::Cop::Gemspec::DevelopmentDependencies::RESTRICT_ON_SEND = T.let(T.unsaf
#
# # good
# Gem::Specification.new do |spec|
-# spec.add_runtime_dependency('parallel', '~> 1.10')
-# spec.add_runtime_dependency('parser', '>= 2.3.3.1', '< 3.0')
+# spec.add_dependency('parallel', '~> 1.10')
+# spec.add_dependency('parser', '>= 2.3.3.1', '< 3.0')
# end
#
# source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#37
@@ -6224,15 +6350,15 @@ RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(ni
# # bad
# Gem::Specification.new do |spec|
# if RUBY_VERSION >= '3.0'
-# spec.add_runtime_dependency 'gem_a'
+# spec.add_dependency 'gem_a'
# else
-# spec.add_runtime_dependency 'gem_b'
+# spec.add_dependency 'gem_b'
# end
# end
#
# # good
# Gem::Specification.new do |spec|
-# spec.add_runtime_dependency 'gem_a'
+# spec.add_dependency 'gem_a'
# end
#
# source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#28
@@ -6617,40 +6743,45 @@ module RuboCop::Cop::HashShorthandSyntax
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#125
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#126
def brackets?(method_dispatch_node); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#155
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#156
def breakdown_value_types_of_hash(hash_node); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#102
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#103
def def_node_that_require_parentheses(node); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#179
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#185
def each_omittable_value_pair(hash_value_type_breakdown, &block); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#175
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#181
def each_omitted_value_pair(hash_value_type_breakdown, &block); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#80
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#81
def enforced_shorthand_syntax; end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#117
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#118
def find_ancestor_method_dispatch_node(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#167
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#168
def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#171
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#172
def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#74
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#176
+ def ignore_explicit_omissible_hash_shorthand_syntax?(hash_value_type_breakdown); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#75
def ignore_hash_shorthand_syntax?(pair_node); end
# @return [Boolean]
@@ -6660,18 +6791,18 @@ module RuboCop::Cop::HashShorthandSyntax
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#140
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#141
def last_expression?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#148
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#149
def method_dispatch_as_argument?(method_dispatch_node); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#183
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#189
def mixed_shorthand_syntax_check(hash_value_type_breakdown); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#199
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#205
def no_mixed_shorthand_syntax_check(hash_value_type_breakdown); end
# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#49
@@ -6679,22 +6810,22 @@ module RuboCop::Cop::HashShorthandSyntax
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#84
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#85
def require_hash_value?(hash_key_source, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#93
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#94
def require_hash_value_for_around_hash_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#129
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#130
def use_element_of_hash_literal_as_receiver?(ancestor, parent); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#134
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#135
def use_modifier_form_without_parenthesized_method_call?(ancestor); end
end
@@ -6707,12 +6838,12 @@ RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_MSG_PREFIX = T.let(T.unsafe(nil),
# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#11
RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_OMIT_VALUE_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#209
+# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#216
class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#218
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#225
def first_argument; end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#222
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#229
def last_argument; end
# Returns the value of attribute node
@@ -6726,7 +6857,7 @@ class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct
# @return [Object] the newly set value
def node=(_); end
- # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#210
+ # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#217
def selector; end
class << self
@@ -7031,7 +7162,7 @@ RuboCop::Cop::IfThenCorrector::DEFAULT_INDENTATION_WIDTH = T.let(T.unsafe(nil),
# @deprecated IgnoredMethods class has been replaced with AllowedMethods.
#
-# source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#40
+# source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#46
RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods
# Handles adding and checking ignored nodes.
@@ -7059,7 +7190,7 @@ end
# @deprecated IgnoredPattern class has been replaced with AllowedPattern.
#
-# source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#54
+# source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#66
RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern
# Common functionality for checking integer nodes.
@@ -7240,19 +7371,19 @@ class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#58
def check_body(body, node); end
- # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#65
+ # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#69
def check_modifier(send_node, end_range); end
- # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#88
+ # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#92
def expected_indent_offset; end
- # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#84
+ # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#88
def message(range); end
# An offset that is not expected, but correct if the configuration is
# changed.
#
- # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#94
+ # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#98
def unexpected_indent_offset; end
end
@@ -7436,7 +7567,7 @@ RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), St
# right-hand-side of a multi-line assignment.
#
# The indentation of the remaining lines can be corrected with
-# other cops such as `IndentationConsistency` and `EndAlignment`.
+# other cops such as `Layout/IndentationConsistency` and `Layout/EndAlignment`.
#
# @example
# # bad
@@ -7451,7 +7582,7 @@ RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), St
# 'bar'
# end
#
-# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#24
+# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#25
class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CheckAssignment
include ::RuboCop::Cop::Alignment
@@ -7459,17 +7590,17 @@ class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#42
+ # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#43
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#33
+ # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#34
def check_assignment(node, rhs); end
- # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#46
+ # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#47
def leftmost_multiple_assignment(node); end
end
-# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#29
+# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#30
RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String)
# Checks whether the end keyword of `begin` is aligned properly.
@@ -7544,7 +7675,7 @@ RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String)
# start of the line where the expression started.
#
# `either` (which is the default) : the `end` is allowed to be in either
-# location. The autofixer will default to `start_of_line`.
+# location. The autocorrect will default to `start_of_line`.
#
# @example EnforcedStyleAlignWith: either (default)
# # bad
@@ -7609,54 +7740,63 @@ class RuboCop::Cop::Layout::BlockAlignment < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#228
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#246
def add_space_before(corrector, loc, delta); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#205
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#223
def alt_start_msg(start_loc, source_line_column); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#155
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#145
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#105
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#95
def block_end_align_target(node); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#123
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#113
def check_block_alignment(start_node, block_node); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#178
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#196
def compute_do_source_line_column(node, end_loc); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#220
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#238
def compute_start_col(ancestor_node, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#119
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#109
def disqualified_parent?(parent, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#115
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#105
def end_align_target?(node, parent); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#168
+ # In offense message, we want to show the assignment LHS rather than
+ # the entire assignment.
+ #
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#191
+ def find_lhs_node(node); end
+
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#162
def format_message(start_loc, end_loc, do_source_line_column, error_source_line_column); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#215
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#233
def format_source_line_column(source_line_column); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#197
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#215
def loc_to_source_line_column(loc); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#136
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#126
def register_offense(block_node, start_loc, end_loc, do_source_line_column); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#232
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#250
def remove_space_before(corrector, end_pos, delta); end
- # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#95
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#172
def start_for_block_node(block_node); end
+
+ # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#179
+ def start_for_line_node(block_node); end
end
# source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#71
@@ -8457,43 +8597,40 @@ RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# if
# some_condition
# do_something
# end
-# @example
#
# # good
-#
# if some_condition
# do_something
# end
#
-# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#25
+# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#21
class RuboCop::Cop::Layout::ConditionPosition < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#31
+ # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#27
def on_if(node); end
- # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#37
+ # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#33
def on_until(node); end
- # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#37
+ # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#33
def on_while(node); end
private
- # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#44
+ # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#40
def check(node); end
- # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#58
+ # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#54
def message(condition); end
end
-# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#29
+# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#25
RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String)
# Checks whether the end keywords of method definitions are
@@ -8771,35 +8908,35 @@ class RuboCop::Cop::Layout::EmptyComment < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#131
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#133
def allow_border_comment?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#135
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#137
def allow_margin_comment?; end
# source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#97
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#127
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#129
def comment_text(comment); end
# source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#108
def concat_consecutive_comments(comments); end
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#139
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#141
def current_token(comment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#117
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#119
def empty_comment_only?(comment_text); end
# source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#85
def investigate(comments); end
- # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#143
+ # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#145
def previous_token(node); end
end
@@ -9225,84 +9362,84 @@ class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#290
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#291
def allowance_range?; end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#274
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#275
def autocorrect_insert_lines(corrector, newline_pos, count); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#267
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#268
def autocorrect_remove_lines(corrector, newline_pos, count); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#227
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#228
def blank_lines_count_between(first_def_node, second_def_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#171
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#172
def candidate?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#191
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#192
def class_candidate?(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#255
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#256
def def_end(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#163
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#164
def def_location(correction_node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#247
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#248
def def_start(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#178
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#179
def empty_line_between_macros; end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#259
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#260
def end_loc(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#205
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#206
def expected_lines; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#223
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#224
def line_count_allowed?(count); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#239
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#240
def lines_between_defs(first_def_node, second_def_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#182
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#183
def macro_candidate?(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#235
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#236
def maximum_empty_lines; end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#199
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#200
def message(node, count: T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#187
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#188
def method_candidate?(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#231
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#232
def minimum_empty_lines; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#195
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#196
def module_candidate?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#214
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#215
def multiple_blank_lines_groups?(first_def_node, second_def_node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#281
+ # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#282
def node_type(node); end
class << self
@@ -9996,22 +10133,24 @@ class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCo
# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#81
def check_body(body, line_of_def_or_kwbegin); end
- # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#108
+ # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#113
def keyword_locations(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#125
+ # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#130
def keyword_locations_in_ensure(node); end
- # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#121
+ # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#126
def keyword_locations_in_rescue(node); end
+ # @return [Boolean]
+ #
# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#96
- def last_rescue_and_end_on_same_line(body); end
+ def last_body_and_end_on_same_line?(body); end
- # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#100
+ # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#105
def message(location, keyword); end
- # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#104
+ # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#109
def style; end
end
@@ -10513,8 +10652,8 @@ RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), Strin
# second_params
# @example EnforcedStyle: special_for_inner_method_call
# # The first argument should normally be indented one step more than
-# # the preceding line, but if it's a argument for a method call that
-# # is itself a argument in a method call, then the inner argument
+# # the preceding line, but if it's an argument for a method call that
+# # is itself an argument in a method call, then the inner argument
# # should be indented relative to the inner method.
#
# # good
@@ -10670,7 +10809,6 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin
# # defined inside a method call.
#
# # bad
-# # consistent
# array = [
# :value
# ]
@@ -10690,68 +10828,66 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin
# # brackets are indented to the same position.
#
# # bad
-# # align_brackets
# and_now_for_something = [
# :completely_different
# ]
#
# # good
-# # align_brackets
# and_now_for_something = [
# :completely_different
# ]
#
-# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#85
+# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#82
class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::MultilineElementIndentation
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#94
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#91
def on_array(node); end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#98
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#97
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#98
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#97
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#189
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#188
def array_alignment_config; end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#109
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#108
def autocorrect(corrector, node); end
# Returns the description of what the correct indentation is based on.
#
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#147
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#146
def base_description(indent_base_type); end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#113
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#112
def brace_alignment_style; end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#117
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#116
def check(array_node, left_parenthesis); end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#131
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#130
def check_right_bracket(right_bracket, first_elem, left_bracket, left_parenthesis); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#183
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#182
def enforce_first_argument_with_fixed_indentation?; end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#160
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#159
def message(base_description); end
- # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#168
+ # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#167
def message_for_right_bracket(indent_base_type); end
end
-# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#91
+# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#88
RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String)
# Checks for a line break before the first element in a
@@ -11093,30 +11229,36 @@ RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), Stri
# qux: "b",
# }
# )
+# @example AllowedMethods: ['some_method']
#
-# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#66
+# # good
+# some_method(foo, bar,
+# baz)
+#
+# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#71
class RuboCop::Cop::Layout::FirstMethodArgumentLineBreak < ::RuboCop::Cop::Base
include ::RuboCop::Cop::FirstElementLineBreak
+ include ::RuboCop::Cop::AllowedMethods
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#72
+ # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#72
+ # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#72
+ # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78
def on_super(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#91
+ # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#99
def ignore_last_element?; end
end
-# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#70
+# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#76
RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String)
# Checks for a line break before the first parameter in a
@@ -11750,7 +11892,7 @@ RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(ni
# Checks the indentation of the here document bodies. The bodies
# are indented one step.
#
-# Note: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default),
+# NOTE: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default),
# this cop does not add any offenses for long here documents to
# avoid ``Layout/LineLength``'s offenses.
#
@@ -12066,13 +12208,12 @@ end
# source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#40
RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String)
-# Checks for indentation that doesn't use the specified number
-# of spaces.
+# Checks for indentation that doesn't use the specified number of spaces.
+# The indentation width can be configured using the `Width` setting. The default width is 2.
#
-# See also the IndentationConsistency cop which is the companion to this
-# one.
+# See also the `Layout/IndentationConsistency` cop which is the companion to this one.
#
-# @example
+# @example Width: 2 (default)
# # bad
# class A
# def test
@@ -12105,7 +12246,7 @@ RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String)
# end
# end
#
-# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#45
+# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#44
class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::RangeHelp
@@ -12115,126 +12256,126 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedPattern
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#57
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#56
def access_modifier?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#81
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#80
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#138
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#137
def on_case(case_node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#146
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#145
def on_case_match(case_match); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#95
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#94
def on_class(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#104
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#103
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#121
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#120
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#121
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#120
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#66
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#65
def on_ensure(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#66
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#65
def on_for(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#156
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#155
def on_if(node, base = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#73
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#72
def on_kwbegin(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#95
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#94
def on_module(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#81
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#80
def on_numblock(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#66
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#65
def on_resbody(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#61
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#60
def on_rescue(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#95
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#94
def on_sclass(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#104
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#103
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#128
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#127
def on_until(node, base = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#128
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#127
def on_while(node, base = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#227
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#226
def access_modifier_indentation_style; end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#165
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#164
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#235
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#234
def check_assignment(node, rhs); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#255
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#254
def check_if(node, body, else_clause, base_loc); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#268
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#267
def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#169
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#168
def check_members(base, members); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#193
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#192
def check_members_for_indented_internal_methods_style(members); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#199
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#198
def check_members_for_normal_style(base, members); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#341
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#340
def check_rescue?(rescue_node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#377
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#376
def configured_indentation_width; end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#207
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#206
def each_member(members); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#231
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#230
def indentation_consistency_style; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#323
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#322
def indentation_to_check?(base_loc, body_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#219
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#218
def indented_internal_methods_style?; end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#381
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#380
def leftmost_modifier_of(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#302
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#301
def message(configured_indentation_width, indentation, name); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#360
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#359
def offending_range(body_node, indentation); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#278
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#277
def offense(body_node, indentation, style); end
# Returns true if the given node is within another node that has
@@ -12242,29 +12383,29 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#313
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#312
def other_offense_in_same_range?(node); end
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#181
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#180
def select_check_member(member); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#345
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#344
def skip_check?(base_loc, body_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#223
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#222
def special_modifier?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#368
+ # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#367
def starts_with_access_modifier?(body_node); end
end
-# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#53
+# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#52
RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String)
# Checks for indentation of the first non-blank non-comment
@@ -12309,13 +12450,15 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String)
# `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives,
# or rackup options.
#
-# @example
-#
-# # bad
-# #Some comment
+# @example AllowSteepAnnotation: true
#
# # good
-# # Some comment
+#
+# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer]
+# list << n
+# end
+#
+# name = 'John' #: String
# @example AllowDoxygenCommentStyle: false (default)
#
# # bad
@@ -12344,72 +12487,123 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String)
#
# #ruby=2.7.0
# #ruby-gemset=myproject
+# @example AllowRBSInlineAnnotation: false (default)
+#
+# # bad
+#
+# include Enumerable #[Integer]
+#
+# attr_reader :name #: String
+# attr_reader :age #: Integer?
+# @example AllowRBSInlineAnnotation: true
+#
+# # good
+#
+# include Enumerable #[Integer]
+#
+# attr_reader :name #: String
+# attr_reader :age #: Integer?
+# @example AllowSteepAnnotation: false (default)
+#
+# # bad
+# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer]
+# list << n
+# end
+#
+# name = 'John' #: String
+# @example
+#
+# # bad
+# #Some comment
+#
+# # good
+# # Some comment
#
-# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#52
+# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#89
class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#58
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#95
def on_new_investigation; end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#95
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#134
def allow_doxygen_comment?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#103
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#142
def allow_gemfile_ruby_comment?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#79
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#158
+ def allow_rbs_inline_annotation?; end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#166
+ def allow_steep_annotation?; end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#118
def allowed_on_first_line?(comment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#99
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#138
def doxygen_comment_style?(comment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#107
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#146
def gemfile?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#115
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#154
def gemfile_ruby_comment?(comment); end
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#75
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#114
def hash_mark(expr); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#91
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#130
def rackup_config_file?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#87
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#126
def rackup_options?(comment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#111
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#162
+ def rbs_inline_annotation?(comment); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#150
def ruby_comment_in_gemfile?(comment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#83
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#122
def shebang?(comment); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#170
+ def steep_annotation?(comment); end
end
-# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#56
+# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#93
RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String)
# Checks for unnecessary leading blank lines at the beginning
@@ -12740,29 +12934,29 @@ RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_IN
# split across lines. These include arrays, hashes, and
# method calls with argument lists.
#
-# If autocorrection is enabled, the following Layout cops
+# If autocorrection is enabled, the following cops
# are recommended to further format the broken lines.
# (Many of these are enabled by default.)
#
-# * ArgumentAlignment
-# * ArrayAlignment
-# * BlockAlignment
-# * BlockDelimiters
-# * BlockEndNewline
-# * ClosingParenthesisIndentation
-# * FirstArgumentIndentation
-# * FirstArrayElementIndentation
-# * FirstHashElementIndentation
-# * FirstParameterIndentation
-# * HashAlignment
-# * IndentationWidth
-# * MultilineArrayLineBreaks
-# * MultilineBlockLayout
-# * MultilineHashBraceLayout
-# * MultilineHashKeyLineBreaks
-# * MultilineMethodArgumentLineBreaks
-# * MultilineMethodParameterLineBreaks
-# * ParameterAlignment
+# * `Layout/ArgumentAlignment`
+# * `Layout/ArrayAlignment`
+# * `Layout/BlockAlignment`
+# * `Layout/BlockEndNewline`
+# * `Layout/ClosingParenthesisIndentation`
+# * `Layout/FirstArgumentIndentation`
+# * `Layout/FirstArrayElementIndentation`
+# * `Layout/FirstHashElementIndentation`
+# * `Layout/FirstParameterIndentation`
+# * `Layout/HashAlignment`
+# * `Layout/IndentationWidth`
+# * `Layout/MultilineArrayLineBreaks`
+# * `Layout/MultilineBlockLayout`
+# * `Layout/MultilineHashBraceLayout`
+# * `Layout/MultilineHashKeyLineBreaks`
+# * `Layout/MultilineMethodArgumentLineBreaks`
+# * `Layout/MultilineMethodParameterLineBreaks`
+# * `Layout//ParameterAlignment`
+# * `Style/BlockDelimiters`
#
# Together, these cops will pretty print hashes, arrays,
# method calls, etc. For example, let's say the max columns
@@ -15100,44 +15294,44 @@ class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#256
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#259
def align_hash_cop_config; end
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#195
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#198
def autocorrect(corrector, range, right_operand); end
# source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#179
def check_operator(type, operator, right_operand); end
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#209
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#212
def enclose_operator_with_space(corrector, range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#236
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#239
def excess_leading_space?(type, operator, with_space); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#251
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#254
def excess_trailing_space?(right_operand, with_space); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#274
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#277
def force_equal_sign_alignment?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#260
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#263
def hash_table_style?; end
# @yield [msg]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#190
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#193
def offense(type, operator, with_space, right_operand); end
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#222
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#225
def offense_message(type, operator, with_space, right_operand); end
# @return [Boolean]
@@ -15152,17 +15346,17 @@ class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#278
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#281
def should_not_have_surrounding_space?(operator, right_operand); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#264
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#267
def space_around_exponent_operator?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#268
+ # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#271
def space_around_slash_operator?(right_operand); end
class << self
@@ -15742,67 +15936,72 @@ class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base
include ::RuboCop::Cop::SurroundingSpace
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#85
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#89
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#85
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#89
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#122
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#126
def adjacent_braces(left_brace, right_brace); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#161
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#165
def aligned_braces?(inner, right_brace, column); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#130
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#134
def braces_with_contents_inside(node, inner); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#105
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#109
def check_inside(node, left_brace, right_brace); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#137
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#141
def check_left_brace(inner, left_brace, args_delimiter); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#145
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#149
def check_right_brace(node, inner, left_brace, right_brace, single_line); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#165
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#169
def inner_last_space_count(inner); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#157
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#161
def multiline_block?(left_brace, right_brace); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#222
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#226
def no_space(begin_pos, end_pos, msg); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#169
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#173
def no_space_inside_left_brace(left_brace, args_delimiter); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#238
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#242
def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#201
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#205
def pipe?(args_delimiter); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#230
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#234
def space(begin_pos, end_pos, msg); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#186
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#190
def space_inside_left_brace(left_brace, args_delimiter); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#205
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#209
def space_inside_right_brace(inner, right_brace, column); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#253
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#257
def style_for_empty_braces; end
+
+ class << self
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#85
+ def autocorrect_incompatible_with; end
+ end
end
# Checks that braces used for hash literals have or don't have
@@ -16250,23 +16449,20 @@ class RuboCop::Cop::Layout::SpaceInsideStringInterpolation < ::RuboCop::Cop::Bas
include ::RuboCop::Cop::ConfigurableEnforcedStyle
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#31
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#30
def on_interpolation(begin_node); end
private
- # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#47
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#46
def autocorrect(corrector, begin_node); end
- # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#57
+ # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#56
def delimiters(begin_node); end
end
# source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#28
-RuboCop::Cop::Layout::SpaceInsideStringInterpolation::NO_SPACE_MSG = T.let(T.unsafe(nil), String)
-
-# source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#29
-RuboCop::Cop::Layout::SpaceInsideStringInterpolation::SPACE_MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Layout::SpaceInsideStringInterpolation::MSG = T.let(T.unsafe(nil), String)
# Looks for trailing blank lines and a final newline in the
# source code.
@@ -16491,7 +16687,7 @@ class RuboCop::Cop::LineBreakCorrector
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#58
+ # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#60
def trailing_class_definition?(token, body); end
end
end
@@ -16536,7 +16732,7 @@ module RuboCop::Cop::LineLengthHelp
# source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#32
def line_length(line); end
- # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#105
+ # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#110
def line_length_without_directive(line); end
# source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#51
@@ -16550,7 +16746,7 @@ module RuboCop::Cop::LineLengthHelp
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#98
+ # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#103
def valid_uri?(uri_ish_string); end
end
@@ -16619,7 +16815,6 @@ RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsaf
#
# # bad
# some_method a { |val| puts val }
-# @example
#
# # good
# # With parentheses, there's no ambiguity.
@@ -16652,38 +16847,38 @@ RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsaf
# expect { do_something }.to change { object.attribute }
# expect { do_something }.to not_change { object.attribute }
#
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#54
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#52
class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#62
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#62
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#85
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#83
def allowed_method_pattern?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#81
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#79
def ambiguous_block_association?(send_node); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#91
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#89
def message(send_node); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#97
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#95
def wrap_in_parentheses(corrector, node); end
end
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#60
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#58
RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String)
# Checks for ambiguous operators in the first argument of a
@@ -16696,51 +16891,50 @@ RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String
# # The `*` is interpreted as a splat operator but it could possibly be
# # a `*` method invocation (i.e. `do_something.*(some_array)`).
# do_something *some_array
-# @example
#
# # good
#
# # With parentheses, there's no ambiguity.
# do_something(*some_array)
#
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#23
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#21
class RuboCop::Cop::Lint::AmbiguousOperator < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#45
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#43
def on_new_investigation; end
private
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#62
def find_offense_node_by(diagnostic); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#80
def message(diagnostic); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#92
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#90
def offense_node(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#88
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#86
def offense_position?(node, diagnostic); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#101
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#99
def unary_operator?(node, diagnostic); end
class << self
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#41
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#39
def autocorrect_incompatible_with; end
end
end
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#26
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#24
RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#36
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#34
RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String)
# Looks for expressions containing multiple binary operators
@@ -16861,38 +17055,39 @@ RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::RESTRICT_ON_SEND = T.let(T.unsa
#
# source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#59
class RuboCop::Cop::Lint::AmbiguousRange < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::RationalLiteral
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#65
def on_erange(node); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#65
def on_irange(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#84
def acceptable?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#92
def acceptable_call?(node); end
# @yield [range.begin]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#77
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#78
def each_boundary(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#99
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#102
def require_parentheses_for_method_chain?; end
end
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#62
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#63
RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String)
# Checks for ambiguous regexp literals in the first argument of
@@ -16906,40 +17101,39 @@ RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String)
# # but it could possibly be `/` method invocations.
# # (i.e. `do_something./(pattern)./(i)`)
# do_something /pattern/i
-# @example
#
# # good
#
# # With parentheses, there's no ambiguity.
# do_something(/pattern/i)
#
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#24
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#22
class RuboCop::Cop::Lint::AmbiguousRegexpLiteral < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#31
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#29
def on_new_investigation; end
private
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#56
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#54
def find_offense_node(node, regexp_receiver); end
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#49
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#47
def find_offense_node_by(diagnostic); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#67
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#65
def first_argument_is_regexp?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#71
+ # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#69
def method_chain_to_regexp_receiver?(node, regexp_receiver); end
end
-# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#27
+# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#25
RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String)
# Checks for assignments in the conditions of
@@ -17033,17 +17227,17 @@ RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T.
class RuboCop::Cop::Lint::BigDecimalNew < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#25
+ # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#24
def big_decimal_new(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#30
+ # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#29
def on_send(node); end
end
# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#20
RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#22
+# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#21
RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for places where binary operator has identical operands.
@@ -17105,7 +17299,6 @@ RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(ni
#
# # good
# true
-# @example
#
# # bad
# :false
@@ -17113,23 +17306,23 @@ RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(ni
# # good
# false
#
-# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#29
+# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#27
class RuboCop::Cop::Lint::BooleanSymbol < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#35
+ # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#33
def boolean_symbol?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#37
+ # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#35
def on_sym(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#50
+ # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#48
def autocorrect(corrector, node); end
end
-# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#32
+# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#30
RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String)
# Checks for circular argument references in optional keyword
@@ -17140,54 +17333,45 @@ RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# def bake(pie: pie)
# pie.heat_up
# end
-# @example
#
# # good
-#
# def bake(pie:)
# pie.refrigerate
# end
-# @example
#
# # good
-#
# def bake(pie: self.pie)
# pie.feed_to(user)
# end
-# @example
#
# # bad
-#
# def cook(dry_ingredients = dry_ingredients)
# dry_ingredients.reduce(&:+)
# end
-# @example
#
# # good
-#
# def cook(dry_ingredients = self.dry_ingredients)
# dry_ingredients.combine
# end
#
-# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#50
+# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#37
class RuboCop::Cop::Lint::CircularArgumentReference < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#40
def on_kwoptarg(node); end
- # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#57
+ # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#44
def on_optarg(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#63
+ # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#50
def check_for_circular_argument_references(arg_name, arg_value); end
end
-# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#51
+# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#38
RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String)
# Do not define constants within a block, since the block's scope does not
@@ -17434,7 +17618,6 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String)
# binding.pry
# do_something
# end
-# @example
#
# # bad (ok during development)
#
@@ -17443,7 +17626,6 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String)
# byebug
# do_something
# end
-# @example
#
# # good
#
@@ -17463,50 +17645,50 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String)
#
# require 'my_debugger/start'
#
-# source://rubocop//lib/rubocop/cop/lint/debugger.rb#78
+# source://rubocop//lib/rubocop/cop/lint/debugger.rb#74
class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#78
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#142
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#138
def assumed_argument?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#121
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#117
def assumed_usage_context?(node); end
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#131
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#127
def chained_method_name(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#108
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#104
def debugger_method?(send_node); end
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#94
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#90
def debugger_methods; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#114
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#110
def debugger_require?(send_node); end
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#101
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#97
def debugger_requires; end
- # source://rubocop//lib/rubocop/cop/lint/debugger.rb#90
+ # source://rubocop//lib/rubocop/cop/lint/debugger.rb#86
def message(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/debugger.rb#80
+# source://rubocop//lib/rubocop/cop/lint/debugger.rb#76
RuboCop::Cop::Lint::Debugger::BLOCK_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/debugger.rb#79
+# source://rubocop//lib/rubocop/cop/lint/debugger.rb#75
RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String)
# Checks for uses of the deprecated class method usages.
@@ -17643,25 +17825,17 @@ RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil),
#
# @example
#
-# # Example for OpenSSL::Cipher instantiation.
-#
# # bad
# OpenSSL::Cipher::AES.new(128, :GCM)
#
# # good
# OpenSSL::Cipher.new('aes-128-gcm')
-# @example
-#
-# # Example for OpenSSL::Digest instantiation.
#
# # bad
# OpenSSL::Digest::SHA256.new
#
# # good
# OpenSSL::Digest.new('SHA256')
-# @example
-#
-# # Example for ::Digest inherited class methods.
#
# # bad
# OpenSSL::Digest::SHA256.digest('foo')
@@ -17669,51 +17843,51 @@ RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil),
# # good
# OpenSSL::Digest.digest('SHA256', 'foo')
#
-# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#40
+# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#30
class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#49
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#39
def algorithm_const(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#59
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#49
def digest_const?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#63
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#53
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#110
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#100
def algorithm_name(node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#75
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#65
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#139
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#129
def build_cipher_arguments(node, algorithm_name, no_arguments); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#102
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#92
def correction_range(node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#87
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#77
def message(node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#106
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#96
def openssl_class(node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#128
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#118
def replacement_args(node); end
- # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#120
+ # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#110
def sanitize_arguments(arguments); end
end
-# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#44
+# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#34
RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#46
+# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#36
RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array)
# Checks constructors for disjunctive assignments (`||=`) that should
@@ -17784,6 +17958,9 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil
# With `IgnoreConstantBranches: true`, branches are not registered
# as offenses if they return a constant value.
#
+# With `IgnoreDuplicateElseBranch: true`, in conditionals with multiple branches,
+# duplicate 'else' branches are not registered as offenses.
+#
# @example
# # bad
# if foo
@@ -17849,59 +18026,78 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil
# when "large" then LARGE_SIZE
# else MEDIUM_SIZE
# end
+# @example IgnoreDuplicateElseBranch: true
+# # good
+# if foo
+# do_foo
+# elsif bar
+# do_bar
+# else
+# do_foo
+# end
#
-# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#86
+# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#99
class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102
def on_branching_statement(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102
def on_case(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102
def on_case_match(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#114
def on_if(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102
def on_rescue(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#117
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#136
def branches(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#121
- def consider_branch?(branch); end
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#140
+ def consider_branch?(branches, branch); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#147
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#174
def const_branch?(branch); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#132
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#178
+ def duplicate_else_branch?(branches, branch); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#155
def ignore_constant_branches?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#128
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#159
+ def ignore_duplicate_else_branches?; end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#151
def ignore_literal_branches?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#136
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#163
def literal_branch?(branch); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#103
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#122
def offense_range(duplicate_branch); end
end
-# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#87
+# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#100
RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String)
# Checks that there are no repeated conditions
@@ -17910,17 +18106,14 @@ RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# case x
# when 'first'
# do_something
# when 'first'
# do_something_else
# end
-# @example
#
# # good
-#
# case x
# when 'first'
# do_something
@@ -17928,13 +18121,13 @@ RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String)
# do_something_else
# end
#
-# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#30
+# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#26
class RuboCop::Cop::Lint::DuplicateCaseCondition < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#33
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#29
def on_case(case_node); end
end
-# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#31
+# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#27
RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String)
# Checks that there are no repeated conditions used in if 'elsif'.
@@ -17971,23 +18164,20 @@ RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# hash = { food: 'apple', food: 'orange' }
-# @example
#
# # good
-#
# hash = { food: 'apple', other_food: 'orange' }
#
-# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#22
+# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#18
class RuboCop::Cop::Lint::DuplicateHashKey < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Duplication
- # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#27
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#23
def on_hash(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#25
+# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#21
RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String)
# Checks for duplicated magic comments.
@@ -18139,7 +18329,6 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# def foo
# 1
# end
@@ -18147,19 +18336,15 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String)
# def foo
# 2
# end
-# @example
#
# # bad
-#
# def foo
# 1
# end
#
# alias foo bar
-# @example
#
# # good
-#
# def foo
# 1
# end
@@ -18167,98 +18352,96 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String)
# def bar
# 2
# end
-# @example
#
# # good
-#
# def foo
# 1
# end
#
# alias bar foo
#
-# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#52
+# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#42
class RuboCop::Cop::Lint::DuplicateMethods < ::RuboCop::Cop::Base
# @return [DuplicateMethods] a new instance of DuplicateMethods
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#57
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#47
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#98
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#88
def alias_method?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#85
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#75
def method_alias?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#79
def on_alias(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#63
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#53
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#72
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#62
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#104
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#94
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#103
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#93
def sym_name(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#117
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#107
def check_const_receiver(node, name, const_name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#124
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#114
def check_self_receiver(node, name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#208
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#198
def found_attr(node, args, readable: T.unsafe(nil), writable: T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#136
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#126
def found_instance_method(node, name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#159
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#149
def found_method(node, method_name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#149
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#139
def found_sclass_method(node, name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#186
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#176
def location(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#218
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#208
def lookup_constant(node, const_name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#131
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#121
def message_for_dup(node, method_name, key); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#178
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#168
def method_key(node, method_name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#194
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#184
def on_attr(node, attr_name, args); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#250
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#240
def possible_dsl?(node); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#236
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#226
def qualified_name(enclosing, namespace, mod_name); end
- # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#260
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#250
def source_location(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#55
+# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#45
RuboCop::Cop::Lint::DuplicateMethods::DEF_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#53
+# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#43
RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#54
+# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#44
RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for duplicate elements in Regexp character classes.
@@ -18406,6 +18589,53 @@ end
# source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#31
RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String)
+# Checks for duplicate literal, constant, or variable elements in Set.
+#
+# @example
+#
+# # bad
+# Set[:foo, :bar, :foo]
+#
+# # good
+# Set[:foo, :bar]
+#
+# # bad
+# Set.new([:foo, :bar, :foo])
+#
+# # good
+# Set.new([:foo, :bar])
+#
+# # bad
+# [:foo, :bar, :foo].to_set
+#
+# # good
+# [:foo, :bar].to_set
+#
+# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#28
+class RuboCop::Cop::Lint::DuplicateSetElement < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43
+ def on_csend(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43
+ def on_send(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#35
+ def set_init_elements(param0 = T.unsafe(nil)); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#64
+ def register_offense(current_element, prev_element); end
+end
+
+# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#31
+RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#32
+RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks if each_with_object is called with an immutable
# argument. Since the argument is the object that the given block shall
# make calls on to build something based on the enumerable that
@@ -18415,31 +18645,28 @@ RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# sum = numbers.each_with_object(0) { |e, a| a += e }
-# @example
#
# # good
-#
# num = 0
# sum = numbers.each_with_object(num) { |e, a| a += e }
#
-# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#24
+# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#20
class RuboCop::Cop::Lint::EachWithObjectArgument < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#29
+ # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#25
def each_with_object?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#33
+ # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#29
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#33
+ # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#29
def on_send(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#25
+# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#21
RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#26
+# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#22
RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for odd `else` block layout - like
@@ -18459,7 +18686,6 @@ RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(ni
# else do_this
# do_that
# end
-# @example
#
# # good
#
@@ -18479,28 +18705,28 @@ RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(ni
# do_that
# end
#
-# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#43
+# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#41
class RuboCop::Cop::Lint::ElseLayout < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#50
+ # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#48
def on_if(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#81
+ # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#79
def autocorrect(corrector, node, first_else); end
- # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#61
+ # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#59
def check(node); end
- # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#71
+ # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#69
def check_else(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#48
+# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#46
RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String)
# Checks for blocks without a body.
@@ -18724,104 +18950,100 @@ class RuboCop::Cop::Lint::EmptyConditionalBody < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#70
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#71
def on_if(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#156
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#177
def all_branches_body_missing?(node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#83
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#95
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#142
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#163
def branch_range(node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#104
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#125
def correct_other_branches(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#162
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#183
def deletion_range(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#137
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#158
def else_branch?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#131
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#152
def empty_elsif_branch?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#123
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#144
def empty_if_branch?(node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#89
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#87
+ def offense_range(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#101
def remove_comments(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#96
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#109
def remove_empty_branch(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#116
+ # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#137
def require_other_branches_correction?(node); end
end
# source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#68
RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String)
-# Checks for empty `ensure` blocks
+# Checks for empty `ensure` blocks.
#
# @example
#
# # bad
-#
# def some_method
# do_something
# ensure
# end
-# @example
#
# # bad
-#
# begin
# do_something
# ensure
# end
-# @example
#
# # good
-#
# def some_method
# do_something
# ensure
# do_something_else
# end
-# @example
#
# # good
-#
# begin
# do_something
# ensure
# do_something_else
# end
#
-# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#45
+# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#35
class RuboCop::Cop::Lint::EmptyEnsure < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#50
+ # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#40
def on_ensure(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#48
+# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#38
RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String)
# Checks for the presence of empty expressions.
@@ -18956,24 +19178,21 @@ RuboCop::Cop::Lint::EmptyInPattern::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# "result is #{}"
-# @example
#
# # good
-#
# "result is #{some_result}"
#
-# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#19
+# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#15
class RuboCop::Cop::Lint::EmptyInterpolation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Interpolation
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#25
+ # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#21
def on_interpolation(begin_node); end
end
-# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#23
+# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#19
RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String)
# Checks for the presence of `when` branches without a body.
@@ -18986,7 +19205,6 @@ RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String)
# do_something
# when baz
# end
-# @example
#
# # good
# case condition
@@ -19014,15 +19232,15 @@ RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String)
# # do nothing
# end
#
-# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#47
+# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#45
class RuboCop::Cop::Lint::EmptyWhen < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CommentsHelp
- # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#52
+ # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#50
def on_case(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#50
+# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#48
RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String)
# Checks for `return` from an `ensure` block.
@@ -19035,17 +19253,14 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# def foo
# do_something
# ensure
# cleanup
# return self
# end
-# @example
#
# # good
-#
# def foo
# do_something
# self
@@ -19053,8 +19268,7 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String)
# cleanup
# end
#
-# # also good
-#
+# # good
# def foo
# begin
# do_something
@@ -19066,16 +19280,13 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String)
# cleanup
# end
#
-# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#47
+# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#42
class RuboCop::Cop::Lint::EnsureReturn < ::RuboCop::Cop::Base
- include ::RuboCop::Cop::RangeHelp
- extend ::RuboCop::Cop::AutoCorrector
-
- # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#45
def on_ensure(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#51
+# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#43
RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String)
# Emulates the following Ruby warnings in Ruby 2.6.
@@ -19139,36 +19350,45 @@ class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
extend ::RuboCop::Cop::TargetRubyVersion
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#83
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#81
def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#88
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#86
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#153
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#160
def arguments_range(node); end
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#108
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#115
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#123
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#130
def build_kwargs(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#119
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#126
def correct_arguments?(arguments); end
- # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#140
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#104
+ def message(positional_argument_index, arg_value); end
+
+ # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#147
def override_by_legacy_args(kwargs, node); end
end
+# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#74
+RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_EOUTVAR = T.let(T.unsafe(nil), String)
+
# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#68
-RuboCop::Cop::Lint::ErbNewArguments::MESSAGES = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_SAFE_LEVEL = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#71
+RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_TRIM_MODE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#80
+# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#78
RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Looks for uses of flip-flop operator
@@ -19210,7 +19430,15 @@ RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String)
# floating-point value representation to be exactly the same, which is very unlikely
# if you perform any arithmetic operations involving precision loss.
#
-# # good - comparing against zero
+# @example
+# # bad
+# x == 0.1
+# x != 0.1
+#
+# # good - using BigDecimal
+# x.to_d == 0.1.to_d
+#
+# # good - comparing against zero
# x == 0.0
# x != 0.0
#
@@ -19224,14 +19452,6 @@ RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String)
# # Or some other epsilon based type of comparison:
# # https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/
#
-# @example
-# # bad
-# x == 0.1
-# x != 0.1
-#
-# # good - using BigDecimal
-# x.to_d == 0.1.to_d
-#
# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#35
class RuboCop::Cop::Lint::FloatComparison < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#44
@@ -19278,21 +19498,18 @@ RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
# @example
#
# # bad
-#
# float = 3.0e400
-# @example
#
# # good
-#
# float = 42.9
#
-# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#21
+# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#17
class RuboCop::Cop::Lint::FloatOutOfRange < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#24
+ # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#20
def on_float(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#22
+# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#18
RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String)
# This lint sees if there is a mismatch between the number of
@@ -19306,138 +19523,131 @@ RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# format('A value: %s and another: %i', a_value)
-# @example
#
# # good
-#
# format('A value: %s and another: %i', a_value, another)
-# @example
#
# # bad
-#
# format('Unnumbered format: %s and numbered: %2$s', a_value, another)
-# @example
#
# # good
-#
# format('Numbered format: %1$s and numbered %2$s', a_value, another)
#
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#37
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#27
class RuboCop::Cop::Lint::FormatParameterMismatch < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#100
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#90
def called_on_string?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#49
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#39
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#137
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#127
def count_format_matches(node); end
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#119
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#109
def count_matches(node); end
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#141
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#131
def count_percent_matches(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#129
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#119
def countable_format?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#133
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#123
def countable_percent?(node); end
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#153
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#143
def expected_fields_count(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#168
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#158
def format?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#146
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#136
def format_method?(name, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#64
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#54
def format_string?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#115
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#105
def heredoc?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#68
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#58
def invalid_format_string?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#91
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#81
def matched_arguments_count?(expected, passed); end
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#186
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#176
def message(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#105
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#95
def method_with_format_args?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#77
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#67
def offending_node?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#176
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#166
def percent?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#109
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#99
def splat_args?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#172
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#162
def sprintf?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#195
+ # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#185
def string_type?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#44
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#34
RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String)
# http://rubular.com/r/CvpbxkcTzy
#
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#39
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#29
RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#41
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#31
RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#47
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#37
RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#45
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#35
RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#46
+# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#36
RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array)
# Prefer using `Hash#compare_by_identity` rather than using `object_id`
@@ -19617,12 +19827,9 @@ RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil),
# @example
#
# # bad
-#
# array = ['Item 1' 'Item 2']
-# @example
#
# # good
-#
# array = ['Item 1Item 2']
# array = ['Item 1' + 'Item 2']
# array = [
@@ -19630,43 +19837,45 @@ RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil),
# 'Item 2'
# ]
#
-# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#25
+# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#21
class RuboCop::Cop::Lint::ImplicitStringConcatenation < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#33
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#32
def on_dstr(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#83
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#92
def display_str(node); end
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#50
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#59
def each_bad_cons(node); end
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#65
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#74
def ending_delimiter(str); end
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#91
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#100
def str_content(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#75
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#84
def string_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#79
+ # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#88
def string_literals?(node1, node2); end
end
-# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#28
+# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#26
RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#30
+# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#28
RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#26
+# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#24
RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String)
# Checks for `IO.select` that is incompatible with Fiber Scheduler since Ruby 3.0.
@@ -19728,7 +19937,6 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T
# @example
#
# # bad
-#
# class C
# private
#
@@ -19736,10 +19944,8 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T
# puts 'hi'
# end
# end
-# @example
#
# # good
-#
# class C
# def self.method
# puts 'hi'
@@ -19747,10 +19953,8 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T
#
# private_class_method :method
# end
-# @example
#
# # good
-#
# class C
# class << self
# private
@@ -19761,49 +19965,49 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T
# end
# end
#
-# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#48
+# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#41
class RuboCop::Cop::Lint::IneffectiveAccessModifier < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#59
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#52
def on_class(node); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#59
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#52
def on_module(node); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#55
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#48
def private_class_methods(param0); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#109
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#102
def access_modifier?(node); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#66
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#59
def check_node(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#113
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#106
def correct_visibility?(node, modifier, ignored_methods); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#78
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#71
def format_message(modifier); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#91
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#84
def ineffective_modifier(node, ignored_methods = T.unsafe(nil), modifier = T.unsafe(nil), &block); end
- # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#74
+ # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#67
def private_class_method_names(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#51
+# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#44
RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#52
+# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#45
RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#49
+# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#42
RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String)
# Looks for error classes inheriting from `Exception`.
@@ -19882,33 +20086,30 @@ RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Ar
# @example
#
# # bad
-#
# foo = 'something with #{interpolation} inside'
-# @example
#
# # good
-#
# foo = "something with #{interpolation} inside"
#
-# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#25
+# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#21
class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#31
+ # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#27
def on_str(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#42
+ # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#38
def autocorrect(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#49
def heredoc?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#28
+# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#24
RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String)
# Emulates the following Ruby warning in Ruby 3.3.
@@ -19938,16 +20139,19 @@ class RuboCop::Cop::Lint::ItWithoutArgumentsInBlock < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#48
+ # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#41
def deprecated_it_method?(node); end
- # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#33
- def on_block(node); end
+ # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#34
+ def on_send(node); end
end
# source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#30
RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::MSG = T.let(T.unsafe(nil), String)
+# source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#32
+RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks uses of lambda without a literal block.
# It emulates the following warning in Ruby 3.0:
#
@@ -20151,84 +20355,84 @@ RuboCop::Cop::Lint::LiteralAssignmentInCondition::MSG = T.let(T.unsafe(nil), Str
# @example
#
# # bad
-#
# "result is #{10}"
-# @example
#
# # good
-#
# "result is 10"
#
-# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#19
+# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#15
class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Interpolation
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::PercentLiteral
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#28
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#24
def on_interpolation(begin_node); end
private
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#62
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#60
def autocorrected_value(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#108
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#127
def autocorrected_value_for_array(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#114
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#133
def autocorrected_value_for_hash(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#84
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#103
def autocorrected_value_for_string(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#92
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#111
def autocorrected_value_for_symbol(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#125
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#144
def autocorrected_value_in_hash(node); end
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#99
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#118
def autocorrected_value_in_hash_for_symbol(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#155
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#174
def ends_heredoc_line?(node); end
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#82
+ def handle_special_regexp_chars(begin_node, value); end
+
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#163
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#182
def in_array_percent_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#48
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#46
def offending?(node); end
# Does node print its own source when converted to a string?
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#146
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#165
def prints_as_self?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#151
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#170
def space_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#56
+ # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#54
def special_keyword?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#26
+# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#22
RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#25
+# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#21
RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String)
# Checks for uses of `begin...end while/until something`.
@@ -20241,15 +20445,6 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String)
# begin
# do_something
# end while some_condition
-# @example
-#
-# # bad
-#
-# # using until
-# begin
-# do_something
-# end until some_condition
-# @example
#
# # good
#
@@ -20258,7 +20453,13 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String)
# do_something
# break unless some_condition
# end
-# @example
+#
+# # bad
+#
+# # using until
+# begin
+# do_something
+# end until some_condition
#
# # good
#
@@ -20268,29 +20469,29 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String)
# break if some_condition
# end
#
-# source://rubocop//lib/rubocop/cop/lint/loop.rb#50
+# source://rubocop//lib/rubocop/cop/lint/loop.rb#44
class RuboCop::Cop::Lint::Loop < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/loop.rb#59
+ # source://rubocop//lib/rubocop/cop/lint/loop.rb#53
def on_until_post(node); end
- # source://rubocop//lib/rubocop/cop/lint/loop.rb#55
+ # source://rubocop//lib/rubocop/cop/lint/loop.rb#49
def on_while_post(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/loop.rb#79
+ # source://rubocop//lib/rubocop/cop/lint/loop.rb#73
def build_break_line(node); end
- # source://rubocop//lib/rubocop/cop/lint/loop.rb#75
+ # source://rubocop//lib/rubocop/cop/lint/loop.rb#69
def keyword_and_condition_range(node); end
- # source://rubocop//lib/rubocop/cop/lint/loop.rb#65
+ # source://rubocop//lib/rubocop/cop/lint/loop.rb#59
def register_offense(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/loop.rb#53
+# source://rubocop//lib/rubocop/cop/lint/loop.rb#47
RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String)
# cop disables on wide ranges of code, that latter contributors to
@@ -20636,15 +20837,17 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe
# Checks for nested method definitions.
#
-# @example AllowedPatterns: ['baz']
-# # good
-# def foo(obj)
-# obj.do_baz do
+# @example
+#
+# # bad
+#
+# # `bar` definition actually produces methods in the same scope
+# # as the outer `foo` method. Furthermore, the `bar` method
+# # will be redefined every time `foo` is invoked.
+# def foo
# def bar
# end
# end
-# end
-# @example
#
# # good
#
@@ -20652,7 +20855,6 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe
# bar = -> { puts 'hello' }
# bar.call
# end
-# @example
#
# # good
#
@@ -20672,7 +20874,6 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe
# end
# end
# end
-# @example
#
# # good
#
@@ -20706,49 +20907,46 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe
# end
# end
# end
-# @example
-#
-# # bad
-#
-# # `bar` definition actually produces methods in the same scope
-# # as the outer `foo` method. Furthermore, the `bar` method
-# # will be redefined every time `foo` is invoked.
-# def foo
+# @example AllowedPatterns: ['baz']
+# # good
+# def foo(obj)
+# obj.do_baz do
# def bar
# end
# end
+# end
#
-# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97
+# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#91
class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#133
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#127
def eval_call?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#138
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#132
def exec_call?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#103
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#103
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97
def on_defs(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#126
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#120
def allowed_method_name?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#121
+ # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#115
def scoping_method_call?(child); end
end
-# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#101
+# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#95
RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String)
# Checks for nested percent literals.
@@ -20814,38 +21012,35 @@ RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array)
# @example
#
# # bad
-#
# result = (1..4).reduce(0) do |acc, i|
# next if i.odd?
# acc + i
# end
-# @example
#
# # good
-#
# result = (1..4).reduce(0) do |acc, i|
# next acc if i.odd?
# acc + i
# end
#
-# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#25
+# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#21
class RuboCop::Cop::Lint::NextWithoutAccumulator < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#28
+ # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#24
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#42
+ # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#38
def on_block_body_of_reduce(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#28
+ # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#24
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#49
+ # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#45
def parent_block_node(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#26
+# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#22
RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String)
# Checks for the presence of a `return` inside a `begin..end` block
@@ -20856,16 +21051,13 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# @some_variable ||= begin
# return some_value if some_condition_is_met
#
# do_something
# end
-# @example
#
# # good
-#
# @some_variable ||= begin
# if some_condition_is_met
# some_value
@@ -20875,7 +21067,6 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String)
# end
#
# # good
-#
# some_variable = if some_condition_is_met
# return if another_condition_is_met
#
@@ -20884,19 +21075,19 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String)
# do_something
# end
#
-# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#43
+# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#38
class RuboCop::Cop::Lint::NoReturnInBeginEndBlocks < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46
+ # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41
def on_lvasgn(node); end
- # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46
+ # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41
def on_op_asgn(node); end
- # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46
+ # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41
def on_or_asgn(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#44
+# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#39
RuboCop::Cop::Lint::NoReturnInBeginEndBlocks::MSG = T.let(T.unsafe(nil), String)
# Checks for non-atomic file operation.
@@ -20966,17 +21157,17 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#151
+ # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#152
def force_method?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#159
+ # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#166
def force_method_name?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#155
+ # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#162
def force_option?(node); end
# @return [Boolean]
@@ -20993,8 +21184,13 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#101
def register_offense(node, exist_node); end
- # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#139
+ # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#140
def replacement_method(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#156
+ def require_mode_keyword?(node); end
end
# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#50
@@ -21537,28 +21733,28 @@ class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#61
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#60
def chained_calls?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#49
- def first_argument_block_type?(first_arg); end
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#56
+ def compound_range?(first_arg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#57
- def first_argument_starts_with_left_parenthesis?(node); end
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#47
+ def first_argument_block_type?(first_arg); end
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#86
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#85
def space_range(expr, space_length); end
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#70
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#69
def spaces_before_left_parenthesis(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#66
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#65
def ternary_expression?(node); end
# @return [Boolean]
@@ -21568,7 +21764,7 @@ class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#51
def valid_first_argument?(first_arg); end
end
@@ -21584,44 +21780,41 @@ RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), S
# @example
#
# # bad
-#
# %w('foo', "bar")
-# @example
#
# # good
-#
# %w(foo bar)
#
-# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#33
+# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#29
class RuboCop::Cop::Lint::PercentStringArray < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::PercentLiteral
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#44
+ # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#40
def on_array(node); end
- # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#48
+ # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#44
def on_percent_literal(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#65
+ # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#61
def contains_quotes_or_commas?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#38
+# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#34
RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp)
-# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#41
+# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#37
RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#37
+# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#33
RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#39
+# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#35
RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp)
# Checks for colons and commas in %i, e.g. `%i(:foo, :bar)`
@@ -21633,43 +21826,40 @@ RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Re
# @example
#
# # bad
-#
# %i(:foo, :bar)
-# @example
#
# # good
-#
# %i(foo bar)
#
-# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#23
+# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#19
class RuboCop::Cop::Lint::PercentSymbolArray < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::PercentLiteral
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#30
+ # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#26
def on_array(node); end
- # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#34
+ # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#30
def on_percent_literal(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#42
+ # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#38
def autocorrect(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#52
+ # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#48
def contains_colons_or_commas?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#62
+ # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#58
def non_alphanumeric_literal?(literal); end
end
-# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#27
+# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#23
RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String)
# Checks for `raise` or `fail` statements which are
@@ -21735,35 +21925,32 @@ RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arra
# @example
#
# # bad
-#
# rand 1
# Kernel.rand(-1)
# rand 1.0
# rand(-1.0)
-# @example
#
# # good
-#
# 0 # just use 0 instead
#
-# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#23
+# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#19
class RuboCop::Cop::Lint::RandOne < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#32
+ # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#28
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#28
+ # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#24
def rand_one?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#40
+ # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#36
def message(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#24
+# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#20
RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#25
+# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#21
RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# removed without causing any offenses to be reported. It's implemented
@@ -21944,13 +22131,14 @@ RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.le
# that cop checks whether any cop was actually enabled.
#
# @example
+#
# # bad
# foo = 1
# # rubocop:enable Layout/LineLength
#
# # good
# foo = 1
-# @example
+#
# # bad
# # rubocop:disable Style/StringLiterals
# foo = "1"
@@ -21964,54 +22152,54 @@ RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.le
# # rubocop:enable all
# baz
#
-# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#37
+# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#39
class RuboCop::Cop::Lint::RedundantCopEnableDirective < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::SurroundingSpace
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#46
def on_new_investigation; end
private
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#120
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#122
def all_or_name(name); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#76
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#78
def comment_start(comment); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#80
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#82
def cop_name_indention(comment, name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#124
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#126
def department?(directive, name); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#71
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#73
def range_of_offense(comment, name); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#95
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#97
def range_to_remove(begin_pos, end_pos, comment); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#84
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#86
def range_with_comma(comment, name); end
# If the list of cops is comma-separated, but without a empty space after the comma,
# we should **not** remove the prepending empty space, thus begin_pos += 1
#
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#114
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#116
def range_with_comma_after(comment, start, begin_pos, end_pos); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#108
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#110
def range_with_comma_before(start, begin_pos, end_pos); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#55
def register_offense(comment, cop_names); end
end
-# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#42
+# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44
RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String)
# Sort globbed results by default in Ruby 3.0.
@@ -22312,7 +22500,7 @@ RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_SPECIFIC_METHODS = T.let(T.unsa
# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#87
RuboCop::Cop::Lint::RedundantSafeNavigation::SNAKE_CASE = T.let(T.unsafe(nil), Regexp)
-# Checks for unneeded usages of splat expansion
+# Checks for unneeded usages of splat expansion.
#
# @example
#
@@ -22465,47 +22653,44 @@ RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), St
# @example
#
# # bad
-#
# "result is #{something.to_s}"
# print something.to_s
# puts something.to_s
# warn something.to_s
-# @example
#
# # good
-#
# "result is #{something}"
# print something
# puts something
# warn something
#
-# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#27
+# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#23
class RuboCop::Cop::Lint::RedundantStringCoercion < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Interpolation
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#38
+ # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#34
def on_interpolation(begin_node); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#46
+ # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#42
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#36
+ # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#32
def to_s_without_args?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#58
+ # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#54
def register_offense(node, context); end
end
-# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#31
+# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#27
RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#32
+# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#28
RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#33
+# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#29
RuboCop::Cop::Lint::RedundantStringCoercion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for redundant `with_index`.
@@ -22685,38 +22870,35 @@ RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# if day.is? :tuesday && month == :jan
# # ...
# end
-# @example
#
# # good
-#
# if day.is?(:tuesday) && month == :jan
# # ...
# end
#
-# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#30
+# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#26
class RuboCop::Cop::Lint::RequireParentheses < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
- # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#35
+ # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#31
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#35
+ # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#31
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#58
+ # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#54
def check_predicate(predicate, node); end
- # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#48
+ # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#44
def check_ternary(ternary, node); end
end
-# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#33
+# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#29
RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String)
# Checks that a range literal is enclosed in parentheses when the end of the range is
@@ -22810,34 +22992,31 @@ RuboCop::Cop::Lint::RequireRelativeSelfPath::RESTRICT_ON_SEND = T.let(T.unsafe(n
# @example
#
# # bad
-#
# begin
# do_something
# rescue Exception
# handle_exception
# end
-# @example
#
# # good
-#
# begin
# do_something
# rescue ArgumentError
# handle_exception
# end
#
-# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#27
+# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#23
class RuboCop::Cop::Lint::RescueException < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#30
+ # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#26
def on_resbody(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#39
+ # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#35
def targets_exception?(rescue_arg_node); end
end
-# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#28
+# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#24
RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String)
# Check for arguments to `rescue` that will result in a `TypeError`
@@ -22915,7 +23094,6 @@ RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String)
# def foo=(bar)
# return 42
# end
-# @example
#
# # good
# def initialize
@@ -22928,18 +23106,18 @@ RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String)
# return
# end
#
-# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#34
+# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#32
class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#37
+ # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#35
def on_return(return_node); end
private
- # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#51
def non_void_context(return_node); end
end
-# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#35
+# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#33
RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String)
# The safe navigation operator returns nil if the receiver is
@@ -22951,28 +23129,25 @@ RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# x&.foo.bar
# x&.foo + bar
# x&.foo[bar]
-# @example
#
# # good
-#
# x&.foo&.bar
# x&.foo || bar
#
-# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#26
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#22
class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::NilMethods
extend ::RuboCop::Cop::AutoCorrector
extend ::RuboCop::Cop::TargetRubyVersion
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#37
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#33
def bad_method?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#44
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#40
def on_send(node); end
private
@@ -22981,85 +23156,131 @@ class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base
# @param send_node [RuboCop::AST::SendNode]
# @return [String]
#
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#62
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#67
def add_safe_navigation_operator(offense_range:, send_node:); end
# @param corrector [RuboCop::Cop::Corrector]
# @param offense_range [Parser::Source::Range]
# @param send_node [RuboCop::AST::SendNode]
#
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#81
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#86
def autocorrect(corrector, offense_range:, send_node:); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#90
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#95
def brackets?(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#94
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#99
def require_parentheses?(send_node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#57
+ def require_safe_navigation?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#33
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#29
RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#34
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#30
RuboCop::Cop::Lint::SafeNavigationChain::PLUS_MINUS_METHODS = T.let(T.unsafe(nil), Array)
-# Check to make sure that if safe navigation is used for a method
-# call in an `&&` or `||` condition that safe navigation is used for all
-# method calls on that same object.
+# Check to make sure that if safe navigation is used in an `&&` or `||` condition,
+# consistent and appropriate safe navigation, without excess or deficiency,
+# is used for all method calls on the same object.
#
# @example
# # bad
-# foo&.bar && foo.baz
+# foo&.bar && foo&.baz
#
-# # bad
-# foo.bar || foo&.baz
+# # good
+# foo&.bar && foo.baz
#
# # bad
-# foo&.bar && (foobar.baz || foo.baz)
+# foo.bar && foo&.baz
#
# # good
# foo.bar && foo.baz
#
+# # bad
+# foo&.bar || foo.baz
+#
# # good
# foo&.bar || foo&.baz
#
+# # bad
+# foo.bar || foo&.baz
+#
# # good
+# foo.bar || foo.baz
+#
+# # bad
# foo&.bar && (foobar.baz || foo&.baz)
#
-# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#29
+# # good
+# foo&.bar && (foobar.baz || foo.baz)
+#
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#41
class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::NilMethods
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#42
- def check(node); end
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#48
+ def on_and(node); end
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#36
- def on_csend(node); end
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#48
+ def on_or(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#61
- def autocorrect(corrector, node); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#96
+ def already_appropriate_call?(operand, dot_op); end
# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#67
- def location(node, unsafe_method_call); end
+ def collect_operands(node, operand_nodes); end
+
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#83
+ def find_consistent_parts(grouped_operands); end
+
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#122
+ def most_left_indices(grouped_operands); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#152
+ def nilable?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#136
+ def operand_in_and?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#144
+ def operand_in_or?(node); end
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#71
- def top_conditional_ancestor(node); end
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#113
+ def operand_nodes(operand, operand_nodes); end
- # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#82
- def unsafe_method_calls(method_calls, safe_nav_receiver); end
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#74
+ def receiver_name_as_key(method, fully_receivers); end
+
+ # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#102
+ def register_offense(operand, dot_operator); end
end
-# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#34
-RuboCop::Cop::Lint::SafeNavigationConsistency::MSG = T.let(T.unsafe(nil), String)
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#45
+RuboCop::Cop::Lint::SafeNavigationConsistency::USE_DOT_MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#46
+RuboCop::Cop::Lint::SafeNavigationConsistency::USE_SAFE_NAVIGATION_MSG = T.let(T.unsafe(nil), String)
# Checks to make sure safe navigation isn't used with `empty?` in
# a conditional.
@@ -23508,17 +23729,16 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String)
# because `Ractor` should not access outer variables.
# eg. following style is encouraged:
#
-# [source,ruby]
-# ----
-# worker_id, pipe = env
-# Ractor.new(worker_id, pipe) do |worker_id, pipe|
-# end
-# ----
+# [source,ruby]
+# ----
+# worker_id, pipe = env
+# Ractor.new(worker_id, pipe) do |worker_id, pipe|
+# end
+# ----
#
# @example
#
# # bad
-#
# def some_method
# foo = 1
#
@@ -23526,10 +23746,8 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String)
# do_something(foo)
# end
# end
-# @example
#
# # good
-#
# def some_method
# foo = 1
#
@@ -23538,37 +23756,37 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String)
# end
# end
#
-# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#45
+# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#41
class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#57
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#53
def before_declaring_variable(variable, variable_table); end
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#93
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#89
def find_conditional_node_from_ascendant(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#100
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#96
def node_or_its_ascendant_conditional?(node); end
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#49
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#45
def ractor_block?(param0 = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#69
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#65
def same_conditions_node_different_branch?(variable, outer_local_variable); end
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#83
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#79
def variable_node(variable); end
class << self
- # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#53
+ # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#49
def joining_forces; end
end
end
-# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#46
+# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#42
RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String)
# Checks unexpected overrides of the `Struct` built-in methods
@@ -23905,12 +24123,12 @@ class RuboCop::Cop::Lint::ToEnumArguments < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#83
+ # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#76
def argument_match?(send_arg, def_arg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#68
+ # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#61
def arguments_match?(arguments, def_node); end
end
@@ -24151,6 +24369,58 @@ end
# source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#44
RuboCop::Cop::Lint::UnderscorePrefixedVariableName::MSG = T.let(T.unsafe(nil), String)
+# Checks for Regexpes (both literals and via `Regexp.new` / `Regexp.compile`)
+# that contain unescaped `]` characters.
+#
+# It emulates the following Ruby warning:
+#
+# [source,ruby]
+# ----
+# $ ruby -e '/abc]123/'
+# -e:1: warning: regular expression has ']' without escape: /abc]123/
+# ----
+#
+# @example
+# # bad
+# /abc]123/
+# %r{abc]123}
+# Regexp.new('abc]123')
+# Regexp.compile('abc]123')
+#
+# # good
+# /abc\]123/
+# %r{abc\]123}
+# Regexp.new('abc\]123')
+# Regexp.compile('abc\]123')
+#
+# source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#30
+class RuboCop::Cop::Lint::UnescapedBracketInRegexp < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#45
+ def on_regexp(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#53
+ def on_send(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#37
+ def regexp_constructor(param0); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#66
+ def detect_offenses(node, expr); end
+
+ # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#81
+ def range_at_index(node, index, offset); end
+end
+
+# source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#33
+RuboCop::Cop::Lint::UnescapedBracketInRegexp::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#34
+RuboCop::Cop::Lint::UnescapedBracketInRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks for a block that is known to need more positional
# block arguments than are given (by default this is configured for
# `Enumerable` methods needing 2 arguments). Optional arguments are allowed,
@@ -24219,27 +24489,24 @@ RuboCop::Cop::Lint::UnexpectedBlockArity::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# 1.is_a?(Fixnum)
# 1.is_a?(Bignum)
-# @example
#
# # good
-#
# 1.is_a?(Integer)
#
-# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#20
+# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#16
class RuboCop::Cop::Lint::UnifiedInteger < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#26
+ # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#22
def fixnum_or_bignum_const(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#30
+ # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#26
def on_const(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#23
+# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#19
RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String)
# Looks for `reduce` or `inject` blocks where the value returned (implicitly or
@@ -24334,31 +24601,31 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#190
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#191
def acceptable_return?(return_val, element_name); end
# Exclude `begin` nodes inside a `dstr` from being collected by `return_values`
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#198
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#199
def allowed_type?(parent_node); end
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#158
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#159
def block_arg_name(node, index); end
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#141
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#142
def check_return_values(block_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#175
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#176
def potential_offense?(return_values, block_body, element_name, accumulator_name); end
# Return values in a block are either the value given to next,
# the last line of a multiline block, or the only line of the block
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#127
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#128
def return_values(block_body_node); end
# Look for an index of the accumulator being returned, except where the index
@@ -24366,7 +24633,7 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base
# This is always an offense, in order to try to catch potential exceptions
# due to type mismatches
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#166
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#167
def returned_accumulator_index(return_values, accumulator_name, element_name); end
# If the accumulator is used in any return value, the node is acceptable since
@@ -24374,7 +24641,7 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#182
+ # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#183
def returns_accumulator_anywhere?(return_values, accumulator_name); end
end
@@ -24391,14 +24658,12 @@ RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil)
# @example
#
# # bad
-#
# def some_method
# return
# do_something
# end
#
# # bad
-#
# def some_method
# if cond
# return
@@ -24407,40 +24672,38 @@ RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil)
# end
# do_something
# end
-# @example
#
# # good
-#
# def some_method
# do_something
# end
#
-# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#37
+# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#32
class RuboCop::Cop::Lint::UnreachableCode < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#55
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#50
def flow_command?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#40
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#35
def on_begin(node); end
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#40
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#35
def on_kwbegin(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#87
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#82
def check_case(node); end
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#81
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#76
def check_if(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#65
+ # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#60
def flow_expression?(node); end
end
-# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#38
+# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#33
RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String)
# Checks for loops that will have at most one iteration.
@@ -24857,33 +25120,46 @@ RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#48
RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-# Identifies places where `URI.regexp` is obsolete and should
-# not be used. Instead, use `URI::DEFAULT_PARSER.make_regexp`.
+# Identifies places where `URI.regexp` is obsolete and should not be used.
+#
+# For Ruby 3.3 or lower, use `URI::DEFAULT_PARSER.make_regexp`.
+# For Ruby 3.4 or higher, use `URI::RFC2396_PARSER.make_regexp`.
+#
+# NOTE: If you need to support both Ruby 3.3 and lower as well as Ruby 3.4 and higher,
+# consider manually changing the code as follows:
+#
+# [source,ruby]
+# ----
+# defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
+# ----
#
# @example
# # bad
# URI.regexp('http://example.com')
#
-# # good
+# # good - Ruby 3.3 or lower
# URI::DEFAULT_PARSER.make_regexp('http://example.com')
#
-# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#16
+# # good - Ruby 3.4 or higher
+# URI::RFC2396_PARSER.make_regexp('http://example.com')
+#
+# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#29
class RuboCop::Cop::Lint::UriRegexp < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#23
+ # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#40
def on_send(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#36
+ def uri_constant?(param0 = T.unsafe(nil)); end
end
-# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#19
+# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#32
RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#21
+# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#33
RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#20
-RuboCop::Cop::Lint::UriRegexp::URI_CONSTANTS = T.let(T.unsafe(nil), Array)
-
# Checks for redundant access modifiers, including those with no
# code, those which are repeated, and leading `public` modifiers in a
# class or module body. Conditionally-defined methods are considered as
@@ -25105,103 +25381,105 @@ RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String)
# reassignments and properly handles varied cases such as branch, loop,
# rescue, ensure, etc.
#
+# This cop's autocorrection avoids cases like `a ||= 1` because removing assignment from
+# operator assignment can cause NameError if this assignment has been used to declare
+# a local variable. For example, replacing `a ||= 1` with `a || 1` may cause
+# "undefined local variable or method `a' for main:Object (NameError)".
+#
# NOTE: Given the assignment `foo = 1, bar = 2`, removing unused variables
# can lead to a syntax error, so this case is not autocorrected.
#
# @example
#
# # bad
-#
# def some_method
# some_var = 1
# do_something
# end
-# @example
#
# # good
-#
# def some_method
# some_var = 1
# do_something(some_var)
# end
#
-# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#45
+# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#40
class RuboCop::Cop::Lint::UselessAssignment < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#56
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#51
def after_leaving_scope(scope, _variable_table); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#162
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#165
def autocorrect(corrector, assignment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#103
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#106
def chained_assignment?(node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#61
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#56
def check_for_unused_assignments(variable); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#146
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#149
def collect_variable_like_names(scope); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#79
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#82
def message_for_useless_assignment(assignment); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#107
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#110
def message_specification(assignment, variable); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#117
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#120
def multiple_assignment_message(variable_name); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#85
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#88
def offense_range(assignment); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#122
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#125
def operator_assignment_message(scope, assignment); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#179
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#182
def remove_exception_assignment_part(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#203
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#206
def remove_local_variable_assignment_part(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#192
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#195
def remove_trailing_character_from_operator(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#188
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#191
def rename_variable_with_underscore(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#196
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#199
def replace_named_capture_group_with_non_capturing_group(corrector, node, variable_name); end
# TODO: More precise handling (rescue, ensure, nested begin, etc.)
#
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#136
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#139
def return_value_node_of_scope(scope); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#93
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#96
def sequential_assignment?(node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#129
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#132
def similar_name_message(variable); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#155
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#158
def variable_like_method_invocation?(node); end
class << self
- # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#52
+ # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#47
def joining_forces; end
end
end
-# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#50
+# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#45
RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String)
# Checks for useless `else` in `begin..end` without `rescue`.
@@ -25211,16 +25489,13 @@ RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String)
# @example
#
# # bad
-#
# begin
# do_something
# else
# do_something_else # This will never be run.
# end
-# @example
#
# # good
-#
# begin
# do_something
# rescue
@@ -25229,13 +25504,13 @@ RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String)
# do_something_else
# end
#
-# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#31
+# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#27
class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base
- # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#34
+ # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#30
def on_new_investigation; end
end
-# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#32
+# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#28
RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String)
# Checks for useless method definitions, specifically: empty constructors
@@ -25297,6 +25572,62 @@ end
# source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#41
RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String)
+# Certain numeric operations have no impact, being:
+# Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1.
+# These are probably leftover from debugging, or are mistakes.
+#
+# @example
+#
+# # bad
+# x + 0
+# x - 0
+# x * 1
+# x / 1
+# x ** 1
+#
+# # good
+# x
+#
+# # bad
+# x += 0
+# x -= 0
+# x *= 1
+# x /= 1
+# x **= 1
+#
+# # good
+# x = x
+#
+# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#32
+class RuboCop::Cop::Lint::UselessNumericOperation < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#54
+ def on_op_asgn(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#43
+ def on_send(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#41
+ def useless_abbreviated_assignment?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#38
+ def useless_operation?(param0 = T.unsafe(nil)); end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#67
+ def useless?(operation, number); end
+end
+
+# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#34
+RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#35
+RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks for useless `rescue`s, which only reraise rescued exceptions.
#
# @example
@@ -25463,83 +25794,80 @@ RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil)
# @example
#
# # bad
-#
# def something
# x = Something.new
# x.attr = 5
# end
-# @example
#
# # good
-#
# def something
# x = Something.new
# x.attr = 5
# x
# end
#
-# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#35
+# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#31
class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#41
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#37
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#41
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#37
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#63
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#59
def setter_call_to_local_variable?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#67
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#63
def last_expression(body); end
end
-# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#39
+# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#35
RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#38
+# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#34
RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String)
# This class tracks variable assignments in a method body
# and if a variable contains object passed as argument at the end of
# the method.
#
-# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#76
+# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#72
class RuboCop::Cop::Lint::UselessSetterCall::MethodVariableTracker
# @return [MethodVariableTracker] a new instance of MethodVariableTracker
#
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#77
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#73
def initialize(body_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#163
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#159
def constructor?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#78
def contain_local_object?(variable_name); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#152
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#148
def process_assignment(asgn_node, rhs_node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#100
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#96
def process_assignment_node(node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#142
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#138
def process_binary_operator_assignment(op_asgn_node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#133
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#129
def process_logical_operator_assignment(asgn_node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#114
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#110
def process_multiple_assignment(masgn_node); end
- # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#92
+ # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#88
def scan(node, &block); end
end
@@ -25661,61 +25989,77 @@ class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/lint/void.rb#92
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#90
def on_begin(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#81
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#92
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#95
+ def on_ensure(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#90
def on_kwbegin(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#82
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#81
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/lint/void.rb#217
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#258
+ def all_keys_entirely_literal?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#262
+ def all_values_entirely_literal?(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#236
def autocorrect_nonmutating_send(corrector, node, suggestion); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#213
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#230
def autocorrect_void_expression(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#201
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#218
def autocorrect_void_op(corrector, node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#99
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#101
def check_begin(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#113
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#198
+ def check_ensure(node); end
+
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#115
def check_expression(expr); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#151
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#156
def check_literal(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#175
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#180
def check_nonmutating(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#159
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#164
def check_self(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#133
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#138
def check_var(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#167
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#172
def check_void_expression(node); end
- # source://rubocop//lib/rubocop/cop/lint/void.rb#123
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#127
def check_void_op(node, &block); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/void.rb#226
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#245
def entirely_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/lint/void.rb#193
+ # source://rubocop//lib/rubocop/cop/lint/void.rb#211
def in_void_context?(node); end
end
@@ -25731,13 +26075,13 @@ RuboCop::Cop::Lint::Void::EXPRESSION_MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/lint/void.rb#61
RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/void.rb#77
+# source://rubocop//lib/rubocop/cop/lint/void.rb#76
RuboCop::Cop::Lint::Void::METHODS_REPLACEABLE_BY_EACH = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/void.rb#79
+# source://rubocop//lib/rubocop/cop/lint/void.rb#78
RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/lint/void.rb#70
+# source://rubocop//lib/rubocop/cop/lint/void.rb#69
RuboCop::Cop::Lint::Void::NONMUTATING_METHODS_WITH_BANG_VERSION = T.let(T.unsafe(nil), Array)
# source://rubocop//lib/rubocop/cop/lint/void.rb#64
@@ -25758,9 +26102,6 @@ RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array)
# source://rubocop//lib/rubocop/cop/lint/void.rb#59
RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/lint/void.rb#69
-RuboCop::Cop::Lint::Void::VOID_CONTEXT_TYPES = T.let(T.unsafe(nil), Array)
-
# Common functionality for obtaining source ranges from regexp matches
#
# source://rubocop//lib/rubocop/cop/mixin/match_range.rb#6
@@ -26023,8 +26364,9 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String)
# The cop can be configured to ignore blocks passed to certain methods.
#
# You can set constructs you want to fold with `CountAsOne`.
-# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct
-# will be counted as one line regardless of its actual size.
+#
+# Available are: 'array', 'hash', 'heredoc', and 'method_call'.
+# Each construct will be counted as one line regardless of its actual size.
#
# NOTE: This cop does not apply for `Struct` definitions.
#
@@ -26032,7 +26374,7 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String)
# for backwards compatibility. Please use `AllowedMethods` and `AllowedPatterns`
# instead. By default, there are no methods to allowed.
#
-# @example CountAsOne: ['array', 'heredoc', 'method_call']
+# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
#
# something do
# array = [ # +1
@@ -26040,7 +26382,7 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String)
# 2
# ]
#
-# hash = { # +3
+# hash = { # +1
# key: 'value'
# }
#
@@ -26053,40 +26395,40 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String)
# 1,
# 2
# )
-# end # 6 points
+# end # 4 points
#
-# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#44
+# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#45
class RuboCop::Cop::Metrics::BlockLength < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CodeLength
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
- # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#51
+ # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#52
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#51
+ # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#52
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#80
+ # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#81
def cop_label; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#62
+ # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#63
def method_receiver_excluded?(node); end
end
-# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#49
+# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#50
RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String)
-# Checks for excessive nesting of conditional and looping
-# constructs.
+# Checks for excessive nesting of conditional and looping constructs.
#
-# You can configure if blocks are considered using the `CountBlocks`
-# option. When set to `false` (the default) blocks are not counted
-# towards the nesting level. Set to `true` to count blocks as well.
+# You can configure if blocks are considered using the `CountBlocks` and `CountModifierForms`
+# options. When both are set to `false` (the default) blocks and modifier forms are not
+# counted towards the nesting level. Set them to `true` to include these in the nesting level
+# calculation as well.
#
# The maximum level of nesting allowed is configurable.
#
@@ -26105,15 +26447,25 @@ class RuboCop::Cop::Metrics::BlockNesting < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#44
+ # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#52
def consider_node?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#54
+ # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#62
def count_blocks?; end
- # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#50
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#44
+ def count_if_block?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#66
+ def count_modifier_forms?; end
+
+ # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#58
def message(max); end
end
@@ -26125,12 +26477,13 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array
# The maximum allowed length is configurable.
#
# You can set constructs you want to fold with `CountAsOne`.
-# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct
-# will be counted as one line regardless of its actual size.
+#
+# Available are: 'array', 'hash', 'heredoc', and 'method_call'.
+# Each construct will be counted as one line regardless of its actual size.
#
# NOTE: This cop also applies for `Struct` definitions.
#
-# @example CountAsOne: ['array', 'heredoc', 'method_call']
+# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
#
# class Foo
# ARRAY = [ # +1
@@ -26138,7 +26491,7 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array
# 2
# ]
#
-# HASH = { # +3
+# HASH = { # +1
# key: 'value'
# }
#
@@ -26151,24 +26504,24 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array
# 1,
# 2
# )
-# end # 6 points
+# end # 4 points
#
-# source://rubocop//lib/rubocop/cop/metrics/class_length.rb#39
+# source://rubocop//lib/rubocop/cop/metrics/class_length.rb#40
class RuboCop::Cop::Metrics::ClassLength < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CodeLength
- # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#52
+ # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#53
def on_casgn(node); end
- # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#42
+ # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#43
def on_class(node); end
- # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#46
+ # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#47
def on_sclass(node); end
private
- # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#70
+ # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#71
def message(length, max_length); end
end
@@ -26253,23 +26606,26 @@ RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsaf
# and ||/or is shorthand for a sequence of ifs, so they also add one.
# Loops can be said to have an exit condition, so they add one.
# Blocks that are calls to builtin iteration methods
-# (e.g. `ary.map{...}) also add one, others are ignored.
+# (e.g. `ary.map{...}`) also add one, others are ignored.
+#
+# @example
#
# def each_child_node(*types) # count begins: 1
-# unless block_given? # unless: +1
-# return to_enum(__method__, *types)
+# unless block_given? # unless: +1
+# return to_enum(__method__, *types)
+# end
#
-# children.each do |child| # each{}: +1
-# next unless child.is_a?(Node) # unless: +1
+# children.each do |child| # each{}: +1
+# next unless child.is_a?(Node) # unless: +1
#
-# yield child if types.empty? || # if: +1, ||: +1
-# types.include?(child.type)
-# end
+# yield child if types.empty? || # if: +1, ||: +1
+# types.include?(child.type)
+# end
#
-# self
+# self
# end # total: 6
#
-# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#32
+# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#35
class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
@@ -26279,19 +26635,19 @@ class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#42
+ # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#45
def complexity_score_for(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#49
+ # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#52
def count_block?(block); end
end
-# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#37
+# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#40
RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#36
+# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#39
RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String)
# Checks if the length of a method exceeds some maximum value.
@@ -26299,15 +26655,16 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String)
# The maximum allowed length is configurable.
#
# You can set constructs you want to fold with `CountAsOne`.
-# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct
-# will be counted as one line regardless of its actual size.
+#
+# Available are: 'array', 'hash', 'heredoc', and 'method_call'.
+# Each construct will be counted as one line regardless of its actual size.
#
# NOTE: The `ExcludedMethods` and `IgnoredMethods` configuration is
# deprecated and only kept for backwards compatibility.
# Please use `AllowedMethods` and `AllowedPatterns` instead.
# By default, there are no methods to allowed.
#
-# @example CountAsOne: ['array', 'heredoc', 'method_call']
+# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
#
# def m
# array = [ # +1
@@ -26315,7 +26672,7 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String)
# 2
# ]
#
-# hash = { # +3
+# hash = { # +1
# key: 'value'
# }
#
@@ -26328,33 +26685,33 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String)
# 1,
# 2
# )
-# end # 6 points
+# end # 4 points
#
-# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#42
+# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#43
class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CodeLength
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
- # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#56
+ # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#57
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#49
+ # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#50
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#49
+ # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#50
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#56
+ # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#57
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#65
+ # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#66
def cop_label; end
end
-# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#47
+# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#48
RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String)
# Checks if the length of a module exceeds some maximum value.
@@ -26362,10 +26719,11 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String)
# The maximum allowed length is configurable.
#
# You can set constructs you want to fold with `CountAsOne`.
-# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct
-# will be counted as one line regardless of its actual size.
#
-# @example CountAsOne: ['array', 'heredoc', 'method_call']
+# Available are: 'array', 'hash', 'heredoc', and 'method_call'.
+# Each construct will be counted as one line regardless of its actual size.
+#
+# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
#
# module M
# ARRAY = [ # +1
@@ -26373,7 +26731,7 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String)
# 2
# ]
#
-# HASH = { # +3
+# HASH = { # +1
# key: 'value'
# }
#
@@ -26386,24 +26744,24 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String)
# 1,
# 2
# )
-# end # 6 points
+# end # 4 points
#
-# source://rubocop//lib/rubocop/cop/metrics/module_length.rb#37
+# source://rubocop//lib/rubocop/cop/metrics/module_length.rb#38
class RuboCop::Cop::Metrics::ModuleLength < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CodeLength
- # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#51
+ # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#52
def module_definition?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#44
+ # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#45
def on_casgn(node); end
- # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#40
+ # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#41
def on_module(node); end
private
- # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#55
+ # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#56
def message(length, max_length); end
end
@@ -27397,16 +27755,21 @@ class RuboCop::Cop::Naming::AccessorMethodName < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#61
+ # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#66
def bad_reader_name?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#65
+ # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#70
def bad_writer_name?(node); end
- # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#53
+ # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#54
def message(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#62
+ def proper_attribute_name?(node); end
end
# source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#39
@@ -28090,10 +28453,10 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#111
def add_offenses_for_token(token, word_locations); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#167
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#176
def add_to_flagged_term_hash(regex_string, term, term_definition); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#193
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#202
def array_to_ignorecase_regex(strings); end
# @return [Boolean]
@@ -28101,55 +28464,58 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#126
def check_token?(type); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#243
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#252
def create_message(word, message = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#217
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#226
def create_multiple_word_message_for_file(words); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#213
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#222
def create_single_word_message_for_file(word); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#189
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#198
def ensure_regex_string(regex); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#160
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#169
def extract_regexp(term, term_definition); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#251
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#260
def find_flagged_term(word); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#265
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#274
def format_suggestions(suggestions); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#197
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#206
def investigate_filepath; end
# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#100
def investigate_tokens; end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#231
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#240
def mask_input(str); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#280
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#289
def offense_range(token, word); end
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#160
+ def preferred_sole_term(suggestions); end
+
# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#130
def preprocess_check_config; end
# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#144
def preprocess_flagged_terms; end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#258
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#267
def preprocess_suggestions(suggestions); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#179
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#188
def process_allowed_regex(allowed); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#221
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#230
def scan_for_words(input); end
- # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#174
+ # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#183
def set_regexes(flagged_term_strings, allowed_strings); end
end
@@ -28496,94 +28862,109 @@ class RuboCop::Cop::Naming::MethodParameterName < ::RuboCop::Cop::Base
def on_defs(node); end
end
-# Checks that predicate methods names end with a question mark and
+# Checks that predicate method names end with a question mark and
# do not start with a forbidden prefix.
#
-# A method is determined to be a predicate method if its name starts
-# with one of the prefixes defined in the `NamePrefix` configuration.
-# You can change what prefixes are considered by changing this option.
-# Any method name that starts with one of these prefixes is required by
-# the cop to end with a `?`. Other methods can be allowed by adding to
-# the `AllowedMethods` configuration.
-#
-# NOTE: The `is_a?` method is allowed by default.
+# A method is determined to be a predicate method if its name starts with
+# one of the prefixes listed in the `NamePrefix` configuration. The list
+# defaults to `is_`, `has_`, and `have_` but may be overridden.
#
-# If `ForbiddenPrefixes` is set, methods that start with the configured
-# prefixes will not be allowed and will be removed by autocorrection.
+# Predicate methods must end with a question mark.
#
-# In other words, if `ForbiddenPrefixes` is empty, a method named `is_foo`
-# will register an offense only due to the lack of question mark (and will be
-# autocorrected to `is_foo?`). If `ForbiddenPrefixes` contains `is_`,
-# `is_foo` will register an offense both because the ? is missing and because of
-# the `is_` prefix, and will be corrected to `foo?`.
+# When `ForbiddenPrefixes` is also set (as it is by default), predicate
+# methods which begin with a forbidden prefix are not allowed, even if
+# they end with a `?`. These methods should be changed to remove the
+# prefix.
#
-# NOTE: `ForbiddenPrefixes` is only applied to prefixes in `NamePrefix`;
-# a prefix in the former but not the latter will not be considered by
-# this cop.
-#
-# @example
+# @example NamePrefix: ['is_', 'has_', 'have_'] (default)
# # bad
# def is_even(value)
# end
#
-# def is_even?(value)
-# end
-#
+# # When ForbiddenPrefixes: ['is_', 'has_', 'have_'] (default)
# # good
# def even?(value)
# end
#
+# # When ForbiddenPrefixes: []
+# # good
+# def is_even?(value)
+# end
+# @example NamePrefix: ['seems_to_be_']
# # bad
-# def has_value
+# def seems_to_be_even(value)
# end
#
-# def has_value?
+# # When ForbiddenPrefixes: ['seems_to_be_']
+# # good
+# def even?(value)
# end
#
+# # When ForbiddenPrefixes: []
# # good
-# def value?
+# def seems_to_be_even?(value)
# end
# @example AllowedMethods: ['is_a?'] (default)
+# # Despite starting with the `is_` prefix, this method is allowed
# # good
# def is_a?(value)
# end
+# @example AllowedMethods: ['is_even?']
+# # good
+# def is_even?(value)
+# end
+# @example MethodDefinitionMacros: ['define_method', 'define_singleton_method'] (default)
+# # bad
+# define_method(:is_even) { |value| }
+#
+# # good
+# define_method(:even?) { |value| }
+# @example MethodDefinitionMacros: ['def_node_matcher']
+# # bad
+# def_node_matcher(:is_even) { |value| }
+#
+# # good
+# def_node_matcher(:even?) { |value| }
#
-# source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#59
+# source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#75
class RuboCop::Cop::Naming::PredicateName < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#63
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#79
def dynamic_method_define(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#82
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#98
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#82
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#98
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#69
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#85
def on_send(node); end
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#112
+ def validate_config; end
+
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#98
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#124
def allowed_method_name?(method_name, prefix); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#106
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#132
def expected_name(method_name, prefix); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#120
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#146
def forbidden_prefixes; end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#116
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#142
def message(method_name, new_name); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#128
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#154
def method_definition_macros(macro_name); end
- # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#124
+ # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#150
def predicate_prefixes; end
end
@@ -28653,31 +29034,31 @@ class RuboCop::Cop::Naming::RescuedExceptionsVariableName < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#96
def autocorrect(corrector, node, range, offending_name, preferred_name); end
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#116
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#117
def correct_node(corrector, node, offending_name, preferred_name); end
# If the exception variable is reassigned, that assignment needs to be corrected.
# Further `lvar` nodes will not be corrected though since they now refer to a
# different variable.
#
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#134
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#143
def correct_reassignment(corrector, node, offending_name, preferred_name); end
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#159
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#168
def message(node); end
# source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#91
def offense_range(resbody); end
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#143
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#152
def preferred_name(variable_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#165
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#174
def shadowed_variable_name?(node); end
- # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#152
+ # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#161
def variable_name(node); end
# @return [Boolean]
@@ -28950,7 +29331,7 @@ class RuboCop::Cop::Offense
# @api private
# @return [Offense] a new instance of Offense
#
- # source://rubocop//lib/rubocop/cop/offense.rb#84
+ # source://rubocop//lib/rubocop/cop/offense.rb#83
def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end
# Returns `-1`, `0`, or `+1`
@@ -28959,105 +29340,104 @@ class RuboCop::Cop::Offense
# @api public
# @return [Integer] comparison result
#
- # source://rubocop//lib/rubocop/cop/offense.rb#230
+ # source://rubocop//lib/rubocop/cop/offense.rb#229
def <=>(other); end
# @api public
# @return [Boolean] returns `true` if two offenses contain same attributes
#
- # source://rubocop//lib/rubocop/cop/offense.rb#211
+ # source://rubocop//lib/rubocop/cop/offense.rb#210
def ==(other); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#160
+ # source://rubocop//lib/rubocop/cop/offense.rb#159
def column; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#170
+ # source://rubocop//lib/rubocop/cop/offense.rb#169
def column_length; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#194
+ # source://rubocop//lib/rubocop/cop/offense.rb#193
def column_range; end
# @api public
# @example
- # 'LineLength'
- # @return [String] a cop class name without department.
- # i.e. type of the violation.
+ # 'Layout/LineLength'
+ # @return [String] the cop name as a String for which this offense is for.
#
- # source://rubocop//lib/rubocop/cop/offense.rb#51
+ # source://rubocop//lib/rubocop/cop/offense.rb#50
def cop_name; end
# @api public
- # @return [Boolean] whether this offense can be automatically corrected via
- # autocorrect or a todo.
+ # @return [Boolean] whether this offense can be automatically corrected via autocorrect.
+ # This includes todo comments, for example when requested with `--disable-uncorrectable`.
#
- # source://rubocop//lib/rubocop/cop/offense.rb#102
+ # source://rubocop//lib/rubocop/cop/offense.rb#101
def correctable?; end
# @api public
# @return [Boolean] whether this offense is automatically corrected via
# autocorrect or a todo.
#
- # source://rubocop//lib/rubocop/cop/offense.rb#113
+ # source://rubocop//lib/rubocop/cop/offense.rb#112
def corrected?; end
# @api public
# @return [Boolean] whether this offense is automatically disabled via a todo.
#
- # source://rubocop//lib/rubocop/cop/offense.rb#123
+ # source://rubocop//lib/rubocop/cop/offense.rb#122
def corrected_with_todo?; end
# @api public
# @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available
#
- # source://rubocop//lib/rubocop/cop/offense.rb#62
+ # source://rubocop//lib/rubocop/cop/offense.rb#61
def corrector; end
# @api public
# @return [Boolean] whether this offense was locally disabled with a
# disable or todo where it occurred.
#
- # source://rubocop//lib/rubocop/cop/offense.rb#134
+ # source://rubocop//lib/rubocop/cop/offense.rb#133
def disabled?; end
# @api public
# @return [Boolean] returns `true` if two offenses contain same attributes
#
- # source://rubocop//lib/rubocop/cop/offense.rb#211
+ # source://rubocop//lib/rubocop/cop/offense.rb#210
def eql?(other); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#179
+ # source://rubocop//lib/rubocop/cop/offense.rb#178
def first_line; end
- # source://rubocop//lib/rubocop/cop/offense.rb#219
+ # source://rubocop//lib/rubocop/cop/offense.rb#218
def hash; end
# @api public
# @return [Parser::Source::Range] the range of the code that is highlighted
#
- # source://rubocop//lib/rubocop/cop/offense.rb#142
+ # source://rubocop//lib/rubocop/cop/offense.rb#141
def highlighted_area; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#189
+ # source://rubocop//lib/rubocop/cop/offense.rb#188
def last_column; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#184
+ # source://rubocop//lib/rubocop/cop/offense.rb#183
def last_line; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#155
+ # source://rubocop//lib/rubocop/cop/offense.rb#154
def line; end
# @api public
@@ -29081,7 +29461,7 @@ class RuboCop::Cop::Offense
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#203
+ # source://rubocop//lib/rubocop/cop/offense.rb#202
def real_column; end
# @api public
@@ -29092,19 +29472,19 @@ class RuboCop::Cop::Offense
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#165
+ # source://rubocop//lib/rubocop/cop/offense.rb#164
def source_line; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#54
+ # source://rubocop//lib/rubocop/cop/offense.rb#53
def status; end
# This is just for debugging purpose.
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/offense.rb#148
+ # source://rubocop//lib/rubocop/cop/offense.rb#147
def to_s; end
end
@@ -29113,10 +29493,10 @@ end
# source://rubocop//lib/rubocop/cop/offense.rb#10
RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/offense.rb#81
+# source://rubocop//lib/rubocop/cop/offense.rb#80
RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange)
-# source://rubocop//lib/rubocop/cop/offense.rb#64
+# source://rubocop//lib/rubocop/cop/offense.rb#63
class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# Returns the value of attribute begin_pos
#
@@ -29140,7 +29520,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# @return [Object] the newly set value
def column=(_); end
- # source://rubocop//lib/rubocop/cop/offense.rb#70
+ # source://rubocop//lib/rubocop/cop/offense.rb#69
def column_range; end
# Returns the value of attribute end_pos
@@ -29169,7 +29549,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# @return [Object] the current value of line
def last_line; end
- # source://rubocop//lib/rubocop/cop/offense.rb#74
+ # source://rubocop//lib/rubocop/cop/offense.rb#73
def length; end
# Returns the value of attribute line
@@ -29183,7 +29563,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct
# @return [Object] the newly set value
def line=(_); end
- # source://rubocop//lib/rubocop/cop/offense.rb#74
+ # source://rubocop//lib/rubocop/cop/offense.rb#73
def size; end
# Returns the value of attribute source_line
@@ -29486,7 +29866,7 @@ class RuboCop::Cop::PercentLiteralCorrector
# source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#34
def delimiters_for(type); end
- # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#100
+ # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#110
def end_content(source); end
# @return [Boolean]
@@ -30496,64 +30876,63 @@ end
module RuboCop::Cop::StatementModifier
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::LineLengthHelp
- include ::RuboCop::Cop::RangeHelp
private
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#79
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#80
def code_after(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#103
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#104
def comment_disables_cop?(comment); end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#71
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#72
def first_line_comment(node); end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#58
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#57
def if_body_source(if_body); end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#44
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#43
def length_in_modifier_form(node); end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#97
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#98
def max_line_length; end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#67
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#66
def method_source(if_body); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#38
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#37
def modifier_fits_on_single_line?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#27
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#26
def non_eligible_body?(body); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#34
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#33
def non_eligible_condition?(condition); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#20
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#19
def non_eligible_node?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#85
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#86
def parenthesize?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#12
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#11
def single_line_as_modifier?(node); end
- # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#51
+ # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#50
def to_modifier_form(node); end
end
@@ -30597,6 +30976,17 @@ end
module RuboCop::Cop::StringLiteralsHelp
private
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#24
+ def enforce_double_quotes?; end
+
+ # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#20
+ def preferred_string_literal; end
+
+ # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#28
+ def string_literals_config; end
+
# @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#9
@@ -30611,6 +31001,17 @@ module RuboCop::Cop::Style; end
# EnforcedStyle config covers only method definitions.
# Applications of visibility methods to symbols can be controlled
# using AllowModifiersOnSymbols config.
+# Also, the visibility of `attr*` methods can be controlled using
+# AllowModifiersOnAttrs config.
+#
+# In Ruby 3.0, `attr*` methods now return an array of defined method names
+# as symbols. So we can write the modifier and `attr*` in inline style.
+# AllowModifiersOnAttrs config allows `attr*` methods to be written in
+# inline style without modifying applications that have been maintained
+# for a long time in group style. Furthermore, developers who are not very
+# familiar with Ruby may know that the modifier applies to `def`, but they
+# may not know that it also applies to `attr*` methods. It would be easier
+# to understand if we could write `attr*` methods in inline style.
#
# @example EnforcedStyle: group (default)
# # bad
@@ -30653,6 +31054,8 @@ module RuboCop::Cop::Style; end
# class Foo
#
# private :bar, :baz
+# private *%i[qux quux]
+# private *METHOD_NAMES
#
# end
# @example AllowModifiersOnSymbols: false
@@ -30660,96 +31063,137 @@ module RuboCop::Cop::Style; end
# class Foo
#
# private :bar, :baz
+# private *%i[qux quux]
+# private *METHOD_NAMES
#
# end
+# @example AllowModifiersOnAttrs: true (default)
+# # good
+# class Foo
+#
+# public attr_reader :bar
+# protected attr_writer :baz
+# private attr_accessor :qux
+# private attr :quux
#
-# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#70
+# def public_method; end
+#
+# private
+#
+# def private_method; end
+#
+# end
+# @example AllowModifiersOnAttrs: false
+# # bad
+# class Foo
+#
+# public attr_reader :bar
+# protected attr_writer :baz
+# private attr_accessor :qux
+# private attr :quux
+#
+# end
+#
+# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#113
class RuboCop::Cop::Style::AccessModifierDeclarations < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#91
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#141
+ def access_modifier_with_attr?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#134
def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#95
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#146
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#145
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#205
def access_modifier_is_inlined?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#149
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#209
def access_modifier_is_not_inlined?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#127
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#187
+ def allow_modifiers_on_attrs?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#183
def allow_modifiers_on_symbols?(node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#112
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#164
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#219
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#279
def def_source(node, def_node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#180
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#240
def find_argument_less_modifier_node(node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#169
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#229
def find_corresponding_def_node(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#137
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#197
def group_style?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#141
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#201
def inline_style?; end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#211
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#271
def insert_inline_modifier(corrector, node, modifier_name); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#159
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#219
def message(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#131
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#191
def offense?(node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#215
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#179
+ def percent_symbol_array?(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#275
def remove_node(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#194
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#254
def replace_def(corrector, node, def_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#153
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#213
def right_siblings_same_inline_method?(node); end
- # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#188
+ # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#248
def select_grouped_def_nodes(node); end
end
-# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#88
+# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#131
RuboCop::Cop::Style::AccessModifierDeclarations::ALLOWED_NODE_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#76
+# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#119
RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#81
+# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#124
RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#86
+# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#129
RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for grouping of accessors in `class` and `module` bodies.
@@ -30759,6 +31203,9 @@ RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsa
# NOTE: If there is a method call before the accessor method it is always allowed
# as it might be intended like Sorbet.
#
+# NOTE: If there is a RBS::Inline annotation comment just after the accessor method
+# it is always allowed.
+#
# @example EnforcedStyle: grouped (default)
# # bad
# class Foo
@@ -30795,73 +31242,73 @@ RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsa
# attr_reader :baz
# end
#
-# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#50
+# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#53
class RuboCop::Cop::Style::AccessorGrouping < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::VisibilityHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#59
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62
def on_class(node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#59
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62
def on_module(node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#59
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62
def on_sclass(node); end
private
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#82
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#85
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#71
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#74
def check(send_node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#114
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#122
def class_send_elements(class_node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#157
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#165
def group_accessors(node, accessors); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#96
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#99
def groupable_accessor?(node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#134
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#142
def groupable_sibling_accessors(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#126
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#134
def grouped_style?; end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#143
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#151
def message(send_node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#148
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#156
def preferred_accessors(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#91
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#94
def previous_line_comment?(node); end
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#163
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#171
def separate_accessors(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#130
+ # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#138
def separated_style?; end
end
-# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#56
+# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#59
RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#57
+# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#60
RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String)
# Enforces the use of either `#alias` or `#alias_method`
@@ -30957,6 +31404,57 @@ RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/alias.rb#39
RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+# Looks for endless methods inside operations of lower precedence (`and`, `or`, and
+# modifier forms of `if`, `unless`, `while`, `until`) that are ambiguous due to
+# lack of parentheses. This may lead to unexpected behavior as the code may appear
+# to use these keywords as part of the method but in fact they modify
+# the method definition itself.
+#
+# In these cases, using a normal method definition is more clear.
+#
+# @example
+#
+# # bad
+# def foo = true if bar
+#
+# # good - using a non-endless method is more explicit
+# def foo
+# true
+# end if bar
+#
+# # ok - method body is explicit
+# def foo = (true if bar)
+#
+# # ok - method definition is explicit
+# (def foo = true) if bar
+#
+# source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#29
+class RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::EndlessMethodRewriter
+ include ::RuboCop::Cop::RangeHelp
+ extend ::RuboCop::Cop::TargetRubyVersion
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#40
+ def ambiguous_endless_method_body(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#48
+ def on_def(node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#69
+ def keyword(operation); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#63
+ def modifier_form?(operation); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#37
+RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String)
+
# Checks for uses of `and` and `or`, and suggests using `&&` and
# `||` instead. It can be configured to check only in conditions or in
# all contexts.
@@ -31086,6 +31584,8 @@ RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String)
#
# Names not on this list are likely to be meaningful and are allowed by default.
#
+# This cop handles not only method forwarding but also forwarding to `super`.
+#
# @example RedundantBlockArgumentNames: ['blk', 'block', 'proc'] (default)
# # bad - But it is good with `EnforcedStyle: explicit` set for `Naming/BlockForwarding`.
# def foo(&block)
@@ -31173,222 +31673,245 @@ RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String)
# bar(...)
# end
#
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#125
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#127
class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
extend ::RuboCop::Cop::TargetRubyVersion
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#144
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#146
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#144
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#146
def on_defs(node); end
private
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#185
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#188
def add_forward_all_offenses(node, send_classifications, forwardable_args); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#351
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#366
def add_parens_if_missing(node, corrector); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#212
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#215
def add_post_ruby_32_offenses(def_node, send_classifications, forwardable_args); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#343
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#352
def allow_only_rest_arguments?; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#335
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#340
def arguments_range(node, first_node); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#263
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#267
def classification_and_forwards(def_node, send_node, referenced_lvars, forwardable_args); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#248
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#252
def classify_send_nodes(def_node, send_nodes, referenced_lvars, forwardable_args); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#495
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#542
def explicit_block_name?; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#168
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#170
def extract_forwardable_args(args); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#238
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#242
def non_splat_or_block_pass_lvar_references(body); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#180
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#182
def only_forwards_all?(send_classifications); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#292
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#296
def outside_block?(node); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#172
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#174
def redundant_forwardable_named_args(restarg, kwrestarg, blockarg); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#282
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#286
def redundant_named_arg(arg, config_name, keyword); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#325
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#329
def register_forward_all_offense(def_or_send, send_or_arguments, rest_or_splat); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#298
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#302
def register_forward_args_offense(def_arguments_or_send, rest_arg_or_splat); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#314
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#318
def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#306
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#310
def register_forward_kwargs_offense(add_parens, def_arguments_or_send, kwrest_arg_or_splat); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#347
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#360
+ def send_inside_block?(send_classifications); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#356
def use_anonymous_forwarding?; end
class << self
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#140
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#142
def autocorrect_incompatible_with; end
end
end
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#133
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#135
RuboCop::Cop::Style::ArgumentsForwarding::ADDITIONAL_ARG_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#136
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#138
RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#138
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#140
RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#132
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#134
RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#135
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#137
RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#137
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#139
RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), String)
# Classifies send nodes for possible rest/kwrest/all (including block) forwarding.
#
-# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#358
+# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#374
class RuboCop::Cop::Style::ArgumentsForwarding::SendNodeClassifier
extend ::RuboCop::AST::NodePattern::Macros
# @return [SendNodeClassifier] a new instance of SendNodeClassifier
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#370
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#403
def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#398
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#431
def classification; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#365
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#387
+ def def_all_anonymous_args?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#381
def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#392
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#425
def forwarded_block_arg; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#368
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#384
def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#386
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#419
def forwarded_kwrest_arg; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#380
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#413
def forwarded_rest_arg; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#362
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#378
def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#396
+ def send_all_anonymous_args?(param0 = T.unsafe(nil)); end
+
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#466
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#513
def additional_kwargs?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#462
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#509
def additional_kwargs_or_forwarded_kwargs?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#476
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#523
def allow_offense_for_no_block?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#447
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#494
def any_arg_referenced?; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#431
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#478
def arguments; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#410
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#446
def can_forward_all?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#470
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#517
def forward_additional_kwargs?; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#427
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#474
def forwarded_rest_and_kwrest_args; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#489
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#536
def missing_rest_arg_or_kwrest_arg?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#480
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#527
def no_additional_args?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#455
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#502
def no_post_splat_args?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#423
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#470
def offensive_block_forwarding?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#443
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#490
def referenced_block_arg?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#439
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#486
def referenced_kwrest_arg?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#435
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#482
def referenced_rest_arg?; end
+ # def foo(a = 41, ...) is a syntax error in 3.0.
+ #
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#419
- def ruby_32_missing_rest_or_kwest?; end
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#458
+ def ruby_30_or_lower_optarg?; end
- # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#451
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#462
+ def ruby_32_only_anonymous_forwarding?; end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#466
+ def ruby_32_or_higher_missing_rest_or_kwest?; end
+
+ # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#498
def target_ruby_version; end
end
@@ -31925,6 +32448,60 @@ class RuboCop::Cop::Style::BisectedAttrAccessor::Macro
end
end
+# Prefer bitwise predicate methods over direct comparison operations.
+#
+# @example
+#
+# # bad - checks any set bits
+# (variable & flags).positive?
+#
+# # good
+# variable.anybits?(flags)
+#
+# # bad - checks all set bits
+# (variable & flags) == flags
+#
+# # good
+# variable.allbits?(flags)
+#
+# # bad - checks no set bits
+# (variable & flags).zero?
+#
+# # good
+# variable.nobits?(flags)
+#
+# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#32
+class RuboCop::Cop::Style::BitwisePredicate < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+ extend ::RuboCop::Cop::TargetRubyVersion
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#52
+ def allbits?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#42
+ def anybits?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#68
+ def bit_operation?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#60
+ def nobits?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#73
+ def on_send(node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#88
+ def preferred_method(node); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#36
+RuboCop::Cop::Style::BitwisePredicate::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#37
+RuboCop::Cop::Style::BitwisePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Looks for uses of block comments (=begin...=end).
#
# @example
@@ -32126,165 +32703,178 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#194
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#198
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#194
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#198
def on_numblock(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#179
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#183
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#459
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#487
def array_or_range?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#208
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#212
def autocorrect(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#463
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#491
def begin_required?(block_node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#236
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#240
def braces_for_chaining_message(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#400
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#428
def braces_for_chaining_style?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#248
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#252
def braces_required_message(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#377
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#405
def braces_required_method?(method_name); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#381
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#409
def braces_required_methods; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#410
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#438
def braces_style?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#455
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#483
def conditional?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#414
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#442
def correction_would_break_code?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#309
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#328
def end_of_chain(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#424
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#452
def functional_block?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#420
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#448
def functional_method?(method_name); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#326
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#345
def get_blocks(node, &block); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#385
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#413
def line_count_based_block_style?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#218
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#222
def line_count_based_message(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#252
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#256
def message(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#300
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#304
def move_comment_before_block(corrector, comment, block_node, closing_brace); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#432
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#460
def procedural_method?(method_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#428
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#456
def procedural_oneliners_may_have_braces?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#344
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#364
def proper_block_style?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#316
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#335
def remove_trailing_whitespace(corrector, range, comment); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#263
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#267
def replace_braces_with_do_end(corrector, loc); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#279
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#283
def replace_do_end_with_braces(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#356
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#377
def require_braces?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#448
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#385
+ def require_do_end?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#476
def return_value_of_scope?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#436
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#464
def return_value_used?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#389
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#417
def semantic_block_style?(node); end
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#226
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#230
def semantic_message(node); end
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#318
+ def source_range_before_comment(range, comment); end
+
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#364
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#392
def special_method?(method_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#370
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#398
def special_method_proper_block_style?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#296
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#300
def whitespace_after?(range, length = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#292
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#296
def whitespace_before?(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#322
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#341
def with_block?(node); end
+
+ class << self
+ # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#179
+ def autocorrect_incompatible_with; end
+ end
end
# source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#175
@@ -32988,6 +33578,7 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# array.reject(&:nil?)
# array.reject { |e| e.nil? }
# array.select { |e| !e.nil? }
+# array.filter { |e| !e.nil? }
# array.grep_v(nil)
# array.grep_v(NilClass)
#
@@ -32996,10 +33587,9 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
#
# # bad
# hash.reject!(&:nil?)
-# array.delete_if(&:nil?)
# hash.reject! { |k, v| v.nil? }
-# array.delete_if { |e| e.nil? }
# hash.select! { |k, v| !v.nil? }
+# hash.filter! { |k, v| !v.nil? }
#
# # good
# hash.compact!
@@ -33014,22 +33604,22 @@ class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
extend ::RuboCop::Cop::TargetRubyVersion
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#85
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#86
def grep_v_with_nil?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#89
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#90
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#89
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#90
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#64
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#65
def reject_method?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#57
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#58
def reject_method_with_block_pass?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#74
+ # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#75
def select_method?(param0 = T.unsafe(nil)); end
private
@@ -33049,6 +33639,9 @@ class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base
def to_enum_method?(node); end
end
+# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#53
+RuboCop::Cop::Style::CollectionCompact::FILTER_METHODS = T.let(T.unsafe(nil), Array)
+
# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#50
RuboCop::Cop::Style::CollectionCompact::MSG = T.let(T.unsafe(nil), String)
@@ -33187,10 +33780,73 @@ end
# source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#25
RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String)
+# Checks for multiple `defined?` calls joined by `&&` that can be combined
+# into a single `defined?`.
+#
+# When checking that a nested constant or chained method is defined, it is
+# not necessary to check each ancestor or component of the chain.
+#
+# @example
+# # bad
+# defined?(Foo) && defined?(Foo::Bar) && defined?(Foo::Bar::Baz)
+#
+# # good
+# defined?(Foo::Bar::Baz)
+#
+# # bad
+# defined?(foo) && defined?(foo.bar) && defined?(foo.bar.baz)
+#
+# # good
+# defined?(foo.bar.baz)
+#
+# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#24
+class RuboCop::Cop::Style::CombinableDefined < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::RangeHelp
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#31
+ def on_and(node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#55
+ def defined_calls(nodes); end
+
+ # If the redundant `defined?` node is the LHS of an `and` node,
+ # the term as well as the subsequent `&&`/`and` operator will be removed.
+ #
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#85
+ def lhs_range_to_remove(term); end
+
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#62
+ def namespaces(nodes); end
+
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#72
+ def remove_term(corrector, term); end
+
+ # If the redundant `defined?` node is the RHS of an `and` node,
+ # the term as well as the preceding `&&`/`and` operator will be removed.
+ #
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#100
+ def rhs_range_to_remove(term); end
+
+ # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#49
+ def terms(node); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#28
+RuboCop::Cop::Style::CombinableDefined::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#29
+RuboCop::Cop::Style::CombinableDefined::OPERATORS = T.let(T.unsafe(nil), Array)
+
# Checks for places where multiple consecutive loops over the same data
# can be combined into a single loop. It is very likely that combining them
# will make the code more efficient and more concise.
#
+# NOTE: Autocorrection is not applied when the block variable names differ in separate loops,
+# as it is impossible to determine which variable name should be prioritized.
+#
# @example
# # bad
# def method
@@ -33236,44 +33892,44 @@ RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String)
# each_slice(3) { |slice| do_something(slice) }
# end
#
-# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#59
+# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#62
class RuboCop::Cop::Style::CombinableLoops < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#64
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#77
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#84
def on_for(node); end
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#64
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68
def on_numblock(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#88
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#95
def collection_looping_method?(node); end
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#105
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#112
def combine_with_left_sibling(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#112
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#119
def correct_end_of_block(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#93
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#100
def same_collection_looping_block?(node, sibling); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#101
+ # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#108
def same_collection_looping_for?(node, sibling); end
end
-# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#62
+# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#65
RuboCop::Cop::Style::CombinableLoops::MSG = T.let(T.unsafe(nil), String)
# Enforces using `` or %x around command literals.
@@ -33522,7 +34178,7 @@ RuboCop::Cop::Style::CommentAnnotation::MSG_SPACE_STYLE = T.let(T.unsafe(nil), S
# These keywords are: `class`, `module`, `def`, `begin`, `end`.
#
# Note that some comments
-# are allowed.
+# and RBS::Inline annotation comments are allowed.
#
# Autocorrection removes comments from `end` keyword and keeps comments
# for `class`, `module`, `def` and `begin` above the keyword.
@@ -33566,10 +34222,15 @@ class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#83
def offensive?(comment); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#95
+ def rbs_inline_annotation?(line, comment); end
+
# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#70
def register_offense(comment, matched_keyword); end
- # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#89
+ # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#91
def source_line(comment); end
end
@@ -34164,10 +34825,10 @@ class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/copyright.rb#83
+ # source://rubocop//lib/rubocop/cop/style/copyright.rb#86
def encoding_token?(processed_source, token_index); end
- # source://rubocop//lib/rubocop/cop/style/copyright.rb#69
+ # source://rubocop//lib/rubocop/cop/style/copyright.rb#72
def insert_notice_before(processed_source); end
# source://rubocop//lib/rubocop/cop/style/copyright.rb#52
@@ -34175,12 +34836,12 @@ class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/copyright.rb#90
+ # source://rubocop//lib/rubocop/cop/style/copyright.rb#93
def notice_found?(processed_source); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/copyright.rb#76
+ # source://rubocop//lib/rubocop/cop/style/copyright.rb#79
def shebang_token?(processed_source, token_index); end
# @raise [Warning]
@@ -34333,7 +34994,6 @@ RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String)
#
# # good (without parentheses it's a syntax error)
# def foo() do_something end
-# @example
#
# # bad
# def Baz.foo()
@@ -34345,18 +35005,18 @@ RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String)
# do_something
# end
#
-# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#42
+# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#40
class RuboCop::Cop::Style::DefWithParentheses < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#47
+ # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#45
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#47
+ # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#45
def on_defs(node); end
end
-# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#45
+# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#43
RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String)
# Checks for places where the `#\_\_dir\_\_` method can replace more
@@ -34848,34 +35508,52 @@ RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String)
# def do_something
# end
# end
+# @example AllowedMethods: ['method_missing', 'respond_to_missing?']
+#
+# # good
+# class Foo
+# def method_missing(name, *args)
+# end
#
-# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#98
+# def respond_to_missing?(symbol, include_private)
+# end
+# end
+#
+# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#109
class RuboCop::Cop::Style::DocumentationMethod < ::RuboCop::Cop::Base
include ::RuboCop::Cop::DocumentationComment
include ::RuboCop::Cop::VisibilityHelp
include ::RuboCop::Cop::DefNode
- # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#105
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#116
def modifier_node?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#109
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#120
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#109
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#120
def on_defs(node); end
private
- # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#119
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#146
+ def allowed_methods; end
+
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#130
def check(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#126
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#142
+ def method_allowed?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#138
def require_for_non_public_methods?; end
end
-# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#102
+# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#113
RuboCop::Cop::Style::DocumentationMethod::MSG = T.let(T.unsafe(nil), String)
# Detects double disable comments on one line. This is mostly to catch
@@ -35015,38 +35693,38 @@ RuboCop::Cop::Style::DoubleNegation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
#
# # good
# 5.times { }
-# @example
+#
# # bad
# (0...10).each {}
#
# # good
# 10.times {}
#
-# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#25
+# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#24
class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#53
+ # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#52
def each_range(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#65
+ # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#64
def each_range_with_zero_origin?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#77
+ # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#76
def each_range_without_block_argument?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#30
+ # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#29
def on_block(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#46
+ # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#45
def offending?(node); end
end
-# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#28
+# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#27
RuboCop::Cop::Style::EachForSimpleLoop::MSG = T.let(T.unsafe(nil), String)
# Looks for inject / reduce calls where the passed in object is
@@ -35363,10 +36041,10 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/empty_else.rb#193
+ # source://rubocop//lib/rubocop/cop/style/empty_else.rb#194
def autocorrect_forbidden?(type); end
- # source://rubocop//lib/rubocop/cop/style/empty_else.rb#186
+ # source://rubocop//lib/rubocop/cop/style/empty_else.rb#187
def base_node(node); end
# source://rubocop//lib/rubocop/cop/style/empty_else.rb#145
@@ -35375,7 +36053,7 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base
# @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/style/empty_else.rb#180
- def comment_in_else?(loc); end
+ def comment_in_else?(node); end
# source://rubocop//lib/rubocop/cop/style/empty_else.rb#160
def empty_check(node); end
@@ -35385,7 +36063,7 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/empty_else.rb#156
def empty_style?; end
- # source://rubocop//lib/rubocop/cop/style/empty_else.rb#197
+ # source://rubocop//lib/rubocop/cop/style/empty_else.rb#198
def missing_else_style; end
# source://rubocop//lib/rubocop/cop/style/empty_else.rb#166
@@ -35434,26 +36112,14 @@ RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::EmptyHeredoc < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Heredoc
include ::RuboCop::Cop::RangeHelp
+ include ::RuboCop::Cop::StringLiteralsHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#43
+ # source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#44
def on_heredoc(node); end
-
- private
-
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#63
- def enforce_double_quotes?; end
-
- # source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#59
- def preferred_string_literal; end
-
- # source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#67
- def string_literals_config; end
end
-# source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#41
+# source://rubocop//lib/rubocop/cop/style/empty_heredoc.rb#42
RuboCop::Cop::Style::EmptyHeredoc::MSG = T.let(T.unsafe(nil), String)
# Checks for parentheses for empty lambda parameters. Parentheses
@@ -35494,7 +36160,9 @@ RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String)
# @example
# # bad
# a = Array.new
+# a = Array[]
# h = Hash.new
+# h = Hash[]
# s = String.new
#
# # good
@@ -35502,83 +36170,79 @@ RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String)
# h = {}
# s = ''
#
-# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#19
+# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#21
class RuboCop::Cop::Style::EmptyLiteral < ::RuboCop::Cop::Base
include ::RuboCop::Cop::FrozenStringLiteral
include ::RuboCop::Cop::RangeHelp
+ include ::RuboCop::Cop::StringLiteralsHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#31
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#34
def array_node(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#40
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#43
def array_with_block(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#34
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#54
+ def array_with_index(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#37
def hash_node(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#43
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#46
def hash_with_block(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#50
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#62
+ def hash_with_index(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#69
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#37
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#40
def str_node(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#111
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#118
def correction(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#74
- def enforce_double_quotes?; end
-
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#82
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#89
def first_argument_unparenthesized?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#129
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#136
def frozen_strings?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#102
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#109
def offense_array_node?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#106
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#113
def offense_hash_node?(node); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#60
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#79
def offense_message(node); end
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#70
- def preferred_string_literal; end
-
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#89
+ # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#96
def replacement_range(node); end
-
- # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#78
- def string_literals_config; end
end
-# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#24
+# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#27
RuboCop::Cop::Style::EmptyLiteral::ARR_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#25
+# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#28
RuboCop::Cop::Style::EmptyLiteral::HASH_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#28
+# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#31
RuboCop::Cop::Style::EmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#26
+# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#29
RuboCop::Cop::Style::EmptyLiteral::STR_MSG = T.let(T.unsafe(nil), String)
# Checks for the formatting of empty method definitions.
@@ -35782,34 +36446,29 @@ RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/endless_method.rb#49
class RuboCop::Cop::Style::EndlessMethod < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
+ include ::RuboCop::Cop::EndlessMethodRewriter
extend ::RuboCop::Cop::TargetRubyVersion
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/endless_method.rb#60
+ # source://rubocop//lib/rubocop/cop/style/endless_method.rb#61
def on_def(node); end
private
- # source://rubocop//lib/rubocop/cop/style/endless_method.rb#95
- def arguments(node, missing = T.unsafe(nil)); end
-
- # source://rubocop//lib/rubocop/cop/style/endless_method.rb#85
- def correct_to_multiline(corrector, node); end
-
- # source://rubocop//lib/rubocop/cop/style/endless_method.rb#70
+ # source://rubocop//lib/rubocop/cop/style/endless_method.rb#71
def handle_allow_style(node); end
- # source://rubocop//lib/rubocop/cop/style/endless_method.rb#79
+ # source://rubocop//lib/rubocop/cop/style/endless_method.rb#80
def handle_disallow_style(node); end
end
-# source://rubocop//lib/rubocop/cop/style/endless_method.rb#56
+# source://rubocop//lib/rubocop/cop/style/endless_method.rb#57
RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/endless_method.rb#57
+# source://rubocop//lib/rubocop/cop/style/endless_method.rb#58
RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/endless_method.rb#58
+# source://rubocop//lib/rubocop/cop/style/endless_method.rb#59
RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String)
# Checks for consistent usage of `ENV['HOME']`. If `nil` is used as
@@ -35858,9 +36517,18 @@ RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# will not attempt to automatically add a binding, or add filename and
# line values.
#
-# This cop works only when a string literal is given as a code string.
+# NOTE: This cop works only when a string literal is given as a code string.
# No offense is reported if a string variable is given as below:
#
+# [source,ruby]
+# ----
+# code = <<-RUBY
+# def do_something
+# end
+# RUBY
+# eval code # not checked.
+# ----
+#
# @example
# # bad
# eval <<-RUBY
@@ -35885,100 +36553,93 @@ RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# def do_something
# end
# RUBY
-# @example
-# # not checked
-# code = <<-RUBY
-# def do_something
-# end
-# RUBY
-# eval code
#
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#56
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#57
class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#74
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#75
def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#81
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#82
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#69
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#70
def valid_eval_receiver?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#186
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#187
def add_offense_for_different_line(node, line_node, line_diff); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#131
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#132
def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#201
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#202
def add_offense_for_missing_line(node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#208
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#209
def add_offense_for_missing_location(node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#180
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#181
def add_offense_for_same_line(node, line_node); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#143
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#144
def check_file(node, file_node); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#156
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#157
def check_line(node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#95
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#96
def check_location(node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#193
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#194
def expected_line(sign, line_diff); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#122
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#123
def file_and_line(node); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#168
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#169
def line_difference(line_node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#220
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#221
def missing_line(node, code); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#109
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#110
def register_offense(node, &block); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#114
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#115
def special_file_keyword?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#118
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#119
def special_line_keyword?(node); end
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#172
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#173
def string_first_line(str_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#127
+ # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#128
def with_binding?(node); end
end
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#59
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#60
RuboCop::Cop::Style::EvalWithLocation::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#60
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#61
RuboCop::Cop::Style::EvalWithLocation::MSG_EVAL = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#61
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#62
RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_FILE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#63
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#64
RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_LINE = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#66
+# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#67
RuboCop::Cop::Style::EvalWithLocation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Checks for places where `Integer#even?` or `Integer#odd?`
@@ -36487,8 +37148,7 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Favor `File.(bin)read` convenience methods.
#
# @example
-# ## text mode
-# # bad
+# # bad - text mode
# File.open(filename).read
# File.open(filename, &:read)
# File.open(filename) { |f| f.read }
@@ -36503,9 +37163,8 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
#
# # good
# File.read(filename)
-# @example
-# ## binary mode
-# # bad
+#
+# # bad - binary mode
# File.open(filename, 'rb').read
# File.open(filename, 'rb', &:read)
# File.open(filename, 'rb') do |f|
@@ -36515,49 +37174,49 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# # good
# File.binread(filename)
#
-# source://rubocop//lib/rubocop/cop/style/file_read.rb#38
+# source://rubocop//lib/rubocop/cop/style/file_read.rb#35
class RuboCop::Cop::Style::FileRead < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#65
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#62
def block_read?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#49
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#46
def file_open?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#69
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#66
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#60
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#57
def send_read?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#84
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#81
def evidence(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#100
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#97
def file_open_read?(node); end
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#106
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#103
def read_method(mode); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/file_read.rb#92
+ # source://rubocop//lib/rubocop/cop/style/file_read.rb#89
def read_node?(node, block_pass); end
end
-# source://rubocop//lib/rubocop/cop/style/file_read.rb#42
+# source://rubocop//lib/rubocop/cop/style/file_read.rb#39
RuboCop::Cop::Style::FileRead::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/file_read.rb#46
+# source://rubocop//lib/rubocop/cop/style/file_read.rb#43
RuboCop::Cop::Style::FileRead::READ_FILE_START_TO_FINISH_MODES = T.let(T.unsafe(nil), Set)
-# source://rubocop//lib/rubocop/cop/style/file_read.rb#44
+# source://rubocop//lib/rubocop/cop/style/file_read.rb#41
RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Favor `File.(bin)write` convenience methods.
@@ -36574,8 +37233,7 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# ----
#
# @example
-# ## text mode
-# # bad
+# # bad - text mode
# File.open(filename, 'w').write(content)
# File.open(filename, 'w') do |f|
# f.write(content)
@@ -36583,9 +37241,8 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
#
# # good
# File.write(filename, content)
-# @example
-# ## binary mode
-# # bad
+#
+# # bad - binary mode
# File.open(filename, 'wb').write(content)
# File.open(filename, 'wb') do |f|
# f.write(content)
@@ -36594,24 +37251,24 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# # good
# File.binwrite(filename, content)
#
-# source://rubocop//lib/rubocop/cop/style/file_write.rb#41
+# source://rubocop//lib/rubocop/cop/style/file_write.rb#38
class RuboCop::Cop::Style::FileWrite < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#68
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#65
def block_write?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#85
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#82
def evidence(node); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#52
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#49
def file_open?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#72
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#69
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#63
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#60
def send_write?(param0 = T.unsafe(nil)); end
private
@@ -36619,31 +37276,31 @@ class RuboCop::Cop::Style::FileWrite < ::RuboCop::Cop::Base
# @return [Boolean]
# @yield [content]
#
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#95
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#92
def file_open_write?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#123
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#120
def heredoc?(write_node); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#128
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#125
def heredoc_range(first_argument); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#108
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#105
def replacement(mode, filename, content, write_node); end
- # source://rubocop//lib/rubocop/cop/style/file_write.rb#104
+ # source://rubocop//lib/rubocop/cop/style/file_write.rb#101
def write_method(mode); end
end
-# source://rubocop//lib/rubocop/cop/style/file_write.rb#45
+# source://rubocop//lib/rubocop/cop/style/file_write.rb#42
RuboCop::Cop::Style::FileWrite::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/file_write.rb#47
+# source://rubocop//lib/rubocop/cop/style/file_write.rb#44
RuboCop::Cop::Style::FileWrite::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
-# source://rubocop//lib/rubocop/cop/style/file_write.rb#49
+# source://rubocop//lib/rubocop/cop/style/file_write.rb#46
RuboCop::Cop::Style::FileWrite::TRUNCATING_WRITE_MODES = T.let(T.unsafe(nil), Set)
# Checks for division with integers coerced to floats.
@@ -36896,8 +37553,8 @@ RuboCop::Cop::Style::FormatString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
# The reason is that _unannotated_ format is very similar
# to encoded URLs or Date/Time formatting strings.
#
-# This cop can be customized allowed methods with `AllowedMethods`.
-# By default, there are no methods to allowed.
+# This cop's allowed methods can be customized with `AllowedMethods`.
+# By default, there are no allowed methods.
#
# It is allowed to contain unannotated token
# if the number of them is less than or equals to
@@ -37208,11 +37865,16 @@ class RuboCop::Cop::Style::GlobalStdStream < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#64
+ # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#70
def gvar_name(const_name); end
- # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#60
+ # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#62
def message(const_name); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#66
+ def namespaced?(node); end
end
# source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#37
@@ -37375,10 +38037,10 @@ RuboCop::Cop::Style::GlobalVars::MSG = T.let(T.unsafe(nil), String)
#
# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#114
class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base
- include ::RuboCop::Cop::Alignment
- include ::RuboCop::Cop::LineLengthHelp
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::MinBodyLength
+ include ::RuboCop::Cop::Alignment
+ include ::RuboCop::Cop::LineLengthHelp
include ::RuboCop::Cop::StatementModifier
extend ::RuboCop::Cop::AutoCorrector
@@ -37406,12 +38068,12 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#283
+ # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#285
def accepted_if?(node, ending); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#297
+ # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#312
def allowed_consecutive_conditionals?; end
# @return [Boolean]
@@ -37419,6 +38081,11 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#265
def and_or_guard_clause?(guard_clause); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#296
+ def assigned_lvar_used_in_if_branch?(node); end
+
# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#210
def autocorrect(corrector, node, condition, replacement, guard); end
@@ -37450,7 +38117,7 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#188
def register_offense(node, scope_exiting_keyword, conditional_keyword, guard = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#293
+ # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#308
def remove_whole_lines(corrector, range); end
# @return [Boolean]
@@ -37646,80 +38313,83 @@ class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Lint::UnusedArgument
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#74
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#79
def check_unused_block_args(node, key, value); end
# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#51
def each_arguments(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#61
+ def hash_mutated?(param0 = T.unsafe(nil), param1); end
+
# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#46
def kv_each(param0 = T.unsafe(nil)); end
# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#56
def kv_each_with_block_pass(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#60
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#65
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#95
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#100
def on_block_pass(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#60
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#65
def on_numblock(node); end
private
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#180
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#186
def check_argument(variable); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#204
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#210
def correct_args(node, corrector); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#190
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#196
def correct_implicit(node, corrector, method_name); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#195
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#201
def correct_key_value_each(node, corrector); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#176
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#182
def format_message(method_name, current); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#103
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#108
def handleable?(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#211
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#217
def kv_range(outer_node); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#133
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#139
def message(prefer, method_name, unused_code); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#139
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#145
def register_each_args_offense(node, message, prefer, unused_range); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#110
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#116
def register_kv_offense(target, method); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#146
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#152
def register_kv_with_block_pass_offense(node, target, method); end
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#167
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#173
def root_receiver(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#121
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#127
def unused_block_arg_exist?(node, block_arg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#157
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#163
def use_array_converter_method_as_preceding?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#186
+ # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#192
def used?(arg); end
end
@@ -37748,9 +38418,9 @@ RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil)
# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar }
# {foo: 1, bar: 2, baz: 3}.select {|k, v| k != :bar }
# {foo: 1, bar: 2, baz: 3}.filter {|k, v| k != :bar }
-# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[foo bar].include?(k) }
-# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[foo bar].include?(k) }
-# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[foo bar].include?(k) }
+# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].include?(k) }
+# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].include?(k) }
+# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[bar].include?(k) }
#
# # good
# {foo: 1, bar: 2, baz: 3}.except(:bar)
@@ -37777,42 +38447,42 @@ class RuboCop::Cop::Style::HashExcept < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#94
- def bad_method?(block); end
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#95
+ def bad_method?(method_name, block); end
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#166
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#169
def decorate_source(value); end
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#174
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#177
def except_key(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#153
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#156
def except_key_source(key); end
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#147
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#150
def extract_body_if_negated(body); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#128
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#131
def included?(negated, body); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#132
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#135
def not_included?(negated, body); end
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#183
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#186
def offense_range(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#136
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#139
def safe_to_register_offense?(block, except_key); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_except.rb#112
+ # source://rubocop//lib/rubocop/cop/style/hash_except.rb#115
def semantically_except_method?(send, block); end
end
@@ -37901,10 +38571,12 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
# * never - forces use of explicit hash literal value
# * either - accepts both shorthand and explicit use of hash literal value
# * consistent - forces use of the 3.1 syntax only if all values can be omitted in the hash
+# * either_consistent - accepts both shorthand and explicit use of hash literal value,
+# but they must be consistent
#
-# @example EnforcedShorthandSyntax: consistent
+# @example EnforcedShorthandSyntax: either_consistent
#
-# # bad - `foo` and `bar` values can be omitted
+# # good - `foo` and `bar` values can be omitted, but they are consistent, so it's accepted
# {foo: foo, bar: bar}
#
# # bad - `bar` value can be omitted
@@ -37941,7 +38613,7 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
# # good
# {a: 1, b: 2}
# {:c => 3, 'd' => 4}
-# @example EnforcedShorthandSyntax: always (default)
+# @example EnforcedShorthandSyntax: always
#
# # bad
# {foo: foo, bar: bar}
@@ -37955,7 +38627,7 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
#
# # good
# {foo: foo, bar: bar}
-# @example EnforcedShorthandSyntax: either
+# @example EnforcedShorthandSyntax: either (default)
#
# # good
# {foo: foo, bar: bar}
@@ -37965,6 +38637,22 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
#
# # good
# {foo:, bar:}
+# @example EnforcedShorthandSyntax: consistent
+#
+# # bad - `foo` and `bar` values can be omitted
+# {foo: foo, bar: bar}
+#
+# # bad - `bar` value can be omitted
+# {foo:, bar: bar}
+#
+# # bad - mixed syntaxes
+# {foo:, bar: baz}
+#
+# # good
+# {foo:, bar:}
+#
+# # good - can't omit `baz`
+# {foo: foo, bar: baz}
# @example EnforcedStyle: ruby19 (default)
# # bad
# {:a => 2}
@@ -37975,84 +38663,84 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
# {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
# {d: 1, 'e' => 2} # technically not forbidden
#
-# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#113
+# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#131
class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::HashShorthandSyntax
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#167
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#185
def alternative_style; end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#145
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#163
def hash_rockets_check(pairs); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#159
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#177
def no_mixed_keys_check(pairs); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#123
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#141
def on_hash(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#141
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#159
def ruby19_check(pairs); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#149
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#167
def ruby19_no_mixed_keys_check(pairs); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#199
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#217
def acceptable_19_syntax_symbol?(sym_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#256
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#274
def argument_without_space?(node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#178
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#196
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#260
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#278
def autocorrect_hash_rockets(corrector, pair_node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#269
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#287
def autocorrect_no_mixed_keys(corrector, pair_node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#235
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#253
def autocorrect_ruby19(corrector, pair_node); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#220
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#238
def check(pairs, delim, msg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#277
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#295
def force_hash_rockets?(pairs); end
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#248
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#266
def range_for_autocorrect_ruby19(pair_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#188
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#206
def sym_indices?(pairs); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#192
+ # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#210
def word_symbol_pair?(pair); end
end
-# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#119
+# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#137
RuboCop::Cop::Style::HashSyntax::MSG_19 = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#121
+# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#139
RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#120
+# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#138
RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String)
# Looks for uses of `\_.each_with_object({}) {...}`,
@@ -38472,9 +39160,9 @@ RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::LineLengthHelp
- include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::StatementModifier
include ::RuboCop::Cop::AllowedPattern
+ include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::CommentsHelp
extend ::RuboCop::Cop::AutoCorrector
@@ -38618,7 +39306,6 @@ RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_NORMAL = T.let(T.unsafe(nil), Str
class RuboCop::Cop::Style::IfUnlessModifierOfIfUnless < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::LineLengthHelp
- include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::StatementModifier
extend ::RuboCop::Cop::AutoCorrector
@@ -38665,7 +39352,7 @@ RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), Stri
#
# # good
# foo == bar
-# @example
+#
# # bad
# if foo.do_something?
# true
@@ -38679,61 +39366,61 @@ RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), Stri
# # good
# num.nonzero? ? true : false
#
-# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#62
+# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#61
class RuboCop::Cop::Style::IfWithBooleanLiteralBranches < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#74
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#73
def double_negative?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#70
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#69
def if_with_boolean_literal_branches?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#76
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#75
def on_if(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#134
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#135
def assume_boolean_value?(condition); end
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#114
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#113
def message(node, keyword); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#96
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#95
def multiple_elsif?(node); end
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#102
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#101
def offense_range_with_keyword(node, condition); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#151
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#152
def opposite_condition?(node); end
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#141
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#142
def replacement_condition(node, condition); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#156
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#157
def require_parentheses?(condition); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#120
+ # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#121
def return_boolean_value?(condition); end
end
-# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#66
+# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#65
RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#67
+# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#66
RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG_FOR_ELSIF = T.let(T.unsafe(nil), String)
# Checks for uses of semicolon in if statements.
@@ -38751,25 +39438,47 @@ class RuboCop::Cop::Style::IfWithSemicolon < ::RuboCop::Cop::Base
include ::RuboCop::Cop::OnNormalIfUnless
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#23
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#24
def on_normal_if_unless(node); end
private
- # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#38
- def autocorrect(node); end
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#54
+ def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#56
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#93
def build_else_branch(second_condition); end
- # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#47
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#84
+ def build_expression(expr); end
+
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#75
def correct_elsif(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#40
+ def message(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#66
+ def replacement(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#113
+ def require_argument_parentheses?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#62
+ def use_block_in_branches?(node); end
end
# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#20
RuboCop::Cop::Style::IfWithSemicolon::MSG_IF_ELSE = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#21
+RuboCop::Cop::Style::IfWithSemicolon::MSG_NEWLINE = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#22
RuboCop::Cop::Style::IfWithSemicolon::MSG_TERNARY = T.let(T.unsafe(nil), String)
# Checks for `raise` or `fail` statements which do not specify an
@@ -38826,6 +39535,9 @@ class RuboCop::Cop::Style::InPatternThen < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#46
def alternative_pattern_source(pattern); end
+
+ # source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#50
+ def collect_alternative_patterns(pattern); end
end
# source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#27
@@ -39217,6 +39929,40 @@ RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer)
# source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#25
RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String)
+# When passing an existing hash as keyword arguments, provide additional arguments
+# directly rather than using `merge`.
+#
+# Providing arguments directly is more performant, than using `merge`, and
+# also leads to a shorter and simpler code.
+#
+# @example
+# # bad
+# some_method(**opts.merge(foo: true))
+# some_method(**opts.merge(other_opts))
+#
+# # good
+# some_method(**opts, foo: true)
+# some_method(**opts, **other_opts)
+#
+# source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#21
+class RuboCop::Cop::Style::KeywordArgumentsMerging < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#27
+ def merge_kwargs?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#36
+ def on_kwsplat(node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#48
+ def autocorrect(corrector, kwsplat_node, hash_node, other_hash_node); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#24
+RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String)
+
# Enforces that optional keyword parameters are placed at the
# end of the parameters list.
#
@@ -39656,7 +40402,7 @@ end
#
# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#107
class RuboCop::Cop::Style::MagicCommentFormat::CommentRange
- extend ::Forwardable
+ extend ::RuboCop::SimpleForwardable
# @return [CommentRange] a new instance of CommentRange
#
@@ -39674,11 +40420,11 @@ class RuboCop::Cop::Style::MagicCommentFormat::CommentRange
# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#125
def directives; end
- # source://forwardable/1.3.3/forwardable.rb#231
- def loc(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def loc(*_arg0, **_arg1, &_arg2); end
- # source://forwardable/1.3.3/forwardable.rb#231
- def text(*args, **_arg1, &block); end
+ # source://rubocop-ast/1.35.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9
+ def text(*_arg0, **_arg1, &_arg2); end
# A magic comment can contain one value (normal style) or
# multiple directives (emacs style)
@@ -39706,6 +40452,7 @@ RuboCop::Cop::Style::MagicCommentFormat::MSG_VALUE = T.let(T.unsafe(nil), String
RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), String)
# Prefer `select` or `reject` over `map { ... }.compact`.
+# This cop also handles `filter_map { ... }`, similar to `map { ... }.compact`.
#
# @example
#
@@ -39713,6 +40460,9 @@ RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil),
# array.map { |e| some_condition? ? e : next }.compact
#
# # bad
+# array.filter_map { |e| some_condition? ? e : next }
+#
+# # bad
# array.map do |e|
# if some_condition?
# e
@@ -39739,48 +40489,60 @@ RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil),
# # good
# array.reject { |e| some_condition? }
#
-# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#40
+# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#44
class RuboCop::Cop::Style::MapCompactWithConditionalBlock < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#46
- def map_and_compact?(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#51
+ def conditional_block(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#72
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#72
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76
def on_send(node); end
private
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#126
- def range(node); end
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#148
+ def current(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#162
+ def filter_map_range(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#96
+ def inspect(node, block_argument_node, condition_node, return_value_node, range); end
+
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#158
+ def map_with_compact_range(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#92
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#114
def returns_block_argument?(block_argument_node, return_value_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#96
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#118
def truthy_branch?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#116
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#138
def truthy_branch_for_guard?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#106
+ # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#128
def truthy_branch_for_if?(node); end
end
-# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#43
+# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#47
RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String)
+# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#48
+RuboCop::Cop::Style::MapCompactWithConditionalBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Checks for usages of `each` with `<<`, `push`, or `append` which
# can be replaced by `map`.
#
@@ -39791,8 +40553,10 @@ RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil),
# return value of `Enumerable#map` is an `Array`. They are not autocorrected
# when a return value could be used because these types differ.
#
-# NOTE: It only detects when the mapping destination is a local variable
-# initialized as an empty array and referred to only by the pushing operation.
+# NOTE: It only detects when the mapping destination is either:
+# * a local variable initialized as an empty array and referred to only by the
+# pushing operation;
+# * or, if it is the single block argument to a `[].tap` block.
# This is because, if not, it's challenging to statically guarantee that the
# mapping destination variable remains an empty array:
#
@@ -39814,74 +40578,96 @@ RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil),
# # good
# dest = src.map { |e| e * 2 }
#
+# # bad
+# [].tap do |dest|
+# src.each { |e| dest << e * 2 }
+# end
+#
+# # good
+# dest = src.map { |e| e * 2 }
+#
# # good - contains another operation
# dest = []
# src.each { |e| dest << e * 2; puts e }
# dest
#
-# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#50
+# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#60
class RuboCop::Cop::Style::MapIntoArray < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#75
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#109
def after_leaving_scope(scope, _variable_table); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#57
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#72
def each_block_with_push?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#66
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#81
def empty_array_asgn?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#69
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#93
+ def empty_array_tap(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#103
def lvar_ref?(param0 = T.unsafe(nil), param1); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#79
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#113
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#79
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#113
def on_numblock(node); end
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#67
+ def suitable_argument_node?(param0 = T.unsafe(nil)); end
+
private
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#155
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#213
def correct_push_node(corrector, push_node); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#163
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#221
def correct_return_value_handling(corrector, block, dest_var); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#108
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#156
def dest_used_only_for_mapping?(block, dest_var, asgn); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#102
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#150
def find_closest_assignment(block, dest_var); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#94
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#133
def find_dest_var(block); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#127
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#181
def new_method_name; end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#116
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#141
+ def offending_empty_array_tap?(node, dest_var); end
+
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#164
def register_offense(block, dest_var, asgn); end
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#148
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#200
def remove_assignment(corrector, asgn); end
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#207
+ def remove_tap(corrector, node, block_node); end
+
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#133
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#187
def return_value_used?(node); end
class << self
- # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#71
+ # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#105
def joining_forces; end
end
end
-# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#54
+# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#64
RuboCop::Cop::Style::MapIntoArray::MSG = T.let(T.unsafe(nil), String)
# Looks for uses of `map.to_h` or `collect.to_h` that could be
@@ -39976,7 +40762,7 @@ RuboCop::Cop::Style::MapToSet::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# Enforces the presence (default) or absence of parentheses in
-# method calls containing parameters.
+# method calls containing arguments.
#
# In the default style (require_parentheses), macro methods are allowed.
# Additional methods can be added to the `AllowedMethods` or
@@ -40167,6 +40953,7 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses
+ include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
extend ::RuboCop::Cop::AutoCorrector
@@ -40202,114 +40989,116 @@ end
#
# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#9
module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
+ include ::RuboCop::Cop::RangeHelp
+
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#70
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#80
def allowed_camel_case_method_call?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#174
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#184
def allowed_chained_call_with_parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#170
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#180
def allowed_multiline_call_with_parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#75
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#85
def allowed_string_interpolation_method_call?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#183
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#193
def ambiguous_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#212
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#222
def assigned_before?(node, target); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#220
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#230
def assignment_in_condition?(node); end
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#31
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#34
def autocorrect(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#151
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#161
def call_as_argument_or_chain?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#144
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#154
def call_in_argument_with_block?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#100
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#110
def call_in_literals?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#111
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#121
def call_in_logical_operators?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#157
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#167
def call_in_match_pattern?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#120
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#130
def call_in_optional_arguments?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#124
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#134
def call_in_single_line_inheritance?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#128
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#138
def call_with_ambiguous_arguments?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#140
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#150
def call_with_braced_block?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#230
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#240
def forwards_anonymous_rest_arguments?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#199
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#209
def hash_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#163
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#173
def hash_literal_in_arguments?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#44
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#50
def inside_endless_method_def?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#216
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#226
def inside_string_interpolation?(node); end
# Require hash value omission be enclosed in parentheses to prevent the following issue:
@@ -40317,70 +41106,75 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#58
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#64
def last_expression?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#87
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#97
def legitimate_call_with_parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#195
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#205
def logical_operator?(node); end
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#40
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#72
+ def method_call_before_constant_resolution?(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#46
def offense_range(node); end
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#16
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#18
def omit_parentheses(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#80
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#90
def parentheses_at_the_end_of_multiline_call?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#203
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#213
def regexp_slash_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#49
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#55
def require_parentheses_for_hash_value_omission?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#187
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#197
def splat?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#66
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#76
def super_call_without_arguments?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#62
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#68
def syntax_like_method_call?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#191
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#201
def ternary_if?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#207
+ # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#217
def unary_literal?(node); end
end
-# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11
+# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#13
RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::OMIT_MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#10
+# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#12
RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::TRAILING_WHITESPACE_REGEX = T.let(T.unsafe(nil), Regexp)
# Style require_parentheses
@@ -40416,8 +41210,8 @@ RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses::REQUIRE_
# Checks for unwanted parentheses in parameterless method calls.
#
-# This cop can be customized allowed methods with `AllowedMethods`.
-# By default, there are no methods to allowed.
+# This cop's allowed methods can be customized with `AllowedMethods`.
+# By default, there are no allowed methods.
#
# NOTE: This cop allows the use of `it()` without arguments in blocks,
# as in `0.times { it() }`, following `Lint/ItWithoutArgumentsInBlock` cop.
@@ -40892,15 +41686,10 @@ class RuboCop::Cop::Style::MissingElse < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/missing_else.rb#127
def check(node); end
- # source://rubocop//lib/rubocop/cop/style/missing_else.rb#181
+ # source://rubocop//lib/rubocop/cop/style/missing_else.rb#177
def empty_else_config; end
- # @return [Boolean]
- #
# source://rubocop//lib/rubocop/cop/style/missing_else.rb#171
- def empty_else_cop_enabled?; end
-
- # source://rubocop//lib/rubocop/cop/style/missing_else.rb#175
def empty_else_style; end
# @return [Boolean]
@@ -41278,7 +42067,6 @@ RuboCop::Cop::Style::MultilineBlockChain::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::MultilineIfModifier < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::LineLengthHelp
- include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::StatementModifier
extend ::RuboCop::Cop::AutoCorrector
@@ -41612,11 +42400,6 @@ class RuboCop::Cop::Style::MultilineWhenThen < ::RuboCop::Cop::Base
private
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#58
- def accept_node_type?(node); end
-
# Requires `then` for write `when` and its body on the same line.
#
# @return [Boolean]
@@ -41675,64 +42458,50 @@ class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
# source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#58
- def on_new_investigation; end
-
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#62
def on_or(node); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#88
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#80
def simple_comparison_lhs?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#93
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#85
def simple_comparison_rhs?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#85
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#77
def simple_double_comparison?(param0 = T.unsafe(nil)); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#161
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#142
def allow_method_comparison?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#136
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#121
def comparison?(node); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#165
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#146
def comparisons_threshold; end
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#128
- def nested_comparison?(node); end
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#90
+ def find_offending_var(node, variables = T.unsafe(nil), values = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#97
- def nested_variable_comparison?(node); end
-
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#156
- def reset_comparison; end
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#113
+ def nested_comparison?(node); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#140
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#132
def root_of_or_node(or_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#150
- def switch_comparison?(node); end
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#125
+ def simple_comparison?(node); end
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#124
+ # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#109
def variable_name(node); end
-
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#103
- def variables_in_node(node); end
-
- # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#111
- def variables_in_simple_node(node); end
end
# source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#55
@@ -41814,7 +42583,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop-sorbet/0.8.3/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
+ # source://rubocop-sorbet/0.8.7/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
def on_assignment(value); end
# source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#127
@@ -41832,7 +42601,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#217
def splat_value(param0 = T.unsafe(nil)); end
- # source://rubocop-sorbet/0.8.3/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12
+ # source://rubocop-sorbet/0.8.7/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12
def t_let(param0 = T.unsafe(nil)); end
private
@@ -43076,8 +43845,8 @@ RuboCop::Cop::Style::NumericLiterals::MSG = T.let(T.unsafe(nil), String)
# These can be replaced by their respective predicate methods.
# This cop can also be configured to do the reverse.
#
-# This cop can be customized allowed methods with `AllowedMethods`.
-# By default, there are no methods to allowed.
+# This cop's allowed methods can be customized with `AllowedMethods`.
+# By default, there are no allowed methods.
#
# This cop disregards `#nonzero?` as its value is truthy or falsey,
# but not `true` and `false`, and thus not always interchangeable with
@@ -43140,16 +43909,16 @@ class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedPattern
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#166
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#174
def comparison(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#171
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#179
def inverted_comparison(param0 = T.unsafe(nil)); end
# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#90
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#161
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#169
def predicate(param0 = T.unsafe(nil)); end
private
@@ -43162,23 +43931,28 @@ class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#111
def check(node); end
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#152
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#154
def invert; end
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#132
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#162
+ def negated?(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#134
def parenthesized_source(node); end
# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#124
- def replacement(numeric, operation); end
+ def replacement(node, numeric, operation); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#144
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#146
def replacement_supported?(operator); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#140
+ # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#142
def require_parentheses?(node); end
end
@@ -43283,42 +44057,42 @@ class RuboCop::Cop::Style::OneLineConditional < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#77
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#81
def always_multiline?; end
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#59
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#63
def autocorrect(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#81
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#85
def cannot_replace_to_ternary?(node); end
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#93
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#97
def expr_replacement(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#114
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#118
def keyword_with_changed_precedence?(node); end
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#55
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#59
def message(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#107
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#111
def method_call_with_changed_precedence?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#99
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#103
def requires_parentheses?(node); end
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#67
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#71
def ternary_correction(node); end
- # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#85
+ # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#89
def ternary_replacement(node); end
end
@@ -43384,27 +44158,35 @@ RuboCop::Cop::Style::OpenStructUse::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::OperatorMethodCall < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#27
+ # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#30
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#53
- def anonymous_forwarding?(argument); end
+ # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#75
+ def insert_space_after?(node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#58
+ def invalid_syntax_argument?(argument); end
# Checks for an acceptable case of `foo.+(bar).baz`.
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#47
+ # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#52
def method_call_with_parenthesized_arg?(argument); end
- # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#60
+ # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#64
def wrap_in_parentheses_if_chained(corrector, node); end
end
+# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#25
+RuboCop::Cop::Style::OperatorMethodCall::INVALID_SYNTAX_ARG_TYPES = T.let(T.unsafe(nil), Array)
+
# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#23
RuboCop::Cop::Style::OperatorMethodCall::MSG = T.let(T.unsafe(nil), String)
@@ -43754,14 +44536,14 @@ class RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
private
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#233
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#234
def cop_config; end
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#229
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#230
def extract_sources(node); end
# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#219
- def source(node); end
+ def source(node, loc); end
end
# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#29
@@ -43770,37 +44552,37 @@ RuboCop::Cop::Style::ParallelAssignment::MSG = T.let(T.unsafe(nil), String)
# An internal class for correcting parallel assignment
# guarded by if, unless, while, or until
#
-# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#275
+# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#276
class RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#276
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#277
def correction; end
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#285
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#286
def correction_range; end
private
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#291
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#292
def modifier_range(node); end
end
# An internal class for correcting parallel assignment
# protected by rescue
#
-# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#240
+# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#241
class RuboCop::Cop::Style::ParallelAssignment::RescueCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#241
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#242
def correction; end
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#252
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#253
def correction_range; end
private
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#263
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#264
def begin_correction(rescue_result); end
- # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#258
+ # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#259
def def_correction(rescue_result); end
end
@@ -44210,7 +44992,7 @@ RuboCop::Cop::Style::Proc::MSG = T.let(T.unsafe(nil), String)
#
# String interpolation is always kept in double quotes.
#
-# Note: `Lint/SymbolConversion` can be used in parallel to ensure that symbols
+# NOTE: `Lint/SymbolConversion` can be used in parallel to ensure that symbols
# are not quoted that don't need to be. This cop is for configuring the quoting
# style to use for symbols that require quotes.
#
@@ -44243,7 +45025,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base
private
- # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#108
+ # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#106
def alternative_style; end
# source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#71
@@ -44264,7 +45046,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#112
+ # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#110
def quoted?(sym_node); end
# source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#99
@@ -44272,7 +45054,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#116
+ # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#114
def wrong_quotes?(node); end
end
@@ -44705,81 +45487,86 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#72
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#76
def offensive_kwbegins(param0); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#84
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#88
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#76
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#80
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#76
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#80
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#95
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#99
def on_kwbegin(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#84
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#88
def on_numblock(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#103
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#107
def allowable_kwbegin?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#177
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#181
def begin_block_has_multiline_statements?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#169
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#173
def condition_range(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#181
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#185
def contain_rescue_or_ensure?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#162
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#166
def correct_modifier_form_after_multiline_begin_block(corrector, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#173
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#177
def empty_begin?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#110
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#114
def register_offense(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#139
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#143
def remove_begin(corrector, offense_range, node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#127
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#131
def replace_begin_with_statement(corrector, offense_range, node); end
# Restore comments that occur between "begin" and "first_child".
# These comments will be moved to above the assignment line.
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#149
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#153
def restore_removed_comments(corrector, offense_range, node, first_child); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#156
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#160
def use_modifier_form_after_multiline_begin_block?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#194
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#198
def valid_begin_assignment?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#187
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#191
def valid_context_using_only_begin?(node); end
+
+ class << self
+ # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#71
+ def autocorrect_incompatible_with; end
+ end
end
# source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#69
@@ -44828,7 +45615,7 @@ RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String)
#
# # good
# a = b || c
-# @example
+#
# # bad
# if b
# b
@@ -44846,7 +45633,7 @@ RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String)
# c
# end
#
-# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#33
+# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#32
class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
@@ -44964,13 +45751,13 @@ class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base
def without_argument_parentheses_method?(node); end
end
-# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#39
+# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#38
RuboCop::Cop::Style::RedundantCondition::ARGUMENT_WITH_OPERATOR_TYPES = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#37
+# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#36
RuboCop::Cop::Style::RedundantCondition::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#38
+# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#37
RuboCop::Cop::Style::RedundantCondition::REDUNDANT_CONDITION = T.let(T.unsafe(nil), String)
# Checks for redundant returning of true/false in conditionals.
@@ -45410,7 +46197,7 @@ RuboCop::Cop::Style::RedundantFetchBlock::MSG = T.let(T.unsafe(nil), String)
# Checks for the presence of superfluous `.rb` extension in
# the filename provided to `require` and `require_relative`.
#
-# Note: If the extension is omitted, Ruby tries adding '.rb', '.so',
+# NOTE: If the extension is omitted, Ruby tries adding '.rb', '.so',
# and so on to the name until found. If the file named cannot be found,
# a `LoadError` will be raised.
# There is an edge case where `foo.so` file is loaded instead of a `LoadError`
@@ -45820,6 +46607,37 @@ end
# source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#43
RuboCop::Cop::Style::RedundantInterpolation::MSG = T.let(T.unsafe(nil), String)
+# Before Ruby 3.0, interpolated strings followed the frozen string literal
+# magic comment which sometimes made it necessary to explicitly unfreeze them.
+# Ruby 3.0 changed interpolated strings to always be unfrozen which makes
+# unfreezing them redundant.
+#
+# @example
+# # bad
+# +"#{foo} bar"
+#
+# # bad
+# "#{foo} bar".dup
+#
+# # good
+# "#{foo} bar"
+#
+# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#21
+class RuboCop::Cop::Style::RedundantInterpolationUnfreeze < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::FrozenStringLiteral
+ extend ::RuboCop::Cop::AutoCorrector
+ extend ::RuboCop::Cop::TargetRubyVersion
+
+ # source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#32
+ def on_send(node); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#26
+RuboCop::Cop::Style::RedundantInterpolationUnfreeze::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#28
+RuboCop::Cop::Style::RedundantInterpolationUnfreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
# Check for redundant line continuation.
#
# This cop marks a line continuation as redundant if removing the backslash
@@ -45887,47 +46705,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::MatchRange
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#78
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#81
def on_new_investigation; end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#182
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#201
def argument_is_method?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#146
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#165
def argument_newline?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#101
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#106
def ends_with_backslash_without_comment?(source_line); end
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#162
- def find_node_for_line(line); end
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#181
+ def find_node_for_line(last_line); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#131
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#150
def inside_string_literal?(range, token); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#109
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#114
def inside_string_literal_or_method_with_argument?(range); end
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#139
+ def inspect_eof_line_continuation; end
+
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#117
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#122
def leading_dot_method_chain_with_blank_line?(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#189
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#208
def method_call_with_arguments?(node); end
# A method call without parentheses such as the following cannot remove `\`:
@@ -45937,41 +46758,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#139
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#158
def method_with_argument?(current_token, next_token); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#123
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#128
def redundant_line_continuation?(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#93
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#98
def require_line_continuation?(range); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#168
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#187
def same_line?(node, line); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#193
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#212
def start_with_arithmetic_operator?(source_line); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#105
+ # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#110
def string_concatenation?(source_line); end
end
-# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#72
+# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#74
RuboCop::Cop::Style::RedundantLineContinuation::ALLOWED_STRING_TOKENS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#73
+# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#79
+RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TAKING_FLOW_TOKEN_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#75
RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array)
+# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#72
+RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#73
+RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION_PATTERN = T.let(T.unsafe(nil), Regexp)
+
# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#71
RuboCop::Cop::Style::RedundantLineContinuation::MSG = T.let(T.unsafe(nil), String)
@@ -45993,25 +46823,22 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#32
def allowed_pin_operator?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#35
- def arg_in_call_with_block?(param0 = T.unsafe(nil)); end
-
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#269
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#261
def first_send_argument?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#274
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#266
def first_super_argument?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#279
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#271
def first_yield_argument?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#175
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#166
def interpolation?(param0 = T.unsafe(nil)); end
# source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#26
def method_node_and_args(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#37
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#34
def on_begin(node); end
# source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#29
@@ -46024,130 +46851,130 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#177
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#168
def allow_in_multiline_conditions?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#68
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#64
def allowed_ancestor?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#60
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#57
def allowed_expression?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#73
- def allowed_method_call?(node); end
-
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#78
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#69
def allowed_multiple_expression?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#87
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#78
def allowed_ternary?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#283
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#275
def call_chain_starts_with_int?(begin_node, send_node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#136
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#127
def check(begin_node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#184
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#175
def check_send(begin_node, node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#193
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#185
def check_unary(begin_node, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#217
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#209
def disallowed_literal?(begin_node, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#114
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#281
+ def do_end_block_in_method_chain?(begin_node, node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#105
def empty_parentheses?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#147
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#138
def find_offense_message(begin_node, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#119
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#110
def first_arg_begins_with_hash_literal?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#258
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#250
def first_argument?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#53
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#50
def ignore_syntax?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#213
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#205
def keyword_ancestor?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#232
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#224
def keyword_with_redundant_parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#100
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#91
def like_method_argument_parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#245
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#237
def method_call_with_redundant_parentheses?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#128
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#119
def method_chain_begins_with_hash_literal(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#107
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#98
def multiline_control_flow_statements?(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#203
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#195
def offense(node, msg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#254
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#246
def only_begin_arg?(args); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#45
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#42
def parens_allowed?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#221
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#213
def raised_to_power_negative_numeric?(begin_node, node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#209
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#201
def suspect_unary?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#93
+ # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#84
def ternary_parentheses_required?; end
end
@@ -46276,38 +47103,39 @@ RuboCop::Cop::Style::RedundantPercentQ::STRING_INTERPOLATION_REGEXP = T.let(T.un
#
# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#35
class RuboCop::Cop::Style::RedundantRegexpArgument < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::StringLiteralsHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#47
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#48
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#47
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#48
def on_send(node); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#64
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#65
def determinist_regexp?(regexp_node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#68
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#69
def preferred_argument(regexp_node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#81
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#84
def replacement(regexp_node); end
end
-# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#42
+# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#43
RuboCop::Cop::Style::RedundantRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp)
-# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#38
+# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#39
RuboCop::Cop::Style::RedundantRegexpArgument::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#39
+# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#40
RuboCop::Cop::Style::RedundantRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#43
+# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#44
RuboCop::Cop::Style::RedundantRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array)
# Checks for unnecessary single-element Regexp character classes.
@@ -46476,13 +47304,10 @@ class RuboCop::Cop::Style::RedundantRegexpEscape < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#92
def delimiter?(node, char); end
- # Please remove this `else` branch when support for regexp_parser 1.8 will be dropped.
- # It's for compatibility with regexp_parser 1.8 and will never be maintained.
- #
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#99
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#98
def each_escape(node); end
- # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#126
+ # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#110
def escape_range_at_index(node, index); end
end
@@ -47515,6 +48340,9 @@ class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#70
def correct_rescue_block(corrector, node, parenthesized); end
+ # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#96
+ def heredoc_end(node); end
+
# source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#86
def indentation_and_offset(node, parenthesized); end
@@ -47701,7 +48529,8 @@ RuboCop::Cop::Style::ReturnNil::RETURN_MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/return_nil.rb#40
RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String)
-# Checks if `return` or `return nil` is used in predicate method definitions.
+# Checks for predicate method definitions that return `nil`.
+# A predicate method should only return a boolean value.
#
# @example
# # bad
@@ -47724,6 +48553,24 @@ RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String)
#
# do_something?
# end
+#
+# # bad
+# def foo?
+# if condition
+# nil
+# else
+# true
+# end
+# end
+#
+# # good
+# def foo?
+# if condition
+# false
+# else
+# true
+# end
+# end
# @example AllowedMethods: ['foo?']
# # good
# def foo?
@@ -47739,31 +48586,48 @@ RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String)
# do_something?
# end
#
-# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#50
+# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#69
class RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::AllowedPattern
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#62
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81
def on_def(node); end
- # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#62
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81
def on_defs(node); end
- # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#58
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#77
def return_nil?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#79
- def nil_node_at_the_end_of_method_body(body); end
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#128
+ def handle_if(if_node); end
+
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#113
+ def handle_implicit_return_values(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#122
+ def handle_nil(nil_node); end
+
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#118
+ def handle_return(return_node); end
- # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#87
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#94
+ def last_node_of_type(node, type); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#103
+ def node_type?(node, type); end
+
+ # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#107
def register_offense(offense_node, replacement); end
end
-# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#55
+# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#74
RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(nil), String)
# Transforms usages of a method call safeguarded by a non `nil`
@@ -47780,9 +48644,14 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(
# `foo&.bar` can start returning `nil` as well as what the method
# returns.
#
-# The default for `MaxChainLength` is `2`
+# The default for `MaxChainLength` is `2`.
# We have limited the cop to not register an offense for method chains
-# that exceed this option is set.
+# that exceed this option's value.
+#
+# NOTE: This cop will recognize offenses but not autocorrect code when the
+# right hand side (RHS) of the `&&` statement is an `||` statement
+# (eg. `foo && (foo.bar? || foo.baz?)`). It can be corrected
+# manually by removing the `foo &&` and adding `&.` to each `foo` on the RHS.
#
# @example
# # bad
@@ -47834,7 +48703,7 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(
# foo.baz + bar if foo
# foo.bar > 2 if foo
#
-# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#84
+# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#89
class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::AllowedMethods
include ::RuboCop::Cop::NilMethods
@@ -47842,114 +48711,165 @@ class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
extend ::RuboCop::Cop::TargetRubyVersion
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#136
+ def and_inside_begin?(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#130
+ def and_with_rhs_or?(param0 = T.unsafe(nil)); end
+
# if format: (if checked_variable body nil)
# unless format: (if checked_variable nil body)
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#99
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#104
def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#125
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#133
def not_nil_check?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#133
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#157
def on_and(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#127
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#141
def on_if(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#114
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#181
+ def report_offense(node, rhs, rhs_receiver, *removal_ranges, offense_range: T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#139
+ def strip_begin(param0 = T.unsafe(nil)); end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#119
def ternary_safe_navigation_candidate(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#307
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#360
def add_safe_nav_to_all_methods_in_chain(corrector, start_method, method_chain); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#200
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#277
def allowed_if_condition?(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#154
- def autocorrect(corrector, node); end
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#222
+ def and_parts(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#299
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#352
def begin_range(node, method_call); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#261
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#314
def chain_length(method_chain, method); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#139
- def check_node(node); end
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#204
+ def collect_and_clauses(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#181
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#258
def comments(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#303
- def end_range(node, method_call); end
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#216
+ def concat_nodes(nodes, and_node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#166
- def extract_body(node); end
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#356
+ def end_range(node, method_call); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#243
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#296
def extract_common_parts(method_chain, checked_variable); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#209
- def extract_parts(node); end
-
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#233
- def extract_parts_from_and(node); end
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#243
+ def extract_if_body(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#218
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#281
def extract_parts_from_if(node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#251
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#304
def find_matching_receiver_invocation(method_chain, checked_variable); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#174
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#198
+ def find_method_chain(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#251
def handle_comments(corrector, node, method_call); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#320
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#374
def max_chain_length; end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#204
- def method_call(node); end
-
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#295
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#348
def method_called?(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#287
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#340
def negated?(send_node); end
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#187
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#229
+ def offending_node?(node, lhs_receiver, rhs, rhs_receiver); end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#264
def relevant_comment_ranges(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#281
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#334
def unsafe_method?(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#269
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#322
def unsafe_method_used?(method_chain, method); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#150
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#239
def use_var_only_in_unless_modifier?(node, variable); end
end
-# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#92
+# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#97
RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array)
-# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#90
+# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#95
RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String)
+# Enforces safe navigation chains length to not exceed the configured maximum.
+# The longer the chain is, the harder it becomes to track what on it could be
+# returning `nil`.
+#
+# There is a potential interplay with `Style/SafeNavigation` - if both are enabled
+# and their settings are "incompatible", one of the cops will complain about what
+# the other proposes.
+#
+# E.g. if `Style/SafeNavigation` is configured with `MaxChainLength: 2` (default)
+# and this cop is configured with `Max: 1`, then for `foo.bar.baz if foo` the former
+# will suggest `foo&.bar&.baz`, which is an offense for the latter.
+#
+# @example Max: 2 (default)
+# # bad
+# user&.address&.zip&.upcase
+#
+# # good
+# user&.address&.zip
+# user.address.zip if user
+#
+# source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#26
+class RuboCop::Cop::Style::SafeNavigationChainLength < ::RuboCop::Cop::Base
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#29
+ def on_csend(node); end
+
+ private
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#46
+ def max; end
+
+ # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#38
+ def safe_navigation_chains(node); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#27
+RuboCop::Cop::Style::SafeNavigationChainLength::MSG = T.let(T.unsafe(nil), String)
+
# Identifies usages of `shuffle.first`,
# `shuffle.last`, and `shuffle[]` and change them to use
# `sample` instead.
@@ -48044,7 +48964,7 @@ RuboCop::Cop::Style::Sample::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
# See https://bugs.ruby-lang.org/issues/17030
#
# @example
-# # bad (select or find_all)
+# # bad (select, filter, or find_all)
# array.select { |x| x.match? /regexp/ }
# array.select { |x| /regexp/.match?(x) }
# array.select { |x| x =~ /regexp/ }
@@ -48065,53 +48985,53 @@ class RuboCop::Cop::Style::SelectByRegexp < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#79
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#81
def calls_lvar?(param0 = T.unsafe(nil), param1); end
# Returns true if a node appears to return a hash
#
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#65
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#67
def creates_hash?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#74
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#76
def env_const?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#88
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#90
def on_csend(node); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#88
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#90
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#56
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#58
def regexp_match?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#133
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#136
def extract_send_node(block_node); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#146
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#149
def find_regexp(node, block); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#157
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#160
def match_predicate_without_receiver?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#142
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#145
def opposite?(regexp_method_send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#107
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#110
def receiver_allowed?(node); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#121
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#124
def register_offense(node, block_node, regexp, replacement); end
- # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#113
+ # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#116
def replacement(regexp_method_send_node, node); end
end
@@ -48121,7 +49041,7 @@ RuboCop::Cop::Style::SelectByRegexp::MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#52
RuboCop::Cop::Style::SelectByRegexp::OPPOSITE_REPLACEMENTS = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#53
+# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#55
RuboCop::Cop::Style::SelectByRegexp::REGEXP_METHODS = T.let(T.unsafe(nil), Set)
# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#51
@@ -48310,6 +49230,83 @@ RuboCop::Cop::Style::Send::MSG = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/cop/style/send.rb#18
RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+# Detects the use of the `public_send` method with a literal method name argument.
+# Since the `send` method can be used to call private methods, by default,
+# only the `public_send` method is detected.
+#
+# NOTE: Writer methods with names ending in `=` are always permitted because their
+# behavior differs as follows:
+#
+# [source,ruby]
+# ----
+# def foo=(foo)
+# @foo = foo
+# 42
+# end
+#
+# self.foo = 1 # => 1
+# send(:foo=, 1) # => 42
+# ----
+#
+# @example
+# # bad
+# obj.public_send(:method_name)
+# obj.public_send('method_name')
+#
+# # good
+# obj.method_name
+# @example AllowSend: true (default)
+# # good
+# obj.send(:method_name)
+# obj.send('method_name')
+# obj.__send__(:method_name)
+# obj.__send__('method_name')
+# @example AllowSend: false
+# # bad
+# obj.send(:method_name)
+# obj.send('method_name')
+# obj.__send__(:method_name)
+# obj.__send__('method_name')
+#
+# # good
+# obj.method_name
+#
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#54
+class RuboCop::Cop::Style::SendWithLiteralMethodName < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#68
+ def on_send(node); end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#90
+ def allow_send?; end
+
+ # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#94
+ def offense_range(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#98
+ def removal_argument_range(first_argument, second_argument); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#60
+RuboCop::Cop::Style::SendWithLiteralMethodName::METHOD_NAME_PATTERN = T.let(T.unsafe(nil), Regexp)
+
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#57
+RuboCop::Cop::Style::SendWithLiteralMethodName::MSG = T.let(T.unsafe(nil), String)
+
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#61
+RuboCop::Cop::Style::SendWithLiteralMethodName::RESERVED_WORDS = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#58
+RuboCop::Cop::Style::SendWithLiteralMethodName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#59
+RuboCop::Cop::Style::SendWithLiteralMethodName::STATIC_METHOD_NAME_NODE_TYPES = T.let(T.unsafe(nil), Array)
+
# Checks for uses of `fail` and `raise`.
#
# @example EnforcedStyle: only_raise (default)
@@ -48832,10 +49829,10 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#242
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#261
def allow_modifier?; end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#227
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#233
def arguments_range(node); end
# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#81
@@ -48853,25 +49850,25 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#145
def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#175
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#181
def correct_for_comment(corrector, node, if_branch); end
# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#136
def correct_for_guard_condition_style(corrector, outer_condition, if_branch, and_operator); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#165
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#171
def correct_for_outer_condition_modify_form_style(corrector, node, if_branch); end
# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#130
def correct_from_unless_to_if(corrector, node, is_modify_form: T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#184
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#190
def correct_outer_condition(corrector, condition); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#197
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#203
def insert_bang(corrector, node, is_modify_form); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#210
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#216
def insert_bang_for_and(corrector, node); end
# @return [Boolean]
@@ -48881,15 +49878,18 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#246
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#265
def outer_condition_modify_form?(node, if_branch); end
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#238
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#254
+ def parenthesized_method_arguments(node); end
+
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#244
def replace_condition(condition); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#222
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#228
def require_parentheses?(condition); end
# @return [Boolean]
@@ -48902,7 +49902,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#233
+ # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#239
def wrap_condition?(node); end
class << self
@@ -48919,13 +49919,30 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String)
# will add a require statement to the top of the file if
# enabled by RequireEnglish config.
#
-# Like `use_perl_names` but allows builtin global vars.
-#
+# @example EnforcedStyle: use_english_names (default)
# # good
+# require 'English' # or this could be in another file.
+#
# puts $LOAD_PATH
# puts $LOADED_FEATURES
# puts $PROGRAM_NAME
-# puts ARGV
+# puts $ERROR_INFO
+# puts $ERROR_POSITION
+# puts $FIELD_SEPARATOR # or $FS
+# puts $OUTPUT_FIELD_SEPARATOR # or $OFS
+# puts $INPUT_RECORD_SEPARATOR # or $RS
+# puts $OUTPUT_RECORD_SEPARATOR # or $ORS
+# puts $INPUT_LINE_NUMBER # or $NR
+# puts $LAST_READ_LINE
+# puts $DEFAULT_OUTPUT
+# puts $DEFAULT_INPUT
+# puts $PROCESS_ID # or $PID
+# puts $CHILD_STATUS
+# puts $LAST_MATCH_INFO
+# puts $IGNORECASE
+# puts $ARGV # or ARGV
+# @example EnforcedStyle: use_perl_names
+# # good
# puts $:
# puts $"
# puts $0
@@ -48944,31 +49961,14 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String)
# puts $~
# puts $=
# puts $*
+# @example EnforcedStyle: use_builtin_english_names
#
-# @example EnforcedStyle: use_english_names (default)
# # good
-# require 'English' # or this could be in another file.
-#
+# # Like `use_perl_names` but allows builtin global vars.
# puts $LOAD_PATH
# puts $LOADED_FEATURES
# puts $PROGRAM_NAME
-# puts $ERROR_INFO
-# puts $ERROR_POSITION
-# puts $FIELD_SEPARATOR # or $FS
-# puts $OUTPUT_FIELD_SEPARATOR # or $OFS
-# puts $INPUT_RECORD_SEPARATOR # or $RS
-# puts $OUTPUT_RECORD_SEPARATOR # or $ORS
-# puts $INPUT_LINE_NUMBER # or $NR
-# puts $LAST_READ_LINE
-# puts $DEFAULT_OUTPUT
-# puts $DEFAULT_INPUT
-# puts $PROCESS_ID # or $PID
-# puts $CHILD_STATUS
-# puts $LAST_MATCH_INFO
-# puts $IGNORECASE
-# puts $ARGV # or ARGV
-# @example EnforcedStyle: use_perl_names
-# # good
+# puts ARGV
# puts $:
# puts $"
# puts $0
@@ -48987,90 +49987,89 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String)
# puts $~
# puts $=
# puts $*
-# @example EnforcedStyle: use_builtin_english_names
#
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#87
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#86
class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::RequireLibrary
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#176
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#175
def autocorrect(corrector, node, global_var); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#168
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#167
def message(global_var); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#152
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#151
def on_gvar(node); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#147
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#146
def on_new_investigation; end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#247
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#246
def add_require_english?; end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#241
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#240
def english_name_replacement(preferred_name, node); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#190
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#189
def format_english_message(global_var); end
# For now, we assume that lists are 2 items or less. Easy grammar!
#
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#212
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#211
def format_list(items); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#198
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#197
def format_message(english, regular, global); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#235
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#234
def matching_styles(global); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#227
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#226
def preferred_names(global); end
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#216
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#215
def replacement(node, global_var); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#251
+ # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#250
def should_require_english?(global_var); end
end
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#128
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#127
RuboCop::Cop::Style::SpecialGlobalVars::BUILTIN_VARS = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#100
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#99
RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#145
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#144
RuboCop::Cop::Style::SpecialGlobalVars::LIBRARY_NAME = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#93
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#92
RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#96
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#95
RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#98
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#97
RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String)
# Anything *not* in this set is provided by the English library.
#
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#122
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#121
RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#124
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#123
RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#139
+# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#138
RuboCop::Cop::Style::SpecialGlobalVars::STYLE_VARS_MAP = T.let(T.unsafe(nil), Hash)
# Check for parentheses around stabby lambda arguments.
@@ -49672,6 +50671,118 @@ end
# source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#30
RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String)
+# Checks for redundant argument forwarding when calling super with arguments identical to
+# the method definition.
+#
+# Using zero arity `super` within a `define_method` block results in `RuntimeError`:
+#
+# [source,ruby]
+# ----
+# def m
+# define_method(:foo) { super() } # => OK
+# end
+#
+# def m
+# define_method(:foo) { super } # => RuntimeError
+# end
+# ----
+#
+# Furthermore, any arguments accompanied by a block may potentially be delegating to
+# `define_method`, therefore, `super` used within these blocks will be allowed.
+# This approach might result in false negatives, yet ensuring safe detection takes precedence.
+#
+# @example
+# # bad
+# def method(*args, **kwargs)
+# super(*args, **kwargs)
+# end
+#
+# # good - implicitly passing all arguments
+# def method(*args, **kwargs)
+# super
+# end
+#
+# # good - forwarding a subset of the arguments
+# def method(*args, **kwargs)
+# super(*args)
+# end
+#
+# # good - forwarding no arguments
+# def method(*args, **kwargs)
+# super()
+# end
+#
+# # good - assigning to the block variable before calling super
+# def method(&block)
+# # Assigning to the block variable would pass the old value to super,
+# # under this circumstance the block must be referenced explicitly.
+# block ||= proc { 'fallback behavior' }
+# super(&block)
+# end
+#
+# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#54
+class RuboCop::Cop::Style::SuperArguments < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#62
+ def on_super(super_node); end
+
+ private
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#81
+ def arguments_identical?(def_node, def_args, super_args); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#136
+ def block_arg_same?(def_node, def_arg, super_arg); end
+
+ # Reassigning the block argument will still pass along the original block to super
+ # https://bugs.ruby-lang.org/issues/20505
+ #
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#147
+ def block_reassigned?(def_node, block_arg_name); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#158
+ def forward_arg_same?(def_arg, super_arg); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#116
+ def keyword_arg_same?(def_arg, super_arg); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#126
+ def keyword_rest_arg_same?(def_arg, super_arg); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#99
+ def positional_arg_same?(def_arg, super_arg); end
+
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#106
+ def positional_rest_arg_same(def_arg, super_arg); end
+
+ # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#162
+ def preprocess_super_args(super_args); end
+end
+
+# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#58
+RuboCop::Cop::Style::SuperArguments::ASSIGN_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#57
+RuboCop::Cop::Style::SuperArguments::DEF_TYPES = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#60
+RuboCop::Cop::Style::SuperArguments::MSG = T.let(T.unsafe(nil), String)
+
# Enforces the presence of parentheses in `super` containing arguments.
#
# `super` is a keyword and is provided as a distinct cop from those designed for method call.
@@ -49895,9 +51006,11 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String)
# `define_method?` methods are allowed by default.
# These are customizable with `AllowedMethods` option.
#
-# @example AllowedPatterns: ['map'] (default)
+# @example AllCops:ActiveSupportExtensionsEnabled: true
# # good
-# something.map { |s| s.upcase }
+# ->(x) { x.foo }
+# proc { |x| x.foo }
+# Proc.new { |x| x.foo }
# @example AllowMethodsWithArguments: false (default)
# # bad
# something.do_something(foo) { |o| o.bar }
@@ -49927,6 +51040,19 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String)
# @example AllowedPatterns: [] (default)
# # bad
# something.map { |s| s.upcase }
+# @example AllowedPatterns: ['map'] (default)
+# # good
+# something.map { |s| s.upcase }
+# @example AllCops:ActiveSupportExtensionsEnabled: false (default)
+# # bad
+# ->(x) { x.foo }
+# proc { |x| x.foo }
+# Proc.new { |x| x.foo }
+#
+# # good
+# lambda(&:foo)
+# proc(&:foo)
+# Proc.new(&:foo)
# @example
# # bad
# something.map { |s| s.upcase }
@@ -49935,7 +51061,7 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String)
# # good
# something.map(&:upcase)
#
-# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#123
+# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#140
class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CommentsHelp
include ::RuboCop::Cop::RangeHelp
@@ -49945,81 +51071,87 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#172
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#189
def destructuring_block_argument?(argument_node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#170
def on_block(node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#170
def on_numblock(node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#134
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152
def proc_node?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#140
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#158
def symbol_proc?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#137
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#155
def symbol_proc_receiver?(param0 = T.unsafe(nil)); end
private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#240
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#274
def allow_comments?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#236
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#270
def allow_if_method_has_argument?(send_node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#187
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#204
def allowed_method_name?(name); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#200
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#217
def autocorrect(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#212
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#247
+ def autocorrect_lambda_block(corrector, node); end
+
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#238
def autocorrect_with_args(corrector, node, args, method_name); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#208
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#225
def autocorrect_without_args(corrector, node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#226
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#260
def begin_pos_for_replacement(node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#221
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#255
def block_range_with_space(node); end
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#191
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#208
def register_offense(node, method_name, block_method_name); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#183
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#200
def unsafe_array_usage?(node); end
# See: https://github.com/rubocop/rubocop/issues/10864
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#179
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#196
def unsafe_hash_usage?(node); end
class << self
- # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#147
+ # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#165
def autocorrect_incompatible_with; end
end
end
-# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#130
+# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#149
+RuboCop::Cop::Style::SymbolProc::LAMBDA_OR_PROC = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#147
RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String)
-# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#131
+# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#148
RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array)
# Corrector to correct conditional assignment in ternary conditions.
@@ -50115,7 +51247,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
include ::RuboCop::Cop::SurroundingSpace
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#193
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#191
def method_name(param0 = T.unsafe(nil)); end
# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#69
@@ -50128,7 +51260,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#183
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#181
def below_ternary_precedence?(child); end
# If the condition is parenthesized we recurse and check for any
@@ -50144,15 +51276,25 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#89
def condition_as_parenthesized_one_line_pattern_matching?(condition); end
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#198
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#196
def correct_parenthesized(corrector, condition); end
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#208
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#210
def correct_unparenthesized(corrector, condition); end
# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#151
def message(node); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#227
+ def node_args_need_parens?(send_node); end
+
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#234
+ def node_with_args?(node); end
+
# Anything that is not a variable, constant, or method/.method call
# will be counted as a complex expression.
#
@@ -50176,6 +51318,9 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#85
def only_closing_parenthesis_is_last_line?(condition); end
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#214
+ def parenthesize_condition_arguments(corrector, send_node); end
+
# @return [Boolean]
#
# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#169
@@ -50193,7 +51338,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#179
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#177
def unparenthesized_method_call?(child); end
# @return [Boolean]
@@ -50203,7 +51348,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#212
+ # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#222
def whitespace_after?(node); end
end
@@ -51297,7 +52442,6 @@ RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String)
# while x.any?
# do_something(x.pop)
# end
-# @example
#
# # bad
# until x.empty? do
@@ -51309,18 +52453,18 @@ RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String)
# do_something(x.pop)
# end
#
-# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#31
+# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#29
class RuboCop::Cop::Style::WhileUntilDo < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#36
+ # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34
def on_until(node); end
- # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#36
+ # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34
def on_while(node); end
end
-# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34
+# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#32
RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String)
# Checks for while and until statements that would fit on one line
@@ -51335,7 +52479,7 @@ RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String)
#
# # good
# x += 1 while x < 10
-# @example
+#
# # bad
# until x > 10
# x += 1
@@ -51352,22 +52496,21 @@ RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String)
# x += 100
# end
#
-# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#36
+# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#35
class RuboCop::Cop::Style::WhileUntilModifier < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Alignment
include ::RuboCop::Cop::LineLengthHelp
- include ::RuboCop::Cop::RangeHelp
include ::RuboCop::Cop::StatementModifier
extend ::RuboCop::Cop::AutoCorrector
- # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#42
+ # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#41
def on_until(node); end
- # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#42
+ # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#41
def on_while(node); end
end
-# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#40
+# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#39
RuboCop::Cop::Style::WhileUntilModifier::MSG = T.let(T.unsafe(nil), String)
# Checks for array literals made up of word-like
@@ -51787,39 +52930,42 @@ class RuboCop::Cop::Style::ZeroLengthPredicate < ::RuboCop::Cop::Base
# implement `#size`, but not `#empty`. We ignore those to
# reduce false positives.
#
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#139
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#147
def non_polymorphic_collection?(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#109
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#114
def nonzero_length_comparison(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#51
+ def on_csend(node); end
+
# source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#45
def on_send(node); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#130
- def other_receiver(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#138
+ def other_length_node(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#101
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#106
def zero_length_comparison(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#96
- def zero_length_predicate(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#130
+ def zero_length_node(param0 = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#122
- def zero_length_receiver(param0 = T.unsafe(nil)); end
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#101
+ def zero_length_predicate?(param0 = T.unsafe(nil)); end
private
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#80
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#85
def check_nonzero_length_comparison(node); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#65
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#70
def check_zero_length_comparison(node); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#53
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#58
def check_zero_length_predicate(node); end
- # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#114
+ # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#119
def replacement(node); end
end
@@ -51939,138 +53085,138 @@ end
# first the ones needed for autocorrection (if any), then the rest
# (unless autocorrections happened).
#
-# source://rubocop//lib/rubocop/cop/team.rb#12
+# source://rubocop//lib/rubocop/cop/team.rb#13
class RuboCop::Cop::Team
# @return [Team] a new instance of Team
#
- # source://rubocop//lib/rubocop/cop/team.rb#55
+ # source://rubocop//lib/rubocop/cop/team.rb#61
def initialize(cops, config = T.unsafe(nil), options = T.unsafe(nil)); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/team.rb#66
+ # source://rubocop//lib/rubocop/cop/team.rb#72
def autocorrect?; end
# Returns the value of attribute cops.
#
- # source://rubocop//lib/rubocop/cop/team.rb#51
+ # source://rubocop//lib/rubocop/cop/team.rb#57
def cops; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/team.rb#70
+ # source://rubocop//lib/rubocop/cop/team.rb#76
def debug?; end
# Returns the value of attribute errors.
#
- # source://rubocop//lib/rubocop/cop/team.rb#51
+ # source://rubocop//lib/rubocop/cop/team.rb#57
def errors; end
- # source://rubocop//lib/rubocop/cop/team.rb#114
+ # source://rubocop//lib/rubocop/cop/team.rb#128
def external_dependency_checksum; end
# @deprecated
#
- # source://rubocop//lib/rubocop/cop/team.rb#110
+ # source://rubocop//lib/rubocop/cop/team.rb#120
def forces; end
- # source://rubocop//lib/rubocop/cop/team.rb#76
+ # source://rubocop//lib/rubocop/cop/team.rb#82
def inspect_file(processed_source); end
# @return [Commissioner::InvestigationReport]
#
- # source://rubocop//lib/rubocop/cop/team.rb#81
+ # source://rubocop//lib/rubocop/cop/team.rb#91
def investigate(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end
# Returns the value of attribute updated_source_file.
#
- # source://rubocop//lib/rubocop/cop/team.rb#51
+ # source://rubocop//lib/rubocop/cop/team.rb#57
def updated_source_file; end
# Returns the value of attribute updated_source_file.
#
- # source://rubocop//lib/rubocop/cop/team.rb#51
+ # source://rubocop//lib/rubocop/cop/team.rb#57
def updated_source_file?; end
# Returns the value of attribute warnings.
#
- # source://rubocop//lib/rubocop/cop/team.rb#51
+ # source://rubocop//lib/rubocop/cop/team.rb#57
def warnings; end
private
- # source://rubocop//lib/rubocop/cop/team.rb#121
+ # source://rubocop//lib/rubocop/cop/team.rb#139
def autocorrect(processed_source, report, original:, offset:); end
- # source://rubocop//lib/rubocop/cop/team.rb#185
+ # source://rubocop//lib/rubocop/cop/team.rb#203
def autocorrect_report(report, offset:, original:); end
- # source://rubocop//lib/rubocop/cop/team.rb#140
+ # source://rubocop//lib/rubocop/cop/team.rb#158
def be_ready; end
- # source://rubocop//lib/rubocop/cop/team.rb#191
+ # source://rubocop//lib/rubocop/cop/team.rb#209
def collate_corrections(report, offset:, original:); end
- # source://rubocop//lib/rubocop/cop/team.rb#207
+ # source://rubocop//lib/rubocop/cop/team.rb#225
def each_corrector(report); end
- # source://rubocop//lib/rubocop/cop/team.rb#257
+ # source://rubocop//lib/rubocop/cop/team.rb#277
def handle_error(error, location, cop); end
- # source://rubocop//lib/rubocop/cop/team.rb#249
+ # source://rubocop//lib/rubocop/cop/team.rb#269
def handle_warning(error, location); end
# @return [Commissioner::InvestigationReport]
#
- # source://rubocop//lib/rubocop/cop/team.rb#154
+ # source://rubocop//lib/rubocop/cop/team.rb#172
def investigate_partial(cops, processed_source, offset:, original:); end
- # source://rubocop//lib/rubocop/cop/team.rb#234
+ # source://rubocop//lib/rubocop/cop/team.rb#252
def process_errors(file, errors); end
- # source://rubocop//lib/rubocop/cop/team.rb#148
+ # source://rubocop//lib/rubocop/cop/team.rb#166
def reset; end
# @return [Array]
#
- # source://rubocop//lib/rubocop/cop/team.rb#160
+ # source://rubocop//lib/rubocop/cop/team.rb#178
def roundup_relevant_cops(processed_source); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/team.rb#176
+ # source://rubocop//lib/rubocop/cop/team.rb#194
def support_target_rails_version?(cop); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/team.rb#170
+ # source://rubocop//lib/rubocop/cop/team.rb#188
def support_target_ruby_version?(cop); end
- # source://rubocop//lib/rubocop/cop/team.rb#222
+ # source://rubocop//lib/rubocop/cop/team.rb#240
def suppress_clobbering; end
- # source://rubocop//lib/rubocop/cop/team.rb#228
+ # source://rubocop//lib/rubocop/cop/team.rb#246
def validate_config; end
class << self
# @return [Array] needed for the given cops
#
- # source://rubocop//lib/rubocop/cop/team.rb#37
+ # source://rubocop//lib/rubocop/cop/team.rb#43
def forces_for(cops); end
# @return [Team] with cops assembled from the given `cop_classes`
#
- # source://rubocop//lib/rubocop/cop/team.rb#22
+ # source://rubocop//lib/rubocop/cop/team.rb#28
def mobilize(cop_classes, config, options = T.unsafe(nil)); end
# @return [Array]
#
- # source://rubocop//lib/rubocop/cop/team.rb#28
+ # source://rubocop//lib/rubocop/cop/team.rb#34
def mobilize_cops(cop_classes, config, options = T.unsafe(nil)); end
# @return [Team]
#
- # source://rubocop//lib/rubocop/cop/team.rb#14
+ # source://rubocop//lib/rubocop/cop/team.rb#15
def new(cop_or_classes, config, options = T.unsafe(nil)); end
end
end
@@ -52300,19 +53446,19 @@ module RuboCop::Cop::Util
private
- # source://rubocop//lib/rubocop/cop/util.rb#35
+ # source://rubocop//lib/rubocop/cop/util.rb#39
def add_parentheses(node, corrector); end
- # source://rubocop//lib/rubocop/cop/util.rb#56
+ # source://rubocop//lib/rubocop/cop/util.rb#60
def any_descendant?(node, *types); end
- # source://rubocop//lib/rubocop/cop/util.rb#71
+ # source://rubocop//lib/rubocop/cop/util.rb#75
def args_begin(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#83
+ # source://rubocop//lib/rubocop/cop/util.rb#87
def args_end(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#104
+ # source://rubocop//lib/rubocop/cop/util.rb#108
def begins_its_line?(range); end
# This is a bad API
@@ -52325,78 +53471,78 @@ module RuboCop::Cop::Util
# source://rubocop//lib/rubocop/cop/util.rb#22
def comment_lines?(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#192
+ # source://rubocop//lib/rubocop/cop/util.rb#198
def compatible_external_encoding_for?(src); end
# If converting a string to Ruby string literal source code, must
# double quotes be used?
#
- # source://rubocop//lib/rubocop/cop/util.rb#130
+ # source://rubocop//lib/rubocop/cop/util.rb#134
def double_quotes_required?(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#144
+ # source://rubocop//lib/rubocop/cop/util.rb#148
def escape_string(string); end
# Returns, for example, a bare `if` node if the given node is an `if`
# with calls chained to the end of it.
#
- # source://rubocop//lib/rubocop/cop/util.rb#114
+ # source://rubocop//lib/rubocop/cop/util.rb#118
def first_part_of_call_chain(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#197
+ # source://rubocop//lib/rubocop/cop/util.rb#203
def include_or_equal?(source, target); end
- # source://rubocop//lib/rubocop/cop/util.rb#179
+ # source://rubocop//lib/rubocop/cop/util.rb#185
def indent(node, offset: T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/util.rb#161
+ # source://rubocop//lib/rubocop/cop/util.rb#165
def interpret_string_escapes(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#165
+ # source://rubocop//lib/rubocop/cop/util.rb#169
def line(node_or_range); end
- # source://rubocop//lib/rubocop/cop/util.rb#26
+ # source://rubocop//lib/rubocop/cop/util.rb#30
def line_range(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#140
+ # source://rubocop//lib/rubocop/cop/util.rb#144
def needs_escaping?(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#87
+ # source://rubocop//lib/rubocop/cop/util.rb#91
def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end
- # source://rubocop//lib/rubocop/cop/util.rb#30
+ # source://rubocop//lib/rubocop/cop/util.rb#34
def parentheses?(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#173
+ # source://rubocop//lib/rubocop/cop/util.rb#177
def same_line?(node1, node2); end
- # source://rubocop//lib/rubocop/cop/util.rb#148
+ # source://rubocop//lib/rubocop/cop/util.rb#152
def to_string_literal(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#185
+ # source://rubocop//lib/rubocop/cop/util.rb#191
def to_supported_styles(enforced_style); end
- # source://rubocop//lib/rubocop/cop/util.rb#157
+ # source://rubocop//lib/rubocop/cop/util.rb#161
def trim_string_interpolation_escape_character(str); end
class << self
- # source://rubocop//lib/rubocop/cop/util.rb#35
+ # source://rubocop//lib/rubocop/cop/util.rb#39
def add_parentheses(node, corrector); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#56
+ # source://rubocop//lib/rubocop/cop/util.rb#60
def any_descendant?(node, *types); end
- # source://rubocop//lib/rubocop/cop/util.rb#71
+ # source://rubocop//lib/rubocop/cop/util.rb#75
def args_begin(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#83
+ # source://rubocop//lib/rubocop/cop/util.rb#87
def args_end(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#104
+ # source://rubocop//lib/rubocop/cop/util.rb#108
def begins_its_line?(range); end
# This is a bad API
@@ -52417,62 +53563,62 @@ module RuboCop::Cop::Util
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#130
+ # source://rubocop//lib/rubocop/cop/util.rb#134
def double_quotes_required?(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#144
+ # source://rubocop//lib/rubocop/cop/util.rb#148
def escape_string(string); end
# Returns, for example, a bare `if` node if the given node is an `if`
# with calls chained to the end of it.
#
- # source://rubocop//lib/rubocop/cop/util.rb#114
+ # source://rubocop//lib/rubocop/cop/util.rb#118
def first_part_of_call_chain(node); end
- # source://rubocop//lib/rubocop/cop/util.rb#179
+ # source://rubocop//lib/rubocop/cop/util.rb#185
def indent(node, offset: T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/cop/util.rb#161
+ # source://rubocop//lib/rubocop/cop/util.rb#165
def interpret_string_escapes(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#165
+ # source://rubocop//lib/rubocop/cop/util.rb#169
def line(node_or_range); end
- # source://rubocop//lib/rubocop/cop/util.rb#26
+ # source://rubocop//lib/rubocop/cop/util.rb#30
def line_range(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#140
+ # source://rubocop//lib/rubocop/cop/util.rb#144
def needs_escaping?(string); end
# @yield [sexp]
#
- # source://rubocop//lib/rubocop/cop/util.rb#87
+ # source://rubocop//lib/rubocop/cop/util.rb#91
def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#30
+ # source://rubocop//lib/rubocop/cop/util.rb#34
def parentheses?(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/util.rb#173
+ # source://rubocop//lib/rubocop/cop/util.rb#177
def same_line?(node1, node2); end
- # source://rubocop//lib/rubocop/cop/util.rb#148
+ # source://rubocop//lib/rubocop/cop/util.rb#152
def to_string_literal(string); end
- # source://rubocop//lib/rubocop/cop/util.rb#185
+ # source://rubocop//lib/rubocop/cop/util.rb#191
def to_supported_styles(enforced_style); end
- # source://rubocop//lib/rubocop/cop/util.rb#157
+ # source://rubocop//lib/rubocop/cop/util.rb#161
def trim_string_interpolation_escape_character(str); end
end
end
-# source://rubocop//lib/rubocop/cop/util.rb#99
+# source://rubocop//lib/rubocop/cop/util.rb#103
RuboCop::Cop::Util::LINE_BEGINS_REGEX_CACHE = T.let(T.unsafe(nil), Hash)
# Match literal regex characters, not including anchors, character
@@ -52484,7 +53630,7 @@ RuboCop::Cop::Util::LITERAL_REGEX = T.let(T.unsafe(nil), Regexp)
# Arbitrarily chosen value, should be enough to cover
# the most nested source code in real world projects.
#
-# source://rubocop//lib/rubocop/cop/util.rb#98
+# source://rubocop//lib/rubocop/cop/util.rb#102
RuboCop::Cop::Util::MAX_LINE_BEGINS_REGEX_INDEX = T.let(T.unsafe(nil), Integer)
# source://rubocop//lib/rubocop/cop/utils/format_string.rb#5
@@ -52717,59 +53863,59 @@ class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#76
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#79
def investigate(processed_source); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#85
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#88
def process_node(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#71
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#74
def variable_table; end
private
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def after_declaring_variable(arg); end
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def after_entering_scope(arg); end
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def after_leaving_scope(arg); end
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def before_declaring_variable(arg); end
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def before_entering_scope(arg); end
- # source://rubocop//lib/rubocop/cop/variable_force.rb#368
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#380
def before_leaving_scope(arg); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#339
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#351
def descendant_reference(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#329
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#341
def each_descendant_reference(loop_node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#314
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#326
def find_variables_in_loop(loop_node); end
# This is called for each scope recursively.
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#94
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#97
def inspect_variables_in_scope(scope_node); end
# Mark all assignments which are referenced in the same loop
@@ -52778,104 +53924,109 @@ class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force
#
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#295
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#307
def mark_assignments_as_referenced_in_loop(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#126
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#130
def node_handler_method_name(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#100
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#103
def process_children(origin_node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#231
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#243
def process_loop(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#160
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#182
+ def process_pattern_match_variable(node); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#164
def process_regexp_named_captures(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#246
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#258
def process_rescue(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#265
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#277
def process_scope(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#284
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#296
def process_send(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#142
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#146
def process_variable_assignment(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#130
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#134
def process_variable_declaration(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#219
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#231
def process_variable_multiple_assignment(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#184
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#196
def process_variable_operator_assignment(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#226
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#238
def process_variable_referencing(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#257
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#269
def process_zero_arity_super(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#178
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#190
def regexp_captured_names(node); end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#351
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#363
def scanned_node?(node); end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#355
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#367
def scanned_nodes; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#108
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#111
def skip_children!; end
# @api private
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#278
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#290
def twisted_nodes(node); end
end
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#32
+# source://rubocop//lib/rubocop/cop/variable_force.rb#35
RuboCop::Cop::VariableForce::ARGUMENT_DECLARATION_TYPES = T.let(T.unsafe(nil), Array)
# This class represents each assignment of a variable.
@@ -52886,28 +54037,28 @@ class RuboCop::Cop::VariableForce::Assignment
# @return [Assignment] a new instance of Assignment
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#16
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#17
def initialize(node, variable); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#50
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#58
def exception_assignment?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#72
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#80
def for_assignment?; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#83
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#91
def meta_assignment_node; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#60
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#68
def multiple_assignment?; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#29
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#31
def name; end
# Returns the value of attribute node.
@@ -52915,15 +54066,28 @@ class RuboCop::Cop::VariableForce::Assignment
# source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12
def node; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#78
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#86
def operator; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#54
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#62
def operator_assignment?; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#37
+ # Returns the value of attribute reassigned.
+ #
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12
+ def reassigned; end
+
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#44
+ def reassigned!; end
+
+ # Returns the value of attribute reassigned.
+ #
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12
+ def reassigned?; end
+
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#39
def reference!(node); end
# Returns the value of attribute referenced.
@@ -52943,20 +54107,20 @@ class RuboCop::Cop::VariableForce::Assignment
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#46
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#54
def regexp_named_capture?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#66
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#74
def rest_assignment?; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#33
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#35
def scope; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#42
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#50
def used?; end
# Returns the value of attribute variable.
@@ -52966,19 +54130,19 @@ class RuboCop::Cop::VariableForce::Assignment
private
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#125
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#140
def find_multiple_assignment_node(grandparent_node); end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#121
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#130
def for_assignment_node; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#104
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#112
def multiple_assignment_node; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#96
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#104
def operator_assignment_node; end
- # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#114
+ # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#123
def rest_assignment_node; end
end
@@ -52987,12 +54151,12 @@ RuboCop::Cop::VariableForce::Assignment::MULTIPLE_LEFT_HAND_SIDE_TYPE = T.let(T.
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#65
+# source://rubocop//lib/rubocop/cop/variable_force.rb#68
class RuboCop::Cop::VariableForce::AssignmentReference < ::Struct
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#66
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#69
def assignment?; end
# Returns the value of attribute node
@@ -53432,32 +54596,37 @@ end
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#39
+# source://rubocop//lib/rubocop/cop/variable_force.rb#42
RuboCop::Cop::VariableForce::LOGICAL_OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#48
+# source://rubocop//lib/rubocop/cop/variable_force.rb#51
RuboCop::Cop::VariableForce::LOOP_TYPES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#42
+# source://rubocop//lib/rubocop/cop/variable_force.rb#45
RuboCop::Cop::VariableForce::MULTIPLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#112
+# source://rubocop//lib/rubocop/cop/variable_force.rb#115
RuboCop::Cop::VariableForce::NODE_HANDLER_METHOD_NAMES = T.let(T.unsafe(nil), Hash)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#40
+# source://rubocop//lib/rubocop/cop/variable_force.rb#43
RuboCop::Cop::VariableForce::OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#47
+# source://rubocop//lib/rubocop/cop/variable_force.rb#30
+RuboCop::Cop::VariableForce::PATTERN_MATCH_VARIABLE_TYPE = T.let(T.unsafe(nil), Symbol)
+
+# @api private
+#
+# source://rubocop//lib/rubocop/cop/variable_force.rb#50
RuboCop::Cop::VariableForce::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array)
# @api private
@@ -53467,12 +54636,12 @@ RuboCop::Cop::VariableForce::REGEXP_NAMED_CAPTURE_TYPE = T.let(T.unsafe(nil), Sy
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#50
+# source://rubocop//lib/rubocop/cop/variable_force.rb#53
RuboCop::Cop::VariableForce::RESCUE_TYPE = T.let(T.unsafe(nil), Symbol)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#43
+# source://rubocop//lib/rubocop/cop/variable_force.rb#46
RuboCop::Cop::VariableForce::REST_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol)
# This class represents each reference of a variable.
@@ -53522,12 +54691,12 @@ RuboCop::Cop::VariableForce::Reference::VARIABLE_REFERENCE_TYPES = T.let(T.unsaf
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#55
+# source://rubocop//lib/rubocop/cop/variable_force.rb#58
RuboCop::Cop::VariableForce::SCOPE_TYPES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#57
+# source://rubocop//lib/rubocop/cop/variable_force.rb#60
RuboCop::Cop::VariableForce::SEND_TYPE = T.let(T.unsafe(nil), Symbol)
# A Scope represents a context of local variable visibility.
@@ -53606,7 +54775,7 @@ RuboCop::Cop::VariableForce::Scope::OUTER_SCOPE_CHILD_INDICES = T.let(T.unsafe(n
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#54
+# source://rubocop//lib/rubocop/cop/variable_force.rb#57
RuboCop::Cop::VariableForce::TWISTED_SCOPE_TYPES = T.let(T.unsafe(nil), Array)
# @api private
@@ -53616,12 +54785,12 @@ RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Sym
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#30
+# source://rubocop//lib/rubocop/cop/variable_force.rb#31
RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#45
+# source://rubocop//lib/rubocop/cop/variable_force.rb#48
RuboCop::Cop::VariableForce::VARIABLE_REFERENCE_TYPE = T.let(T.unsafe(nil), Symbol)
# A Variable represents existence of a local variable.
@@ -53636,7 +54805,7 @@ class RuboCop::Cop::VariableForce::Variable
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#94
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#98
def argument?; end
# source://rubocop//lib/rubocop/cop/variable_force/variable.rb#31
@@ -53649,10 +54818,10 @@ class RuboCop::Cop::VariableForce::Variable
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#102
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#106
def block_argument?; end
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#74
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#78
def capture_with_block!; end
# Returns the value of attribute captured_by_block.
@@ -53672,22 +54841,22 @@ class RuboCop::Cop::VariableForce::Variable
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#110
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#114
def explicit_block_local_variable?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#66
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#70
def in_modifier_conditional?(assignment); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#106
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#110
def keyword_argument?; end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#98
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#102
def method_argument?; end
# Returns the value of attribute name.
@@ -53695,12 +54864,12 @@ class RuboCop::Cop::VariableForce::Variable
# source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11
def name; end
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#40
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#44
def reference!(node); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#35
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#39
def referenced?; end
# Returns the value of attribute references.
@@ -53715,7 +54884,7 @@ class RuboCop::Cop::VariableForce::Variable
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#90
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#94
def should_be_unused?; end
# This is a convenient way to check whether the variable is used
@@ -53729,7 +54898,7 @@ class RuboCop::Cop::VariableForce::Variable
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#86
+ # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#90
def used?; end
end
@@ -53738,12 +54907,12 @@ RuboCop::Cop::VariableForce::Variable::VARIABLE_DECLARATION_TYPES = T.let(T.unsa
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#59
+# source://rubocop//lib/rubocop/cop/variable_force.rb#62
class RuboCop::Cop::VariableForce::VariableReference < ::Struct
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/cop/variable_force.rb#60
+ # source://rubocop//lib/rubocop/cop/variable_force.rb#63
def assignment?; end
# Returns the value of attribute name
@@ -53825,7 +54994,7 @@ end
# @api private
#
-# source://rubocop//lib/rubocop/cop/variable_force.rb#52
+# source://rubocop//lib/rubocop/cop/variable_force.rb#55
RuboCop::Cop::VariableForce::ZERO_ARITY_SUPER_TYPE = T.let(T.unsafe(nil), Symbol)
# Help methods for determining node visibility.
@@ -54175,13 +55344,10 @@ end
#
# source://rubocop//lib/rubocop/ext/regexp_node.rb#6
module RuboCop::Ext::RegexpNode
- # Please remove this `else` branch when support for regexp_parser 1.8 will be dropped.
- # It's for compatibility with regexp_parser 1.8 and will never be maintained.
- #
- # source://rubocop//lib/rubocop/ext/regexp_node.rb#19
+ # source://rubocop//lib/rubocop/ext/regexp_node.rb#18
def assign_properties(*_arg0); end
- # source://rubocop//lib/rubocop/ext/regexp_node.rb#53
+ # source://rubocop//lib/rubocop/ext/regexp_node.rb#31
def each_capture(named: T.unsafe(nil)); end
# Note: we extend Regexp nodes to provide `loc` and `expression`
@@ -54196,10 +55362,10 @@ module RuboCop::Ext::RegexpNode
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/ext/regexp_node.rb#65
+ # source://rubocop//lib/rubocop/ext/regexp_node.rb#43
def named_capturing?(exp, event, named); end
- # source://rubocop//lib/rubocop/ext/regexp_node.rb#73
+ # source://rubocop//lib/rubocop/ext/regexp_node.rb#51
def with_interpolations_blanked; end
end
@@ -54220,7 +55386,7 @@ module RuboCop::Ext::RegexpParser::Expression; end
module RuboCop::Ext::RegexpParser::Expression::Base
# Shortcut to `loc.expression`
#
- # source://rubocop//lib/rubocop/ext/regexp_parser.rb#27
+ # source://rubocop//lib/rubocop/ext/regexp_parser.rb#26
def expression; end
# E.g.
@@ -54233,7 +55399,7 @@ module RuboCop::Ext::RegexpParser::Expression::Base
#
# Please open issue if you need other locations
#
- # source://rubocop//lib/rubocop/ext/regexp_parser.rb#61
+ # source://rubocop//lib/rubocop/ext/regexp_parser.rb#44
def loc; end
# Returns the value of attribute origin.
@@ -54250,15 +55416,15 @@ module RuboCop::Ext::RegexpParser::Expression::Base
private
- # source://rubocop//lib/rubocop/ext/regexp_parser.rb#67
+ # source://rubocop//lib/rubocop/ext/regexp_parser.rb#50
def build_location; end
end
# Provide `CharacterSet` with `begin` and `end` locations.
#
-# source://rubocop//lib/rubocop/ext/regexp_parser.rb#79
+# source://rubocop//lib/rubocop/ext/regexp_parser.rb#62
module RuboCop::Ext::RegexpParser::Expression::CharacterSet
- # source://rubocop//lib/rubocop/ext/regexp_parser.rb#80
+ # source://rubocop//lib/rubocop/ext/regexp_parser.rb#63
def build_location; end
end
@@ -54386,11 +55552,16 @@ module RuboCop::FileFinder
# source://rubocop//lib/rubocop/file_finder.rb#20
def find_last_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/file_finder.rb#26
+ def traverse_directories_upwards(start_dir, stop_dir = T.unsafe(nil)); end
+
private
# @api private
#
- # source://rubocop//lib/rubocop/file_finder.rb#28
+ # source://rubocop//lib/rubocop/file_finder.rb#36
def traverse_files_upwards(filename, start_dir, stop_dir); end
class << self
@@ -54657,16 +55828,16 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#73
def command; end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#161
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#165
def cop_config_params(default_cfg, cfg); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#181
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#185
def default_config(cop_name); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#225
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#229
def excludes(offending_files, cop_name, parent); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#196
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#200
def filtered_config(cfg); end
# Returns true if the given arr include the given elm or if any of the
@@ -54674,38 +55845,38 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo
#
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#273
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#277
def include_or_match?(arr, elm); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#246
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#250
def merge_mode_for_exclude?(cfg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#267
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#271
def no_exclude_limit?; end
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#102
def output_cop(cop_name, offense_count); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#133
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#137
def output_cop_comments(output_buffer, cfg, cop_name, offense_count); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#185
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#189
def output_cop_config(output_buffer, cfg, cop_name); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#168
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#172
def output_cop_param_comments(output_buffer, params, default_cfg); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#215
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#219
def output_exclude_list(output_buffer, offending_files, cop_name); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#250
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#254
def output_exclude_path(output_buffer, exclude_path, parent); end
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#204
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#208
def output_offending_files(output_buffer, cfg, cop_name); end
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#96
@@ -54713,12 +55884,17 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#263
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#267
def safe_autocorrect?(config); end
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#116
def set_max(cfg, cop_name); end
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#125
+ def should_set_max?(cop_name); end
+
# @return [Boolean]
#
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#65
@@ -54731,12 +55907,12 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#153
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#157
def supports_safe_autocorrect?(cop_class, default_cfg); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#157
+ # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#161
def supports_unsafe_autocorrect?(cop_class, default_cfg); end
# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#92
@@ -54809,43 +55985,46 @@ end
class RuboCop::Formatter::FormatterSet < ::Array
# @return [FormatterSet] a new instance of FormatterSet
#
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#39
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#40
def initialize(options = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#55
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#56
def add_formatter(formatter_type, output_path = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#67
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#68
def close_output_files; end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#50
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#51
def file_finished(file, offenses); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#44
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#45
def file_started(file, options); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#34
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#35
def finished(*args); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#34
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#35
def started(*args); end
private
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#86
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#87
def builtin_formatter_class(specified_key); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#99
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#105
def custom_formatter_class(specified_class_name); end
- # source://rubocop//lib/rubocop/formatter/formatter_set.rb#75
+ # source://rubocop//lib/rubocop/formatter/formatter_set.rb#76
def formatter_class(formatter_type); end
end
# source://rubocop//lib/rubocop/formatter/formatter_set.rb#11
RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/formatter/formatter_set.rb#31
+# source://rubocop//lib/rubocop/formatter/formatter_set.rb#30
+RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTER_NAMES = T.let(T.unsafe(nil), Array)
+
+# source://rubocop//lib/rubocop/formatter/formatter_set.rb#32
RuboCop::Formatter::FormatterSet::FORMATTER_APIS = T.let(T.unsafe(nil), Array)
# This formatter displays a progress bar and shows details of offenses as
@@ -54945,15 +56124,15 @@ end
# This class provides helper methods used in the ERB CSS template.
#
-# source://rubocop//lib/rubocop/formatter/html_formatter.rb#135
+# source://rubocop//lib/rubocop/formatter/html_formatter.rb#137
class RuboCop::Formatter::HTMLFormatter::CSSContext
# Make Kernel#binding public.
#
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#146
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#148
def binding; end
end
-# source://rubocop//lib/rubocop/formatter/html_formatter.rb#136
+# source://rubocop//lib/rubocop/formatter/html_formatter.rb#138
RuboCop::Formatter::HTMLFormatter::CSSContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash)
# source://rubocop//lib/rubocop/formatter/html_formatter.rb#12
@@ -55025,60 +56204,60 @@ RuboCop::Formatter::HTMLFormatter::ELLIPSES = T.let(T.unsafe(nil), String)
# This class provides helper methods used in the ERB template.
#
-# source://rubocop//lib/rubocop/formatter/html_formatter.rb#61
+# source://rubocop//lib/rubocop/formatter/html_formatter.rb#63
class RuboCop::Formatter::HTMLFormatter::ERBContext
include ::RuboCop::PathUtil
include ::RuboCop::Formatter::TextUtil
# @return [ERBContext] a new instance of ERBContext
#
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#69
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#71
def initialize(files, summary); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#116
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#118
def base64_encoded_logo_image; end
# Make Kernel#binding public.
#
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#76
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#78
def binding; end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#81
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#83
def decorated_message(offense); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#112
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#114
def escape(string); end
# Returns the value of attribute files.
#
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#67
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#69
def files; end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#92
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#94
def highlight_source_tag(offense); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#85
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#87
def highlighted_source_line(offense); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#108
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#110
def possible_ellipses(location); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#124
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#126
def render_css; end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#103
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#105
def source_after_highlight(offense); end
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#98
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#100
def source_before_highlight(offense); end
# Returns the value of attribute summary.
#
- # source://rubocop//lib/rubocop/formatter/html_formatter.rb#67
+ # source://rubocop//lib/rubocop/formatter/html_formatter.rb#69
def summary; end
end
-# source://rubocop//lib/rubocop/formatter/html_formatter.rb#65
+# source://rubocop//lib/rubocop/formatter/html_formatter.rb#67
RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String)
# source://rubocop//lib/rubocop/formatter/html_formatter.rb#25
@@ -55206,40 +56385,92 @@ end
# This formatter formats the report data in JUnit format.
#
-# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#17
+# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#15
class RuboCop::Formatter::JUnitFormatter < ::RuboCop::Formatter::BaseFormatter
# @return [JUnitFormatter] a new instance of JUnitFormatter
#
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#18
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#24
def initialize(output, options = T.unsafe(nil)); end
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#55
- def add_testcase_element_to_testsuite_element(file, target_offenses, cop); end
-
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#64
- def classname_attribute_value(file); end
-
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#29
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#32
def file_finished(file, offenses); end
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#71
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#51
def finished(_inspected_files); end
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#51
+ private
+
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#106
+ def add_failure_to(testcase, offenses, cop_name); end
+
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#85
+ def add_testcase_element_to_testsuite_element(file, target_offenses, cop); end
+
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#94
+ def classname_attribute_value(file); end
+
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#81
def offenses_for_cop(all_offenses, cop); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#47
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#77
def relevant_for_output?(options, target_offenses); end
- private
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#101
+ def reset_count; end
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#83
- def add_failure_to(testcase, offenses, cop_name); end
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#118
+ def xml_escape(string); end
+end
- # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#78
- def reset_count; end
+# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#16
+RuboCop::Formatter::JUnitFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash)
+
+# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#132
+class RuboCop::Formatter::JUnitFormatter::FailureElement
+ # @return [FailureElement] a new instance of FailureElement
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#135
+ def initialize(type:, message:, text:); end
+
+ # Returns the value of attribute message.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133
+ def message; end
+
+ # Returns the value of attribute text.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133
+ def text; end
+
+ # Returns the value of attribute type.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133
+ def type; end
+end
+
+# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#122
+class RuboCop::Formatter::JUnitFormatter::TestCaseElement
+ # @return [TestCaseElement] a new instance of TestCaseElement
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#125
+ def initialize(classname:, name:); end
+
+ # Returns the value of attribute classname.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123
+ def classname; end
+
+ # Returns the value of attribute failures.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123
+ def failures; end
+
+ # Returns the value of attribute name.
+ #
+ # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123
+ def name; end
end
# This formatter displays the report data in markdown
@@ -55606,7 +56837,7 @@ module RuboCop::LSP
# @return [void]
#
# source://rubocop//lib/rubocop/lsp.rb#25
- def disable; end
+ def disable(&block); end
# Enable LSP.
#
@@ -55628,7 +56859,7 @@ module RuboCop::LSP
# @return [void]
#
# source://rubocop//lib/rubocop/lsp.rb#25
- def disable; end
+ def disable(&block); end
# Enable LSP.
#
@@ -55646,227 +56877,6 @@ module RuboCop::LSP
end
end
-# Log for Language Server Protocol of RuboCop.
-#
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/logger.rb#16
-class RuboCop::LSP::Logger
- class << self
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/logger.rb#17
- def log(message); end
- end
-end
-
-# Routes for Language Server Protocol of RuboCop.
-#
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/routes.rb#18
-class RuboCop::LSP::Routes
- # @api private
- # @return [Routes] a new instance of Routes
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#25
- def initialize(server); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#31
- def for(name); end
-
- # source://rubocop//lib/rubocop/lsp/routes.rb#38
- def handle_initialize(request); end
-
- # source://rubocop//lib/rubocop/lsp/routes.rb#61
- def handle_initialized(_request); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#168
- def handle_method_missing(request); end
-
- # source://rubocop//lib/rubocop/lsp/routes.rb#67
- def handle_shutdown(request); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#157
- def handle_unsupported_method(request, method = T.unsafe(nil)); end
-
- private
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#206
- def diagnostic(file_uri, text); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#176
- def extract_initialization_options_from(request); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#186
- def format_file(file_uri, command: T.unsafe(nil)); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#220
- def remove_file_protocol_from(uri); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#224
- def to_diagnostic(offense); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#236
- def to_range(location); end
-
- class << self
- private
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/routes.rb#19
- def handle(name, &block); end
- end
-end
-
-# Runtime for Language Server Protocol of RuboCop.
-#
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/runtime.rb#16
-class RuboCop::LSP::Runtime
- # @api private
- # @return [Runtime] a new instance of Runtime
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#19
- def initialize(config_store); end
-
- # This abuses the `--stdin` option of rubocop and reads the formatted text
- # from the `options[:stdin]` that rubocop mutates. This depends on
- # `parallel: false` as well as the fact that RuboCop doesn't otherwise dup
- # or reassign that options object. Risky business!
- #
- # Reassigning `options[:stdin]` is done here:
- # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/cop/team.rb#L131
- # Printing `options[:stdin]`
- # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/cli/command/execute_runner.rb#L95
- # Setting `parallel: true` would break this here:
- # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/runner.rb#L72
- #
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#38
- def format(path, text, command:); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#17
- def layout_mode=(_arg0); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#17
- def lint_mode=(_arg0); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#55
- def offenses(path, text); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#17
- def safe_autocorrect=(_arg0); end
-
- private
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#77
- def config_only_options; end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#84
- def redirect_stdout(&block); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/runtime.rb#92
- def run_rubocop(options, path); end
-end
-
-# Language Server Protocol of RuboCop.
-#
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/server.rb#22
-class RuboCop::LSP::Server
- # @api private
- # @return [Server] a new instance of Server
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#23
- def initialize(config_store); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#61
- def configure(options); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#53
- def format(path, text, command:); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#57
- def offenses(path, text); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#34
- def start; end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#67
- def stop(&block); end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/server.rb#49
- def write(response); end
-end
-
-# Severity for Language Server Protocol of RuboCop.
-#
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/severity.rb#7
-class RuboCop::LSP::Severity
- class << self
- # @api private
- #
- # source://rubocop//lib/rubocop/lsp/severity.rb#17
- def find_by(rubocop_severity); end
- end
-end
-
-# @api private
-#
-# source://rubocop//lib/rubocop/lsp/severity.rb#8
-RuboCop::LSP::Severity::SEVERITIES = T.let(T.unsafe(nil), Hash)
-
# Encapsulation of a lockfile for use when checking for gems.
# Does not actually resolve gems, just parses the lockfile.
#
@@ -55917,17 +56927,17 @@ class RuboCop::Lockfile
private
- # @api private
- # @return [Boolean]
- #
- # source://rubocop//lib/rubocop/lockfile.rb#85
- def bundler_lock_parser_defined?; end
-
# @api private
# @return [Bundler::LockfileParser, nil]
#
# source://rubocop//lib/rubocop/lockfile.rb#72
def parser; end
+
+ # @api private
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/lockfile.rb#85
+ def use_bundler_lock_parser?; end
end
# Parse different formats of magic comments.
@@ -56692,12 +57702,12 @@ class RuboCop::RemoteConfig
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#19
+ # source://rubocop//lib/rubocop/remote_config.rb#23
def file; end
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#32
+ # source://rubocop//lib/rubocop/remote_config.rb#36
def inherit_from_remote(file, path); end
# @api private
@@ -56709,46 +57719,46 @@ class RuboCop::RemoteConfig
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#95
+ # source://rubocop//lib/rubocop/remote_config.rb#99
def cache_name_from_uri; end
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#78
+ # source://rubocop//lib/rubocop/remote_config.rb#82
def cache_path; end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/remote_config.rb#82
+ # source://rubocop//lib/rubocop/remote_config.rb#86
def cache_path_exists?; end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/remote_config.rb#86
+ # source://rubocop//lib/rubocop/remote_config.rb#90
def cache_path_expired?; end
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#101
+ # source://rubocop//lib/rubocop/remote_config.rb#105
def cloned_url; end
# @api private
# @yield [request]
#
- # source://rubocop//lib/rubocop/remote_config.rb#53
+ # source://rubocop//lib/rubocop/remote_config.rb#57
def generate_request(uri); end
# @api private
#
- # source://rubocop//lib/rubocop/remote_config.rb#62
+ # source://rubocop//lib/rubocop/remote_config.rb#66
def handle_response(response, limit, &block); end
# @api private
# @raise [ArgumentError]
#
- # source://rubocop//lib/rubocop/remote_config.rb#40
+ # source://rubocop//lib/rubocop/remote_config.rb#44
def request(uri = T.unsafe(nil), limit = T.unsafe(nil), &block); end
end
@@ -56811,7 +57821,7 @@ class RuboCop::ResultCache
#
# @api private
#
- # source://rubocop//lib/rubocop/result_cache.rb#236
+ # source://rubocop//lib/rubocop/result_cache.rb#229
def context_checksum(team, options); end
# @api private
@@ -56851,14 +57861,6 @@ class RuboCop::ResultCache
# source://rubocop//lib/rubocop/result_cache.rb#142
def symlink_protection_triggered?(path); end
- # The external dependency checksums are cached per RuboCop team so that
- # the checksums don't need to be recomputed for each file.
- #
- # @api private
- #
- # source://rubocop//lib/rubocop/result_cache.rb#227
- def team_checksum(team); end
-
class << self
# @api private
# @return [Boolean]
@@ -57004,10 +58006,10 @@ class RuboCop::Runner
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/runner.rb#427
+ # source://rubocop//lib/rubocop/runner.rb#434
def considered_failure?(offense); end
- # source://rubocop//lib/rubocop/runner.rb#460
+ # source://rubocop//lib/rubocop/runner.rb#471
def default_config(cop_name); end
# source://rubocop//lib/rubocop/runner.rb#276
@@ -57036,16 +58038,16 @@ class RuboCop::Runner
# source://rubocop//lib/rubocop/runner.rb#244
def file_started(file); end
- # source://rubocop//lib/rubocop/runner.rb#407
+ # source://rubocop//lib/rubocop/runner.rb#414
def filter_cop_classes(cop_classes, config); end
# source://rubocop//lib/rubocop/runner.rb#108
def find_target_files(paths); end
- # source://rubocop//lib/rubocop/runner.rb#418
+ # source://rubocop//lib/rubocop/runner.rb#425
def formatter_set; end
- # source://rubocop//lib/rubocop/runner.rb#475
+ # source://rubocop//lib/rubocop/runner.rb#486
def get_processed_source(file); end
# source://rubocop//lib/rubocop/runner.rb#346
@@ -57062,25 +58064,30 @@ class RuboCop::Runner
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/runner.rb#456
+ # source://rubocop//lib/rubocop/runner.rb#467
def mark_as_safe_by_config?(config); end
- # source://rubocop//lib/rubocop/runner.rb#464
+ # source://rubocop//lib/rubocop/runner.rb#475
def minimum_severity_to_fail; end
- # source://rubocop//lib/rubocop/runner.rb#368
+ # source://rubocop//lib/rubocop/runner.rb#375
def mobilize_team(processed_source); end
- # source://rubocop//lib/rubocop/runner.rb#373
+ # source://rubocop//lib/rubocop/runner.rb#380
def mobilized_cop_classes(config); end
- # source://rubocop//lib/rubocop/runner.rb#436
+ # @return [Boolean]
+ #
+ # source://rubocop//lib/rubocop/runner.rb#443
+ def offense_displayed?(offense); end
+
+ # source://rubocop//lib/rubocop/runner.rb#455
def offenses_to_report(offenses); end
# source://rubocop//lib/rubocop/runner.rb#156
def process_file(file); end
- # source://rubocop//lib/rubocop/runner.rb#397
+ # source://rubocop//lib/rubocop/runner.rb#404
def qualify_option_cop_names; end
# @yield [cop]
@@ -57096,17 +58103,17 @@ class RuboCop::Runner
# otherwise dormant team that can be used for config- and option-
# level caching in ResultCache.
#
- # source://rubocop//lib/rubocop/runner.rb#503
+ # source://rubocop//lib/rubocop/runner.rb#514
def standby_team(config); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/runner.rb#414
+ # source://rubocop//lib/rubocop/runner.rb#421
def style_guide_cops_only?(config); end
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/runner.rb#448
+ # source://rubocop//lib/rubocop/runner.rb#459
def supports_safe_autocorrect?(offense); end
# @yield [team]
@@ -57378,34 +58385,34 @@ class RuboCop::TargetRuby
# @api private
# @return [TargetRuby] a new instance of TargetRuby
#
- # source://rubocop//lib/rubocop/target_ruby.rb#254
+ # source://rubocop//lib/rubocop/target_ruby.rb#258
def initialize(config); end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#270
+ # source://rubocop//lib/rubocop/target_ruby.rb#274
def rubocop_version_with_support; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#258
+ # source://rubocop//lib/rubocop/target_ruby.rb#262
def source; end
# @api private
# @return [Boolean]
#
- # source://rubocop//lib/rubocop/target_ruby.rb#266
+ # source://rubocop//lib/rubocop/target_ruby.rb#270
def supported?; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#262
+ # source://rubocop//lib/rubocop/target_ruby.rb#266
def version; end
class << self
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#240
+ # source://rubocop//lib/rubocop/target_ruby.rb#244
def supported_versions; end
end
end
@@ -57414,23 +58421,23 @@ end
#
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#187
+# source://rubocop//lib/rubocop/target_ruby.rb#191
class RuboCop::TargetRuby::BundlerLockFile < ::RuboCop::TargetRuby::Source
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#188
+ # source://rubocop//lib/rubocop/target_ruby.rb#192
def name; end
private
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#221
+ # source://rubocop//lib/rubocop/target_ruby.rb#225
def bundler_lock_file_path; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#194
+ # source://rubocop//lib/rubocop/target_ruby.rb#198
def find_version; end
end
@@ -57443,18 +58450,18 @@ RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float)
#
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#228
+# source://rubocop//lib/rubocop/target_ruby.rb#232
class RuboCop::TargetRuby::Default < ::RuboCop::TargetRuby::Source
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#229
+ # source://rubocop//lib/rubocop/target_ruby.rb#233
def name; end
private
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#235
+ # source://rubocop//lib/rubocop/target_ruby.rb#239
def find_version; end
end
@@ -57466,42 +58473,37 @@ end
class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source
extend ::RuboCop::AST::NodePattern::Macros
- # source://rubocop//lib/rubocop/target_ruby.rb#64
+ # source://rubocop//lib/rubocop/target_ruby.rb#62
def gem_requirement_versions(param0 = T.unsafe(nil)); end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#70
+ # source://rubocop//lib/rubocop/target_ruby.rb#68
def name; end
- # source://rubocop//lib/rubocop/target_ruby.rb#59
+ # source://rubocop//lib/rubocop/target_ruby.rb#57
def required_ruby_version(param0); end
private
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#121
- def find_default_minimal_known_ruby(right_hand_side); end
+ # source://rubocop//lib/rubocop/target_ruby.rb#123
+ def find_minimal_known_ruby(right_hand_side); end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#76
+ # source://rubocop//lib/rubocop/target_ruby.rb#74
def find_version; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#86
- def gemspec_filename; end
-
- # @api private
- #
- # source://rubocop//lib/rubocop/target_ruby.rb#93
+ # source://rubocop//lib/rubocop/target_ruby.rb#84
def gemspec_filepath; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#117
+ # source://rubocop//lib/rubocop/target_ruby.rb#119
def version_from_array(array); end
# @api private
@@ -57511,15 +58513,10 @@ class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#105
+ # source://rubocop//lib/rubocop/target_ruby.rb#107
def version_from_right_hand_side(right_hand_side); end
end
-# @api private
-#
-# source://rubocop//lib/rubocop/target_ruby.rb#56
-RuboCop::TargetRuby::GemspecFile::GEMSPEC_EXTENSION = T.let(T.unsafe(nil), String)
-
# @api private
#
# source://rubocop//lib/rubocop/target_ruby.rb#7
@@ -57553,49 +58550,49 @@ end
#
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#133
+# source://rubocop//lib/rubocop/target_ruby.rb#137
class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#137
+ # source://rubocop//lib/rubocop/target_ruby.rb#141
def name; end
private
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#143
+ # source://rubocop//lib/rubocop/target_ruby.rb#147
def filename; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#151
+ # source://rubocop//lib/rubocop/target_ruby.rb#155
def find_version; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#147
+ # source://rubocop//lib/rubocop/target_ruby.rb#151
def pattern; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#158
+ # source://rubocop//lib/rubocop/target_ruby.rb#162
def version_file; end
end
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#134
+# source://rubocop//lib/rubocop/target_ruby.rb#138
RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String)
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#135
+# source://rubocop//lib/rubocop/target_ruby.rb#139
RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp)
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#244
+# source://rubocop//lib/rubocop/target_ruby.rb#248
RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array)
# A place where information about a target ruby version is found.
@@ -57631,34 +58628,34 @@ end
#
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#166
+# source://rubocop//lib/rubocop/target_ruby.rb#170
class RuboCop::TargetRuby::ToolVersionsFile < ::RuboCop::TargetRuby::RubyVersionFile
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#170
+ # source://rubocop//lib/rubocop/target_ruby.rb#174
def name; end
private
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#176
+ # source://rubocop//lib/rubocop/target_ruby.rb#180
def filename; end
# @api private
#
- # source://rubocop//lib/rubocop/target_ruby.rb#180
+ # source://rubocop//lib/rubocop/target_ruby.rb#184
def pattern; end
end
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#167
+# source://rubocop//lib/rubocop/target_ruby.rb#171
RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String)
# @api private
#
-# source://rubocop//lib/rubocop/target_ruby.rb#168
+# source://rubocop//lib/rubocop/target_ruby.rb#172
RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp)
# source://rubocop//lib/rubocop/ast_aliases.rb#7
@@ -57684,12 +58681,17 @@ module RuboCop::Version
class << self
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#108
+ # source://rubocop//lib/rubocop/version.rb#99
+ def config_for_pwd(env); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/version.rb#129
def document_version; end
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#58
+ # source://rubocop//lib/rubocop/version.rb#66
def extension_versions(env); end
# Returns feature version in one of two ways:
@@ -57699,30 +58701,42 @@ module RuboCop::Version
#
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#92
+ # source://rubocop//lib/rubocop/version.rb#113
def feature_version(feature); end
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#43
+ # source://rubocop//lib/rubocop/version.rb#51
def parser_version; end
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#113
+ # source://rubocop//lib/rubocop/version.rb#134
def server_mode; end
# @api private
#
- # source://rubocop//lib/rubocop/version.rb#21
+ # source://rubocop//lib/rubocop/version.rb#90
+ def target_ruby_version(env); end
+
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/version.rb#46
+ def verbose(env: T.unsafe(nil)); end
+
+ # NOTE: Marked as private but used by gems like standard.
+ #
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/version.rb#23
def version(debug: T.unsafe(nil), env: T.unsafe(nil)); end
end
end
-# source://rubocop//lib/rubocop/version.rb#12
+# source://rubocop//lib/rubocop/version.rb#13
RuboCop::Version::CANONICAL_FEATURE_NAMES = T.let(T.unsafe(nil), Hash)
-# source://rubocop//lib/rubocop/version.rb#16
+# source://rubocop//lib/rubocop/version.rb#17
RuboCop::Version::EXTENSION_PATH_NAMES = T.let(T.unsafe(nil), Hash)
# source://rubocop//lib/rubocop/version.rb#8
@@ -57751,14 +58765,23 @@ module RuboCop::YAMLDuplicationChecker
#
# source://rubocop//lib/rubocop/yaml_duplication_checker.rb#7
def check(yaml_string, filename, &on_duplicated); end
+ end
+end
- private
+# @api private
+#
+# source://rubocop//lib/rubocop/yaml_duplication_checker.rb#14
+class RuboCop::YAMLDuplicationChecker::DuplicationCheckHandler < ::Psych::TreeBuilder
+ # @api private
+ # @return [DuplicationCheckHandler] a new instance of DuplicationCheckHandler
+ #
+ # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#15
+ def initialize(&block); end
- # @api private
- #
- # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#21
- def traverse(tree, &on_duplicated); end
- end
+ # @api private
+ #
+ # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#20
+ def end_mapping; end
end
# Extensions to the core String class
@@ -57771,13 +58794,11 @@ class String
# is either empty or contains only whitespace characters.
#
# @example
- # ''.blank? #=> true
- # @example
- # ' '.blank? #=> true
- # @example
+ # ''.blank? #=> true
+ # ' '.blank? #=> true
# ' test'.blank? #=> false
# @return [Boolean] true is the string is blank, false otherwise
#
- # source://rubocop//lib/rubocop/core_ext/string.rb#19
+ # source://rubocop//lib/rubocop/core_ext/string.rb#15
def blank?; end
end
diff --git a/sorbet/rbi/gems/tapioca@0.16.2.rbi b/sorbet/rbi/gems/tapioca@0.16.5.rbi
similarity index 94%
rename from sorbet/rbi/gems/tapioca@0.16.2.rbi
rename to sorbet/rbi/gems/tapioca@0.16.5.rbi
index 116a25c1..f8ff202d 100644
--- a/sorbet/rbi/gems/tapioca@0.16.2.rbi
+++ b/sorbet/rbi/gems/tapioca@0.16.5.rbi
@@ -55,7 +55,7 @@ module RBI; end
# source://tapioca//lib/tapioca/rbi_ext/model.rb#5
class RBI::Tree < ::RBI::NodeWithComments
- # source://rbi/0.2.1/lib/rbi/model.rb#121
+ # source://rbi/0.2.3/lib/rbi/model.rb#121
sig do
params(
loc: T.nilable(::RBI::Loc),
@@ -65,15 +65,15 @@ class RBI::Tree < ::RBI::NodeWithComments
end
def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
- # source://rbi/0.2.1/lib/rbi/model.rb#128
+ # source://rbi/0.2.3/lib/rbi/model.rb#128
sig { params(node: ::RBI::Node).void }
def <<(node); end
- # source://rbi/0.2.1/lib/rbi/rewriters/add_sig_templates.rb#66
+ # source://rbi/0.2.3/lib/rbi/rewriters/add_sig_templates.rb#66
sig { params(with_todo_comment: T::Boolean).void }
def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end
- # source://rbi/0.2.1/lib/rbi/rewriters/annotate.rb#49
+ # source://rbi/0.2.3/lib/rbi/rewriters/annotate.rb#49
sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
@@ -138,35 +138,35 @@ class RBI::Tree < ::RBI::NodeWithComments
end
def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end
- # source://rbi/0.2.1/lib/rbi/rewriters/deannotate.rb#41
+ # source://rbi/0.2.3/lib/rbi/rewriters/deannotate.rb#41
sig { params(annotation: ::String).void }
def deannotate!(annotation); end
- # source://rbi/0.2.1/lib/rbi/model.rb#134
+ # source://rbi/0.2.3/lib/rbi/model.rb#134
sig { returns(T::Boolean) }
def empty?; end
- # source://rbi/0.2.1/lib/rbi/rewriters/filter_versions.rb#118
+ # source://rbi/0.2.3/lib/rbi/rewriters/filter_versions.rb#118
sig { params(version: ::Gem::Version).void }
def filter_versions!(version); end
- # source://rbi/0.2.1/lib/rbi/rewriters/flatten_singleton_methods.rb#60
+ # source://rbi/0.2.3/lib/rbi/rewriters/flatten_singleton_methods.rb#60
sig { void }
def flatten_singleton_methods!; end
- # source://rbi/0.2.1/lib/rbi/rewriters/flatten_visibilities.rb#60
+ # source://rbi/0.2.3/lib/rbi/rewriters/flatten_visibilities.rb#60
sig { void }
def flatten_visibilities!; end
- # source://rbi/0.2.1/lib/rbi/rewriters/group_nodes.rb#81
+ # source://rbi/0.2.3/lib/rbi/rewriters/group_nodes.rb#81
sig { void }
def group_nodes!; end
- # source://rbi/0.2.1/lib/rbi/index.rb#68
+ # source://rbi/0.2.3/lib/rbi/index.rb#68
sig { returns(::RBI::Index) }
def index; end
- # source://rbi/0.2.1/lib/rbi/rewriters/merge_trees.rb#324
+ # source://rbi/0.2.3/lib/rbi/rewriters/merge_trees.rb#324
sig do
params(
other: ::RBI::Tree,
@@ -177,27 +177,27 @@ class RBI::Tree < ::RBI::NodeWithComments
end
def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
- # source://rbi/0.2.1/lib/rbi/rewriters/nest_non_public_members.rb#46
+ # source://rbi/0.2.3/lib/rbi/rewriters/nest_non_public_members.rb#46
sig { void }
def nest_non_public_members!; end
- # source://rbi/0.2.1/lib/rbi/rewriters/nest_singleton_methods.rb#36
+ # source://rbi/0.2.3/lib/rbi/rewriters/nest_singleton_methods.rb#36
sig { void }
def nest_singleton_methods!; end
- # source://rbi/0.2.1/lib/rbi/rewriters/nest_top_level_members.rb#63
+ # source://rbi/0.2.3/lib/rbi/rewriters/nest_top_level_members.rb#63
sig { void }
def nest_top_level_members!; end
- # source://rbi/0.2.1/lib/rbi/model.rb#112
+ # source://rbi/0.2.3/lib/rbi/model.rb#112
sig { returns(T::Array[::RBI::Node]) }
def nodes; end
- # source://rbi/0.2.1/lib/rbi/rewriters/attr_to_methods.rb#53
+ # source://rbi/0.2.3/lib/rbi/rewriters/attr_to_methods.rb#53
sig { void }
def replace_attributes_with_methods!; end
- # source://rbi/0.2.1/lib/rbi/rewriters/sort_nodes.rb#119
+ # source://rbi/0.2.3/lib/rbi/rewriters/sort_nodes.rb#119
sig { void }
def sort_nodes!; end
@@ -218,7 +218,7 @@ class RBI::TypedParam < ::T::Struct
const :type, ::String
class << self
- # source://sorbet-runtime/0.5.11589/lib/types/struct.rb#13
+ # source://sorbet-runtime/0.5.11694/lib/types/struct.rb#13
def inherited(s); end
end
end
@@ -453,24 +453,24 @@ class Tapioca::Cli < ::Thor
include ::Tapioca::ConfigHelper
include ::Tapioca::EnvHelper
- # source://tapioca//lib/tapioca/cli.rb#366
+ # source://tapioca//lib/tapioca/cli.rb#371
def __print_version; end
- # source://tapioca//lib/tapioca/cli.rb#348
+ # source://tapioca//lib/tapioca/cli.rb#353
def annotations; end
- # source://tapioca//lib/tapioca/cli.rb#320
+ # source://tapioca//lib/tapioca/cli.rb#325
def check_shims; end
# source://tapioca//lib/tapioca/cli.rb#46
def configure; end
- # source://tapioca//lib/tapioca/cli.rb#147
+ # source://tapioca//lib/tapioca/cli.rb#151
def dsl(*constant_or_paths); end
# @raise [MalformattedArgumentError]
#
- # source://tapioca//lib/tapioca/cli.rb#264
+ # source://tapioca//lib/tapioca/cli.rb#269
def gem(*gems); end
# source://tapioca//lib/tapioca/cli.rb#27
@@ -484,11 +484,11 @@ class Tapioca::Cli < ::Thor
private
- # source://tapioca//lib/tapioca/cli.rb#380
+ # source://tapioca//lib/tapioca/cli.rb#385
def print_init_next_steps; end
class << self
- # source://tapioca//lib/tapioca/cli.rb#372
+ # source://tapioca//lib/tapioca/cli.rb#377
def exit_on_failure?; end
end
end
@@ -525,7 +525,7 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke
abstract!
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#33
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#34
sig do
params(
requested_constants: T::Array[::String],
@@ -544,22 +544,23 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke
rbi_formatter: ::Tapioca::RBIFormatter,
app_root: ::String,
halt_upon_load_error: T::Boolean,
- compiler_options: T::Hash[::String, T.untyped]
+ compiler_options: T::Hash[::String, T.untyped],
+ lsp_addon: T::Boolean
).void
end
- def initialize(requested_constants:, requested_paths:, outpath:, only:, exclude:, file_header:, tapioca_path:, skip_constant: T.unsafe(nil), quiet: T.unsafe(nil), verbose: T.unsafe(nil), number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), gem_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), compiler_options: T.unsafe(nil)); end
+ def initialize(requested_constants:, requested_paths:, outpath:, only:, exclude:, file_header:, tapioca_path:, skip_constant: T.unsafe(nil), quiet: T.unsafe(nil), verbose: T.unsafe(nil), number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), gem_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), compiler_options: T.unsafe(nil), lsp_addon: T.unsafe(nil)); end
private
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#100
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#107
sig { returns(T::Array[::String]) }
def all_requested_constants; end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#293
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#304
sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) }
def build_error_for_files(cause, files); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#217
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#228
sig do
params(
constant_name: ::String,
@@ -570,75 +571,75 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke
end
def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#154
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#163
sig { params(constant_names: T::Array[::String], ignore_missing: T::Boolean).returns(T::Array[::Module]) }
def constantize(constant_names, ignore_missing: T.unsafe(nil)); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#177
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#188
sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) }
def constantize_compilers(compiler_names); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#353
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#364
sig { returns(T::Array[::String]) }
def constants_from_requested_paths; end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#123
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#131
sig { returns(::Tapioca::Dsl::Pipeline) }
def create_pipeline; end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#256
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#267
sig { params(constant_name: ::String).returns(::Pathname) }
def dsl_rbi_filename(constant_name); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#140
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#149
sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) }
def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#348
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#359
sig { params(constant: ::String).returns(::String) }
def generate_command_for(constant); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#76
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#79
sig { params(outpath: ::Pathname, quiet: T::Boolean).returns(T::Set[::Pathname]) }
def generate_dsl_rbi_files(outpath, quiet:); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#113
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#120
sig { void }
def load_application; end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#235
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#246
sig { params(dir: ::Pathname).void }
def perform_dsl_verification(dir); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#108
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#115
sig { returns(::Tapioca::Dsl::Pipeline) }
def pipeline; end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#244
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#255
sig { params(files: T::Set[::Pathname]).void }
def purge_stale_dsl_rbi_files(files); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#343
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#354
sig { params(constant: ::String).returns(::String) }
def rbi_filename_for(constant); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#324
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#335
sig { params(path: ::Pathname).returns(T::Array[::Pathname]) }
def rbi_files_in(path); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#302
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#313
sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void }
def report_diff_and_exit_if_out_of_date(diff, command); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#197
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#208
sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) }
def resolve(name); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#331
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#342
sig { params(class_name: ::String).returns(::String) }
def underscore(class_name); end
- # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#261
+ # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#272
sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) }
def verify_dsl_rbi(tmp_dir:); end
end
@@ -1141,7 +1142,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct
const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart]
class << self
- # source://sorbet-runtime/0.5.11589/lib/types/struct.rb#13
+ # source://sorbet-runtime/0.5.11694/lib/types/struct.rb#13
def inherited(s); end
end
end
@@ -1152,7 +1153,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct
const :colors, T::Array[::Symbol]
class << self
- # source://sorbet-runtime/0.5.11589/lib/types/struct.rb#13
+ # source://sorbet-runtime/0.5.11694/lib/types/struct.rb#13
def inherited(s); end
end
end
@@ -1209,7 +1210,7 @@ class Tapioca::Dsl::Compiler
ConstantType = type_member { { upper: Module } }
- # source://tapioca//lib/tapioca/dsl/compiler.rb#74
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#110
sig do
params(
pipeline: ::Tapioca::Dsl::Pipeline,
@@ -1222,11 +1223,11 @@ class Tapioca::Dsl::Compiler
# NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`.
#
- # source://tapioca//lib/tapioca/dsl/compiler.rb#92
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#128
sig { params(error: ::String).void }
def add_error(error); end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#83
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#119
sig { params(compiler_name: ::String).returns(T::Boolean) }
def compiler_enabled?(compiler_name); end
@@ -1236,7 +1237,7 @@ class Tapioca::Dsl::Compiler
# @abstract
#
- # source://tapioca//lib/tapioca/dsl/compiler.rb#88
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#124
sig { abstract.void }
def decorate; end
@@ -1250,48 +1251,65 @@ class Tapioca::Dsl::Compiler
private
- # source://tapioca//lib/tapioca/dsl/compiler.rb#141
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#177
sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) }
def compile_method_parameters_to_rbi(method_def); end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#177
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#213
sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) }
def compile_method_return_type_to_rbi(method_def); end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#131
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#167
sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void }
def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end
# Get the types of each parameter from a method signature
#
- # source://tapioca//lib/tapioca/dsl/compiler.rb#105
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#141
sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) }
def parameters_types_from_signature(method_def, signature); end
class << self
# @abstract
#
- # source://tapioca//lib/tapioca/dsl/compiler.rb#37
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#39
sig { abstract.returns(T::Enumerable[::Module]) }
def gather_constants; end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#32
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#34
sig { params(constant: ::Module).returns(T::Boolean) }
def handles?(constant); end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#40
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#42
sig { returns(T::Set[::Module]) }
def processable_constants; end
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#50
+ sig { params(constants: T::Array[::Module]).void }
+ def requested_constants=(constants); end
+
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#55
+ sig { void }
+ def reset_state; end
+
private
- # source://tapioca//lib/tapioca/dsl/compiler.rb#50
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#82
sig { returns(T::Enumerable[T::Class[T.anything]]) }
def all_classes; end
- # source://tapioca//lib/tapioca/dsl/compiler.rb#58
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#90
sig { returns(T::Enumerable[::Module]) }
def all_modules; end
+
+ # source://tapioca//lib/tapioca/dsl/compiler.rb#68
+ sig do
+ type_parameters(:U)
+ .params(
+ klass: T.all(T.type_parameter(:U), T::Class[T.anything])
+ ).returns(T::Array[T.type_parameter(:U)])
+ end
+ def descendants_of(klass); end
end
end
@@ -1310,7 +1328,7 @@ Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array)
# source://tapioca//lib/tapioca/dsl/pipeline.rb#6
class Tapioca::Dsl::Pipeline
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#39
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#40
sig do
params(
requested_constants: T::Array[::Module],
@@ -1320,24 +1338,25 @@ class Tapioca::Dsl::Pipeline
error_handler: T.proc.params(error: ::String).void,
skipped_constants: T::Array[::Module],
number_of_workers: T.nilable(::Integer),
- compiler_options: T::Hash[::String, T.untyped]
+ compiler_options: T::Hash[::String, T.untyped],
+ lsp_addon: T::Boolean
).void
end
- def initialize(requested_constants:, requested_paths: T.unsafe(nil), requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), skipped_constants: T.unsafe(nil), number_of_workers: T.unsafe(nil), compiler_options: T.unsafe(nil)); end
+ def initialize(requested_constants:, requested_paths: T.unsafe(nil), requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), skipped_constants: T.unsafe(nil), number_of_workers: T.unsafe(nil), compiler_options: T.unsafe(nil), lsp_addon: T.unsafe(nil)); end
# source://tapioca//lib/tapioca/dsl/pipeline.rb#10
sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) }
def active_compilers; end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#102
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#105
sig { params(error: ::String).void }
def add_error(error); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#107
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#110
sig { params(compiler_name: ::String).returns(T::Boolean) }
def compiler_enabled?(compiler_name); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#116
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#119
sig { returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) }
def compilers; end
@@ -1357,7 +1376,7 @@ class Tapioca::Dsl::Pipeline
sig { returns(T::Array[::Pathname]) }
def requested_paths; end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#67
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#70
sig do
type_parameters(:T)
.params(
@@ -1372,15 +1391,15 @@ class Tapioca::Dsl::Pipeline
private
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#223
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#227
sig { void }
def abort_if_pending_migrations!; end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#168
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#172
sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) }
def filter_anonymous_and_reloaded_constants(constants); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#133
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#136
sig do
params(
requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
@@ -1389,7 +1408,7 @@ class Tapioca::Dsl::Pipeline
end
def gather_active_compilers(requested_compilers, excluded_compilers); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#147
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#150
sig do
params(
requested_constants: T::Array[::Module],
@@ -1399,11 +1418,11 @@ class Tapioca::Dsl::Pipeline
end
def gather_constants(requested_constants, requested_paths, skipped_constants); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#197
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#201
sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) }
def rbi_for_constant(constant); end
- # source://tapioca//lib/tapioca/dsl/pipeline.rb#216
+ # source://tapioca//lib/tapioca/dsl/pipeline.rb#220
sig { params(error: ::String).returns(T.noreturn) }
def report_error(error); end
end
@@ -2208,7 +2227,7 @@ class Tapioca::GemInfo < ::T::Struct
sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) }
def from_spec(spec); end
- # source://sorbet-runtime/0.5.11589/lib/types/struct.rb#13
+ # source://sorbet-runtime/0.5.11694/lib/types/struct.rb#13
def inherited(s); end
end
end
@@ -2387,7 +2406,7 @@ module Tapioca::Loaders; end
# source://tapioca//lib/tapioca/loaders/dsl.rb#6
class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader
- # source://tapioca//lib/tapioca/loaders/dsl.rb#38
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#60
sig do
params(
tapioca_path: ::String,
@@ -2398,35 +2417,40 @@ class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader
end
def initialize(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end
- # source://tapioca//lib/tapioca/loaders/dsl.rb#27
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#43
sig { override.void }
def load; end
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#50
+ sig { void }
+ def load_dsl_extensions_and_compilers; end
+
protected
- # source://tapioca//lib/tapioca/loaders/dsl.rb#88
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#105
sig { void }
def load_application; end
- # source://tapioca//lib/tapioca/loaders/dsl.rb#63
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#85
sig { void }
def load_dsl_compilers; end
- # source://tapioca//lib/tapioca/loaders/dsl.rb#48
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#70
sig { void }
def load_dsl_extensions; end
class << self
- # source://tapioca//lib/tapioca/loaders/dsl.rb#15
+ # source://tapioca//lib/tapioca/loaders/dsl.rb#21
sig do
params(
tapioca_path: ::String,
eager_load: T::Boolean,
app_root: ::String,
- halt_upon_load_error: T::Boolean
+ halt_upon_load_error: T::Boolean,
+ lsp_addon: T::Boolean
).void
end
- def load_application(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end
+ def load_application(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil), lsp_addon: T.unsafe(nil)); end
end
end
@@ -2723,7 +2747,7 @@ module Tapioca::RBIHelper
sig { params(name: ::String).returns(T::Boolean) }
def valid_method_name?(name); end
- # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#123
+ # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#114
sig { params(name: ::String).returns(T::Boolean) }
def valid_parameter_name?(name); end
@@ -2942,7 +2966,7 @@ module Tapioca::Runtime::Reflection
extend ::Tapioca::Runtime::AttachedClassOf
extend ::Tapioca::Runtime::Reflection
- # source://tapioca//lib/tapioca/runtime/reflection.rb#201
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#207
sig { params(constant: ::Module).returns(T.untyped) }
def abstract_type_of(constant); end
@@ -2995,11 +3019,11 @@ module Tapioca::Runtime::Reflection
end
def descendants_of(klass); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#194
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#200
sig { params(constant: ::Module).returns(T::Set[::String]) }
def file_candidates_for(constant); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#207
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#213
sig { params(constant: ::Module).returns(T::Boolean) }
def final_module?(constant); end
@@ -3040,14 +3064,15 @@ module Tapioca::Runtime::Reflection
def qualified_name_of(constant); end
# Examines the call stack to identify the closest location where a "require" is performed
- # by searching for the label "". If none is found, it returns the location
+ # by searching for the label "" or "block in " in the
+ # case of an ActiveSupport.on_load hook. If none is found, it returns the location
# labeled "", which is the original call site.
#
- # source://tapioca//lib/tapioca/runtime/reflection.rb#184
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#185
sig { params(locations: T.nilable(T::Array[::Thread::Backtrace::Location])).returns(::String) }
def resolve_loc(locations); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#212
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#218
sig { params(constant: ::Module).returns(T::Boolean) }
def sealed_module?(constant); end
@@ -3069,23 +3094,23 @@ module Tapioca::Runtime::Reflection
private
- # source://tapioca//lib/tapioca/runtime/reflection.rb#249
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#255
sig { params(parent: ::Module, name: ::String).returns(T.nilable(::Module)) }
def child_module_for_parent_with_name(parent, name); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#265
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#271
sig { params(name: ::String).returns(T::Boolean) }
def has_aliased_namespace?(name); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#260
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#266
sig { params(method: ::UnboundMethod).returns(T::Boolean) }
def method_defined_by_forwardable_module?(method); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#235
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#241
sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) }
def methods_for(constant); end
- # source://tapioca//lib/tapioca/runtime/reflection.rb#219
+ # source://tapioca//lib/tapioca/runtime/reflection.rb#225
sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) }
def relevant_methods_for(constant); end
end
@@ -3415,10 +3440,10 @@ module Tapioca::Static::SymbolLoader
# @return [Array]
#
- # source://tapioca//lib/tapioca/static/symbol_loader.rb#69
+ # source://tapioca//lib/tapioca/static/symbol_loader.rb#71
def engines; end
- # source://tapioca//lib/tapioca/static/symbol_loader.rb#82
+ # source://tapioca//lib/tapioca/static/symbol_loader.rb#84
sig { params(input: ::String, table_type: ::String).returns(::String) }
def symbol_table_json_from(input, table_type: T.unsafe(nil)); end
end
@@ -3532,35 +3557,34 @@ end
# source://tapioca//lib/tapioca/version.rb#5
Tapioca::VERSION = T.let(T.unsafe(nil), String)
-# source://tapioca//lib/tapioca/helpers/source_uri.rb#6
-module URI
- include ::URI::RFC2396_REGEXP
-end
-
# source://tapioca//lib/tapioca/helpers/source_uri.rb#7
class URI::Source < ::URI::File
- # source://tapioca//lib/tapioca/helpers/source_uri.rb#58
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#72
sig { params(v: T.nilable(::String)).returns(T::Boolean) }
def check_host(v); end
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#55
+ sig { returns(T.nilable(::String)) }
def gem_name; end
- # source://tapioca//lib/tapioca/helpers/source_uri.rb#25
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#29
sig { returns(T.nilable(::String)) }
def gem_version; end
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#60
+ sig { returns(T.nilable(::String)) }
def line_number; end
- # source://tapioca//lib/tapioca/helpers/source_uri.rb#51
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#65
sig { params(v: T.nilable(::String)).void }
def set_path(v); end
- # source://tapioca//lib/tapioca/helpers/source_uri.rb#70
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#84
sig { returns(::String) }
def to_s; end
class << self
- # source://tapioca//lib/tapioca/helpers/source_uri.rb#38
+ # source://tapioca//lib/tapioca/helpers/source_uri.rb#42
sig do
params(
gem_name: ::String,
@@ -3576,4 +3600,11 @@ end
# source://tapioca//lib/tapioca/helpers/source_uri.rb#10
URI::Source::COMPONENT = T.let(T.unsafe(nil), Array)
-class URI::WSS < ::URI::WS; end
+# `uri` for Ruby 3.4 switched the default parser from RFC2396 to RFC3986. The new parser emits a deprecation
+# warning on a few methods and delegates them to RFC2396, namely `extract`/`make_regexp`/`escape`/`unescape`.
+# On earlier versions of the uri gem, the RFC2396_PARSER constant doesn't exist, so it needs some special
+# handling to select a parser that doesn't emit deprecations. While it was backported to Ruby 3.1, users may
+# have the uri gem in their own bundle and thus not use a compatible version.
+#
+# source://tapioca//lib/tapioca/helpers/source_uri.rb#26
+URI::Source::PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser)
diff --git a/sorbet/rbi/gems/thor@1.3.1.rbi b/sorbet/rbi/gems/thor@1.3.2.rbi
similarity index 98%
rename from sorbet/rbi/gems/thor@1.3.1.rbi
rename to sorbet/rbi/gems/thor@1.3.2.rbi
index a806aa38..10202a5d 100644
--- a/sorbet/rbi/gems/thor@1.3.1.rbi
+++ b/sorbet/rbi/gems/thor@1.3.2.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `thor` gem.
# Please instead update this file by running `bin/tapioca gem thor`.
+
# source://thor//lib/thor/shell/lcs_diff.rb#1
module LCSDiff
protected
@@ -36,7 +37,7 @@ class Thor
extend ::Thor::Base::ClassMethods
extend ::Thor::Invocation::ClassMethods
- # source://thor//lib/thor.rb#652
+ # source://thor//lib/thor.rb#663
def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end
class << self
@@ -95,6 +96,19 @@ class Thor
# source://thor//lib/thor.rb#363
def check_unknown_options?(config); end
+ # Checks if a specified command exists.
+ #
+ # ==== Parameters
+ # command_name:: The name of the command to check for existence.
+ #
+ # ==== Returns
+ # Boolean:: +true+ if the command exists, +false+ otherwise.
+ #
+ # @return [Boolean]
+ #
+ # source://thor//lib/thor.rb#449
+ def command_exists?(command_name); end
+
# Prints help information for the given command.
#
# ==== Parameters
@@ -470,48 +484,48 @@ class Thor
# the command that is going to be invoked and a boolean which indicates if
# the namespace should be displayed as arguments.
#
- # source://thor//lib/thor.rb#535
+ # source://thor//lib/thor.rb#546
def banner(command, namespace = T.unsafe(nil), subcommand = T.unsafe(nil)); end
- # source://thor//lib/thor.rb#541
+ # source://thor//lib/thor.rb#552
def baseclass; end
- # source://thor//lib/thor.rb#549
+ # source://thor//lib/thor.rb#560
def create_command(meth); end
- # source://thor//lib/thor.rb#549
+ # source://thor//lib/thor.rb#560
def create_task(meth); end
# help command has the required check disabled by default.
#
- # source://thor//lib/thor.rb#467
+ # source://thor//lib/thor.rb#478
def disable_required_check; end
# The method responsible for dispatching given the args.
#
# @yield [instance]
#
- # source://thor//lib/thor.rb#494
+ # source://thor//lib/thor.rb#505
def dispatch(meth, given_args, given_opts, config); end
- # source://thor//lib/thor.rb#545
+ # source://thor//lib/thor.rb#556
def dynamic_command_class; end
# this is the logic that takes the command name passed in by the user
# and determines whether it is an unambiguous substrings of a command or
# alias name.
#
- # source://thor//lib/thor.rb#615
+ # source://thor//lib/thor.rb#626
def find_command_possibilities(meth); end
# this is the logic that takes the command name passed in by the user
# and determines whether it is an unambiguous substrings of a command or
# alias name.
#
- # source://thor//lib/thor.rb#615
+ # source://thor//lib/thor.rb#626
def find_task_possibilities(meth); end
- # source://thor//lib/thor.rb#575
+ # source://thor//lib/thor.rb#586
def initialize_added; end
# Returns this class at least one of required options array set.
@@ -519,7 +533,7 @@ class Thor
# ==== Returns
# Array[Array[Thor::Option.name]]
#
- # source://thor//lib/thor.rb#458
+ # source://thor//lib/thor.rb#469
def method_at_least_one_option_names; end
# Returns this class exclusive options array set.
@@ -527,7 +541,7 @@ class Thor
# ==== Returns
# Array[Array[Thor::Option.name]]
#
- # source://thor//lib/thor.rb#449
+ # source://thor//lib/thor.rb#460
def method_exclusive_option_names; end
# receives a (possibly nil) command name and returns a name that is in
@@ -540,7 +554,7 @@ class Thor
#
# @raise [AmbiguousTaskError]
#
- # source://thor//lib/thor.rb#594
+ # source://thor//lib/thor.rb#605
def normalize_command_name(meth); end
# receives a (possibly nil) command name and returns a name that is in
@@ -553,23 +567,23 @@ class Thor
#
# @raise [AmbiguousTaskError]
#
- # source://thor//lib/thor.rb#594
+ # source://thor//lib/thor.rb#605
def normalize_task_name(meth); end
- # source://thor//lib/thor.rb#482
+ # source://thor//lib/thor.rb#493
def print_at_least_one_required_options(shell, command = T.unsafe(nil)); end
- # source://thor//lib/thor.rb#471
+ # source://thor//lib/thor.rb#482
def print_exclusive_options(shell, command = T.unsafe(nil)); end
# Retrieve the command name from given args.
#
- # source://thor//lib/thor.rb#581
+ # source://thor//lib/thor.rb#592
def retrieve_command_name(args); end
# Retrieve the command name from given args.
#
- # source://thor//lib/thor.rb#581
+ # source://thor//lib/thor.rb#592
def retrieve_task_name(args); end
# Sort the commands, lexicographically by default.
@@ -577,16 +591,16 @@ class Thor
# Can be overridden in the subclass to change the display order of the
# commands.
#
- # source://thor//lib/thor.rb#642
+ # source://thor//lib/thor.rb#653
def sort_commands!(list); end
- # source://thor//lib/thor.rb#462
+ # source://thor//lib/thor.rb#473
def stop_on_unknown_option; end
- # source://thor//lib/thor.rb#630
+ # source://thor//lib/thor.rb#641
def subcommand_help(cmd); end
- # source://thor//lib/thor.rb#630
+ # source://thor//lib/thor.rb#641
def subtask_help(cmd); end
end
end
@@ -2629,7 +2643,7 @@ class Thor::Group
# Shortcut to invoke with padding and block handling. Use internally by
# invoke and invoke_from_option class methods.
#
- # source://thor//lib/thor/group.rb#265
+ # source://thor//lib/thor/group.rb#276
def _invoke_for_class_method(klass, command = T.unsafe(nil), *args, &block); end
class << self
@@ -2639,6 +2653,19 @@ class Thor::Group
# source://thor//lib/thor/group.rb#161
def class_options_help(shell, groups = T.unsafe(nil)); end
+ # Checks if a specified command exists.
+ #
+ # ==== Parameters
+ # command_name:: The name of the command to check for existence.
+ #
+ # ==== Returns
+ # Boolean:: +true+ if the command exists, +false+ otherwise.
+ #
+ # @return [Boolean]
+ #
+ # source://thor//lib/thor/group.rb#221
+ def command_exists?(command_name); end
+
# The description for this Thor::Group. If none is provided, but a source root
# exists, tries to find the USAGE one folder above it, otherwise searches
# in the superclass.
@@ -2746,33 +2773,33 @@ class Thor::Group
# The banner for this class. You can customize it if you are invoking the
# thor class by another ways which is not the Thor::Runner.
#
- # source://thor//lib/thor/group.rb#238
+ # source://thor//lib/thor/group.rb#249
def banner; end
- # source://thor//lib/thor/group.rb#248
+ # source://thor//lib/thor/group.rb#259
def baseclass; end
- # source://thor//lib/thor/group.rb#252
+ # source://thor//lib/thor/group.rb#263
def create_command(meth); end
- # source://thor//lib/thor/group.rb#252
+ # source://thor//lib/thor/group.rb#263
def create_task(meth); end
# The method responsible for dispatching given the args.
#
# @yield [instance]
#
- # source://thor//lib/thor/group.rb#217
+ # source://thor//lib/thor/group.rb#228
def dispatch(command, given_args, given_opts, config); end
# Represents the whole class as a command.
#
- # source://thor//lib/thor/group.rb#243
+ # source://thor//lib/thor/group.rb#254
def self_command; end
# Represents the whole class as a command.
#
- # source://thor//lib/thor/group.rb#243
+ # source://thor//lib/thor/group.rb#254
def self_task; end
end
end
diff --git a/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi b/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi
similarity index 99%
rename from sorbet/rbi/gems/unicode-display_width@2.5.0.rbi
rename to sorbet/rbi/gems/unicode-display_width@2.6.0.rbi
index ccdfd066..2aaad232 100644
--- a/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi
+++ b/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `unicode-display_width` gem.
# Please instead update this file by running `bin/tapioca gem unicode-display_width`.
+
# source://unicode-display_width//lib/unicode/display_width/constants.rb#3
module Unicode; end
diff --git a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi
similarity index 90%
rename from sorbet/rbi/gems/yard-sorbet@0.8.1.rbi
rename to sorbet/rbi/gems/yard-sorbet@0.9.0.rbi
index 5c416133..aa626e03 100644
--- a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi
+++ b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `yard-sorbet` gem.
# Please instead update this file by running `bin/tapioca gem yard-sorbet`.
+
class YARD::Handlers::Ruby::ClassHandler < ::YARD::Handlers::Ruby::Base
include ::YARDSorbet::Handlers::StructClassHandler
end
@@ -35,7 +36,7 @@ end
# source://yard-sorbet//lib/yard-sorbet/handlers.rb#7
module YARDSorbet::Handlers; end
-# Apllies an `@abstract` tag to `abstract!`/`interface!` modules (if not alerady present).
+# Applies an `@abstract` tag to `abstract!`/`interface!` modules (if not alerady present).
#
# source://yard-sorbet//lib/yard-sorbet/handlers/abstract_dsl_handler.rb#7
class YARDSorbet::Handlers::AbstractDSLHandler < ::YARD::Handlers::Ruby::Base
@@ -94,7 +95,7 @@ end
#
# source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#9
class YARDSorbet::Handlers::MixesInClassMethodsHandler < ::YARD::Handlers::Ruby::Base
- # source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#23
+ # source://yard-sorbet//lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#21
sig { void }
def process; end
@@ -120,7 +121,7 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base
# source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#73
sig { params(method_objects: T::Array[::YARD::CodeObjects::MethodObject]).void }
- def document_attr_methods(method_objects); end
+ def document_attrs(method_objects); end
# An attr* sig can be merged into a previous attr* docstring if it is the only parameter passed to the attr*
# declaration. This is to avoid needing to rewrite the source code to separate merged and unmerged attr*
@@ -130,7 +131,7 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base
sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Boolean) }
def merged_into_attr?(attr_node); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#78
+ # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#76
sig do
params(
attach_to: T.any(::YARD::CodeObjects::MethodObject, ::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode),
@@ -140,15 +141,15 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base
end
def parse_node(attach_to, docstring, include_params: T.unsafe(nil)); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#99
+ # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#97
sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void }
def parse_params(node, docstring); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#109
+ # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#107
sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void }
def parse_return(node, docstring); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#87
+ # source://yard-sorbet//lib/yard-sorbet/handlers/sig_handler.rb#85
sig { params(docstring: ::YARD::Docstring, include_params: T::Boolean).void }
def parse_sig(docstring, include_params: T.unsafe(nil)); end
@@ -222,27 +223,27 @@ class YARDSorbet::Handlers::StructPropHandler < ::YARD::Handlers::Ruby::Base
sig { returns(T::Boolean) }
def immutable?; end
- # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#44
+ # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#42
sig { params(kwd: ::String).returns(T.nilable(::String)) }
def kw_arg(kwd); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#49
+ # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#45
sig { params(name: ::String).returns(::YARDSorbet::TStructProp) }
def make_prop(name); end
- # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#60
+ # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#56
sig { returns(T::Array[::YARD::Parser::Ruby::AstNode]) }
def params; end
# Register the field explicitly as an attribute.
#
- # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#66
+ # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#60
sig { params(object: ::YARD::CodeObjects::MethodObject, name: ::String).void }
def register_attrs(object, name); end
# Store the prop for use in the constructor definition
#
- # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#74
+ # source://yard-sorbet//lib/yard-sorbet/handlers/struct_prop_handler.rb#68
sig { params(prop: ::YARDSorbet::TStructProp).void }
def update_state(prop); end
end
@@ -266,13 +267,19 @@ module YARDSorbet::NodeUtils
end
def bfs_traverse(node, &_blk); end
- # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#32
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#31
sig { params(node: ::YARD::Parser::Ruby::AstNode).void }
def delete_node(node); end
+ # Enqueue the eligible children of a node in the BFS queue
+ #
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#35
+ sig { params(queue: ::Thread::Queue, node: ::YARD::Parser::Ruby::AstNode).void }
+ def enqueue_children(queue, node); end
+
# Gets the node that a sorbet `sig` can be attached do, bypassing visisbility modifiers and the like
#
- # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#38
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#48
sig do
params(
node: ::YARD::Parser::Ruby::AstNode
@@ -284,17 +291,17 @@ module YARDSorbet::NodeUtils
#
# @raise [IndexError] if the node does not have an adjacent sibling (ascending)
#
- # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#45
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#53
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::YARD::Parser::Ruby::AstNode) }
def sibling_node(node); end
- # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#52
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#60
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Boolean) }
def sigable_node?(node); end
# @see https://github.com/lsegal/yard/blob/main/lib/yard/handlers/ruby/attribute_handler.rb YARD::Handlers::Ruby::AttributeHandler.validated_attribute_names
#
- # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#63
+ # source://yard-sorbet//lib/yard-sorbet/node_utils.rb#71
sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) }
def validated_attribute_names(attr_node); end
end
@@ -328,43 +335,43 @@ module YARDSorbet::SigToYARD
private
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#61
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#58
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::String) }
def build_generic_type(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#70
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#67
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
def convert_aref(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#82
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#79
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
def convert_array(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#90
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#87
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
def convert_collection(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#97
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#94
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
def convert_hash(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#105
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#102
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
def convert_list(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#31
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#28
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
def convert_node(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#43
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#40
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) }
def convert_node_type(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#110
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#107
sig { params(node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) }
def convert_t_method(node); end
- # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#121
+ # source://yard-sorbet//lib/yard-sorbet/sig_to_yard.rb#118
sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) }
def convert_unknown(node); end
end
@@ -381,7 +388,7 @@ class YARDSorbet::TStructProp < ::T::Struct
const :types, T::Array[::String]
class << self
- # source://sorbet-runtime/0.5.11361/lib/types/struct.rb#13
+ # source://sorbet-runtime/0.5.11694/lib/types/struct.rb#13
def inherited(s); end
end
end
@@ -403,7 +410,7 @@ module YARDSorbet::TagUtils
# Create or update a `YARD` tag with type information
#
- # source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#30
+ # source://yard-sorbet//lib/yard-sorbet/tag_utils.rb#28
sig do
params(
docstring: ::YARD::Docstring,
diff --git a/sorbet/rbi/gems/yard@0.9.36.rbi b/sorbet/rbi/gems/yard@0.9.37.rbi
similarity index 97%
rename from sorbet/rbi/gems/yard@0.9.36.rbi
rename to sorbet/rbi/gems/yard@0.9.37.rbi
index cf3844a6..b7622a23 100644
--- a/sorbet/rbi/gems/yard@0.9.36.rbi
+++ b/sorbet/rbi/gems/yard@0.9.37.rbi
@@ -4,6 +4,7 @@
# This is an autogenerated file for types exported from the `yard` gem.
# Please instead update this file by running `bin/tapioca gem yard`.
+
# source://yard//lib/yard.rb#61
::RUBY18 = T.let(T.unsafe(nil), FalseClass)
@@ -3264,11 +3265,11 @@ YARD::CodeObjects::METHODNAMEMATCH = T.let(T.unsafe(nil), Regexp)
# # Extra data added to docstring
# property :bar
#
-# source://yard//lib/yard/code_objects/macro_object.rb#30
+# source://yard//lib/yard/code_objects/macro_object.rb#29
class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# @return [Boolean] whether this macro is attached to a method
#
- # source://yard//lib/yard/code_objects/macro_object.rb#149
+ # source://yard//lib/yard/code_objects/macro_object.rb#148
def attached?; end
# Expands the macro using
@@ -3283,39 +3284,39 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# call, if there is a block.
# @see expand
#
- # source://yard//lib/yard/code_objects/macro_object.rb#167
+ # source://yard//lib/yard/code_objects/macro_object.rb#166
def expand(call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end
# @return [String] the macro data stored on the object
#
- # source://yard//lib/yard/code_objects/macro_object.rb#142
+ # source://yard//lib/yard/code_objects/macro_object.rb#141
def macro_data; end
# @return [String] the macro data stored on the object
#
- # source://yard//lib/yard/code_objects/macro_object.rb#142
+ # source://yard//lib/yard/code_objects/macro_object.rb#141
def macro_data=(_arg0); end
# @return [CodeObjects::Base] the method object that this macro is
# attached to.
#
- # source://yard//lib/yard/code_objects/macro_object.rb#146
+ # source://yard//lib/yard/code_objects/macro_object.rb#145
def method_object; end
# @return [CodeObjects::Base] the method object that this macro is
# attached to.
#
- # source://yard//lib/yard/code_objects/macro_object.rb#146
+ # source://yard//lib/yard/code_objects/macro_object.rb#145
def method_object=(_arg0); end
# Overrides {Base#path} so the macro path is ".macro.MACRONAME"
#
- # source://yard//lib/yard/code_objects/macro_object.rb#152
+ # source://yard//lib/yard/code_objects/macro_object.rb#151
def path; end
# Overrides the separator to be '.'
#
- # source://yard//lib/yard/code_objects/macro_object.rb#155
+ # source://yard//lib/yard/code_objects/macro_object.rb#154
def sep; end
class << self
@@ -3333,7 +3334,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# @return [String] the expanded macro data
# @see find_or_create
#
- # source://yard//lib/yard/code_objects/macro_object.rb#120
+ # source://yard//lib/yard/code_objects/macro_object.rb#119
def apply(docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil), _method_object = T.unsafe(nil)); end
# Applies a macro to a docstring, interpolating the macro's data on the
@@ -3349,7 +3350,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# interpolating the block data as a variable.
# @return [String] the expanded macro data
#
- # source://yard//lib/yard/code_objects/macro_object.rb#136
+ # source://yard//lib/yard/code_objects/macro_object.rb#135
def apply_macro(macro, docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end
# Creates a new macro and fills in the relevant properties.
@@ -3360,7 +3361,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# macro to. If supplied, {#attached?} will be true
# @return [MacroObject] the newly created object
#
- # source://yard//lib/yard/code_objects/macro_object.rb#40
+ # source://yard//lib/yard/code_objects/macro_object.rb#39
def create(macro_name, data, method_object = T.unsafe(nil)); end
# Parses a given docstring and determines if the macro is "new" or
@@ -3380,7 +3381,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# @return [nil] if the +data+ has no macro tag or if the macro is
# not new and no macro by the macro name is found.
#
- # source://yard//lib/yard/code_objects/macro_object.rb#71
+ # source://yard//lib/yard/code_objects/macro_object.rb#70
def create_docstring(macro_name, data, method_object = T.unsafe(nil)); end
# Expands +macro_data+ using the interpolation parameters.
@@ -3393,7 +3394,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
#
# @param macro_data [String] the macro data to expand (taken from {#macro_data})
#
- # source://yard//lib/yard/code_objects/macro_object.rb#93
+ # source://yard//lib/yard/code_objects/macro_object.rb#92
def expand(macro_data, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end
# Finds a macro using +macro_name+
@@ -3402,7 +3403,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# @return [MacroObject] if a macro is found
# @return [nil] if there is no registered macro by that name
#
- # source://yard//lib/yard/code_objects/macro_object.rb#51
+ # source://yard//lib/yard/code_objects/macro_object.rb#50
def find(macro_name); end
# Parses a given docstring and determines if the macro is "new" or
@@ -3422,12 +3423,12 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base
# @return [nil] if the +data+ has no macro tag or if the macro is
# not new and no macro by the macro name is found.
#
- # source://yard//lib/yard/code_objects/macro_object.rb#71
+ # source://yard//lib/yard/code_objects/macro_object.rb#70
def find_or_create(macro_name, data, method_object = T.unsafe(nil)); end
end
end
-# source://yard//lib/yard/code_objects/macro_object.rb#31
+# source://yard//lib/yard/code_objects/macro_object.rb#30
YARD::CodeObjects::MacroObject::MACRO_MATCH = T.let(T.unsafe(nil), Regexp)
# Represents a Ruby method in source
@@ -4762,7 +4763,7 @@ YARD::Docstring::META_MATCH = T.let(T.unsafe(nil), Regexp)
# @see #parse_content
# @since 0.8.0
#
-# source://yard//lib/yard/docstring_parser.rb#30
+# source://yard//lib/yard/docstring_parser.rb#29
class YARD::DocstringParser
# Creates a new parser to parse docstring data
#
@@ -4771,7 +4772,7 @@ class YARD::DocstringParser
# @return [DocstringParser] a new instance of DocstringParser
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#81
+ # source://yard//lib/yard/docstring_parser.rb#80
def initialize(library = T.unsafe(nil)); end
# Creates a new directive using the registered {#library}
@@ -4779,14 +4780,14 @@ class YARD::DocstringParser
# @return [Tags::Directive] the directive object that is created
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#232
+ # source://yard//lib/yard/docstring_parser.rb#231
def create_directive(tag_name, tag_buf); end
# Creates a {Tags::RefTag}
#
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#226
+ # source://yard//lib/yard/docstring_parser.rb#225
def create_ref_tag(tag_name, name, object_name); end
# Creates a tag from the {Tags::DefaultFactory tag factory}.
@@ -4798,7 +4799,7 @@ class YARD::DocstringParser
# @return [Tags::Tag, Tags::RefTag] a tag
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#209
+ # source://yard//lib/yard/docstring_parser.rb#208
def create_tag(tag_name, tag_buf = T.unsafe(nil)); end
# @return [Array] a list of directives identified
@@ -4806,7 +4807,7 @@ class YARD::DocstringParser
# Docstring object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#45
+ # source://yard//lib/yard/docstring_parser.rb#44
def directives; end
# @return [Array] a list of directives identified
@@ -4814,7 +4815,7 @@ class YARD::DocstringParser
# Docstring object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#45
+ # source://yard//lib/yard/docstring_parser.rb#44
def directives=(_arg0); end
# @return [Handlers::Base, nil] the handler parsing this
@@ -4822,7 +4823,7 @@ class YARD::DocstringParser
# initialized through
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#66
+ # source://yard//lib/yard/docstring_parser.rb#65
def handler; end
# @return [Handlers::Base, nil] the handler parsing this
@@ -4830,21 +4831,21 @@ class YARD::DocstringParser
# initialized through
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#66
+ # source://yard//lib/yard/docstring_parser.rb#65
def handler=(_arg0); end
# @return [Tags::Library] the tag library being used to
# identify registered tags in the docstring.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#70
+ # source://yard//lib/yard/docstring_parser.rb#69
def library; end
# @return [Tags::Library] the tag library being used to
# identify registered tags in the docstring.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#70
+ # source://yard//lib/yard/docstring_parser.rb#69
def library=(_arg0); end
# @return [CodeObjects::Base, nil] the object associated with
@@ -4852,7 +4853,7 @@ class YARD::DocstringParser
# not attached to any object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#56
+ # source://yard//lib/yard/docstring_parser.rb#55
def object; end
# @return [CodeObjects::Base, nil] the object associated with
@@ -4860,7 +4861,7 @@ class YARD::DocstringParser
# not attached to any object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#56
+ # source://yard//lib/yard/docstring_parser.rb#55
def object=(_arg0); end
# Parses all content and returns itself.
@@ -4877,7 +4878,7 @@ class YARD::DocstringParser
# @see #to_docstring
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#113
+ # source://yard//lib/yard/docstring_parser.rb#112
def parse(content, object = T.unsafe(nil), handler = T.unsafe(nil)); end
# Parses a given block of text.
@@ -4887,7 +4888,7 @@ class YARD::DocstringParser
# @param content [String] the content to parse
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#129
+ # source://yard//lib/yard/docstring_parser.rb#128
def parse_content(content); end
# Call post processing callbacks on parser.
@@ -4897,19 +4898,19 @@ class YARD::DocstringParser
# @return [void]
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#196
+ # source://yard//lib/yard/docstring_parser.rb#195
def post_process; end
# @return [String] the complete input string to the parser.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#36
+ # source://yard//lib/yard/docstring_parser.rb#35
def raw_text; end
# @return [String] the complete input string to the parser.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#36
+ # source://yard//lib/yard/docstring_parser.rb#35
def raw_text=(_arg0); end
# @return [CodeObjects::Base, nil] the object referenced by
@@ -4917,7 +4918,7 @@ class YARD::DocstringParser
# refer to any object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#61
+ # source://yard//lib/yard/docstring_parser.rb#60
def reference; end
# @return [CodeObjects::Base, nil] the object referenced by
@@ -4925,7 +4926,7 @@ class YARD::DocstringParser
# refer to any object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#61
+ # source://yard//lib/yard/docstring_parser.rb#60
def reference=(_arg0); end
# @return [OpenStruct] any arbitrary state to be passed between
@@ -4934,7 +4935,7 @@ class YARD::DocstringParser
# used in a docstring).
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#51
+ # source://yard//lib/yard/docstring_parser.rb#50
def state; end
# @return [OpenStruct] any arbitrary state to be passed between
@@ -4943,7 +4944,7 @@ class YARD::DocstringParser
# used in a docstring).
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#51
+ # source://yard//lib/yard/docstring_parser.rb#50
def state=(_arg0); end
# Backward compatibility to detect old tags that should be specified
@@ -4952,42 +4953,42 @@ class YARD::DocstringParser
# @return [Boolean]
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#252
+ # source://yard//lib/yard/docstring_parser.rb#251
def tag_is_directive?(tag_name); end
# @return [Array] the list of meta-data tags identified
# by the parser
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#40
+ # source://yard//lib/yard/docstring_parser.rb#39
def tags; end
# @return [Array] the list of meta-data tags identified
# by the parser
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#40
+ # source://yard//lib/yard/docstring_parser.rb#39
def tags=(_arg0); end
# @return [String] the parsed text portion of the docstring,
# with tags removed.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#33
+ # source://yard//lib/yard/docstring_parser.rb#32
def text; end
# @return [String] the parsed text portion of the docstring,
# with tags removed.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#33
+ # source://yard//lib/yard/docstring_parser.rb#32
def text=(_arg0); end
# @return [Docstring] translates parsed text into
# a Docstring object.
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#95
+ # source://yard//lib/yard/docstring_parser.rb#94
def to_docstring; end
private
@@ -4996,7 +4997,7 @@ class YARD::DocstringParser
#
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#324
+ # source://yard//lib/yard/docstring_parser.rb#323
def call_after_parse_callbacks; end
# Calls the {Tags::Directive#after_parse} callback on all the
@@ -5004,17 +5005,17 @@ class YARD::DocstringParser
#
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#319
+ # source://yard//lib/yard/docstring_parser.rb#318
def call_directives_after_parse; end
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#305
+ # source://yard//lib/yard/docstring_parser.rb#304
def detect_reference(content); end
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#301
+ # source://yard//lib/yard/docstring_parser.rb#300
def namespace; end
class << self
@@ -5029,13 +5030,13 @@ class YARD::DocstringParser
# with all directives and tags created.
# @yieldreturn [void]
#
- # source://yard//lib/yard/docstring_parser.rb#266
+ # source://yard//lib/yard/docstring_parser.rb#265
def after_parse(&block); end
# @return [Array] the {after_parse} callback proc objects
# @since 0.8.0
#
- # source://yard//lib/yard/docstring_parser.rb#271
+ # source://yard//lib/yard/docstring_parser.rb#270
def after_parse_callbacks; end
end
end
@@ -5044,7 +5045,7 @@ end
#
# @since 0.8.0
#
-# source://yard//lib/yard/docstring_parser.rb#73
+# source://yard//lib/yard/docstring_parser.rb#72
YARD::DocstringParser::META_MATCH = T.let(T.unsafe(nil), Regexp)
# source://yard//lib/yard/gem_index.rb#6
@@ -5953,14 +5954,14 @@ end
#
# @see Handlers::Base
#
-# source://yard//lib/yard/handlers/processor.rb#20
+# source://yard//lib/yard/handlers/processor.rb#19
class YARD::Handlers::Processor
# Creates a new Processor for a +file+.
#
# @param parser [Parser::SourceParser] the parser used to initialize the processor
# @return [Processor] a new instance of Processor
#
- # source://yard//lib/yard/handlers/processor.rb#92
+ # source://yard//lib/yard/handlers/processor.rb#91
def initialize(parser); end
# Share state across different handlers inside of a file.
@@ -5973,7 +5974,7 @@ class YARD::Handlers::Processor
# @return [OpenStruct] an open structure that can store arbitrary data
# @see #globals
#
- # source://yard//lib/yard/handlers/processor.rb#88
+ # source://yard//lib/yard/handlers/processor.rb#87
def extra_state; end
# Share state across different handlers inside of a file.
@@ -5986,17 +5987,17 @@ class YARD::Handlers::Processor
# @return [OpenStruct] an open structure that can store arbitrary data
# @see #globals
#
- # source://yard//lib/yard/handlers/processor.rb#88
+ # source://yard//lib/yard/handlers/processor.rb#87
def extra_state=(_arg0); end
# @return [String] the filename
#
- # source://yard//lib/yard/handlers/processor.rb#41
+ # source://yard//lib/yard/handlers/processor.rb#40
def file; end
# @return [String] the filename
#
- # source://yard//lib/yard/handlers/processor.rb#41
+ # source://yard//lib/yard/handlers/processor.rb#40
def file=(_arg0); end
# Searches for all handlers in {Base.subclasses} that match the +statement+
@@ -6004,7 +6005,7 @@ class YARD::Handlers::Processor
# @param statement the statement object to match.
# @return [Array] a list of handlers to process the statement with.
#
- # source://yard//lib/yard/handlers/processor.rb#151
+ # source://yard//lib/yard/handlers/processor.rb#150
def find_handlers(statement); end
# Handlers can share state for the entire post processing stage through
@@ -6024,7 +6025,7 @@ class YARD::Handlers::Processor
# @return [OpenStruct] global shared state for post-processing stage
# @see #extra_state
#
- # source://yard//lib/yard/handlers/processor.rb#77
+ # source://yard//lib/yard/handlers/processor.rb#76
def globals; end
# Handlers can share state for the entire post processing stage through
@@ -6044,17 +6045,17 @@ class YARD::Handlers::Processor
# @return [OpenStruct] global shared state for post-processing stage
# @see #extra_state
#
- # source://yard//lib/yard/handlers/processor.rb#77
+ # source://yard//lib/yard/handlers/processor.rb#76
def globals=(_arg0); end
# @return [CodeObjects::NamespaceObject] the current namespace
#
- # source://yard//lib/yard/handlers/processor.rb#44
+ # source://yard//lib/yard/handlers/processor.rb#43
def namespace; end
# @return [CodeObjects::NamespaceObject] the current namespace
#
- # source://yard//lib/yard/handlers/processor.rb#44
+ # source://yard//lib/yard/handlers/processor.rb#43
def namespace=(_arg0); end
# @return [CodeObjects::Base, nil] unlike the namespace, the owner
@@ -6062,7 +6063,7 @@ class YARD::Handlers::Processor
# For instance, when parsing a method body, the {CodeObjects::MethodObject}
# is set as the owner, in case any extra method information is processed.
#
- # source://yard//lib/yard/handlers/processor.rb#56
+ # source://yard//lib/yard/handlers/processor.rb#55
def owner; end
# @return [CodeObjects::Base, nil] unlike the namespace, the owner
@@ -6070,7 +6071,7 @@ class YARD::Handlers::Processor
# For instance, when parsing a method body, the {CodeObjects::MethodObject}
# is set as the owner, in case any extra method information is processed.
#
- # source://yard//lib/yard/handlers/processor.rb#56
+ # source://yard//lib/yard/handlers/processor.rb#55
def owner=(_arg0); end
# Continue parsing the remainder of the files in the +globals.ordered_parser+
@@ -6080,17 +6081,17 @@ class YARD::Handlers::Processor
# @return [void]
# @see Parser::OrderedParser
#
- # source://yard//lib/yard/handlers/processor.rb#140
+ # source://yard//lib/yard/handlers/processor.rb#139
def parse_remaining_files; end
# @return [Symbol] the parser type (:ruby, :ruby18, :c)
#
- # source://yard//lib/yard/handlers/processor.rb#59
+ # source://yard//lib/yard/handlers/processor.rb#58
def parser_type; end
# @return [Symbol] the parser type (:ruby, :ruby18, :c)
#
- # source://yard//lib/yard/handlers/processor.rb#59
+ # source://yard//lib/yard/handlers/processor.rb#58
def parser_type=(_arg0); end
# Processes a list of statements by finding handlers to process each
@@ -6099,27 +6100,27 @@ class YARD::Handlers::Processor
# @param statements [Array] a list of statements
# @return [void]
#
- # source://yard//lib/yard/handlers/processor.rb#110
+ # source://yard//lib/yard/handlers/processor.rb#109
def process(statements); end
# @return [Symbol] the current scope (class, instance)
#
- # source://yard//lib/yard/handlers/processor.rb#50
+ # source://yard//lib/yard/handlers/processor.rb#49
def scope; end
# @return [Symbol] the current scope (class, instance)
#
- # source://yard//lib/yard/handlers/processor.rb#50
+ # source://yard//lib/yard/handlers/processor.rb#49
def scope=(_arg0); end
# @return [Symbol] the current visibility (public, private, protected)
#
- # source://yard//lib/yard/handlers/processor.rb#47
+ # source://yard//lib/yard/handlers/processor.rb#46
def visibility; end
# @return [Symbol] the current visibility (public, private, protected)
#
- # source://yard//lib/yard/handlers/processor.rb#47
+ # source://yard//lib/yard/handlers/processor.rb#46
def visibility=(_arg0); end
private
@@ -6128,7 +6129,7 @@ class YARD::Handlers::Processor
#
# @return [Base] the base class
#
- # source://yard//lib/yard/handlers/processor.rb#172
+ # source://yard//lib/yard/handlers/processor.rb#171
def handler_base_class; end
# The module holding the handlers to be loaded
@@ -6136,12 +6137,12 @@ class YARD::Handlers::Processor
# @return [Module] the module containing the handlers depending on
# {#parser_type}.
#
- # source://yard//lib/yard/handlers/processor.rb#180
+ # source://yard//lib/yard/handlers/processor.rb#179
def handler_base_namespace; end
# @return [Boolean]
#
- # source://yard//lib/yard/handlers/processor.rb#161
+ # source://yard//lib/yard/handlers/processor.rb#160
def handles?(handler, statement); end
# Loads handlers from {#handler_base_namespace}. This ensures that
@@ -6150,7 +6151,7 @@ class YARD::Handlers::Processor
#
# @return [void]
#
- # source://yard//lib/yard/handlers/processor.rb#188
+ # source://yard//lib/yard/handlers/processor.rb#187
def load_handlers; end
class << self
@@ -6158,14 +6159,14 @@ class YARD::Handlers::Processor
# @return [Hash] a list of registered parser type extensions
# @since 0.6.0
#
- # source://yard//lib/yard/handlers/processor.rb#33
+ # source://yard//lib/yard/handlers/processor.rb#32
def namespace_for_handler; end
# Registers a new namespace for handlers of the given type.
#
# @since 0.6.0
#
- # source://yard//lib/yard/handlers/processor.rb#24
+ # source://yard//lib/yard/handlers/processor.rb#23
def register_handler_namespace(type, ns); end
end
end
@@ -6998,6 +6999,11 @@ end
# source://yard//lib/yard/handlers/ruby/visibility_handler.rb#3
class YARD::Handlers::Ruby::VisibilityHandler < ::YARD::Handlers::Ruby::Base
include ::YARD::Handlers::Ruby::DecoratorHandlerMethods
+
+ # @return [Boolean]
+ #
+ # source://yard//lib/yard/handlers/ruby/visibility_handler.rb#31
+ def is_attribute_method?(node); end
end
# Handles 'yield' calls
@@ -7460,13 +7466,16 @@ end
# Handles console logging for info, warnings and errors.
# Uses the stdlib Logger class in Ruby for all the backend logic.
#
-# source://yard//lib/yard/logging.rb#9
-class YARD::Logger < ::Logger
+# source://yard//lib/yard/logging.rb#8
+class YARD::Logger
+ include ::YARD::Logger::Severity
+
# Creates a new logger
#
+ # @private
# @return [Logger] a new instance of Logger
#
- # source://yard//lib/yard/logging.rb#43
+ # source://yard//lib/yard/logging.rb#82
def initialize(pipe, *args); end
# Displays an unformatted line to the logger output stream.
@@ -7475,7 +7484,7 @@ class YARD::Logger < ::Logger
# @return [void]
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#143
+ # source://yard//lib/yard/logging.rb#205
def <<(msg = T.unsafe(nil)); end
# Prints the backtrace +exc+ to the logger as error data.
@@ -7484,7 +7493,7 @@ class YARD::Logger < ::Logger
# @param level_meth [Symbol] the level to log backtrace at
# @return [void]
#
- # source://yard//lib/yard/logging.rb#154
+ # source://yard//lib/yard/logging.rb#216
def backtrace(exc, level_meth = T.unsafe(nil)); end
# Captures the duration of a block of code for benchmark analysis. Also
@@ -7497,7 +7506,7 @@ class YARD::Logger < ::Logger
# @todo Implement capture storage for reporting of benchmarks
# @yield a block of arbitrary code to benchmark
#
- # source://yard//lib/yard/logging.rb#80
+ # source://yard//lib/yard/logging.rb#234
def capture(msg, nontty_log = T.unsafe(nil)); end
# Clears the progress indicator in the TTY display.
@@ -7505,14 +7514,18 @@ class YARD::Logger < ::Logger
# @return [void]
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#121
+ # source://yard//lib/yard/logging.rb#186
def clear_progress; end
- # Changes the debug level to DEBUG if $DEBUG is set
- # and writes a debugging message.
+ # Changes the debug level to DEBUG if $DEBUG is set and writes a debugging message.
+ # Logs a message with the debug severity level.
+ #
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
#
- # source://yard//lib/yard/logging.rb#59
- def debug(*args); end
+ # source://yard//lib/yard/logging.rb#103
+ def debug(message); end
# Sets the logger level for the duration of the block
#
@@ -7524,17 +7537,65 @@ class YARD::Logger < ::Logger
# values can be found in Ruby's Logger class.
# @yield the block with the logger temporarily set to +new_level+
#
- # source://yard//lib/yard/logging.rb#179
+ # source://yard//lib/yard/logging.rb#142
def enter_level(new_level = T.unsafe(nil)); end
+ # Logs a message with the error severity level.
+ #
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
+ #
+ # source://yard//lib/yard/logging.rb#103
+ def error(message); end
+
+ # Logs a message with the fatal severity level.
+ #
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
+ #
+ # source://yard//lib/yard/logging.rb#103
+ def fatal(message); end
+
+ # Logs a message with the info severity level.
+ #
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
+ #
+ # source://yard//lib/yard/logging.rb#103
+ def info(message); end
+
# @return [IO] the IO object being logged to
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#17
+ # source://yard//lib/yard/logging.rb#49
def io; end
- # source://yard//lib/yard/logging.rb#18
- def io=(pipe); end
+ # @return [IO] the IO object being logged to
+ # @since 0.8.2
+ #
+ # source://yard//lib/yard/logging.rb#49
+ def io=(_arg0); end
+
+ # @return [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the logging level
+ #
+ # source://yard//lib/yard/logging.rb#57
+ def level; end
+
+ # @return [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the logging level
+ #
+ # source://yard//lib/yard/logging.rb#57
+ def level=(_arg0); end
+
+ # Logs a message with a given severity
+ #
+ # @param severity [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the severity level
+ # @param message [String] the message to log
+ #
+ # source://yard//lib/yard/logging.rb#122
+ def log(severity, message); end
# Displays an unformatted line to the logger output stream.
#
@@ -7542,7 +7603,7 @@ class YARD::Logger < ::Logger
# @return [void]
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#143
+ # source://yard//lib/yard/logging.rb#205
def print(msg = T.unsafe(nil)); end
# Displays a progress indicator for a given message. This progress report
@@ -7555,7 +7616,7 @@ class YARD::Logger < ::Logger
# @return [void]
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#96
+ # source://yard//lib/yard/logging.rb#161
def progress(msg, nontty_log = T.unsafe(nil)); end
# Displays an unformatted line to the logger output stream, adding
@@ -7565,86 +7626,91 @@ class YARD::Logger < ::Logger
# @return [void]
# @since 0.8.2
#
- # source://yard//lib/yard/logging.rb#132
+ # source://yard//lib/yard/logging.rb#197
def puts(msg = T.unsafe(nil)); end
# @return [Boolean] whether backtraces should be shown (by default
# this is on).
#
- # source://yard//lib/yard/logging.rb#22
+ # source://yard//lib/yard/logging.rb#53
def show_backtraces; end
# Sets the attribute show_backtraces
#
# @param value the value to set the attribute show_backtraces to.
#
- # source://yard//lib/yard/logging.rb#23
+ # source://yard//lib/yard/logging.rb#54
def show_backtraces=(_arg0); end
# @return [Boolean] whether progress indicators should be shown when
# logging CLIs (by default this is off).
#
- # source://yard//lib/yard/logging.rb#27
+ # source://yard//lib/yard/logging.rb#64
def show_progress; end
# Sets the attribute show_progress
#
# @param value the value to set the attribute show_progress to.
#
- # source://yard//lib/yard/logging.rb#34
+ # source://yard//lib/yard/logging.rb#70
def show_progress=(_arg0); end
+ # Logs a message with the unknown severity level.
+ #
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
+ #
+ # source://yard//lib/yard/logging.rb#103
+ def unknown(message); end
+
# Remembers when a warning occurs and writes a warning message.
+ # Logs a message with the warn severity level.
#
- # source://yard//lib/yard/logging.rb#65
- def warn(*args); end
+ # @param message [String] the message to log
+ # @return [void]
+ # @see #log
+ #
+ # source://yard//lib/yard/logging.rb#103
+ def warn(message); end
# Warns that the Ruby environment does not support continuations. Applies
# to JRuby, Rubinius and MacRuby. This warning will only display once
# per Ruby process.
#
# @deprecated Continuations are no longer needed by YARD 0.8.0+.
+ # @private
# @return [void]
#
- # source://yard//lib/yard/logging.rb#167
+ # source://yard//lib/yard/logging.rb#250
def warn_no_continuations; end
- # Returns the value of attribute warned.
+ # @return [Boolean] whether a warn message has been emitted. Used for status tracking.
#
- # source://yard//lib/yard/logging.rb#69
+ # source://yard//lib/yard/logging.rb#60
def warned; end
- # Sets the attribute warned
+ # @return [Boolean] whether a warn message has been emitted. Used for status tracking.
#
- # @param value the value to set the attribute warned to.
- #
- # source://yard//lib/yard/logging.rb#69
+ # source://yard//lib/yard/logging.rb#60
def warned=(_arg0); end
private
- # Override this internal Logger method to clear line
- #
- # source://yard//lib/yard/logging.rb#190
- def add(*args); end
-
- # source://yard//lib/yard/logging.rb#195
+ # source://yard//lib/yard/logging.rb#255
def clear_line; end
- # Log format (from Logger implementation). Used by Logger internally
- #
- # source://yard//lib/yard/logging.rb#201
- def format_log(sev, _time, _prog, msg); end
-
- # source://logger/1.5.3/logger.rb#682
- def print_no_newline(msg); end
-
class << self
+ # @private
+ #
+ # source://yard//lib/yard/logging.rb#101
+ def create_log_method(name); end
+
# The logger instance
#
# @return [Logger] the logger instance
#
- # source://yard//lib/yard/logging.rb#38
+ # source://yard//lib/yard/logging.rb#76
def instance(pipe = T.unsafe(nil)); end
end
end
@@ -7654,9 +7720,97 @@ end
#
# @since 0.8.2
#
-# source://yard//lib/yard/logging.rb#13
+# source://yard//lib/yard/logging.rb#45
YARD::Logger::PROGRESS_INDICATORS = T.let(T.unsafe(nil), Array)
+# Log severity levels
+#
+# source://yard//lib/yard/logging.rb#10
+module YARD::Logger::Severity; end
+
+# Debugging log level
+#
+# source://yard//lib/yard/logging.rb#12
+YARD::Logger::Severity::DEBUG = T.let(T.unsafe(nil), Integer)
+
+# Error log level
+#
+# source://yard//lib/yard/logging.rb#21
+YARD::Logger::Severity::ERROR = T.let(T.unsafe(nil), Integer)
+
+# Fatal log level
+#
+# source://yard//lib/yard/logging.rb#24
+YARD::Logger::Severity::FATAL = T.let(T.unsafe(nil), Integer)
+
+# Information log level
+#
+# source://yard//lib/yard/logging.rb#15
+YARD::Logger::Severity::INFO = T.let(T.unsafe(nil), Integer)
+
+# @private
+#
+# source://yard//lib/yard/logging.rb#30
+YARD::Logger::Severity::SEVERITIES = T.let(T.unsafe(nil), Hash)
+
+# Unknown log level
+#
+# source://yard//lib/yard/logging.rb#27
+YARD::Logger::Severity::UNKNOWN = T.let(T.unsafe(nil), Integer)
+
+# Warning log level
+#
+# source://yard//lib/yard/logging.rb#18
+YARD::Logger::Severity::WARN = T.let(T.unsafe(nil), Integer)
+
+# An OpenStruct compatible struct class that allows for basic access of attributes
+# via +struct.attr_name+ and +struct.attr_name = value+.
+#
+# source://yard//lib/yard/open_struct.rb#4
+class YARD::OpenStruct
+ # @return [OpenStruct] a new instance of OpenStruct
+ #
+ # source://yard//lib/yard/open_struct.rb#5
+ def initialize(hash = T.unsafe(nil)); end
+
+ # source://yard//lib/yard/open_struct.rb#25
+ def ==(other); end
+
+ # source://yard//lib/yard/open_struct.rb#41
+ def [](key); end
+
+ # source://yard//lib/yard/open_struct.rb#37
+ def []=(key, value); end
+
+ # source://yard//lib/yard/open_struct.rb#33
+ def dig(*keys); end
+
+ # source://yard//lib/yard/open_struct.rb#45
+ def each_pair(&block); end
+
+ # source://yard//lib/yard/open_struct.rb#29
+ def hash; end
+
+ # source://yard//lib/yard/open_struct.rb#49
+ def marshal_dump; end
+
+ # source://yard//lib/yard/open_struct.rb#53
+ def marshal_load(data); end
+
+ # @private
+ #
+ # source://yard//lib/yard/open_struct.rb#10
+ def method_missing(name, *args); end
+
+ # source://yard//lib/yard/open_struct.rb#21
+ def to_h; end
+
+ private
+
+ # source://yard//lib/yard/open_struct.rb#59
+ def __cache_lookup__(name); end
+end
+
# Generalized options class for passing around large amounts of options between objects.
#
# The options class exists for better visibility and documentability of options being
@@ -8208,7 +8362,7 @@ end
#
# @see Processor#parse_remaining_files
#
-# source://yard//lib/yard/parser/source_parser.rb#21
+# source://yard//lib/yard/parser/source_parser.rb#20
class YARD::Parser::OrderedParser
# Creates a new OrderedParser with the global state and a list
# of files to parse.
@@ -8220,30 +8374,30 @@ class YARD::Parser::OrderedParser
# @param files [Array] the list of files to parse
# @return [OrderedParser] a new instance of OrderedParser
#
- # source://yard//lib/yard/parser/source_parser.rb#33
+ # source://yard//lib/yard/parser/source_parser.rb#32
def initialize(global_state, files); end
# @return [Array] the list of remaining files to parse
#
- # source://yard//lib/yard/parser/source_parser.rb#23
+ # source://yard//lib/yard/parser/source_parser.rb#22
def files; end
# @return [Array] the list of remaining files to parse
#
- # source://yard//lib/yard/parser/source_parser.rb#23
+ # source://yard//lib/yard/parser/source_parser.rb#22
def files=(_arg0); end
# Parses the remainder of the {#files} list.
#
# @see Processor#parse_remaining_files
#
- # source://yard//lib/yard/parser/source_parser.rb#42
+ # source://yard//lib/yard/parser/source_parser.rb#41
def parse; end
end
# Raised when the parser sees a Ruby syntax error
#
-# source://yard//lib/yard/parser/source_parser.rb#13
+# source://yard//lib/yard/parser/source_parser.rb#12
class YARD::Parser::ParserSyntaxError < ::YARD::Parser::UndocumentableError; end
# Ruby parsing components.
@@ -8688,6 +8842,9 @@ class YARD::Parser::Ruby::Legacy::RubyLex
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#430
def continue; end
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1116
+ def dedent(str); end
+
# Returns the value of attribute exception_on_syntax_error.
#
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#463
@@ -8712,7 +8869,7 @@ class YARD::Parser::Ruby::Legacy::RubyLex
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#488
def gets; end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1257
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1272
def identify_comment; end
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#945
@@ -8724,13 +8881,13 @@ class YARD::Parser::Ruby::Legacy::RubyLex
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#980
def identify_identifier; end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1130
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1145
def identify_number(start); end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1111
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1126
def identify_quotation(initial_char); end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1192
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1207
def identify_string(ltype, quoted = T.unsafe(nil), opener = T.unsafe(nil), initial_char = T.unsafe(nil)); end
# Returns the value of attribute indent.
@@ -8777,10 +8934,10 @@ class YARD::Parser::Ruby::Legacy::RubyLex
# source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#462
def read_auto_clean_up=(_arg0); end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1280
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1295
def read_escape; end
- # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1242
+ # source://yard//lib/yard/parser/ruby/legacy/ruby_lex.rb#1257
def skip_inner_expression; end
# Returns the value of attribute skip_space.
@@ -9973,7 +10130,7 @@ end
# source://yard//lib/yard/parser/ruby/ast_node.rb#479
class YARD::Parser::Ruby::MethodDefinitionNode < ::YARD::Parser::Ruby::AstNode
- def block(*_arg0); end
+ def block(n = T.unsafe(nil)); end
# @return [Boolean]
#
@@ -10969,7 +11126,7 @@ end
# @see Handlers::Base
# @see CodeObjects::Base
#
-# source://yard//lib/yard/parser/source_parser.rb#64
+# source://yard//lib/yard/parser/source_parser.rb#63
class YARD::Parser::SourceParser
# @overload initialize
# @return [SourceParser] a new instance of SourceParser
@@ -11225,7 +11382,7 @@ class YARD::Parser::SourceParser
# {YARD::Logger}
# @return [void]
#
- # source://yard//lib/yard/parser/source_parser.rb#100
+ # source://yard//lib/yard/parser/source_parser.rb#99
def parse(paths = T.unsafe(nil), excluded = T.unsafe(nil), level = T.unsafe(nil)); end
# Parses a string +content+
@@ -11239,10 +11396,10 @@ class YARD::Parser::SourceParser
# @return [Symbol] the default parser type (defaults to :ruby)
#
- # source://yard//lib/yard/parser/source_parser.rb#86
+ # source://yard//lib/yard/parser/source_parser.rb#85
def parser_type; end
- # source://yard//lib/yard/parser/source_parser.rb#88
+ # source://yard//lib/yard/parser/source_parser.rb#87
def parser_type=(value); end
# @private
@@ -11323,30 +11480,30 @@ end
#
# @since 0.9.0
#
-# source://yard//lib/yard/parser/source_parser.rb#71
+# source://yard//lib/yard/parser/source_parser.rb#70
YARD::Parser::SourceParser::DEFAULT_PATH_GLOB = T.let(T.unsafe(nil), Array)
# Byte order marks for various encodings
#
# @since 0.7.0
#
-# source://yard//lib/yard/parser/source_parser.rb#75
+# source://yard//lib/yard/parser/source_parser.rb#74
YARD::Parser::SourceParser::ENCODING_BYTE_ORDER_MARKS = T.let(T.unsafe(nil), Hash)
-# source://yard//lib/yard/parser/source_parser.rb#66
+# source://yard//lib/yard/parser/source_parser.rb#65
YARD::Parser::SourceParser::ENCODING_LINE = T.let(T.unsafe(nil), Regexp)
-# source://yard//lib/yard/parser/source_parser.rb#67
+# source://yard//lib/yard/parser/source_parser.rb#66
YARD::Parser::SourceParser::FROZEN_STRING_LINE = T.let(T.unsafe(nil), Regexp)
-# source://yard//lib/yard/parser/source_parser.rb#65
+# source://yard//lib/yard/parser/source_parser.rb#64
YARD::Parser::SourceParser::SHEBANG_LINE = T.let(T.unsafe(nil), Regexp)
# Raised when an object is recognized but cannot be documented. This
# generally occurs when the Ruby syntax used to declare an object is
# too dynamic in nature.
#
-# source://yard//lib/yard/parser/source_parser.rb#10
+# source://yard//lib/yard/parser/source_parser.rb#9
class YARD::Parser::UndocumentableError < ::RuntimeError; end
# The root path for YARD source libraries
@@ -14621,42 +14778,42 @@ module YARD::Tags; end
# @see tag:!method
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#461
+# source://yard//lib/yard/tags/directives.rb#460
class YARD::Tags::AttributeDirective < ::YARD::Tags::MethodDirective
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#462
+ # source://yard//lib/yard/tags/directives.rb#461
def after_parse; end
protected
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#470
+ # source://yard//lib/yard/tags/directives.rb#469
def method_name; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#476
+ # source://yard//lib/yard/tags/directives.rb#475
def method_signature; end
private
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#486
+ # source://yard//lib/yard/tags/directives.rb#485
def create_attribute_data(object); end
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#516
+ # source://yard//lib/yard/tags/directives.rb#515
def readable?; end
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#512
+ # source://yard//lib/yard/tags/directives.rb#511
def writable?; end
end
@@ -14790,14 +14947,14 @@ end
# @see Library.define_directive
# @since 0.8.0
#
-# source://yard//lib/yard/tags/directives.rb#23
+# source://yard//lib/yard/tags/directives.rb#22
class YARD::Tags::Directive
# @param tag [Tag] the meta-data tag containing all input to the docstring
# @param parser [DocstringParser] the docstring parser object
# @return [Directive] a new instance of Directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#55
+ # source://yard//lib/yard/tags/directives.rb#54
def initialize(tag, parser); end
# Called after parsing all directives and tags in the docstring. Used
@@ -14806,7 +14963,7 @@ class YARD::Tags::Directive
# @return [void]
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#74
+ # source://yard//lib/yard/tags/directives.rb#73
def after_parse; end
# Called when processing the directive. Subclasses should implement
@@ -14818,7 +14975,7 @@ class YARD::Tags::Directive
# @return [void]
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#69
+ # source://yard//lib/yard/tags/directives.rb#68
def call; end
# Set this field to replace the directive definition inside of a docstring
@@ -14830,7 +14987,7 @@ class YARD::Tags::Directive
# @return [nil] if no expansion should take place for this directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#34
+ # source://yard//lib/yard/tags/directives.rb#33
def expanded_text; end
# Set this field to replace the directive definition inside of a docstring
@@ -14842,7 +14999,7 @@ class YARD::Tags::Directive
# @return [nil] if no expansion should take place for this directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#34
+ # source://yard//lib/yard/tags/directives.rb#33
def expanded_text=(_arg0); end
# @return [Handlers::Base, nil] the handler object the docstring parser
@@ -14850,33 +15007,33 @@ class YARD::Tags::Directive
# through {Parser::SourceParser}.
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#49
+ # source://yard//lib/yard/tags/directives.rb#48
def handler; end
# @return [CodeObjects::Base, nil] the object the parent docstring is
# attached to. May be nil.
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#43
+ # source://yard//lib/yard/tags/directives.rb#42
def object; end
# @return [DocstringParser] the parser that is parsing all tag
# information out of the docstring
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#38
+ # source://yard//lib/yard/tags/directives.rb#37
def parser=(_arg0); end
# @return [Tag] the meta-data tag containing data input to the directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#25
+ # source://yard//lib/yard/tags/directives.rb#24
def tag; end
# @return [Tag] the meta-data tag containing data input to the directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#25
+ # source://yard//lib/yard/tags/directives.rb#24
def tag=(_arg0); end
protected
@@ -14884,14 +15041,14 @@ class YARD::Tags::Directive
# @return [Boolean]
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#80
+ # source://yard//lib/yard/tags/directives.rb#79
def inside_directive?; end
# @return [DocstringParser] the parser that is parsing all tag
# information out of the docstring
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#38
+ # source://yard//lib/yard/tags/directives.rb#37
def parser; end
end
@@ -14915,11 +15072,11 @@ end
# @see tag:!group
# @since 0.6.0
#
-# source://yard//lib/yard/tags/directives.rb#105
+# source://yard//lib/yard/tags/directives.rb#104
class YARD::Tags::EndGroupDirective < ::YARD::Tags::Directive
# @since 0.6.0
#
- # source://yard//lib/yard/tags/directives.rb#106
+ # source://yard//lib/yard/tags/directives.rb#105
def call; end
end
@@ -14940,11 +15097,11 @@ end
# @see tag:!endgroup
# @since 0.6.0
#
-# source://yard//lib/yard/tags/directives.rb#128
+# source://yard//lib/yard/tags/directives.rb#127
class YARD::Tags::GroupDirective < ::YARD::Tags::Directive
# @since 0.6.0
#
- # source://yard//lib/yard/tags/directives.rb#129
+ # source://yard//lib/yard/tags/directives.rb#128
def call; end
end
@@ -15709,12 +15866,12 @@ end
# end
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#258
+# source://yard//lib/yard/tags/directives.rb#257
class YARD::Tags::MacroDirective < ::YARD::Tags::Directive
# @raise [TagFormatError]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#259
+ # source://yard//lib/yard/tags/directives.rb#258
def call; end
private
@@ -15722,40 +15879,40 @@ class YARD::Tags::MacroDirective < ::YARD::Tags::Directive
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#288
+ # source://yard//lib/yard/tags/directives.rb#287
def anonymous?; end
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#277
+ # source://yard//lib/yard/tags/directives.rb#276
def attach?; end
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#283
+ # source://yard//lib/yard/tags/directives.rb#282
def class_method?; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#292
+ # source://yard//lib/yard/tags/directives.rb#291
def expand(macro_data); end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#308
+ # source://yard//lib/yard/tags/directives.rb#307
def find_or_create; end
# @return [Boolean]
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#272
+ # source://yard//lib/yard/tags/directives.rb#271
def new?; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#332
+ # source://yard//lib/yard/tags/directives.rb#331
def warn; end
end
@@ -15788,49 +15945,49 @@ end
# @see tag:!attribute
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#368
+# source://yard//lib/yard/tags/directives.rb#367
class YARD::Tags::MethodDirective < ::YARD::Tags::Directive
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#373
+ # source://yard//lib/yard/tags/directives.rb#372
def after_parse; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#371
+ # source://yard//lib/yard/tags/directives.rb#370
def call; end
protected
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#413
+ # source://yard//lib/yard/tags/directives.rb#412
def create_object; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#381
+ # source://yard//lib/yard/tags/directives.rb#380
def method_name; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#390
+ # source://yard//lib/yard/tags/directives.rb#389
def method_signature; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#394
+ # source://yard//lib/yard/tags/directives.rb#393
def sanitized_tag_signature; end
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#403
+ # source://yard//lib/yard/tags/directives.rb#402
def use_indented_text; end
end
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#369
+# source://yard//lib/yard/tags/directives.rb#368
YARD::Tags::MethodDirective::SCOPE_MATCH = T.let(T.unsafe(nil), Regexp)
# source://yard//lib/yard/tags/option_tag.rb#4
@@ -15942,11 +16099,11 @@ end
# # }
# @since 0.8.0
#
-# source://yard//lib/yard/tags/directives.rb#545
+# source://yard//lib/yard/tags/directives.rb#544
class YARD::Tags::ParseDirective < ::YARD::Tags::Directive
# @since 0.8.0
#
- # source://yard//lib/yard/tags/directives.rb#546
+ # source://yard//lib/yard/tags/directives.rb#545
def call; end
end
@@ -16030,11 +16187,11 @@ end
# def method2; end
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#579
+# source://yard//lib/yard/tags/directives.rb#578
class YARD::Tags::ScopeDirective < ::YARD::Tags::Directive
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#580
+ # source://yard//lib/yard/tags/directives.rb#579
def call; end
end
@@ -16065,7 +16222,7 @@ class YARD::Tags::Tag
# @param name [String] optional key name which the tag refers to
# @return [Tag] a new instance of Tag
#
- # source://yard//lib/yard/tags/tag.rb#44
+ # source://yard//lib/yard/tags/tag.rb#45
def initialize(tag_name, text, types = T.unsafe(nil), name = T.unsafe(nil)); end
# Provides a plain English summary of the type specification, or nil
@@ -16074,27 +16231,29 @@ class YARD::Tags::Tag
# @return [String] a plain English description of the associated types
# @return [nil] if no types are provided or not parsable
#
- # source://yard//lib/yard/tags/tag.rb#65
+ # source://yard//lib/yard/tags/tag.rb#66
def explain_types; end
# @return [String] a name associated with the tag
+ # @return [nil] if no tag name is supplied
#
- # source://yard//lib/yard/tags/tag.rb#26
+ # source://yard//lib/yard/tags/tag.rb#27
def name; end
# @return [String] a name associated with the tag
+ # @return [nil] if no tag name is supplied
#
- # source://yard//lib/yard/tags/tag.rb#26
+ # source://yard//lib/yard/tags/tag.rb#27
def name=(_arg0); end
# @return [CodeObjects::Base] the associated object
#
- # source://yard//lib/yard/tags/tag.rb#29
+ # source://yard//lib/yard/tags/tag.rb#30
def object; end
# @return [CodeObjects::Base] the associated object
#
- # source://yard//lib/yard/tags/tag.rb#29
+ # source://yard//lib/yard/tags/tag.rb#30
def object=(_arg0); end
# @return [String] the name of the tag
@@ -16125,7 +16284,7 @@ class YARD::Tags::Tag
# @return [String] the first of the list of specified types
# @see #types
#
- # source://yard//lib/yard/tags/tag.rb#56
+ # source://yard//lib/yard/tags/tag.rb#57
def type; end
# @return [Array] a list of types associated with the tag
@@ -16316,11 +16475,11 @@ end
# def method2; end
# @since 0.7.0
#
-# source://yard//lib/yard/tags/directives.rb#611
+# source://yard//lib/yard/tags/directives.rb#610
class YARD::Tags::VisibilityDirective < ::YARD::Tags::Directive
# @since 0.7.0
#
- # source://yard//lib/yard/tags/directives.rb#612
+ # source://yard//lib/yard/tags/directives.rb#611
def call; end
end
@@ -16336,7 +16495,7 @@ module YARD::Templates; end
# * To render a template, call {render}.
# * To register a template path in the lookup paths, call {register_template_path}.
#
-# source://yard//lib/yard/templates/engine.rb#12
+# source://yard//lib/yard/templates/engine.rb#11
module YARD::Templates::Engine
class << self
# Passes a set of objects to the +:fulldoc+ template for full documentation generation.
@@ -16348,7 +16507,7 @@ module YARD::Templates::Engine
# @param options [Hash] (see {render})
# @return [void]
#
- # source://yard//lib/yard/templates/engine.rb#101
+ # source://yard//lib/yard/templates/engine.rb#100
def generate(objects, options = T.unsafe(nil)); end
# Registers a new template path in {template_paths}
@@ -16356,7 +16515,7 @@ module YARD::Templates::Engine
# @param path [String] a new template path
# @return [void]
#
- # source://yard//lib/yard/templates/engine.rb#21
+ # source://yard//lib/yard/templates/engine.rb#20
def register_template_path(path); end
# Renders a template on a {CodeObjects::Base code object} using
@@ -16377,7 +16536,7 @@ module YARD::Templates::Engine
# @param options [Hash] the options hash
# @return [String] the rendered template
#
- # source://yard//lib/yard/templates/engine.rb#82
+ # source://yard//lib/yard/templates/engine.rb#81
def render(options = T.unsafe(nil)); end
# Creates a template module representing the path. Searches on disk
@@ -16391,7 +16550,7 @@ module YARD::Templates::Engine
# {template_paths} on disk.
# @return [Template] the module representing the template
#
- # source://yard//lib/yard/templates/engine.rb#35
+ # source://yard//lib/yard/templates/engine.rb#34
def template(*path); end
# Forces creation of a template at +path+ within a +full_path+.
@@ -16400,17 +16559,17 @@ module YARD::Templates::Engine
# @param full_paths [Array] the full path on disk of the template
# @return [Template] the template module representing the +path+
#
- # source://yard//lib/yard/templates/engine.rb#53
+ # source://yard//lib/yard/templates/engine.rb#52
def template!(path, full_paths = T.unsafe(nil)); end
# @return [Array] the list of registered template paths
#
- # source://yard//lib/yard/templates/engine.rb#15
+ # source://yard//lib/yard/templates/engine.rb#14
def template_paths; end
# @return [Array] the list of registered template paths
#
- # source://yard//lib/yard/templates/engine.rb#15
+ # source://yard//lib/yard/templates/engine.rb#14
def template_paths=(_arg0); end
# Serializes the results of a block with a +serializer+ object.
@@ -16421,7 +16580,7 @@ module YARD::Templates::Engine
# @yield a block whose result will be serialize
# @yieldreturn [String] the contents to serialize
#
- # source://yard//lib/yard/templates/engine.rb#115
+ # source://yard//lib/yard/templates/engine.rb#114
def with_serializer(object, serializer); end
private
@@ -16436,7 +16595,7 @@ module YARD::Templates::Engine
# @return [Array] a list of full paths that are existing
# candidates for a template module
#
- # source://yard//lib/yard/templates/engine.rb#161
+ # source://yard//lib/yard/templates/engine.rb#160
def find_template_paths(from_template, path); end
# Sets default options on the options hash
@@ -16447,7 +16606,7 @@ module YARD::Templates::Engine
# @param options [Hash] the options hash
# @return [void]
#
- # source://yard//lib/yard/templates/engine.rb#141
+ # source://yard//lib/yard/templates/engine.rb#140
def set_default_options(options = T.unsafe(nil)); end
# The name of the module that represents a +path+
@@ -16455,7 +16614,7 @@ module YARD::Templates::Engine
# @param path [String] the path to generate a module name for
# @return [String] the module name
#
- # source://yard//lib/yard/templates/engine.rb#176
+ # source://yard//lib/yard/templates/engine.rb#175
def template_module_name(path); end
end
end
@@ -17866,7 +18025,7 @@ end
#
# @see CLI::YardocOptions
#
-# source://yard//lib/yard/templates/template_options.rb#10
+# source://yard//lib/yard/templates/template_options.rb#9
class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [OpenStruct] an open struct containing any global state across all
# generated objects in a template.
@@ -17909,7 +18068,7 @@ class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [Boolean] whether a mixin matches the embed_mixins list
# @return [nil] if the mixin is not a module object
#
- # source://yard//lib/yard/templates/template_options.rb#78
+ # source://yard//lib/yard/templates/template_options.rb#77
def embed_mixins_match?(mixin); end
# @return [Symbol] the template output format
@@ -17956,12 +18115,12 @@ class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [Boolean] whether the page is the "index"
#
- # source://yard//lib/yard/templates/template_options.rb#64
+ # source://yard//lib/yard/templates/template_options.rb#63
def index; end
# @return [Boolean] whether the page is the "index"
#
- # source://yard//lib/yard/templates/template_options.rb#64
+ # source://yard//lib/yard/templates/template_options.rb#63
def index=(_arg0); end
# @return [Symbol] the markup format to use when parsing docstrings
@@ -17976,51 +18135,51 @@ class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [Class] the markup provider class for the markup format
#
- # source://yard//lib/yard/templates/template_options.rb#30
+ # source://yard//lib/yard/templates/template_options.rb#29
def markup_provider; end
# @return [Class] the markup provider class for the markup format
#
- # source://yard//lib/yard/templates/template_options.rb#30
+ # source://yard//lib/yard/templates/template_options.rb#29
def markup_provider=(_arg0); end
# @deprecated use {#highlight} instead.
# @return [Boolean] whether highlighting should be ignored
#
- # source://yard//lib/yard/templates/template_options.rb#57
+ # source://yard//lib/yard/templates/template_options.rb#56
def no_highlight; end
- # source://yard//lib/yard/templates/template_options.rb#58
+ # source://yard//lib/yard/templates/template_options.rb#57
def no_highlight=(value); end
# @return [CodeObjects::Base] the main object being generated in the template
#
- # source://yard//lib/yard/templates/template_options.rb#38
+ # source://yard//lib/yard/templates/template_options.rb#37
def object; end
# @return [CodeObjects::Base] the main object being generated in the template
#
- # source://yard//lib/yard/templates/template_options.rb#38
+ # source://yard//lib/yard/templates/template_options.rb#37
def object=(_arg0); end
# @return [CodeObjects::Base] the owner of the generated object
#
- # source://yard//lib/yard/templates/template_options.rb#41
+ # source://yard//lib/yard/templates/template_options.rb#40
def owner; end
# @return [CodeObjects::Base] the owner of the generated object
#
- # source://yard//lib/yard/templates/template_options.rb#41
+ # source://yard//lib/yard/templates/template_options.rb#40
def owner=(_arg0); end
# @return [String] the title of a given page
#
- # source://yard//lib/yard/templates/template_options.rb#61
+ # source://yard//lib/yard/templates/template_options.rb#60
def page_title; end
# @return [String] the title of a given page
#
- # source://yard//lib/yard/templates/template_options.rb#61
+ # source://yard//lib/yard/templates/template_options.rb#60
def page_title=(_arg0); end
# @return [Boolean] whether serialization should be performed
@@ -18036,13 +18195,13 @@ class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [Serializers::Base] the serializer used to generate links and serialize
# output. Serialization output only occurs if {#serialize} is +true+.
#
- # source://yard//lib/yard/templates/template_options.rb#51
+ # source://yard//lib/yard/templates/template_options.rb#50
def serializer; end
# @return [Serializers::Base] the serializer used to generate links and serialize
# output. Serialization output only occurs if {#serialize} is +true+.
#
- # source://yard//lib/yard/templates/template_options.rb#51
+ # source://yard//lib/yard/templates/template_options.rb#50
def serializer=(_arg0); end
# @return [Symbol] the template name used to render output
@@ -18057,22 +18216,22 @@ class YARD::Templates::TemplateOptions < ::YARD::Options
# @return [Symbol] the template type used to generate output
#
- # source://yard//lib/yard/templates/template_options.rb#44
+ # source://yard//lib/yard/templates/template_options.rb#43
def type; end
# @return [Symbol] the template type used to generate output
#
- # source://yard//lib/yard/templates/template_options.rb#44
+ # source://yard//lib/yard/templates/template_options.rb#43
def type=(_arg0); end
# @return [Verifier] the verifier object
#
- # source://yard//lib/yard/templates/template_options.rb#89
+ # source://yard//lib/yard/templates/template_options.rb#88
def verifier; end
# @return [Verifier] the verifier object
#
- # source://yard//lib/yard/templates/template_options.rb#89
+ # source://yard//lib/yard/templates/template_options.rb#88
def verifier=(_arg0); end
end
diff --git a/test/spoom/sorbet/sigs_test.rb b/test/spoom/sorbet/sigs_test.rb
index b9d4aa35..43b893fc 100644
--- a/test/spoom/sorbet/sigs_test.rb
+++ b/test/spoom/sorbet/sigs_test.rb
@@ -120,6 +120,21 @@ def a
RBS
end
+ def test_translate_method_sigs_with_annotations
+ contents = <<~RBI
+ sig(:final) { abstract.override(allow_incompatible: true).void }
+ def foo; end
+ RBI
+
+ assert_equal(<<~RBS, Sigs.rbi_to_rbs(contents))
+ # @final
+ # @abstract
+ # @override(allow_incompatible: true)
+ #: -> void
+ def foo; end
+ RBS
+ end
+
def test_translate_singleton_method_sigs
contents = <<~RBI
class A