From b70c065c7671f486bab8815e00ace4091341ee73 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:50:17 +0200 Subject: [PATCH] Update rbi for latest `ruby-lsp` (#405) --- Gemfile.lock | 10 +- sorbet/rbi/gems/logger@1.6.0.rbi | 902 + .../{prism@0.29.0.rbi => prism@0.30.0.rbi} | 33665 ++++++++++------ sorbet/rbi/gems/rbs@3.5.1.rbi | 6700 +++ ...uby-lsp@0.17.2.rbi => ruby-lsp@0.17.4.rbi} | 861 +- 5 files changed, 29140 insertions(+), 12998 deletions(-) create mode 100644 sorbet/rbi/gems/logger@1.6.0.rbi rename sorbet/rbi/gems/{prism@0.29.0.rbi => prism@0.30.0.rbi} (51%) create mode 100644 sorbet/rbi/gems/rbs@3.5.1.rbi rename sorbet/rbi/gems/{ruby-lsp@0.17.2.rbi => ruby-lsp@0.17.4.rbi} (87%) diff --git a/Gemfile.lock b/Gemfile.lock index a56e81dd..69f5974f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,6 +118,7 @@ GEM reline (>= 0.4.2) json (2.7.2) language_server-protocol (3.17.0.3) + logger (1.6.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -153,7 +154,7 @@ GEM parser (3.3.1.0) ast (~> 2.4.1) racc - prism (0.29.0) + prism (0.30.0) psych (5.1.2) stringio public_suffix (5.0.5) @@ -202,6 +203,8 @@ GEM rbi (0.1.13) prism (>= 0.18.0, < 1.0.0) sorbet-runtime (>= 0.5.9204) + rbs (3.5.1) + logger regexp_parser (2.9.0) reline (0.5.7) io-console (~> 0.5) @@ -229,9 +232,10 @@ GEM rubocop (~> 1.51) rubocop-sorbet (0.8.3) rubocop (>= 0.90.0) - ruby-lsp (0.17.2) + ruby-lsp (0.17.4) language_server-protocol (~> 3.17.0) - prism (>= 0.29.0, < 0.30) + prism (>= 0.29.0, < 0.31) + rbs (>= 3, < 4) sorbet-runtime (>= 0.5.10782) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) diff --git a/sorbet/rbi/gems/logger@1.6.0.rbi b/sorbet/rbi/gems/logger@1.6.0.rbi new file mode 100644 index 00000000..3ac3f4b1 --- /dev/null +++ b/sorbet/rbi/gems/logger@1.6.0.rbi @@ -0,0 +1,902 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `logger` gem. +# Please instead update this file by running `bin/tapioca gem logger`. + +# \Class \Logger provides a simple but sophisticated logging utility that +# you can use to create one or more +# {event logs}[https://en.wikipedia.org/wiki/Logging_(software)#Event_logs] +# for your program. +# Each such log contains a chronological sequence of entries +# that provides a record of the program's activities. +# +# == About the Examples +# +# All examples on this page assume that \Logger has been required: +# +# require 'logger' +# +# == Synopsis +# +# Create a log with Logger.new: +# +# # Single log file. +# logger = Logger.new('t.log') +# # Size-based rotated logging: 3 10-megabyte files. +# logger = Logger.new('t.log', 3, 10485760) +# # Period-based rotated logging: daily (also allowed: 'weekly', 'monthly'). +# logger = Logger.new('t.log', 'daily') +# # Log to an IO stream. +# logger = Logger.new($stdout) +# +# Add entries (level, message) with Logger#add: +# +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# logger.add(Logger::INFO, 'Non-error information') +# logger.add(Logger::WARN, 'Non-error warning') +# logger.add(Logger::ERROR, 'Non-fatal error') +# logger.add(Logger::FATAL, 'Fatal error') +# logger.add(Logger::UNKNOWN, 'Most severe') +# +# Close the log with Logger#close: +# +# logger.close +# +# == Entries +# +# You can add entries with method Logger#add: +# +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# logger.add(Logger::INFO, 'Non-error information') +# logger.add(Logger::WARN, 'Non-error warning') +# logger.add(Logger::ERROR, 'Non-fatal error') +# logger.add(Logger::FATAL, 'Fatal error') +# logger.add(Logger::UNKNOWN, 'Most severe') +# +# These shorthand methods also add entries: +# +# logger.debug('Maximal debugging info') +# logger.info('Non-error information') +# logger.warn('Non-error warning') +# logger.error('Non-fatal error') +# logger.fatal('Fatal error') +# logger.unknown('Most severe') +# +# When you call any of these methods, +# the entry may or may not be written to the log, +# depending on the entry's severity and on the log level; +# see {Log Level}[rdoc-ref:Logger@Log+Level] +# +# An entry always has: +# +# - A severity (the required argument to #add). +# - An automatically created timestamp. +# +# And may also have: +# +# - A message. +# - A program name. +# +# Example: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message.', 'mung') +# # => I, [2022-05-07T17:21:46.536234 #20536] INFO -- mung: My message. +# +# The default format for an entry is: +# +# "%s, [%s #%d] %5s -- %s: %s\n" +# +# where the values to be formatted are: +# +# - \Severity (one letter). +# - Timestamp. +# - Process id. +# - \Severity (word). +# - Program name. +# - Message. +# +# You can use a different entry format by: +# +# - Setting a custom format proc (affects following entries); +# see {formatter=}[Logger.html#attribute-i-formatter]. +# - Calling any of the methods above with a block +# (affects only the one entry). +# Doing so can have two benefits: +# +# - Context: the block can evaluate the entire program context +# and create a context-dependent message. +# - Performance: the block is not evaluated unless the log level +# permits the entry actually to be written: +# +# logger.error { my_slow_message_generator } +# +# Contrast this with the string form, where the string is +# always evaluated, regardless of the log level: +# +# logger.error("#{my_slow_message_generator}") +# +# === \Severity +# +# The severity of a log entry has two effects: +# +# - Determines whether the entry is selected for inclusion in the log; +# see {Log Level}[rdoc-ref:Logger@Log+Level]. +# - Indicates to any log reader (whether a person or a program) +# the relative importance of the entry. +# +# === Timestamp +# +# The timestamp for a log entry is generated automatically +# when the entry is created. +# +# The logged timestamp is formatted by method +# {Time#strftime}[rdoc-ref:Time#strftime] +# using this format string: +# +# '%Y-%m-%dT%H:%M:%S.%6N' +# +# Example: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO) +# # => I, [2022-05-07T17:04:32.318331 #20536] INFO -- : nil +# +# You can set a different format using method #datetime_format=. +# +# === Message +# +# The message is an optional argument to an entry method: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message') +# # => I, [2022-05-07T18:15:37.647581 #20536] INFO -- : My message +# +# For the default entry formatter, Logger::Formatter, +# the message object may be: +# +# - A string: used as-is. +# - An Exception: message.message is used. +# - Anything else: message.inspect is used. +# +# *Note*: Logger::Formatter does not escape or sanitize +# the message passed to it. +# Developers should be aware that malicious data (user input) +# may be in the message, and should explicitly escape untrusted data. +# +# You can use a custom formatter to escape message data; +# see the example at {formatter=}[Logger.html#attribute-i-formatter]. +# +# === Program Name +# +# The program name is an optional argument to an entry method: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message', 'mung') +# # => I, [2022-05-07T18:17:38.084716 #20536] INFO -- mung: My message +# +# The default program name for a new logger may be set in the call to +# Logger.new via optional keyword argument +progname+: +# +# logger = Logger.new('t.log', progname: 'mung') +# +# The default program name for an existing logger may be set +# by a call to method #progname=: +# +# logger.progname = 'mung' +# +# The current program name may be retrieved with method +# {progname}[Logger.html#attribute-i-progname]: +# +# logger.progname # => "mung" +# +# == Log Level +# +# The log level setting determines whether an entry is actually +# written to the log, based on the entry's severity. +# +# These are the defined severities (least severe to most severe): +# +# logger = Logger.new($stdout) +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# # => D, [2022-05-07T17:57:41.776220 #20536] DEBUG -- : Maximal debugging info +# logger.add(Logger::INFO, 'Non-error information') +# # => I, [2022-05-07T17:59:14.349167 #20536] INFO -- : Non-error information +# logger.add(Logger::WARN, 'Non-error warning') +# # => W, [2022-05-07T18:00:45.337538 #20536] WARN -- : Non-error warning +# logger.add(Logger::ERROR, 'Non-fatal error') +# # => E, [2022-05-07T18:02:41.592912 #20536] ERROR -- : Non-fatal error +# logger.add(Logger::FATAL, 'Fatal error') +# # => F, [2022-05-07T18:05:24.703931 #20536] FATAL -- : Fatal error +# logger.add(Logger::UNKNOWN, 'Most severe') +# # => A, [2022-05-07T18:07:54.657491 #20536] ANY -- : Most severe +# +# The default initial level setting is Logger::DEBUG, the lowest level, +# which means that all entries are to be written, regardless of severity: +# +# logger = Logger.new($stdout) +# logger.level # => 0 +# logger.add(0, "My message") +# # => D, [2022-05-11T15:10:59.773668 #20536] DEBUG -- : My message +# +# You can specify a different setting in a new logger +# using keyword argument +level+ with an appropriate value: +# +# logger = Logger.new($stdout, level: Logger::ERROR) +# logger = Logger.new($stdout, level: 'error') +# logger = Logger.new($stdout, level: :error) +# logger.level # => 3 +# +# With this level, entries with severity Logger::ERROR and higher +# are written, while those with lower severities are not written: +# +# logger = Logger.new($stdout, level: Logger::ERROR) +# logger.add(3) +# # => E, [2022-05-11T15:17:20.933362 #20536] ERROR -- : nil +# logger.add(2) # Silent. +# +# You can set the log level for an existing logger +# with method #level=: +# +# logger.level = Logger::ERROR +# +# These shorthand methods also set the level: +# +# logger.debug! # => 0 +# logger.info! # => 1 +# logger.warn! # => 2 +# logger.error! # => 3 +# logger.fatal! # => 4 +# +# You can retrieve the log level with method #level. +# +# logger.level = Logger::ERROR +# logger.level # => 3 +# +# These methods return whether a given +# level is to be written: +# +# logger.level = Logger::ERROR +# logger.debug? # => false +# logger.info? # => false +# logger.warn? # => false +# logger.error? # => true +# logger.fatal? # => true +# +# == Log File Rotation +# +# By default, a log file is a single file that grows indefinitely +# (until explicitly closed); there is no file rotation. +# +# To keep log files to a manageable size, +# you can use _log_ _file_ _rotation_, which uses multiple log files: +# +# - Each log file has entries for a non-overlapping +# time interval. +# - Only the most recent log file is open and active; +# the others are closed and inactive. +# +# === Size-Based Rotation +# +# For size-based log file rotation, call Logger.new with: +# +# - Argument +logdev+ as a file path. +# - Argument +shift_age+ with a positive integer: +# the number of log files to be in the rotation. +# - Argument +shift_size+ as a positive integer: +# the maximum size (in bytes) of each log file; +# defaults to 1048576 (1 megabyte). +# +# Examples: +# +# logger = Logger.new('t.log', 3) # Three 1-megabyte files. +# logger = Logger.new('t.log', 5, 10485760) # Five 10-megabyte files. +# +# For these examples, suppose: +# +# logger = Logger.new('t.log', 3) +# +# Logging begins in the new log file, +t.log+; +# the log file is "full" and ready for rotation +# when a new entry would cause its size to exceed +shift_size+. +# +# The first time +t.log+ is full: +# +# - +t.log+ is closed and renamed to +t.log.0+. +# - A new file +t.log+ is opened. +# +# The second time +t.log+ is full: +# +# - +t.log.0 is renamed as +t.log.1+. +# - +t.log+ is closed and renamed to +t.log.0+. +# - A new file +t.log+ is opened. +# +# Each subsequent time that +t.log+ is full, +# the log files are rotated: +# +# - +t.log.1+ is removed. +# - +t.log.0 is renamed as +t.log.1+. +# - +t.log+ is closed and renamed to +t.log.0+. +# - A new file +t.log+ is opened. +# +# === Periodic Rotation +# +# For periodic rotation, call Logger.new with: +# +# - Argument +logdev+ as a file path. +# - Argument +shift_age+ as a string period indicator. +# +# Examples: +# +# logger = Logger.new('t.log', 'daily') # Rotate log files daily. +# logger = Logger.new('t.log', 'weekly') # Rotate log files weekly. +# logger = Logger.new('t.log', 'monthly') # Rotate log files monthly. +# +# Example: +# +# logger = Logger.new('t.log', 'daily') +# +# When the given period expires: +# +# - The base log file, +t.log+ is closed and renamed +# with a date-based suffix such as +t.log.20220509+. +# - A new log file +t.log+ is opened. +# - Nothing is removed. +# +# The default format for the suffix is '%Y%m%d', +# which produces a suffix similar to the one above. +# You can set a different format using create-time option +# +shift_period_suffix+; +# see details and suggestions at +# {Time#strftime}[rdoc-ref:Time#strftime]. +class Logger + include ::Logger::Severity + + # :call-seq: + # Logger.new(logdev, shift_age = 0, shift_size = 1048576, **options) + # + # With the single argument +logdev+, + # returns a new logger with all default options: + # + # Logger.new('t.log') # => # + # + # Argument +logdev+ must be one of: + # + # - A string filepath: entries are to be written + # to the file at that path; if the file at that path exists, + # new entries are appended. + # - An IO stream (typically +$stdout+, +$stderr+. or an open file): + # entries are to be written to the given stream. + # - +nil+ or +File::NULL+: no entries are to be written. + # + # Examples: + # + # Logger.new('t.log') + # Logger.new($stdout) + # + # The keyword options are: + # + # - +level+: sets the log level; default value is Logger::DEBUG. + # See {Log Level}[rdoc-ref:Logger@Log+Level]: + # + # Logger.new('t.log', level: Logger::ERROR) + # + # - +progname+: sets the default program name; default is +nil+. + # See {Program Name}[rdoc-ref:Logger@Program+Name]: + # + # Logger.new('t.log', progname: 'mung') + # + # - +formatter+: sets the entry formatter; default is +nil+. + # See {formatter=}[Logger.html#attribute-i-formatter]. + # - +datetime_format+: sets the format for entry timestamp; + # default is +nil+. + # See #datetime_format=. + # - +binmode+: sets whether the logger writes in binary mode; + # default is +false+. + # - +shift_period_suffix+: sets the format for the filename suffix + # for periodic log file rotation; default is '%Y%m%d'. + # See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation]. + # + # @return [Logger] a new instance of Logger + # + # source://logger/logger.rb#578 + def initialize(logdev, shift_age = T.unsafe(nil), shift_size = T.unsafe(nil), level: T.unsafe(nil), progname: T.unsafe(nil), formatter: T.unsafe(nil), datetime_format: T.unsafe(nil), binmode: T.unsafe(nil), shift_period_suffix: T.unsafe(nil)); end + + # Writes the given +msg+ to the log with no formatting; + # returns the number of characters written, + # or +nil+ if no log device exists: + # + # logger = Logger.new($stdout) + # logger << 'My message.' # => 10 + # + # Output: + # + # My message. + # + # source://logger/logger.rb#684 + def <<(msg); end + + # Creates a log entry, which may or may not be written to the log, + # depending on the entry's severity and on the log level. + # See {Log Level}[rdoc-ref:Logger@Log+Level] + # and {Entries}[rdoc-ref:Logger@Entries] for details. + # + # Examples: + # + # logger = Logger.new($stdout, progname: 'mung') + # logger.add(Logger::INFO) + # logger.add(Logger::ERROR, 'No good') + # logger.add(Logger::ERROR, 'No good', 'gnum') + # + # Output: + # + # I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung + # E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good + # E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good + # + # These convenience methods have implicit severity: + # + # - #debug. + # - #info. + # - #warn. + # - #error. + # - #fatal. + # - #unknown. + # + # source://logger/logger.rb#651 + def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end + + # Closes the logger; returns +nil+: + # + # logger = Logger.new('t.log') + # logger.close # => nil + # logger.info('foo') # Prints "log writing failed. closed stream" + # + # Related: Logger#reopen. + # + # source://logger/logger.rb#731 + def close; end + + # Returns the date-time format; see #datetime_format=. + # + # source://logger/logger.rb#438 + def datetime_format; end + + # Sets the date-time format. + # + # Argument +datetime_format+ should be either of these: + # + # - A string suitable for use as a format for method + # {Time#strftime}[rdoc-ref:Time#strftime]. + # - +nil+: the logger uses '%Y-%m-%dT%H:%M:%S.%6N'. + # + # source://logger/logger.rb#432 + def datetime_format=(datetime_format); end + + # Equivalent to calling #add with severity Logger::DEBUG. + # + # source://logger/logger.rb#690 + def debug(progname = T.unsafe(nil), &block); end + + # Sets the log level to Logger::DEBUG. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # source://logger/logger.rb#487 + def debug!; end + + # Returns +true+ if the log level allows entries with severity + # Logger::DEBUG to be written, +false+ otherwise. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # @return [Boolean] + # + # source://logger/logger.rb#482 + def debug?; end + + # Equivalent to calling #add with severity Logger::ERROR. + # + # source://logger/logger.rb#708 + def error(progname = T.unsafe(nil), &block); end + + # Sets the log level to Logger::ERROR. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # source://logger/logger.rb#520 + def error!; end + + # Returns +true+ if the log level allows entries with severity + # Logger::ERROR to be written, +false+ otherwise. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # @return [Boolean] + # + # source://logger/logger.rb#515 + def error?; end + + # Equivalent to calling #add with severity Logger::FATAL. + # + # source://logger/logger.rb#714 + def fatal(progname = T.unsafe(nil), &block); end + + # Sets the log level to Logger::FATAL. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # source://logger/logger.rb#531 + def fatal!; end + + # Returns +true+ if the log level allows entries with severity + # Logger::FATAL to be written, +false+ otherwise. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # @return [Boolean] + # + # source://logger/logger.rb#526 + def fatal?; end + + # Sets or retrieves the logger entry formatter proc. + # + # When +formatter+ is +nil+, the logger uses Logger::Formatter. + # + # When +formatter+ is a proc, a new entry is formatted by the proc, + # which is called with four arguments: + # + # - +severity+: The severity of the entry. + # - +time+: A Time object representing the entry's timestamp. + # - +progname+: The program name for the entry. + # - +msg+: The message for the entry (string or string-convertible object). + # + # The proc should return a string containing the formatted entry. + # + # This custom formatter uses + # {String#dump}[rdoc-ref:String#dump] + # to escape the message string: + # + # logger = Logger.new($stdout, progname: 'mung') + # original_formatter = logger.formatter || Logger::Formatter.new + # logger.formatter = proc { |severity, time, progname, msg| + # original_formatter.call(severity, time, progname, msg.dump) + # } + # logger.add(Logger::INFO, "hello \n ''") + # logger.add(Logger::INFO, "\f\x00\xff\\\"") + # + # Output: + # + # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''" + # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\"" + # + # source://logger/logger.rb#473 + def formatter; end + + # Sets or retrieves the logger entry formatter proc. + # + # When +formatter+ is +nil+, the logger uses Logger::Formatter. + # + # When +formatter+ is a proc, a new entry is formatted by the proc, + # which is called with four arguments: + # + # - +severity+: The severity of the entry. + # - +time+: A Time object representing the entry's timestamp. + # - +progname+: The program name for the entry. + # - +msg+: The message for the entry (string or string-convertible object). + # + # The proc should return a string containing the formatted entry. + # + # This custom formatter uses + # {String#dump}[rdoc-ref:String#dump] + # to escape the message string: + # + # logger = Logger.new($stdout, progname: 'mung') + # original_formatter = logger.formatter || Logger::Formatter.new + # logger.formatter = proc { |severity, time, progname, msg| + # original_formatter.call(severity, time, progname, msg.dump) + # } + # logger.add(Logger::INFO, "hello \n ''") + # logger.add(Logger::INFO, "\f\x00\xff\\\"") + # + # Output: + # + # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''" + # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\"" + # + # source://logger/logger.rb#473 + def formatter=(_arg0); end + + # Equivalent to calling #add with severity Logger::INFO. + # + # source://logger/logger.rb#696 + def info(progname = T.unsafe(nil), &block); end + + # Sets the log level to Logger::INFO. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # source://logger/logger.rb#498 + def info!; end + + # Returns +true+ if the log level allows entries with severity + # Logger::INFO to be written, +false+ otherwise. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # @return [Boolean] + # + # source://logger/logger.rb#493 + def info?; end + + # Logging severity threshold (e.g. Logger::INFO). + # + # source://logger/logger.rb#383 + def level; end + + # Sets the log level; returns +severity+. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # Argument +severity+ may be an integer, a string, or a symbol: + # + # logger.level = Logger::ERROR # => 3 + # logger.level = 3 # => 3 + # logger.level = 'error' # => "error" + # logger.level = :error # => :error + # + # Logger#sev_threshold= is an alias for Logger#level=. + # + # source://logger/logger.rb#399 + def level=(severity); end + + # Creates a log entry, which may or may not be written to the log, + # depending on the entry's severity and on the log level. + # See {Log Level}[rdoc-ref:Logger@Log+Level] + # and {Entries}[rdoc-ref:Logger@Entries] for details. + # + # Examples: + # + # logger = Logger.new($stdout, progname: 'mung') + # logger.add(Logger::INFO) + # logger.add(Logger::ERROR, 'No good') + # logger.add(Logger::ERROR, 'No good', 'gnum') + # + # Output: + # + # I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung + # E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good + # E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good + # + # These convenience methods have implicit severity: + # + # - #debug. + # - #info. + # - #warn. + # - #error. + # - #fatal. + # - #unknown. + # + # source://logger/logger.rb#651 + def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil)); end + + # Program name to include in log messages. + # + # source://logger/logger.rb#422 + def progname; end + + # Program name to include in log messages. + # + # source://logger/logger.rb#422 + def progname=(_arg0); end + + # Sets the logger's output stream: + # + # - If +logdev+ is +nil+, reopens the current output stream. + # - If +logdev+ is a filepath, opens the indicated file for append. + # - If +logdev+ is an IO stream + # (usually $stdout, $stderr, or an open File object), + # opens the stream for append. + # + # Example: + # + # logger = Logger.new('t.log') + # logger.add(Logger::ERROR, 'one') + # logger.close + # logger.add(Logger::ERROR, 'two') # Prints 'log writing failed. closed stream' + # logger.reopen + # logger.add(Logger::ERROR, 'three') + # logger.close + # File.readlines('t.log') + # # => + # # ["# Logfile created on 2022-05-12 14:21:19 -0500 by logger.rb/v1.5.0\n", + # # "E, [2022-05-12T14:21:27.596726 #22428] ERROR -- : one\n", + # # "E, [2022-05-12T14:23:05.847241 #22428] ERROR -- : three\n"] + # + # source://logger/logger.rb#619 + def reopen(logdev = T.unsafe(nil)); end + + # Logging severity threshold (e.g. Logger::INFO). + # + # source://logger/logger.rb#383 + def sev_threshold; end + + # Sets the log level; returns +severity+. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # Argument +severity+ may be an integer, a string, or a symbol: + # + # logger.level = Logger::ERROR # => 3 + # logger.level = 3 # => 3 + # logger.level = 'error' # => "error" + # logger.level = :error # => :error + # + # Logger#sev_threshold= is an alias for Logger#level=. + # + # source://logger/logger.rb#399 + def sev_threshold=(severity); end + + # Equivalent to calling #add with severity Logger::UNKNOWN. + # + # source://logger/logger.rb#720 + def unknown(progname = T.unsafe(nil), &block); end + + # Equivalent to calling #add with severity Logger::WARN. + # + # source://logger/logger.rb#702 + def warn(progname = T.unsafe(nil), &block); end + + # Sets the log level to Logger::WARN. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # source://logger/logger.rb#509 + def warn!; end + + # Returns +true+ if the log level allows entries with severity + # Logger::WARN to be written, +false+ otherwise. + # See {Log Level}[rdoc-ref:Logger@Log+Level]. + # + # @return [Boolean] + # + # source://logger/logger.rb#504 + def warn?; end + + # Adjust the log level during the block execution for the current Fiber only + # + # logger.with_level(:debug) do + # logger.debug { "Hello" } + # end + # + # source://logger/logger.rb#408 + def with_level(severity); end + + private + + # source://logger/logger.rb#744 + def format_message(severity, datetime, progname, msg); end + + # source://logger/logger.rb#740 + def format_severity(severity); end +end + +# Default formatter for log messages. +class Logger::Formatter + # @return [Formatter] a new instance of Formatter + # + # source://logger/logger/formatter.rb#11 + def initialize; end + + # source://logger/logger/formatter.rb#15 + def call(severity, time, progname, msg); end + + # Returns the value of attribute datetime_format. + # + # source://logger/logger/formatter.rb#9 + def datetime_format; end + + # Sets the attribute datetime_format + # + # @param value the value to set the attribute datetime_format to. + # + # source://logger/logger/formatter.rb#9 + def datetime_format=(_arg0); end + + private + + # source://logger/logger/formatter.rb#21 + def format_datetime(time); end + + # source://logger/logger/formatter.rb#25 + def msg2str(msg); end +end + +# source://logger/logger/formatter.rb#7 +Logger::Formatter::DatetimeFormat = T.let(T.unsafe(nil), String) + +# source://logger/logger/formatter.rb#6 +Logger::Formatter::Format = T.let(T.unsafe(nil), String) + +# Device used for logging messages. +class Logger::LogDevice + include ::Logger::Period + include ::MonitorMixin + + # @return [LogDevice] a new instance of LogDevice + # + # source://logger/logger/log_device.rb#14 + def initialize(log = T.unsafe(nil), shift_age: T.unsafe(nil), shift_size: T.unsafe(nil), shift_period_suffix: T.unsafe(nil), binmode: T.unsafe(nil)); end + + # source://logger/logger/log_device.rb#52 + def close; end + + # Returns the value of attribute dev. + # + # source://logger/logger/log_device.rb#10 + def dev; end + + # Returns the value of attribute filename. + # + # source://logger/logger/log_device.rb#11 + def filename; end + + # source://logger/logger/log_device.rb#62 + def reopen(log = T.unsafe(nil)); end + + # source://logger/logger/log_device.rb#31 + def write(message); end + + private + + # source://logger/logger/log_device.rb#119 + def add_log_header(file); end + + # source://logger/logger/log_device.rb#125 + def check_shift_log; end + + # source://logger/logger/log_device.rb#103 + def create_logfile(filename); end + + # source://logger/logger/log_device.rb#145 + def lock_shift_log; end + + # source://logger/logger/log_device.rb#95 + def open_logfile(filename); end + + # source://logger/logger/log_device.rb#79 + def set_dev(log); end + + # source://logger/logger/log_device.rb#176 + def shift_log_age; end + + # source://logger/logger/log_device.rb#188 + def shift_log_period(period_end); end +end + +module Logger::Period + private + + # source://logger/logger/period.rb#9 + def next_rotate_time(now, shift_age); end + + # source://logger/logger/period.rb#31 + def previous_period_end(now, shift_age); end + + class << self + # source://logger/logger/period.rb#9 + def next_rotate_time(now, shift_age); end + + # source://logger/logger/period.rb#31 + def previous_period_end(now, shift_age); end + end +end + +# source://logger/logger/period.rb#7 +Logger::Period::SiD = T.let(T.unsafe(nil), Integer) + +# \Severity label for logging (max 5 chars). +# +# source://logger/logger.rb#738 +Logger::SEV_LABEL = T.let(T.unsafe(nil), Array) + +# Logging severity. +module Logger::Severity + class << self + # source://logger/logger/severity.rb#29 + def coerce(severity); end + end +end + +# source://logger/logger/severity.rb#19 +Logger::Severity::LEVELS = T.let(T.unsafe(nil), Hash) diff --git a/sorbet/rbi/gems/prism@0.29.0.rbi b/sorbet/rbi/gems/prism@0.30.0.rbi similarity index 51% rename from sorbet/rbi/gems/prism@0.29.0.rbi rename to sorbet/rbi/gems/prism@0.30.0.rbi index cf3d7254..625a449c 100644 --- a/sorbet/rbi/gems/prism@0.29.0.rbi +++ b/sorbet/rbi/gems/prism@0.30.0.rbi @@ -4,12 +4,25 @@ # This is an autogenerated file for types exported from the `prism` gem. # Please instead update this file by running `bin/tapioca gem prism`. +# typed: strict + +# =begin +# This file is generated by the templates/template.rb script and should not be +# modified manually. See templates/rbi/prism/node.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.rbi.erb +# modified manually. See templates/rbi/prism/visitor.rbi.erb # if you are looking to modify the template # =end +# We keep these shims in here because our client libraries might not have parser +# in their bundle. +module Parser; end + +class Parser::Base; end + # The Prism Ruby parser. # # "Parsing Ruby is suddenly manageable!" @@ -28,7 +41,7 @@ module Prism def lex(*_arg0); end # :call-seq: - # Prism::lex_compat(source, **options) -> ParseResult + # Prism::lex_compat(source, **options) -> LexCompat::Result # # Returns a parse result whose value is an array of tokens that closely # resembles the return value of Ripper::lex. The main difference is that the @@ -36,7 +49,8 @@ module Prism # # For supported options, see Prism::parse. # - # source://prism/lib/prism.rb#46 + # 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 # Mirror the Prism.lex_file API by using the serialization API. @@ -49,7 +63,8 @@ module Prism # returns the same tokens. Raises SyntaxError if the syntax in source is # invalid. # - # source://prism/lib/prism.rb#56 + # source://prism/lib/prism.rb#55 + sig { params(source: String).returns(T::Array[T.untyped]) } def lex_ripper(source); end # :call-seq: @@ -57,7 +72,8 @@ module Prism # # Load the serialized AST using the source as a reference into a tree. # - # source://prism/lib/prism.rb#64 + # source://prism/lib/prism.rb#63 + sig { params(source: String, serialized: String).returns(Prism::ParseResult) } def load(source, serialized); end # Mirror the Prism.parse API by using the serialization API. @@ -66,19 +82,14 @@ module Prism # Mirror the Prism.parse_comments API by using the serialization API. def parse_comments(*_arg0); end - # :call-seq: - # Prism::parse_failure?(source, **options) -> bool - # - # Returns true if the source parses with errors. + # Mirror the Prism.parse_failure? API by using the serialization API. # # @return [Boolean] - # - # source://prism/lib/prism.rb#72 - def parse_failure?(source, **options); end + def parse_failure?(*_arg0); end # Mirror the Prism.parse_file API by using the serialization API. This uses - # native strings instead of Ruby strings because it allows us to use mmap when - # it is available. + # native strings instead of Ruby strings because it allows us to use mmap + # when it is available. def parse_file(*_arg0); end # Mirror the Prism.parse_file_comments API by using the serialization @@ -86,15 +97,10 @@ module Prism # to use mmap when it is available. def parse_file_comments(*_arg0); end - # :call-seq: - # Prism::parse_file_failure?(filepath, **options) -> bool - # - # Returns true if the file at filepath parses with errors. + # Mirror the Prism.parse_file_failure? API by using the serialization API. # # @return [Boolean] - # - # source://prism/lib/prism.rb#80 - def parse_file_failure?(filepath, **options); end + def parse_file_failure?(*_arg0); end # Mirror the Prism.parse_file_success? API by using the serialization API. # @@ -107,98 +113,179 @@ module Prism # Mirror the Prism.parse_lex_file API by using the serialization API. def parse_lex_file(*_arg0); end + # Mirror the Prism.parse_stream API by using the serialization API. + def parse_stream(*_arg0); end + # Mirror the Prism.parse_success? API by using the serialization API. # # @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. +# +# source://prism/lib/prism/parse_result.rb#126 +class Prism::ASCIISource < ::Prism::Source + # Return the column number in characters for the given byte offset. + # + # source://prism/lib/prism/parse_result.rb#133 + 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 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); 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`. + # + # source://prism/lib/prism/parse_result.rb#150 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_column(byte_offset, encoding); end + + # Returns the offset from the start of the file for the given byte offset + # counting in code units for the given encoding. + # + # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the + # 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 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_offset(byte_offset, encoding); end +end + # Represents the use of the `alias` keyword to alias a global variable. # # alias $foo $bar # ^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#97 +# source://prism/lib/prism/node.rb#176 class Prism::AliasGlobalVariableNode < ::Prism::Node - # def initialize: (Node new_name, Node old_name, Location keyword_loc, Location location) -> void + # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void # # @return [AliasGlobalVariableNode] a new instance of AliasGlobalVariableNode # - # source://prism/lib/prism/node.rb#99 + # source://prism/lib/prism/node.rb#178 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, new_name, old_name, keyword_loc, location); 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#281 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#109 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#187 + 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#114 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#192 + 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#124 + # source://prism/lib/prism/node.rb#202 + 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#119 + # source://prism/lib/prism/node.rb#197 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AliasGlobalVariableNode + # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasGlobalVariableNode # - # source://prism/lib/prism/node.rb#129 - sig { params(params: T.untyped).returns(Prism::AliasGlobalVariableNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#207 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#114 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#192 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Node, old_name: Node, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#143 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#215 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#166 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#247 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#161 + # source://prism/lib/prism/node.rb#242 sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `alias` keyword. + # + # alias $foo $bar + # ^^^^^ # - # source://prism/lib/prism/node.rb#154 + # source://prism/lib/prism/node.rb#235 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader new_name: Node + # 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. # - # source://prism/lib/prism/node.rb#148 + # alias $foo $bar + # ^^^^ + # + # source://prism/lib/prism/node.rb#223 sig { returns(Prism::Node) } def new_name; end - # attr_reader old_name: Node + # 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. # - # source://prism/lib/prism/node.rb#151 + # alias $foo $bar + # ^^^^ + # + # source://prism/lib/prism/node.rb#229 sig { returns(Prism::Node) } def old_name; end @@ -217,7 +304,8 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#190 + # source://prism/lib/prism/node.rb#265 + sig { override.returns(Symbol) } def type; end class << self @@ -228,7 +316,7 @@ class Prism::AliasGlobalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#200 + # source://prism/lib/prism/node.rb#275 def type; end end end @@ -238,86 +326,110 @@ end # alias foo bar # ^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#209 +# source://prism/lib/prism/node.rb#293 class Prism::AliasMethodNode < ::Prism::Node - # def initialize: (Node new_name, Node old_name, Location keyword_loc, Location location) -> void + # def initialize: (Prism::node new_name, Prism::node old_name, Location keyword_loc, Location location) -> void # # @return [AliasMethodNode] a new instance of AliasMethodNode # - # source://prism/lib/prism/node.rb#211 + # source://prism/lib/prism/node.rb#295 + sig do + params( + source: Prism::Source, + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, new_name, old_name, keyword_loc, location); 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#389 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#221 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#304 + 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#226 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#309 + 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#236 + # source://prism/lib/prism/node.rb#319 + 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#231 + # source://prism/lib/prism/node.rb#314 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AliasMethodNode + # def copy: (?new_name: Prism::node, ?old_name: Prism::node, ?keyword_loc: Location, ?location: Location) -> AliasMethodNode # - # source://prism/lib/prism/node.rb#241 - sig { params(params: T.untyped).returns(Prism::AliasMethodNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#324 + sig do + params( + new_name: Prism::Node, + old_name: Prism::Node, + keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#226 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Node, old_name: Node, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { new_name: Prism::node, old_name: Prism::node, keyword_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#255 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#278 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#355 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#273 + # source://prism/lib/prism/node.rb#350 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#266 + # source://prism/lib/prism/node.rb#343 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader new_name: Node + # attr_reader new_name: Prism::node # - # source://prism/lib/prism/node.rb#260 + # source://prism/lib/prism/node.rb#337 sig { returns(Prism::Node) } def new_name; end - # attr_reader old_name: Node + # attr_reader old_name: Prism::node # - # source://prism/lib/prism/node.rb#263 + # source://prism/lib/prism/node.rb#340 sig { returns(Prism::Node) } def old_name; end @@ -336,7 +448,8 @@ class Prism::AliasMethodNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#302 + # source://prism/lib/prism/node.rb#373 + sig { override.returns(Symbol) } def type; end class << self @@ -347,7 +460,7 @@ class Prism::AliasMethodNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#312 + # source://prism/lib/prism/node.rb#383 def type; end end end @@ -357,86 +470,110 @@ end # foo => bar | baz # ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#321 +# source://prism/lib/prism/node.rb#401 class Prism::AlternationPatternNode < ::Prism::Node - # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # # @return [AlternationPatternNode] a new instance of AlternationPatternNode # - # source://prism/lib/prism/node.rb#323 + # source://prism/lib/prism/node.rb#403 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, left, right, operator_loc, location); 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#497 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#333 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#412 + 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#338 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#417 + 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#348 + # source://prism/lib/prism/node.rb#427 + 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#343 + # source://prism/lib/prism/node.rb#422 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AlternationPatternNode + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AlternationPatternNode # - # source://prism/lib/prism/node.rb#353 - sig { params(params: T.untyped).returns(Prism::AlternationPatternNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#432 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#338 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#417 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#367 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#440 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#390 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#463 + sig { override.returns(String) } + def inspect; end - # attr_reader left: Node + # attr_reader left: Prism::node # - # source://prism/lib/prism/node.rb#372 + # source://prism/lib/prism/node.rb#445 sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#385 + # source://prism/lib/prism/node.rb#458 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#378 + # source://prism/lib/prism/node.rb#451 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader right: Node + # attr_reader right: Prism::node # - # source://prism/lib/prism/node.rb#375 + # source://prism/lib/prism/node.rb#448 sig { returns(Prism::Node) } def right; end @@ -455,7 +592,8 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#414 + # source://prism/lib/prism/node.rb#481 + sig { override.returns(Symbol) } def type; end class << self @@ -466,7 +604,7 @@ class Prism::AlternationPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#424 + # source://prism/lib/prism/node.rb#491 def type; end end end @@ -476,64 +614,88 @@ end # left and right # ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#433 +# source://prism/lib/prism/node.rb#509 class Prism::AndNode < ::Prism::Node - # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # # @return [AndNode] a new instance of AndNode # - # source://prism/lib/prism/node.rb#435 + # source://prism/lib/prism/node.rb#511 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, left, right, operator_loc, location); 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#620 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#445 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#520 + 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#450 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#525 + 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#460 + # source://prism/lib/prism/node.rb#535 + 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#455 + # source://prism/lib/prism/node.rb#530 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AndNode + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> AndNode # - # source://prism/lib/prism/node.rb#465 - sig { params(params: T.untyped).returns(Prism::AndNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#540 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#450 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#525 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#479 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#548 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#517 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#586 + sig { override.returns(String) } + def inspect; end # Represents the left 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). # @@ -543,13 +705,13 @@ class Prism::AndNode < ::Prism::Node # 1 && 2 # ^ # - # source://prism/lib/prism/node.rb#490 + # source://prism/lib/prism/node.rb#559 sig { returns(Prism::Node) } def left; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#512 + # source://prism/lib/prism/node.rb#581 sig { returns(String) } def operator; end @@ -558,7 +720,7 @@ class Prism::AndNode < ::Prism::Node # left and right # ^^^ # - # source://prism/lib/prism/node.rb#505 + # source://prism/lib/prism/node.rb#574 sig { returns(Prism::Location) } def operator_loc; end @@ -570,7 +732,7 @@ class Prism::AndNode < ::Prism::Node # 1 and 2 # ^ # - # source://prism/lib/prism/node.rb#499 + # source://prism/lib/prism/node.rb#568 sig { returns(Prism::Node) } def right; end @@ -589,7 +751,8 @@ class Prism::AndNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#541 + # source://prism/lib/prism/node.rb#604 + sig { override.returns(Symbol) } def type; end class << self @@ -600,7 +763,7 @@ class Prism::AndNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#551 + # source://prism/lib/prism/node.rb#614 def type; end end end @@ -610,78 +773,108 @@ end # return foo, bar, baz # ^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#560 +# source://prism/lib/prism/node.rb#632 class Prism::ArgumentsNode < ::Prism::Node - # def initialize: (Integer flags, Array[Node] arguments, Location location) -> void + # def initialize: (Integer flags, Array[Prism::node] arguments, Location location) -> void # # @return [ArgumentsNode] a new instance of ArgumentsNode # - # source://prism/lib/prism/node.rb#562 + # source://prism/lib/prism/node.rb#634 + sig do + params( + source: Prism::Source, + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).void + end def initialize(source, flags, arguments, location); 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#726 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#571 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#642 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader arguments: Array[Node] + # attr_reader arguments: Array[Prism::node] # - # source://prism/lib/prism/node.rb#613 + # source://prism/lib/prism/node.rb#679 sig { returns(T::Array[Prism::Node]) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#576 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#647 + 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#586 + # source://prism/lib/prism/node.rb#657 + 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#581 + # source://prism/lib/prism/node.rb#652 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def contains_keyword_splat?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#617 + # source://prism/lib/prism/node.rb#687 sig { returns(T::Boolean) } def contains_keyword_splat?; end - # def copy: (**params) -> ArgumentsNode + # def contains_keywords?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#682 + sig { returns(T::Boolean) } + def contains_keywords?; end + + # def copy: (?flags: Integer, ?arguments: Array[Prism::node], ?location: Location) -> ArgumentsNode # - # source://prism/lib/prism/node.rb#591 - sig { params(params: T.untyped).returns(Prism::ArgumentsNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#662 + sig do + params( + flags: Integer, + arguments: T::Array[Prism::Node], + location: Prism::Location + ).returns(Prism::ArgumentsNode) + end + def copy(flags: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#576 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#647 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Node], location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, arguments: Array[Prism::node], location: Location } # - # source://prism/lib/prism/node.rb#604 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#670 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#622 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#692 + 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 @@ -698,14 +891,15 @@ class Prism::ArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#644 + # source://prism/lib/prism/node.rb#710 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#609 + # source://prism/lib/prism/node.rb#675 sig { returns(Integer) } def flags; end @@ -717,19 +911,24 @@ class Prism::ArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#654 + # source://prism/lib/prism/node.rb#720 def type; end end end # Flags for arguments nodes. # -# source://prism/lib/prism/node.rb#19241 +# source://prism/lib/prism/node.rb#19127 module Prism::ArgumentsNodeFlags; end +# if arguments contain keywords +# +# source://prism/lib/prism/node.rb#19129 +Prism::ArgumentsNodeFlags::CONTAINS_KEYWORDS = T.let(T.unsafe(nil), Integer) + # if arguments contain keyword splat # -# source://prism/lib/prism/node.rb#19243 +# source://prism/lib/prism/node.rb#19132 Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_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. @@ -737,100 +936,136 @@ Prism::ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT = T.let(T.unsafe(nil), Integer # [1, 2, 3] # ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#663 +# source://prism/lib/prism/node.rb#738 class Prism::ArrayNode < ::Prism::Node - # def initialize: (Integer flags, Array[Node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void + # def initialize: (Integer flags, Array[Prism::node] elements, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [ArrayNode] a new instance of ArrayNode # - # source://prism/lib/prism/node.rb#665 + # source://prism/lib/prism/node.rb#740 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, flags, elements, opening_loc, closing_loc, location); 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#875 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#676 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#750 + 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#681 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#755 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#758 + # source://prism/lib/prism/node.rb#836 sig { returns(T.nilable(String)) } def closing; end - # attr_reader closing_loc: Location? + # Represents the optional source location for the closing token. # - # source://prism/lib/prism/node.rb#735 + # [1,2,3] # "]" + # %w[foo bar baz] # "]" + # %I(apple orange banana) # ")" + # foo = 1, 2, 3 # nil + # + # source://prism/lib/prism/node.rb#813 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#691 + # source://prism/lib/prism/node.rb#765 + 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#686 + # source://prism/lib/prism/node.rb#760 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def contains_splat?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#748 + # source://prism/lib/prism/node.rb#826 sig { returns(T::Boolean) } def contains_splat?; end - # def copy: (**params) -> ArrayNode + # def copy: (?flags: Integer, ?elements: Array[Prism::node], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> ArrayNode # - # source://prism/lib/prism/node.rb#696 - sig { params(params: T.untyped).returns(Prism::ArrayNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#770 + sig do + params( + flags: Integer, + elements: T::Array[Prism::Node], + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#681 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#755 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Prism::node], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#711 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#778 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] + # 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#720 + # source://prism/lib/prism/node.rb#787 sig { returns(T::Array[Prism::Node]) } def elements; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#763 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#841 + sig { override.returns(String) } + def inspect; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#753 + # source://prism/lib/prism/node.rb#831 sig { returns(T.nilable(String)) } def opening; end - # attr_reader opening_loc: Location? + # Represents the optional source location for the opening token. # - # source://prism/lib/prism/node.rb#723 + # [1,2,3] # "[" + # %w[foo bar baz] # "%w[" + # %I(apple orange banana) # "%I(" + # foo = 1, 2, 3 # nil + # + # source://prism/lib/prism/node.rb#795 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end @@ -849,14 +1084,15 @@ class Prism::ArrayNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#787 + # source://prism/lib/prism/node.rb#859 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#716 + # source://prism/lib/prism/node.rb#783 sig { returns(Integer) } def flags; end @@ -868,19 +1104,19 @@ class Prism::ArrayNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#797 + # source://prism/lib/prism/node.rb#869 def type; end end end # Flags for array nodes. # -# source://prism/lib/prism/node.rb#19247 +# source://prism/lib/prism/node.rb#19136 module Prism::ArrayNodeFlags; end # if array contains splat nodes # -# source://prism/lib/prism/node.rb#19249 +# source://prism/lib/prism/node.rb#19138 Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # Represents an array pattern in pattern matching. @@ -900,110 +1136,140 @@ Prism::ArrayNodeFlags::CONTAINS_SPLAT = T.let(T.unsafe(nil), Integer) # foo in Bar[1, 2, 3] # ^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#818 +# source://prism/lib/prism/node.rb#901 class Prism::ArrayPatternNode < ::Prism::Node - # def initialize: (Node? constant, Array[Node] requireds, Node? rest, Array[Node] posts, Location? opening_loc, Location? closing_loc, Location location) -> void + # 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 # # @return [ArrayPatternNode] a new instance of ArrayPatternNode # - # source://prism/lib/prism/node.rb#820 + # source://prism/lib/prism/node.rb#903 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + 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 + ).void + end def initialize(source, constant, requireds, rest, posts, opening_loc, closing_loc, location); 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#1035 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#833 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#915 + 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#838 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#920 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#922 + # source://prism/lib/prism/node.rb#996 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#904 + # source://prism/lib/prism/node.rb#978 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#853 + # source://prism/lib/prism/node.rb#935 + 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#843 + # source://prism/lib/prism/node.rb#925 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader constant: Node? + # attr_reader constant: Prism::node? # - # source://prism/lib/prism/node.rb#880 + # source://prism/lib/prism/node.rb#953 sig { returns(T.nilable(Prism::Node)) } def constant; end - # def copy: (**params) -> ArrayPatternNode + # 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 # - # source://prism/lib/prism/node.rb#858 - sig { params(params: T.untyped).returns(Prism::ArrayPatternNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#940 + sig do + params( + constant: T.nilable(Prism::Node), + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#838 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#920 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, requireds: Array[Node], rest: Node?, posts: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#875 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#948 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#927 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1001 + sig { override.returns(String) } + def inspect; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#917 + # source://prism/lib/prism/node.rb#991 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#892 + # source://prism/lib/prism/node.rb#965 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # attr_reader posts: Array[Node] + # attr_reader posts: Array[Prism::node] # - # source://prism/lib/prism/node.rb#889 + # source://prism/lib/prism/node.rb#962 sig { returns(T::Array[Prism::Node]) } def posts; end - # attr_reader requireds: Array[Node] + # attr_reader requireds: Array[Prism::node] # - # source://prism/lib/prism/node.rb#883 + # source://prism/lib/prism/node.rb#956 sig { returns(T::Array[Prism::Node]) } def requireds; end - # attr_reader rest: Node? + # attr_reader rest: Prism::node? # - # source://prism/lib/prism/node.rb#886 + # source://prism/lib/prism/node.rb#959 sig { returns(T.nilable(Prism::Node)) } def rest; end @@ -1022,7 +1288,8 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#962 + # source://prism/lib/prism/node.rb#1019 + sig { override.returns(Symbol) } def type; end class << self @@ -1033,7 +1300,7 @@ class Prism::ArrayPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#972 + # source://prism/lib/prism/node.rb#1029 def type; end end end @@ -1043,64 +1310,88 @@ end # { a => b } # ^^^^^^ # -# source://prism/lib/prism/node.rb#981 +# source://prism/lib/prism/node.rb#1052 class Prism::AssocNode < ::Prism::Node - # def initialize: (Node key, Node value, Location? operator_loc, Location location) -> void + # def initialize: (Prism::node key, Prism::node value, Location? operator_loc, Location location) -> void # # @return [AssocNode] a new instance of AssocNode # - # source://prism/lib/prism/node.rb#983 + # source://prism/lib/prism/node.rb#1054 + sig do + params( + source: Prism::Source, + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, key, value, operator_loc, location); 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#1172 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#993 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1063 + 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#998 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1068 + 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#1008 + # source://prism/lib/prism/node.rb#1078 + 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#1003 + # source://prism/lib/prism/node.rb#1073 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AssocNode + # def copy: (?key: Prism::node, ?value: Prism::node, ?operator_loc: Location?, ?location: Location) -> AssocNode # - # source://prism/lib/prism/node.rb#1013 - sig { params(params: T.untyped).returns(Prism::AssocNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1083 + sig do + params( + key: Prism::Node, + value: Prism::Node, + operator_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#998 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1068 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { key: Node, value: Node, operator_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { key: Prism::node, value: Prism::node, operator_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#1027 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1091 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1074 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1138 + sig { override.returns(String) } + def inspect; end # The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # @@ -1113,13 +1404,13 @@ class Prism::AssocNode < ::Prism::Node # { def a; end => 1 } # ^^^^^^^^^^ # - # source://prism/lib/prism/node.rb#1041 + # source://prism/lib/prism/node.rb#1105 sig { returns(Prism::Node) } def key; end # def operator: () -> String? # - # source://prism/lib/prism/node.rb#1069 + # source://prism/lib/prism/node.rb#1133 sig { returns(T.nilable(String)) } def operator; end @@ -1128,7 +1419,7 @@ class Prism::AssocNode < ::Prism::Node # { foo => bar } # ^^ # - # source://prism/lib/prism/node.rb#1056 + # source://prism/lib/prism/node.rb#1120 sig { returns(T.nilable(Prism::Location)) } def operator_loc; end @@ -1147,7 +1438,8 @@ class Prism::AssocNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1098 + # source://prism/lib/prism/node.rb#1156 + sig { override.returns(Symbol) } def type; end # The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). @@ -1158,7 +1450,7 @@ class Prism::AssocNode < ::Prism::Node # { x: 1 } # ^ # - # source://prism/lib/prism/node.rb#1050 + # source://prism/lib/prism/node.rb#1114 sig { returns(Prism::Node) } def value; end @@ -1170,7 +1462,7 @@ class Prism::AssocNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1108 + # source://prism/lib/prism/node.rb#1166 def type; end end end @@ -1180,68 +1472,90 @@ end # { **foo } # ^^^^^ # -# source://prism/lib/prism/node.rb#1117 +# source://prism/lib/prism/node.rb#1184 class Prism::AssocSplatNode < ::Prism::Node - # def initialize: (Node? value, Location operator_loc, Location location) -> void + # def initialize: (Prism::node? value, Location operator_loc, Location location) -> void # # @return [AssocSplatNode] a new instance of AssocSplatNode # - # source://prism/lib/prism/node.rb#1119 + # source://prism/lib/prism/node.rb#1186 + sig do + params( + source: Prism::Source, + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, operator_loc, location); 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#1284 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1128 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1194 + 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#1133 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1199 + 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#1145 + # source://prism/lib/prism/node.rb#1211 + 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#1138 + # source://prism/lib/prism/node.rb#1204 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> AssocSplatNode + # def copy: (?value: Prism::node?, ?operator_loc: Location, ?location: Location) -> AssocSplatNode # - # source://prism/lib/prism/node.rb#1150 - sig { params(params: T.untyped).returns(Prism::AssocSplatNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1216 + sig do + params( + value: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::AssocSplatNode) + end + def copy(value: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1133 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1199 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node?, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node?, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#1163 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1224 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1189 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1250 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#1184 + # source://prism/lib/prism/node.rb#1245 sig { returns(String) } def operator; end @@ -1250,7 +1564,7 @@ class Prism::AssocSplatNode < ::Prism::Node # { **x } # ^^ # - # source://prism/lib/prism/node.rb#1177 + # source://prism/lib/prism/node.rb#1238 sig { returns(Prism::Location) } def operator_loc; end @@ -1269,7 +1583,8 @@ class Prism::AssocSplatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1215 + # source://prism/lib/prism/node.rb#1268 + sig { override.returns(Symbol) } def type; end # The value to be splatted, if present. Will be missing when keyword rest argument forwarding is used. @@ -1277,7 +1592,7 @@ class Prism::AssocSplatNode < ::Prism::Node # { **foo } # ^^^ # - # source://prism/lib/prism/node.rb#1171 + # source://prism/lib/prism/node.rb#1232 sig { returns(T.nilable(Prism::Node)) } def value; end @@ -1289,11 +1604,14 @@ class Prism::AssocSplatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1225 + # source://prism/lib/prism/node.rb#1278 def type; end end end +# The FFI backend is used on other Ruby implementations. +# +# 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. @@ -1301,64 +1619,73 @@ Prism::BACKEND = T.let(T.unsafe(nil), Symbol) # $' # ^^ # -# source://prism/lib/prism/node.rb#1234 +# source://prism/lib/prism/node.rb#1295 class Prism::BackReferenceReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [BackReferenceReadNode] a new instance of BackReferenceReadNode # - # source://prism/lib/prism/node.rb#1236 + # source://prism/lib/prism/node.rb#1297 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#1378 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1244 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1304 + 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#1249 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1309 + 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#1259 + # source://prism/lib/prism/node.rb#1319 + 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#1254 + # source://prism/lib/prism/node.rb#1314 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BackReferenceReadNode + # def copy: (?name: Symbol, ?location: Location) -> BackReferenceReadNode # - # source://prism/lib/prism/node.rb#1264 - sig { params(params: T.untyped).returns(Prism::BackReferenceReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1324 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::BackReferenceReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1249 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#1276 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1289 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1344 + sig { override.returns(String) } + def inspect; end # The name of the back-reference variable, including the leading `$`. # @@ -1366,7 +1693,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # $+ # name `:$+` # - # source://prism/lib/prism/node.rb#1285 + # source://prism/lib/prism/node.rb#1341 sig { returns(Symbol) } def name; end @@ -1385,7 +1712,8 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1309 + # source://prism/lib/prism/node.rb#1362 + sig { override.returns(Symbol) } def type; end class << self @@ -1396,7 +1724,7 @@ class Prism::BackReferenceReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1319 + # source://prism/lib/prism/node.rb#1372 def type; end end end @@ -1406,24 +1734,24 @@ end # implement each one that they need. For a default implementation that # continues walking the tree, see the Visitor class. # -# source://prism/lib/prism/visitor.rb#13 +# source://prism/lib/prism/visitor.rb#14 class Prism::BasicVisitor # Calls `accept` on the given node if it is not `nil`, which in turn should # call back into this visitor by calling the appropriate `visit_*` method. # - # source://prism/lib/prism/visitor.rb#16 + # source://prism/lib/prism/visitor.rb#17 sig { params(node: T.nilable(Prism::Node)).void } def visit(node); end # Visits each node in `nodes` by calling `accept` on each one. # - # source://prism/lib/prism/visitor.rb#21 + # source://prism/lib/prism/visitor.rb#23 sig { params(nodes: T::Array[T.nilable(Prism::Node)]).void } def visit_all(nodes); end # Visits the child nodes of `node` by calling `accept` on each one. # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::Node).void } def visit_child_nodes(node); end end @@ -1435,113 +1763,143 @@ end # end # ^^^^^ # -# source://prism/lib/prism/node.rb#1330 +# source://prism/lib/prism/node.rb#1390 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 # # @return [BeginNode] a new instance of BeginNode # - # source://prism/lib/prism/node.rb#1332 + # source://prism/lib/prism/node.rb#1392 + sig do + params( + source: Prism::Source, + 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 + ).void + end def initialize(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location); 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#1524 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1345 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1404 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_keyword: () -> String? # - # source://prism/lib/prism/node.rb#1433 + # source://prism/lib/prism/node.rb#1480 sig { returns(T.nilable(String)) } def begin_keyword; end # attr_reader begin_keyword_loc: Location? # - # source://prism/lib/prism/node.rb#1396 + # source://prism/lib/prism/node.rb#1442 sig { returns(T.nilable(Prism::Location)) } def begin_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1354 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1409 + 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#1369 + # source://prism/lib/prism/node.rb#1424 + 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#1359 + # source://prism/lib/prism/node.rb#1414 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BeginNode + # def copy: (?begin_keyword_loc: Location?, ?statements: StatementsNode?, ?rescue_clause: RescueNode?, ?else_clause: ElseNode?, ?ensure_clause: EnsureNode?, ?end_keyword_loc: Location?, ?location: Location) -> BeginNode # - # source://prism/lib/prism/node.rb#1374 - sig { params(params: T.untyped).returns(Prism::BeginNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1429 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1354 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1409 + 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 } # - # source://prism/lib/prism/node.rb#1391 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1437 + 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#1414 + # source://prism/lib/prism/node.rb#1461 sig { returns(T.nilable(Prism::ElseNode)) } def else_clause; end # def end_keyword: () -> String? # - # source://prism/lib/prism/node.rb#1438 + # source://prism/lib/prism/node.rb#1485 sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism/lib/prism/node.rb#1420 + # source://prism/lib/prism/node.rb#1467 sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # attr_reader ensure_clause: EnsureNode? # - # source://prism/lib/prism/node.rb#1417 + # source://prism/lib/prism/node.rb#1464 sig { returns(T.nilable(Prism::EnsureNode)) } def ensure_clause; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1443 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1490 + sig { override.returns(String) } + def inspect; end + + # source://prism/lib/prism/parse_result/newlines.rb#79 + def newline!(lines); end # attr_reader rescue_clause: RescueNode? # - # source://prism/lib/prism/node.rb#1411 + # source://prism/lib/prism/node.rb#1458 sig { returns(T.nilable(Prism::RescueNode)) } def rescue_clause; end - # source://prism/lib/prism/node.rb#1349 - def set_newline_flag(newline_marked); end - # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#1408 + # source://prism/lib/prism/node.rb#1455 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -1560,7 +1918,8 @@ class Prism::BeginNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1488 + # source://prism/lib/prism/node.rb#1508 + sig { override.returns(Symbol) } def type; end class << self @@ -1571,7 +1930,7 @@ class Prism::BeginNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1498 + # source://prism/lib/prism/node.rb#1518 def type; end end end @@ -1581,80 +1940,102 @@ end # bar(&args) # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#1507 +# source://prism/lib/prism/node.rb#1539 class Prism::BlockArgumentNode < ::Prism::Node - # def initialize: (Node? expression, Location operator_loc, Location location) -> void + # def initialize: (Prism::node? expression, Location operator_loc, Location location) -> void # # @return [BlockArgumentNode] a new instance of BlockArgumentNode # - # source://prism/lib/prism/node.rb#1509 + # source://prism/lib/prism/node.rb#1541 + sig do + params( + source: Prism::Source, + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, expression, operator_loc, location); 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#1633 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1518 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1549 + 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#1523 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1554 + 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#1535 + # source://prism/lib/prism/node.rb#1566 + 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#1528 + # source://prism/lib/prism/node.rb#1559 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BlockArgumentNode + # def copy: (?expression: Prism::node?, ?operator_loc: Location, ?location: Location) -> BlockArgumentNode # - # source://prism/lib/prism/node.rb#1540 - sig { params(params: T.untyped).returns(Prism::BlockArgumentNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1571 + sig do + params( + expression: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BlockArgumentNode) + end + def copy(expression: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1523 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1554 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node?, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Prism::node?, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#1553 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1579 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader expression: Node? + # attr_reader expression: Prism::node? # - # source://prism/lib/prism/node.rb#1558 + # source://prism/lib/prism/node.rb#1584 sig { returns(T.nilable(Prism::Node)) } def expression; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1573 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1599 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#1568 + # source://prism/lib/prism/node.rb#1594 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#1561 + # source://prism/lib/prism/node.rb#1587 sig { returns(Prism::Location) } def operator_loc; end @@ -1673,7 +2054,8 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1599 + # source://prism/lib/prism/node.rb#1617 + sig { override.returns(Symbol) } def type; end class << self @@ -1684,7 +2066,7 @@ class Prism::BlockArgumentNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1609 + # source://prism/lib/prism/node.rb#1627 def type; end end end @@ -1694,68 +2076,77 @@ end # a { |; b| } # ^ # -# source://prism/lib/prism/node.rb#1618 +# source://prism/lib/prism/node.rb#1644 class Prism::BlockLocalVariableNode < ::Prism::Node # def initialize: (Integer flags, Symbol name, Location location) -> void # # @return [BlockLocalVariableNode] a new instance of BlockLocalVariableNode # - # source://prism/lib/prism/node.rb#1620 + # source://prism/lib/prism/node.rb#1646 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } def initialize(source, flags, name, location); 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#1733 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1629 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1654 + 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#1634 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1659 + 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#1644 + # source://prism/lib/prism/node.rb#1669 + 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#1639 + # source://prism/lib/prism/node.rb#1664 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BlockLocalVariableNode + # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> BlockLocalVariableNode # - # source://prism/lib/prism/node.rb#1649 - sig { params(params: T.untyped).returns(Prism::BlockLocalVariableNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1674 + 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 # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1634 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1659 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#1662 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1682 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1680 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1699 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#1671 + # source://prism/lib/prism/node.rb#1691 sig { returns(Symbol) } def name; end @@ -1763,7 +2154,7 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#1675 + # source://prism/lib/prism/node.rb#1694 sig { returns(T::Boolean) } def repeated_parameter?; end @@ -1782,14 +2173,15 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1702 + # source://prism/lib/prism/node.rb#1717 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#1667 + # source://prism/lib/prism/node.rb#1687 sig { returns(Integer) } def flags; end @@ -1801,7 +2193,7 @@ class Prism::BlockLocalVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1712 + # source://prism/lib/prism/node.rb#1727 def type; end end end @@ -1811,104 +2203,132 @@ end # [1, 2, 3].each { |i| puts x } # ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#1721 +# source://prism/lib/prism/node.rb#1744 class Prism::BlockNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, Node? parameters, Node? body, Location opening_loc, Location closing_loc, Location location) -> void + # def initialize: (Array[Symbol] locals, Prism::node? parameters, Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void # # @return [BlockNode] a new instance of BlockNode # - # source://prism/lib/prism/node.rb#1723 + # source://prism/lib/prism/node.rb#1746 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, locals, parameters, body, opening_loc, closing_loc, location); 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#1860 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1735 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1757 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # attr_reader body: Prism::node? # - # source://prism/lib/prism/node.rb#1785 + # source://prism/lib/prism/node.rb#1799 sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1740 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1762 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#1806 + # source://prism/lib/prism/node.rb#1821 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#1794 + # source://prism/lib/prism/node.rb#1809 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#1753 + # source://prism/lib/prism/node.rb#1775 + 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#1745 + # source://prism/lib/prism/node.rb#1767 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BlockNode + # def copy: (?locals: Array[Symbol], ?parameters: Prism::node?, ?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> BlockNode # - # source://prism/lib/prism/node.rb#1758 - sig { params(params: T.untyped).returns(Prism::BlockNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1780 + sig do + params( + locals: T::Array[Symbol], + parameters: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1740 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1762 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Node?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], parameters: Prism::node?, body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#1774 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1788 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1811 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1826 + sig { override.returns(String) } + def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism/lib/prism/node.rb#1779 + # source://prism/lib/prism/node.rb#1793 sig { returns(T::Array[Symbol]) } def locals; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#1801 + # source://prism/lib/prism/node.rb#1816 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#1788 + # source://prism/lib/prism/node.rb#1802 sig { returns(Prism::Location) } def opening_loc; end - # attr_reader parameters: Node? + # attr_reader parameters: Prism::node? # - # source://prism/lib/prism/node.rb#1782 + # source://prism/lib/prism/node.rb#1796 sig { returns(T.nilable(Prism::Node)) } def parameters; end @@ -1927,7 +2347,8 @@ class Prism::BlockNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1845 + # source://prism/lib/prism/node.rb#1844 + sig { override.returns(Symbol) } def type; end class << self @@ -1938,7 +2359,7 @@ class Prism::BlockNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1855 + # source://prism/lib/prism/node.rb#1854 def type; end end end @@ -1949,86 +2370,112 @@ end # ^^ # end # -# source://prism/lib/prism/node.rb#1865 +# source://prism/lib/prism/node.rb#1876 class Prism::BlockParameterNode < ::Prism::Node # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # # @return [BlockParameterNode] a new instance of BlockParameterNode # - # source://prism/lib/prism/node.rb#1867 + # source://prism/lib/prism/node.rb#1878 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, name, name_loc, operator_loc, location); 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#1992 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#1878 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#1888 + 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#1883 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1893 + 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#1893 + # source://prism/lib/prism/node.rb#1903 + 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#1888 + # source://prism/lib/prism/node.rb#1898 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BlockParameterNode + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> BlockParameterNode # - # source://prism/lib/prism/node.rb#1898 - sig { params(params: T.untyped).returns(Prism::BlockParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#1908 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#1883 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#1893 + 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 } # - # source://prism/lib/prism/node.rb#1913 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#1916 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#1954 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#1958 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol? # - # source://prism/lib/prism/node.rb#1922 + # source://prism/lib/prism/node.rb#1925 sig { returns(T.nilable(Symbol)) } def name; end # attr_reader name_loc: Location? # - # source://prism/lib/prism/node.rb#1925 + # source://prism/lib/prism/node.rb#1928 sig { returns(T.nilable(Prism::Location)) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#1949 + # source://prism/lib/prism/node.rb#1953 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#1937 + # source://prism/lib/prism/node.rb#1941 sig { returns(Prism::Location) } def operator_loc; end @@ -2036,7 +2483,7 @@ class Prism::BlockParameterNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#1944 + # source://prism/lib/prism/node.rb#1948 sig { returns(T::Boolean) } def repeated_parameter?; end @@ -2055,14 +2502,15 @@ class Prism::BlockParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#1982 + # source://prism/lib/prism/node.rb#1976 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#1918 + # source://prism/lib/prism/node.rb#1921 sig { returns(Integer) } def flags; end @@ -2074,7 +2522,7 @@ class Prism::BlockParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#1992 + # source://prism/lib/prism/node.rb#1986 def type; end end end @@ -2088,98 +2536,124 @@ end # ^^^^^^^^^^^^^^^^^ # end # -# source://prism/lib/prism/node.rb#2005 +# source://prism/lib/prism/node.rb#2009 class Prism::BlockParametersNode < ::Prism::Node - # def initialize: (ParametersNode? parameters, Array[Node] locals, Location? opening_loc, Location? closing_loc, Location location) -> void + # def initialize: (ParametersNode? parameters, Array[BlockLocalVariableNode] locals, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [BlockParametersNode] a new instance of BlockParametersNode # - # source://prism/lib/prism/node.rb#2007 + # source://prism/lib/prism/node.rb#2011 + sig do + params( + source: Prism::Source, + 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 + ).void + end def initialize(source, parameters, locals, opening_loc, closing_loc, location); 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#2133 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2018 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2021 + 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#2023 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2026 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#2097 + # source://prism/lib/prism/node.rb#2094 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#2079 + # source://prism/lib/prism/node.rb#2076 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#2036 + # source://prism/lib/prism/node.rb#2039 + 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#2028 + # source://prism/lib/prism/node.rb#2031 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BlockParametersNode + # def copy: (?parameters: ParametersNode?, ?locals: Array[BlockLocalVariableNode], ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> BlockParametersNode # - # source://prism/lib/prism/node.rb#2041 - sig { params(params: T.untyped).returns(Prism::BlockParametersNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2044 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2023 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2026 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { parameters: ParametersNode?, locals: Array[BlockLocalVariableNode], opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#2056 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2052 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#2102 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#2099 + sig { override.returns(String) } + def inspect; end - # attr_reader locals: Array[Node] + # attr_reader locals: Array[BlockLocalVariableNode] # - # source://prism/lib/prism/node.rb#2064 - sig { returns(T::Array[Prism::Node]) } + # source://prism/lib/prism/node.rb#2060 + sig { returns(T::Array[Prism::BlockLocalVariableNode]) } def locals; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#2092 + # source://prism/lib/prism/node.rb#2089 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#2067 + # source://prism/lib/prism/node.rb#2063 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end # attr_reader parameters: ParametersNode? # - # source://prism/lib/prism/node.rb#2061 + # source://prism/lib/prism/node.rb#2057 sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end @@ -2198,7 +2672,8 @@ class Prism::BlockParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#2130 + # source://prism/lib/prism/node.rb#2117 + sig { override.returns(Symbol) } def type; end class << self @@ -2209,7 +2684,7 @@ class Prism::BlockParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#2140 + # source://prism/lib/prism/node.rb#2127 def type; end end end @@ -2219,80 +2694,108 @@ end # break foo # ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#2149 +# source://prism/lib/prism/node.rb#2147 class Prism::BreakNode < ::Prism::Node # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # # @return [BreakNode] a new instance of BreakNode # - # source://prism/lib/prism/node.rb#2151 + # source://prism/lib/prism/node.rb#2149 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, arguments, keyword_loc, location); 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#2247 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2160 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2157 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader arguments: ArgumentsNode? + # The arguments to the break statement, if present. These can be any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). # - # source://prism/lib/prism/node.rb#2200 + # break foo + # ^^^ + # + # source://prism/lib/prism/node.rb#2195 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2165 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2162 + 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#2177 + # source://prism/lib/prism/node.rb#2174 + 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#2170 + # source://prism/lib/prism/node.rb#2167 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> BreakNode + # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> BreakNode # - # source://prism/lib/prism/node.rb#2182 - sig { params(params: T.untyped).returns(Prism::BreakNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2179 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::BreakNode) + end + def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2165 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2162 + 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 } # - # source://prism/lib/prism/node.rb#2195 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2187 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#2215 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#2213 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#2210 + # source://prism/lib/prism/node.rb#2208 sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `break` keyword. + # + # break foo + # ^^^^^ # - # source://prism/lib/prism/node.rb#2203 + # source://prism/lib/prism/node.rb#2201 sig { returns(Prism::Location) } def keyword_loc; end @@ -2311,7 +2814,8 @@ class Prism::BreakNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#2241 + # source://prism/lib/prism/node.rb#2231 + sig { override.returns(Symbol) } def type; end class << self @@ -2322,7 +2826,7 @@ class Prism::BreakNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#2251 + # source://prism/lib/prism/node.rb#2241 def type; end end end @@ -2332,126 +2836,160 @@ end # foo.bar &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#2260 +# source://prism/lib/prism/node.rb#2258 class Prism::CallAndWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [CallAndWriteNode] a new instance of CallAndWriteNode # - # source://prism/lib/prism/node.rb#2262 + # source://prism/lib/prism/node.rb#2260 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); 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#2428 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2277 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2274 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2381 + # source://prism/lib/prism/node.rb#2369 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#2391 + # source://prism/lib/prism/node.rb#2379 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#2331 + # source://prism/lib/prism/node.rb#2317 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2282 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2279 + 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#2295 + # source://prism/lib/prism/node.rb#2292 + 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#2287 + # source://prism/lib/prism/node.rb#2284 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CallAndWriteNode + # 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 # - # source://prism/lib/prism/node.rb#2300 - sig { params(params: T.untyped).returns(Prism::CallAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2297 + sig do + params( + 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, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2282 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2279 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#2319 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2305 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2386 + # source://prism/lib/prism/node.rb#2374 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#2406 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#2394 + sig { override.returns(String) } + def inspect; end # def message: () -> String? # - # source://prism/lib/prism/node.rb#2396 + # source://prism/lib/prism/node.rb#2384 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism/lib/prism/node.rb#2343 + # source://prism/lib/prism/node.rb#2330 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#2401 + # source://prism/lib/prism/node.rb#2389 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#2361 + # source://prism/lib/prism/node.rb#2349 sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism/lib/prism/node.rb#2355 + # source://prism/lib/prism/node.rb#2343 sig { returns(Symbol) } def read_name; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#2328 + # source://prism/lib/prism/node.rb#2314 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -2459,7 +2997,7 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2371 + # source://prism/lib/prism/node.rb#2359 sig { returns(T::Boolean) } def safe_navigation?; end @@ -2478,12 +3016,13 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#2440 + # source://prism/lib/prism/node.rb#2412 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#2367 + # source://prism/lib/prism/node.rb#2356 sig { returns(Prism::Node) } def value; end @@ -2491,21 +3030,21 @@ class Prism::CallAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2376 + # source://prism/lib/prism/node.rb#2364 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism/lib/prism/node.rb#2358 + # source://prism/lib/prism/node.rb#2346 sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#2324 + # source://prism/lib/prism/node.rb#2310 sig { returns(Integer) } def flags; end @@ -2517,7 +3056,7 @@ class Prism::CallAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#2450 + # source://prism/lib/prism/node.rb#2422 def type; end end end @@ -2542,24 +3081,45 @@ end # foo&.bar # ^^^^^^^^ # -# source://prism/lib/prism/node.rb#2474 +# source://prism/lib/prism/node.rb#2460 class Prism::CallNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Node? block, Location location) -> void + # 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 # # @return [CallNode] a new instance of CallNode # - # source://prism/lib/prism/node.rb#2476 + # source://prism/lib/prism/node.rb#2462 + sig do + params( + source: Prism::Source, + 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(Prism::Node), + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location); 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#2665 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2492 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2477 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#2596 + # source://prism/lib/prism/node.rb#2572 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -2567,119 +3127,148 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2625 + # source://prism/lib/prism/node.rb#2601 sig { returns(T::Boolean) } def attribute_write?; end - # attr_reader block: Node? + # attr_reader block: Prism::node? # - # source://prism/lib/prism/node.rb#2611 + # source://prism/lib/prism/node.rb#2588 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#2635 + # source://prism/lib/prism/node.rb#2611 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#2557 + # source://prism/lib/prism/node.rb#2530 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2497 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2482 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#2650 + # source://prism/lib/prism/node.rb#2626 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#2599 + # source://prism/lib/prism/node.rb#2575 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#2511 + # source://prism/lib/prism/node.rb#2496 + 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#2502 + # source://prism/lib/prism/node.rb#2487 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CallNode + # 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 # - # source://prism/lib/prism/node.rb#2516 - sig { params(params: T.untyped).returns(Prism::CallNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2501 + sig do + params( + 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(Prism::Node), + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2497 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2482 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#2536 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2509 + 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 + + # When a call node has the attribute_write flag set, it means that the call + # is using the attribute write syntax. This is either a method call to []= + # or a method call to a method that ends with =. Either way, the = sign is + # present in the source. + # + # Prism returns the message_loc _without_ the = sign attached, because there + # can be any amount of space between the message and the = sign. However, + # 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#315 + sig { returns(T.nilable(Prism::Location)) } + def full_message_loc; end + # def ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2630 + # source://prism/lib/prism/node.rb#2606 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#2655 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#2631 + sig { override.returns(String) } + def inspect; end # def message: () -> String? # - # source://prism/lib/prism/node.rb#2640 + # source://prism/lib/prism/node.rb#2616 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism/lib/prism/node.rb#2572 + # source://prism/lib/prism/node.rb#2546 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#2569 + # source://prism/lib/prism/node.rb#2543 sig { returns(Symbol) } def name; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#2645 + # source://prism/lib/prism/node.rb#2621 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#2584 + # source://prism/lib/prism/node.rb#2559 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end @@ -2694,7 +3283,7 @@ class Prism::CallNode < ::Prism::Node # foo + bar # ^^^ # - # source://prism/lib/prism/node.rb#2554 + # source://prism/lib/prism/node.rb#2527 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -2702,7 +3291,7 @@ class Prism::CallNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2615 + # source://prism/lib/prism/node.rb#2591 sig { returns(T::Boolean) } def safe_navigation?; end @@ -2721,22 +3310,23 @@ class Prism::CallNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#2699 + # source://prism/lib/prism/node.rb#2649 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2620 + # source://prism/lib/prism/node.rb#2596 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#2541 + # source://prism/lib/prism/node.rb#2514 sig { returns(Integer) } def flags; end @@ -2748,34 +3338,34 @@ class Prism::CallNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#2709 + # source://prism/lib/prism/node.rb#2659 def type; end end end # Flags for call nodes. # -# source://prism/lib/prism/node.rb#19253 +# source://prism/lib/prism/node.rb#19142 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#19261 +# source://prism/lib/prism/node.rb#19150 Prism::CallNodeFlags::ATTRIBUTE_WRITE = T.let(T.unsafe(nil), Integer) # a call that ignores method visibility # -# source://prism/lib/prism/node.rb#19264 +# source://prism/lib/prism/node.rb#19153 Prism::CallNodeFlags::IGNORE_VISIBILITY = T.let(T.unsafe(nil), Integer) # &. operator # -# source://prism/lib/prism/node.rb#19255 +# source://prism/lib/prism/node.rb#19144 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#19258 +# source://prism/lib/prism/node.rb#19147 Prism::CallNodeFlags::VARIABLE_CALL = T.let(T.unsafe(nil), Integer) # Represents the use of an assignment operator on a call. @@ -2783,126 +3373,174 @@ 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#2683 class Prism::CallOperatorWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol operator, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [CallOperatorWriteNode] a new instance of CallOperatorWriteNode # - # source://prism/lib/prism/node.rb#2720 - def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location); end + # source://prism/lib/prism/node.rb#2685 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location); 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#2852 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2736 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2700 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2844 + # source://prism/lib/prism/node.rb#2798 sig { returns(T::Boolean) } def attribute_write?; end + # attr_reader binary_operator: Symbol + # + # source://prism/lib/prism/node.rb#2775 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#2778 + sig { returns(Prism::Location) } + def binary_operator_loc; end + # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#2854 + # source://prism/lib/prism/node.rb#2808 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#2791 + # source://prism/lib/prism/node.rb#2743 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2741 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2705 + 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#2718 + 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#2710 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CallOperatorWriteNode + # 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 # - # source://prism/lib/prism/node.rb#2759 - sig { params(params: T.untyped).returns(Prism::CallOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2723 + sig do + params( + 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, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2741 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2705 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#2779 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2731 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2849 + # source://prism/lib/prism/node.rb#2803 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#2864 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#2818 + sig { override.returns(String) } + def inspect; end # def message: () -> String? # - # source://prism/lib/prism/node.rb#2859 + # source://prism/lib/prism/node.rb#2813 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism/lib/prism/node.rb#2803 + # source://prism/lib/prism/node.rb#2756 sig { returns(T.nilable(Prism::Location)) } def message_loc; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#2821 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#323 def operator; end - # attr_reader operator_loc: Location + # 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.rb#2824 - sig { returns(Prism::Location) } + # source://prism/lib/prism/node_ext.rb#330 def operator_loc; end # attr_reader read_name: Symbol # - # source://prism/lib/prism/node.rb#2815 + # source://prism/lib/prism/node.rb#2769 sig { returns(Symbol) } def read_name; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#2788 + # source://prism/lib/prism/node.rb#2740 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -2910,7 +3548,7 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2834 + # source://prism/lib/prism/node.rb#2788 sig { returns(T::Boolean) } def safe_navigation?; end @@ -2929,12 +3567,13 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#2899 + # source://prism/lib/prism/node.rb#2836 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#2830 + # source://prism/lib/prism/node.rb#2785 sig { returns(Prism::Node) } def value; end @@ -2942,21 +3581,21 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#2839 + # source://prism/lib/prism/node.rb#2793 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism/lib/prism/node.rb#2818 + # source://prism/lib/prism/node.rb#2772 sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#2784 + # source://prism/lib/prism/node.rb#2736 sig { returns(Integer) } def flags; end @@ -2968,7 +3607,7 @@ class Prism::CallOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#2909 + # source://prism/lib/prism/node.rb#2846 def type; end end end @@ -2978,126 +3617,160 @@ end # foo.bar ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#2918 +# source://prism/lib/prism/node.rb#2870 class Prism::CallOrWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [CallOrWriteNode] a new instance of CallOrWriteNode # - # source://prism/lib/prism/node.rb#2920 + # source://prism/lib/prism/node.rb#2872 + sig do + params( + source: Prism::Source, + 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, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location); 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#3040 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#2935 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#2886 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3039 + # source://prism/lib/prism/node.rb#2981 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#3049 + # source://prism/lib/prism/node.rb#2991 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#2989 + # source://prism/lib/prism/node.rb#2929 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2940 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2891 + 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#2953 + # source://prism/lib/prism/node.rb#2904 + 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#2945 + # source://prism/lib/prism/node.rb#2896 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CallOrWriteNode + # 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 # - # source://prism/lib/prism/node.rb#2958 - sig { params(params: T.untyped).returns(Prism::CallOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#2909 + sig do + params( + 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, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#2940 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#2891 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#2977 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#2917 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3044 + # source://prism/lib/prism/node.rb#2986 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#3064 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3006 + sig { override.returns(String) } + def inspect; end # def message: () -> String? # - # source://prism/lib/prism/node.rb#3054 + # source://prism/lib/prism/node.rb#2996 sig { returns(T.nilable(String)) } def message; end # attr_reader message_loc: Location? # - # source://prism/lib/prism/node.rb#3001 + # source://prism/lib/prism/node.rb#2942 sig { returns(T.nilable(Prism::Location)) } def message_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#3059 + # source://prism/lib/prism/node.rb#3001 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#3019 + # source://prism/lib/prism/node.rb#2961 sig { returns(Prism::Location) } def operator_loc; end # attr_reader read_name: Symbol # - # source://prism/lib/prism/node.rb#3013 + # source://prism/lib/prism/node.rb#2955 sig { returns(Symbol) } def read_name; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#2986 + # source://prism/lib/prism/node.rb#2926 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -3105,7 +3778,7 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3029 + # source://prism/lib/prism/node.rb#2971 sig { returns(T::Boolean) } def safe_navigation?; end @@ -3124,12 +3797,13 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3098 + # source://prism/lib/prism/node.rb#3024 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#3025 + # source://prism/lib/prism/node.rb#2968 sig { returns(Prism::Node) } def value; end @@ -3137,21 +3811,21 @@ class Prism::CallOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3034 + # source://prism/lib/prism/node.rb#2976 sig { returns(T::Boolean) } def variable_call?; end # attr_reader write_name: Symbol # - # source://prism/lib/prism/node.rb#3016 + # source://prism/lib/prism/node.rb#2958 sig { returns(Symbol) } def write_name; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#2982 + # source://prism/lib/prism/node.rb#2922 sig { returns(Integer) } def flags; end @@ -3163,7 +3837,7 @@ class Prism::CallOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3108 + # source://prism/lib/prism/node.rb#3034 def type; end end end @@ -3181,114 +3855,142 @@ end # for foo.bar in baz do end # ^^^^^^^ # -# source://prism/lib/prism/node.rb#3125 +# source://prism/lib/prism/node.rb#3065 class Prism::CallTargetNode < ::Prism::Node - # def initialize: (Integer flags, Node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void + # def initialize: (Integer flags, Prism::node receiver, Location call_operator_loc, Symbol name, Location message_loc, Location location) -> void # # @return [CallTargetNode] a new instance of CallTargetNode # - # source://prism/lib/prism/node.rb#3127 + # source://prism/lib/prism/node.rb#3067 + sig do + params( + source: Prism::Source, + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, name, message_loc, location); 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#3199 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3139 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3078 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def attribute_write?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3213 + # source://prism/lib/prism/node.rb#3145 sig { returns(T::Boolean) } def attribute_write?; end # def call_operator: () -> String # - # source://prism/lib/prism/node.rb#3223 + # source://prism/lib/prism/node.rb#3155 sig { returns(String) } def call_operator; end # attr_reader call_operator_loc: Location # - # source://prism/lib/prism/node.rb#3187 + # source://prism/lib/prism/node.rb#3118 sig { returns(Prism::Location) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3144 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3083 + 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#3154 + # source://prism/lib/prism/node.rb#3093 + 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#3149 + # source://prism/lib/prism/node.rb#3088 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CallTargetNode + # def copy: (?flags: Integer, ?receiver: Prism::node, ?call_operator_loc: Location, ?name: Symbol, ?message_loc: Location, ?location: Location) -> CallTargetNode # - # source://prism/lib/prism/node.rb#3159 - sig { params(params: T.untyped).returns(Prism::CallTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3098 + sig do + params( + flags: Integer, + receiver: Prism::Node, + call_operator_loc: Prism::Location, + name: Symbol, + message_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3144 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3083 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#3175 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3106 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3218 + # source://prism/lib/prism/node.rb#3150 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#3233 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3165 + sig { override.returns(String) } + def inspect; end # def message: () -> String # - # source://prism/lib/prism/node.rb#3228 + # source://prism/lib/prism/node.rb#3160 sig { returns(String) } def message; end # attr_reader message_loc: Location # - # source://prism/lib/prism/node.rb#3196 + # source://prism/lib/prism/node.rb#3128 sig { returns(Prism::Location) } def message_loc; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#3193 + # source://prism/lib/prism/node.rb#3125 sig { returns(Symbol) } def name; end - # attr_reader receiver: Node + # attr_reader receiver: Prism::node # - # source://prism/lib/prism/node.rb#3184 + # source://prism/lib/prism/node.rb#3115 sig { returns(Prism::Node) } def receiver; end @@ -3296,7 +3998,7 @@ class Prism::CallTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3203 + # source://prism/lib/prism/node.rb#3135 sig { returns(T::Boolean) } def safe_navigation?; end @@ -3315,22 +4017,23 @@ class Prism::CallTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3259 + # source://prism/lib/prism/node.rb#3183 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#3208 + # source://prism/lib/prism/node.rb#3140 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#3180 + # source://prism/lib/prism/node.rb#3111 sig { returns(Integer) } def flags; end @@ -3342,7 +4045,7 @@ class Prism::CallTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3269 + # source://prism/lib/prism/node.rb#3193 def type; end end end @@ -3352,80 +4055,104 @@ end # foo => [bar => baz] # ^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3278 +# source://prism/lib/prism/node.rb#3213 class Prism::CapturePatternNode < ::Prism::Node - # def initialize: (Node value, Node target, Location operator_loc, Location location) -> void + # def initialize: (Prism::node value, Prism::node target, Location operator_loc, Location location) -> void # # @return [CapturePatternNode] a new instance of CapturePatternNode # - # source://prism/lib/prism/node.rb#3280 + # source://prism/lib/prism/node.rb#3215 + sig do + params( + source: Prism::Source, + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, value, target, operator_loc, location); 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#3309 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3290 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3224 + 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#3295 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3229 + 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#3305 + # source://prism/lib/prism/node.rb#3239 + 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#3300 + # source://prism/lib/prism/node.rb#3234 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> CapturePatternNode + # def copy: (?value: Prism::node, ?target: Prism::node, ?operator_loc: Location, ?location: Location) -> CapturePatternNode # - # source://prism/lib/prism/node.rb#3310 - sig { params(params: T.untyped).returns(Prism::CapturePatternNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3244 + sig do + params( + value: Prism::Node, + target: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3295 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3229 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, target: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, target: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#3324 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3252 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#3347 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3275 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#3342 + # source://prism/lib/prism/node.rb#3270 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#3335 + # source://prism/lib/prism/node.rb#3263 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader target: Node + # attr_reader target: Prism::node # - # source://prism/lib/prism/node.rb#3332 + # source://prism/lib/prism/node.rb#3260 sig { returns(Prism::Node) } def target; end @@ -3444,12 +4171,13 @@ class Prism::CapturePatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3371 + # source://prism/lib/prism/node.rb#3293 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#3329 + # source://prism/lib/prism/node.rb#3257 sig { returns(Prism::Node) } def value; end @@ -3461,7 +4189,7 @@ class Prism::CapturePatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3381 + # source://prism/lib/prism/node.rb#3303 def type; end end end @@ -3473,104 +4201,132 @@ end # end # ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3392 +# source://prism/lib/prism/node.rb#3323 class Prism::CaseMatchNode < ::Prism::Node - # def initialize: (Node? predicate, Array[Node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void + # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseMatchNode] a new instance of CaseMatchNode # - # source://prism/lib/prism/node.rb#3394 + # source://prism/lib/prism/node.rb#3325 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); 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#3440 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3406 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3336 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def case_keyword: () -> String # - # source://prism/lib/prism/node.rb#3473 + # source://prism/lib/prism/node.rb#3396 sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3460 + # source://prism/lib/prism/node.rb#3382 sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3411 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3341 + 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#3425 + # source://prism/lib/prism/node.rb#3355 + 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#3416 + # source://prism/lib/prism/node.rb#3346 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader conditions: Array[Node] + # attr_reader conditions: Array[Prism::node] # - # source://prism/lib/prism/node.rb#3454 + # source://prism/lib/prism/node.rb#3376 sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism/lib/prism/node.rb#3457 + # source://prism/lib/prism/node.rb#3379 sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end - # def copy: (**params) -> CaseMatchNode + # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseMatchNode # - # source://prism/lib/prism/node.rb#3430 - sig { params(params: T.untyped).returns(Prism::CaseMatchNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3360 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3411 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3341 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#3446 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3368 + 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#3478 + # source://prism/lib/prism/node.rb#3401 sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3466 + # source://prism/lib/prism/node.rb#3389 sig { returns(Prism::Location) } def end_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#3483 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3406 + sig { override.returns(String) } + def inspect; end - # attr_reader predicate: Node? + # attr_reader predicate: Prism::node? # - # source://prism/lib/prism/node.rb#3451 + # source://prism/lib/prism/node.rb#3373 sig { returns(T.nilable(Prism::Node)) } def predicate; end @@ -3589,7 +4345,8 @@ class Prism::CaseMatchNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3517 + # source://prism/lib/prism/node.rb#3424 + sig { override.returns(Symbol) } def type; end class << self @@ -3600,7 +4357,7 @@ class Prism::CaseMatchNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3527 + # source://prism/lib/prism/node.rb#3434 def type; end end end @@ -3612,104 +4369,132 @@ end # end # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3538 +# source://prism/lib/prism/node.rb#3457 class Prism::CaseNode < ::Prism::Node - # def initialize: (Node? predicate, Array[Node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void + # def initialize: (Prism::node? predicate, Array[Prism::node] conditions, ElseNode? consequent, Location case_keyword_loc, Location end_keyword_loc, Location location) -> void # # @return [CaseNode] a new instance of CaseNode # - # source://prism/lib/prism/node.rb#3540 + # source://prism/lib/prism/node.rb#3459 + sig do + params( + source: Prism::Source, + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location); 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#3574 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3552 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3470 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def case_keyword: () -> String # - # source://prism/lib/prism/node.rb#3619 + # source://prism/lib/prism/node.rb#3530 sig { returns(String) } def case_keyword; end # attr_reader case_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3606 + # source://prism/lib/prism/node.rb#3516 sig { returns(Prism::Location) } def case_keyword_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3557 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3475 + 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#3571 + # source://prism/lib/prism/node.rb#3489 + 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#3562 + # source://prism/lib/prism/node.rb#3480 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader conditions: Array[Node] + # attr_reader conditions: Array[Prism::node] # - # source://prism/lib/prism/node.rb#3600 + # source://prism/lib/prism/node.rb#3510 sig { returns(T::Array[Prism::Node]) } def conditions; end # attr_reader consequent: ElseNode? # - # source://prism/lib/prism/node.rb#3603 + # source://prism/lib/prism/node.rb#3513 sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end - # def copy: (**params) -> CaseNode + # def copy: (?predicate: Prism::node?, ?conditions: Array[Prism::node], ?consequent: ElseNode?, ?case_keyword_loc: Location, ?end_keyword_loc: Location, ?location: Location) -> CaseNode # - # source://prism/lib/prism/node.rb#3576 - sig { params(params: T.untyped).returns(Prism::CaseNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3494 + sig do + params( + predicate: T.nilable(Prism::Node), + conditions: T::Array[Prism::Node], + consequent: T.nilable(Prism::ElseNode), + case_keyword_loc: Prism::Location, + end_keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3557 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3475 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#3592 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3502 + 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#3624 + # source://prism/lib/prism/node.rb#3535 sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3612 + # source://prism/lib/prism/node.rb#3523 sig { returns(Prism::Location) } def end_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#3629 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3540 + sig { override.returns(String) } + def inspect; end - # attr_reader predicate: Node? + # attr_reader predicate: Prism::node? # - # source://prism/lib/prism/node.rb#3597 + # source://prism/lib/prism/node.rb#3507 sig { returns(T.nilable(Prism::Node)) } def predicate; end @@ -3728,7 +4513,8 @@ class Prism::CaseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3663 + # source://prism/lib/prism/node.rb#3558 + sig { override.returns(Symbol) } def type; end class << self @@ -3739,7 +4525,7 @@ class Prism::CaseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3673 + # source://prism/lib/prism/node.rb#3568 def type; end end end @@ -3749,128 +4535,162 @@ end # class Foo end # ^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3682 +# source://prism/lib/prism/node.rb#3589 class Prism::ClassNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Node constant_path, Location? inheritance_operator_loc, Node? superclass, Node? body, Location end_keyword_loc, Symbol name, Location location) -> void + # 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 # # @return [ClassNode] a new instance of ClassNode # - # source://prism/lib/prism/node.rb#3684 - def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); end + # source://prism/lib/prism/node.rb#3591 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end + def initialize(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location); 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#3733 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3699 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3605 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # attr_reader body: Prism::node? # - # source://prism/lib/prism/node.rb#3774 + # source://prism/lib/prism/node.rb#3671 sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3704 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3610 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def class_keyword: () -> String # - # source://prism/lib/prism/node.rb#3787 + # source://prism/lib/prism/node.rb#3684 sig { returns(String) } def class_keyword; end # attr_reader class_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3750 + # source://prism/lib/prism/node.rb#3645 sig { returns(Prism::Location) } def class_keyword_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#3718 + # source://prism/lib/prism/node.rb#3624 + 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#3709 + # source://prism/lib/prism/node.rb#3615 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader constant_path: Node + # attr_reader constant_path: Prism::node # - # source://prism/lib/prism/node.rb#3756 + # source://prism/lib/prism/node.rb#3652 sig { returns(Prism::Node) } def constant_path; end - # def copy: (**params) -> ClassNode + # 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 # - # source://prism/lib/prism/node.rb#3723 - sig { params(params: T.untyped).returns(Prism::ClassNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3629 + sig do + params( + locals: T::Array[Symbol], + class_keyword_loc: Prism::Location, + constant_path: Prism::Node, + inheritance_operator_loc: T.nilable(Prism::Location), + superclass: T.nilable(Prism::Node), + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3704 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3610 + 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: Node, inheritance_operator_loc: Location?, superclass: Node?, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#3742 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3637 + 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#3797 + # source://prism/lib/prism/node.rb#3694 sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/node.rb#3777 + # source://prism/lib/prism/node.rb#3674 sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def inheritance_operator: () -> String? # - # source://prism/lib/prism/node.rb#3792 + # source://prism/lib/prism/node.rb#3689 sig { returns(T.nilable(String)) } def inheritance_operator; end # attr_reader inheritance_operator_loc: Location? # - # source://prism/lib/prism/node.rb#3759 + # source://prism/lib/prism/node.rb#3655 sig { returns(T.nilable(Prism::Location)) } def inheritance_operator_loc; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#3802 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3699 + sig { override.returns(String) } + def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism/lib/prism/node.rb#3747 + # source://prism/lib/prism/node.rb#3642 sig { returns(T::Array[Symbol]) } def locals; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#3783 + # source://prism/lib/prism/node.rb#3681 sig { returns(Symbol) } def name; end - # attr_reader superclass: Node? + # attr_reader superclass: Prism::node? # - # source://prism/lib/prism/node.rb#3771 + # source://prism/lib/prism/node.rb#3668 sig { returns(T.nilable(Prism::Node)) } def superclass; end @@ -3889,7 +4709,8 @@ class Prism::ClassNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3840 + # source://prism/lib/prism/node.rb#3717 + sig { override.returns(Symbol) } def type; end class << self @@ -3900,7 +4721,7 @@ class Prism::ClassNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3850 + # source://prism/lib/prism/node.rb#3727 def type; end end end @@ -3910,89 +4731,115 @@ end # @@target &&= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3859 +# source://prism/lib/prism/node.rb#3751 class Prism::ClassVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ClassVariableAndWriteNode] a new instance of ClassVariableAndWriteNode # - # source://prism/lib/prism/node.rb#3861 + # source://prism/lib/prism/node.rb#3753 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#3855 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3872 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3763 + 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#3877 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3768 + 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#3887 + # source://prism/lib/prism/node.rb#3778 + 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#3882 + # source://prism/lib/prism/node.rb#3773 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableAndWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableAndWriteNode # - # source://prism/lib/prism/node.rb#3892 - sig { params(params: T.untyped).returns(Prism::ClassVariableAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3783 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3877 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3768 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#3907 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3791 + 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#125 + # source://prism/lib/prism/desugar_compiler.rb#127 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#3936 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3821 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#3912 + # source://prism/lib/prism/node.rb#3796 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#3915 + # source://prism/lib/prism/node.rb#3799 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#3931 + # source://prism/lib/prism/node.rb#3816 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#3921 + # source://prism/lib/prism/node.rb#3806 sig { returns(Prism::Location) } def operator_loc; end @@ -4011,12 +4858,13 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#3960 + # source://prism/lib/prism/node.rb#3839 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#3927 + # source://prism/lib/prism/node.rb#3813 sig { returns(Prism::Node) } def value; end @@ -4028,7 +4876,7 @@ class Prism::ClassVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#3970 + # source://prism/lib/prism/node.rb#3849 def type; end end end @@ -4038,90 +4886,130 @@ end # @@target += value # ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#3979 +# source://prism/lib/prism/node.rb#3868 class Prism::ClassVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void # # @return [ClassVariableOperatorWriteNode] a new instance of ClassVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#3981 - def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # source://prism/lib/prism/node.rb#3870 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); 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#3971 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#3993 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3881 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader binary_operator: Symbol + # + # source://prism/lib/prism/node.rb#3934 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#3924 + sig { returns(Prism::Location) } + def binary_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3998 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3886 + 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#4008 + # source://prism/lib/prism/node.rb#3896 + 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#4003 + # source://prism/lib/prism/node.rb#3891 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableOperatorWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#4013 - sig { params(params: T.untyped).returns(Prism::ClassVariableOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#3901 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#3998 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#3886 + 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: Node, operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#4029 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#3909 + 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#137 + # source://prism/lib/prism/desugar_compiler.rb#139 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4056 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#3937 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4034 + # source://prism/lib/prism/node.rb#3914 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#4037 + # source://prism/lib/prism/node.rb#3917 sig { returns(Prism::Location) } def name_loc; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#4052 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#339 def operator; end - # attr_reader operator_loc: Location + # 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.rb#4043 - sig { returns(Prism::Location) } + # source://prism/lib/prism/node_ext.rb#346 def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -4139,12 +5027,13 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4081 + # source://prism/lib/prism/node.rb#3955 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4049 + # source://prism/lib/prism/node.rb#3931 sig { returns(Prism::Node) } def value; end @@ -4156,7 +5045,7 @@ class Prism::ClassVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4091 + # source://prism/lib/prism/node.rb#3965 def type; end end end @@ -4166,89 +5055,115 @@ end # @@target ||= value # ^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4100 +# source://prism/lib/prism/node.rb#3985 class Prism::ClassVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ClassVariableOrWriteNode] a new instance of ClassVariableOrWriteNode # - # source://prism/lib/prism/node.rb#4102 + # source://prism/lib/prism/node.rb#3987 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#4089 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4113 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#3997 + 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#4118 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4002 + 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#4128 + # source://prism/lib/prism/node.rb#4012 + 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#4123 + # source://prism/lib/prism/node.rb#4007 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableOrWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ClassVariableOrWriteNode # - # source://prism/lib/prism/node.rb#4133 - sig { params(params: T.untyped).returns(Prism::ClassVariableOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4017 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4118 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4002 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#4148 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4025 + 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#131 + # source://prism/lib/prism/desugar_compiler.rb#133 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4177 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4055 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4153 + # source://prism/lib/prism/node.rb#4030 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#4156 + # source://prism/lib/prism/node.rb#4033 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#4172 + # source://prism/lib/prism/node.rb#4050 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#4162 + # source://prism/lib/prism/node.rb#4040 sig { returns(Prism::Location) } def operator_loc; end @@ -4267,12 +5182,13 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4201 + # source://prism/lib/prism/node.rb#4073 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4168 + # source://prism/lib/prism/node.rb#4047 sig { returns(Prism::Node) } def value; end @@ -4284,7 +5200,7 @@ class Prism::ClassVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4211 + # source://prism/lib/prism/node.rb#4083 def type; end end end @@ -4294,64 +5210,73 @@ end # @@foo # ^^^^^ # -# source://prism/lib/prism/node.rb#4220 +# source://prism/lib/prism/node.rb#4102 class Prism::ClassVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableReadNode] a new instance of ClassVariableReadNode # - # source://prism/lib/prism/node.rb#4222 + # source://prism/lib/prism/node.rb#4104 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#4185 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4230 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4111 + 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#4235 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4116 + 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#4245 + # source://prism/lib/prism/node.rb#4126 + 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#4240 + # source://prism/lib/prism/node.rb#4121 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableReadNode + # def copy: (?name: Symbol, ?location: Location) -> ClassVariableReadNode # - # source://prism/lib/prism/node.rb#4250 - sig { params(params: T.untyped).returns(Prism::ClassVariableReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4131 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4235 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4116 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#4262 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4139 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4275 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4151 + sig { override.returns(String) } + def inspect; end # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # @@ -4359,7 +5284,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # @@_test # name `:@@_test` # - # source://prism/lib/prism/node.rb#4271 + # source://prism/lib/prism/node.rb#4148 sig { returns(Symbol) } def name; end @@ -4378,7 +5303,8 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4295 + # source://prism/lib/prism/node.rb#4169 + sig { override.returns(Symbol) } def type; end class << self @@ -4389,7 +5315,7 @@ class Prism::ClassVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4305 + # source://prism/lib/prism/node.rb#4179 def type; end end end @@ -4399,68 +5325,77 @@ end # @@foo, @@bar = baz # ^^^^^ ^^^^^ # -# source://prism/lib/prism/node.rb#4314 +# source://prism/lib/prism/node.rb#4195 class Prism::ClassVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ClassVariableTargetNode] a new instance of ClassVariableTargetNode # - # source://prism/lib/prism/node.rb#4316 + # source://prism/lib/prism/node.rb#4197 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#4274 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4324 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4204 + 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#4329 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4209 + 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#4339 + # source://prism/lib/prism/node.rb#4219 + 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#4334 + # source://prism/lib/prism/node.rb#4214 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableTargetNode + # def copy: (?name: Symbol, ?location: Location) -> ClassVariableTargetNode # - # source://prism/lib/prism/node.rb#4344 - sig { params(params: T.untyped).returns(Prism::ClassVariableTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4224 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ClassVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4329 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4209 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#4356 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4232 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4365 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4240 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4361 + # source://prism/lib/prism/node.rb#4237 sig { returns(Symbol) } def name; end @@ -4479,7 +5414,8 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4385 + # source://prism/lib/prism/node.rb#4258 + sig { override.returns(Symbol) } def type; end class << self @@ -4490,7 +5426,7 @@ class Prism::ClassVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4395 + # source://prism/lib/prism/node.rb#4268 def type; end end end @@ -4500,87 +5436,123 @@ end # @@foo = 1 # ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4404 +# source://prism/lib/prism/node.rb#4284 class Prism::ClassVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Node value, Location? operator_loc, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [ClassVariableWriteNode] a new instance of ClassVariableWriteNode # - # source://prism/lib/prism/node.rb#4406 + # source://prism/lib/prism/node.rb#4286 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); 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#4404 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4417 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4296 + 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#4422 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4301 + 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#4432 + # source://prism/lib/prism/node.rb#4311 + 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#4427 + # source://prism/lib/prism/node.rb#4306 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ClassVariableWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ClassVariableWriteNode # - # source://prism/lib/prism/node.rb#4437 - sig { params(params: T.untyped).returns(Prism::ClassVariableWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4316 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4422 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4301 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#4452 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4324 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4487 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4370 + sig { override.returns(String) } + def inspect; end - # attr_reader name: Symbol + # The name of the class variable, which is a `@@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # - # source://prism/lib/prism/node.rb#4457 + # @@abc = 123 # name `@@abc` + # + # @@_test = :test # name `@@_test` + # + # source://prism/lib/prism/node.rb#4333 sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the variable name. + # + # @@foo = :bar + # ^^^^^ # - # source://prism/lib/prism/node.rb#4460 + # source://prism/lib/prism/node.rb#4339 sig { returns(Prism::Location) } def name_loc; end - # def operator: () -> String? + # def operator: () -> String # - # source://prism/lib/prism/node.rb#4482 - sig { returns(T.nilable(String)) } + # source://prism/lib/prism/node.rb#4365 + sig { returns(String) } def operator; end - # attr_reader operator_loc: Location? + # The location of the `=` operator. # - # source://prism/lib/prism/node.rb#4469 - sig { returns(T.nilable(Prism::Location)) } + # @@foo = :bar + # ^ + # + # source://prism/lib/prism/node.rb#4358 + sig { returns(Prism::Location) } def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -4598,12 +5570,19 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4511 + # source://prism/lib/prism/node.rb#4388 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # The value to write to the class variable. This 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#4466 + # @@foo = :bar + # ^^^^ + # + # @@_xyz = 123 + # ^^^ + # + # source://prism/lib/prism/node.rb#4352 sig { returns(Prism::Node) } def value; end @@ -4615,7 +5594,7 @@ class Prism::ClassVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4521 + # source://prism/lib/prism/node.rb#4398 def type; end end end @@ -4623,27 +5602,37 @@ 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#258 +# source://prism/lib/prism/parse_result.rb#366 class Prism::Comment + abstract! + # Create a new comment object with the given location. # # @return [Comment] a new instance of Comment # - # source://prism/lib/prism/parse_result.rb#263 + # source://prism/lib/prism/parse_result.rb#371 + 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#268 + # source://prism/lib/prism/parse_result.rb#376 + 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#260 + # source://prism/lib/prism/parse_result.rb#368 sig { returns(Prism::Location) } def location; end - sig { returns(T::Boolean) } + # Returns the content of the comment by slicing it from the source code. + # + # source://prism/lib/prism/parse_result.rb#381 + sig { returns(String) } + def slice; end + + sig { abstract.returns(T::Boolean) } def trailing?; end end @@ -4664,909 +5653,930 @@ end # Prism.parse("1 + 2").value.accept(SExpressions.new) # # => [:program, [[[:call, [[:integer], [:arguments, [[:integer]]]]]]]] # -# source://prism/lib/prism/compiler.rb#26 -class Prism::Compiler +# source://prism/lib/prism/compiler.rb#27 +class Prism::Compiler < ::Prism::Visitor # Visit an individual node. # - # source://prism/lib/prism/compiler.rb#28 + # source://prism/lib/prism/compiler.rb#29 + sig { params(node: T.nilable(Prism::Node)).returns(T.untyped) } def visit(node); end # Visit the child nodes of the given node. # Compile a AliasGlobalVariableNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_alias_global_variable_node(node); end # Visit the child nodes of the given node. # Compile a AliasMethodNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_alias_method_node(node); end # Visit a list of nodes. # - # source://prism/lib/prism/compiler.rb#33 + # source://prism/lib/prism/compiler.rb#34 + sig { params(nodes: T::Array[T.nilable(Prism::Node)]).returns(T::Array[T.untyped]) } def visit_all(nodes); end # Visit the child nodes of the given node. # Compile a AlternationPatternNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_alternation_pattern_node(node); end # Visit the child nodes of the given node. # Compile a AndNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_and_node(node); end # Visit the child nodes of the given node. # Compile a ArgumentsNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_arguments_node(node); end # Visit the child nodes of the given node. # Compile a ArrayNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_array_node(node); end # Visit the child nodes of the given node. # Compile a ArrayPatternNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_array_pattern_node(node); end # Visit the child nodes of the given node. # Compile a AssocNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_assoc_node(node); end # Visit the child nodes of the given node. # Compile a AssocSplatNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_assoc_splat_node(node); end # Visit the child nodes of the given node. # Compile a BackReferenceReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_back_reference_read_node(node); end # Visit the child nodes of the given node. # Compile a BeginNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_begin_node(node); end # Visit the child nodes of the given node. # Compile a BlockArgumentNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_block_argument_node(node); end # Visit the child nodes of the given node. # Compile a BlockLocalVariableNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_block_local_variable_node(node); end # Visit the child nodes of the given node. # Compile a BlockNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_block_node(node); end # Visit the child nodes of the given node. # Compile a BlockParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_block_parameter_node(node); end # Visit the child nodes of the given node. # Compile a BlockParametersNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_block_parameters_node(node); end # Visit the child nodes of the given node. # Compile a BreakNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_break_node(node); end # Visit the child nodes of the given node. # Compile a CallAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_call_and_write_node(node); end # Visit the child nodes of the given node. # Compile a CallNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_call_node(node); end # Visit the child nodes of the given node. # Compile a CallOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_call_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a CallOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_call_or_write_node(node); end # Visit the child nodes of the given node. # Compile a CallTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_call_target_node(node); end # Visit the child nodes of the given node. # Compile a CapturePatternNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_capture_pattern_node(node); end # Visit the child nodes of the given node. # Compile a CaseMatchNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_case_match_node(node); end # Visit the child nodes of the given node. # Compile a CaseNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_case_node(node); end # Visit the child nodes of the given node. # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 + sig { params(node: Prism::Node).returns(T::Array[T.untyped]) } def visit_child_nodes(node); end # Visit the child nodes of the given node. # Compile a ClassNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a ClassVariableWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_class_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_and_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_or_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_target_node(node); end # Visit the child nodes of the given node. # Compile a ConstantPathWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_path_write_node(node); end # Visit the child nodes of the given node. # Compile a ConstantReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_read_node(node); end # Visit the child nodes of the given node. # Compile a ConstantTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_target_node(node); end # Visit the child nodes of the given node. # Compile a ConstantWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_constant_write_node(node); end # Visit the child nodes of the given node. # Compile a DefNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_def_node(node); end # Visit the child nodes of the given node. # Compile a DefinedNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_defined_node(node); end # Visit the child nodes of the given node. # Compile a ElseNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_else_node(node); end # Visit the child nodes of the given node. # Compile a EmbeddedStatementsNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_embedded_statements_node(node); end # Visit the child nodes of the given node. # Compile a EmbeddedVariableNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_embedded_variable_node(node); end # Visit the child nodes of the given node. # Compile a EnsureNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_ensure_node(node); end # Visit the child nodes of the given node. # Compile a FalseNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_false_node(node); end # Visit the child nodes of the given node. # Compile a FindPatternNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_find_pattern_node(node); end # Visit the child nodes of the given node. # Compile a FlipFlopNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_flip_flop_node(node); end # Visit the child nodes of the given node. # Compile a FloatNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_float_node(node); end # Visit the child nodes of the given node. # Compile a ForNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_for_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingArgumentsNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_forwarding_arguments_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_forwarding_parameter_node(node); end # Visit the child nodes of the given node. # Compile a ForwardingSuperNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_forwarding_super_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a GlobalVariableWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_global_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a HashNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_hash_node(node); end # Visit the child nodes of the given node. # Compile a HashPatternNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_hash_pattern_node(node); end # Visit the child nodes of the given node. # Compile a IfNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_if_node(node); end # Visit the child nodes of the given node. # Compile a ImaginaryNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_imaginary_node(node); end # Visit the child nodes of the given node. # Compile a ImplicitNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_implicit_node(node); end # Visit the child nodes of the given node. # Compile a ImplicitRestNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_implicit_rest_node(node); end # Visit the child nodes of the given node. # Compile a InNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_in_node(node); end # Visit the child nodes of the given node. # Compile a IndexAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_index_and_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_index_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_index_or_write_node(node); end # Visit the child nodes of the given node. # Compile a IndexTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_index_target_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a InstanceVariableWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_instance_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a IntegerNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_integer_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedMatchLastLineNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_interpolated_match_last_line_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedRegularExpressionNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_interpolated_regular_expression_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedStringNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_interpolated_string_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedSymbolNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_interpolated_symbol_node(node); end # Visit the child nodes of the given node. # Compile a InterpolatedXStringNode node # - # source://prism/lib/prism/compiler.rb#38 + # 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 + # + # source://prism/lib/prism/compiler.rb#39 + def visit_it_parameters_node(node); end + # Visit the child nodes of the given node. # Compile a KeywordHashNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_keyword_hash_node(node); end # Visit the child nodes of the given node. # Compile a KeywordRestParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_keyword_rest_parameter_node(node); end # Visit the child nodes of the given node. # Compile a LambdaNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_lambda_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableAndWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_and_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableOperatorWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_operator_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableOrWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_or_write_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_read_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_target_node(node); end # Visit the child nodes of the given node. # Compile a LocalVariableWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_local_variable_write_node(node); end # Visit the child nodes of the given node. # Compile a MatchLastLineNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_match_last_line_node(node); end # Visit the child nodes of the given node. # Compile a MatchPredicateNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_match_predicate_node(node); end # Visit the child nodes of the given node. # Compile a MatchRequiredNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_match_required_node(node); end # Visit the child nodes of the given node. # Compile a MatchWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_match_write_node(node); end # Visit the child nodes of the given node. # Compile a MissingNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_missing_node(node); end # Visit the child nodes of the given node. # Compile a ModuleNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_module_node(node); end # Visit the child nodes of the given node. # Compile a MultiTargetNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_multi_target_node(node); end # Visit the child nodes of the given node. # Compile a MultiWriteNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_multi_write_node(node); end # Visit the child nodes of the given node. # Compile a NextNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_next_node(node); end # Visit the child nodes of the given node. # Compile a NilNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_nil_node(node); end # Visit the child nodes of the given node. # Compile a NoKeywordsParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_no_keywords_parameter_node(node); end # Visit the child nodes of the given node. # Compile a NumberedParametersNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_numbered_parameters_node(node); end # Visit the child nodes of the given node. # Compile a NumberedReferenceReadNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_numbered_reference_read_node(node); end # Visit the child nodes of the given node. # Compile a OptionalKeywordParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_optional_keyword_parameter_node(node); end # Visit the child nodes of the given node. # Compile a OptionalParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_optional_parameter_node(node); end # Visit the child nodes of the given node. # Compile a OrNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_or_node(node); end # Visit the child nodes of the given node. # Compile a ParametersNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_parameters_node(node); end # Visit the child nodes of the given node. # Compile a ParenthesesNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_parentheses_node(node); end # Visit the child nodes of the given node. # Compile a PinnedExpressionNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_pinned_expression_node(node); end # Visit the child nodes of the given node. # Compile a PinnedVariableNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_pinned_variable_node(node); end # Visit the child nodes of the given node. # Compile a PostExecutionNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_post_execution_node(node); end # Visit the child nodes of the given node. # Compile a PreExecutionNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_pre_execution_node(node); end # Visit the child nodes of the given node. # Compile a ProgramNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_program_node(node); end # Visit the child nodes of the given node. # Compile a RangeNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_range_node(node); end # Visit the child nodes of the given node. # Compile a RationalNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_rational_node(node); end # Visit the child nodes of the given node. # Compile a RedoNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_redo_node(node); end # Visit the child nodes of the given node. # Compile a RegularExpressionNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_regular_expression_node(node); end # Visit the child nodes of the given node. # Compile a RequiredKeywordParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_required_keyword_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RequiredParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_required_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RescueModifierNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_rescue_modifier_node(node); end # Visit the child nodes of the given node. # Compile a RescueNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_rescue_node(node); end # Visit the child nodes of the given node. # Compile a RestParameterNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_rest_parameter_node(node); end # Visit the child nodes of the given node. # Compile a RetryNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_retry_node(node); end # Visit the child nodes of the given node. # Compile a ReturnNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_return_node(node); end # Visit the child nodes of the given node. # Compile a SelfNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_self_node(node); end + # Visit the child nodes of the given node. + # Compile a ShareableConstantNode node + # + # source://prism/lib/prism/compiler.rb#39 + def visit_shareable_constant_node(node); end + # Visit the child nodes of the given node. # Compile a SingletonClassNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_singleton_class_node(node); end # Visit the child nodes of the given node. # Compile a SourceEncodingNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_source_encoding_node(node); end # Visit the child nodes of the given node. # Compile a SourceFileNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_source_file_node(node); end # Visit the child nodes of the given node. # Compile a SourceLineNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_source_line_node(node); end # Visit the child nodes of the given node. # Compile a SplatNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_splat_node(node); end # Visit the child nodes of the given node. # Compile a StatementsNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_statements_node(node); end # Visit the child nodes of the given node. # Compile a StringNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_string_node(node); end # Visit the child nodes of the given node. # Compile a SuperNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_super_node(node); end # Visit the child nodes of the given node. # Compile a SymbolNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_symbol_node(node); end # Visit the child nodes of the given node. # Compile a TrueNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_true_node(node); end # Visit the child nodes of the given node. # Compile a UndefNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_undef_node(node); end # Visit the child nodes of the given node. # Compile a UnlessNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_unless_node(node); end # Visit the child nodes of the given node. # Compile a UntilNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_until_node(node); end # Visit the child nodes of the given node. # Compile a WhenNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_when_node(node); end # Visit the child nodes of the given node. # Compile a WhileNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_while_node(node); end # Visit the child nodes of the given node. # Compile a XStringNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_x_string_node(node); end # Visit the child nodes of the given node. # Compile a YieldNode node # - # source://prism/lib/prism/compiler.rb#38 + # source://prism/lib/prism/compiler.rb#39 def visit_yield_node(node); end end @@ -5575,89 +6585,115 @@ end # Target &&= value # ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4530 +# source://prism/lib/prism/node.rb#4417 class Prism::ConstantAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantAndWriteNode] a new instance of ConstantAndWriteNode # - # source://prism/lib/prism/node.rb#4532 + # source://prism/lib/prism/node.rb#4419 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#4521 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4543 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4429 + 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#4548 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4434 + 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#4558 + # source://prism/lib/prism/node.rb#4444 + 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#4553 + # source://prism/lib/prism/node.rb#4439 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantAndWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantAndWriteNode # - # source://prism/lib/prism/node.rb#4563 - sig { params(params: T.untyped).returns(Prism::ConstantAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4449 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4548 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4434 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#4578 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4457 + 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#143 + # source://prism/lib/prism/desugar_compiler.rb#145 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4607 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4487 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4583 + # source://prism/lib/prism/node.rb#4462 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#4586 + # source://prism/lib/prism/node.rb#4465 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#4602 + # source://prism/lib/prism/node.rb#4482 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#4592 + # source://prism/lib/prism/node.rb#4472 sig { returns(Prism::Location) } def operator_loc; end @@ -5676,12 +6712,13 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4631 + # source://prism/lib/prism/node.rb#4505 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4598 + # source://prism/lib/prism/node.rb#4479 sig { returns(Prism::Node) } def value; end @@ -5693,7 +6730,7 @@ class Prism::ConstantAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4641 + # source://prism/lib/prism/node.rb#4515 def type; end end end @@ -5703,90 +6740,130 @@ end # Target += value # ^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4650 +# source://prism/lib/prism/node.rb#4534 class Prism::ConstantOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void # # @return [ConstantOperatorWriteNode] a new instance of ConstantOperatorWriteNode # - # source://prism/lib/prism/node.rb#4652 - def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # source://prism/lib/prism/node.rb#4536 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); 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#4637 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4664 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4547 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader binary_operator: Symbol + # + # source://prism/lib/prism/node.rb#4600 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#4590 + sig { returns(Prism::Location) } + def binary_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4669 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4552 + 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#4679 + # source://prism/lib/prism/node.rb#4562 + 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#4674 + # source://prism/lib/prism/node.rb#4557 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantOperatorWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode # - # source://prism/lib/prism/node.rb#4684 - sig { params(params: T.untyped).returns(Prism::ConstantOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4567 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4669 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4552 + 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: Node, operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#4700 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4575 + 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#155 + # source://prism/lib/prism/desugar_compiler.rb#157 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4727 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4603 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4705 + # source://prism/lib/prism/node.rb#4580 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#4708 + # source://prism/lib/prism/node.rb#4583 sig { returns(Prism::Location) } def name_loc; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#4723 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#355 def operator; end - # attr_reader operator_loc: Location + # 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.rb#4714 - sig { returns(Prism::Location) } + # 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 @@ -5804,12 +6881,13 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4752 + # source://prism/lib/prism/node.rb#4621 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4720 + # source://prism/lib/prism/node.rb#4597 sig { returns(Prism::Node) } def value; end @@ -5821,7 +6899,7 @@ class Prism::ConstantOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4762 + # source://prism/lib/prism/node.rb#4631 def type; end end end @@ -5831,89 +6909,115 @@ end # Target ||= value # ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4771 +# source://prism/lib/prism/node.rb#4651 class Prism::ConstantOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantOrWriteNode] a new instance of ConstantOrWriteNode # - # source://prism/lib/prism/node.rb#4773 + # source://prism/lib/prism/node.rb#4653 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#4755 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4784 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4663 + 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#4789 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4668 + 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#4799 + # source://prism/lib/prism/node.rb#4678 + 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#4794 + # source://prism/lib/prism/node.rb#4673 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantOrWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantOrWriteNode # - # source://prism/lib/prism/node.rb#4804 - sig { params(params: T.untyped).returns(Prism::ConstantOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4683 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4789 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4668 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#4819 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4691 + 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#149 + # source://prism/lib/prism/desugar_compiler.rb#151 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4848 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4721 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#4824 + # source://prism/lib/prism/node.rb#4696 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#4827 + # source://prism/lib/prism/node.rb#4699 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#4843 + # source://prism/lib/prism/node.rb#4716 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#4833 + # source://prism/lib/prism/node.rb#4706 sig { returns(Prism::Location) } def operator_loc; end @@ -5932,12 +7036,13 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4872 + # source://prism/lib/prism/node.rb#4739 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4839 + # source://prism/lib/prism/node.rb#4713 sig { returns(Prism::Node) } def value; end @@ -5949,7 +7054,7 @@ class Prism::ConstantOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4882 + # source://prism/lib/prism/node.rb#4749 def type; end end end @@ -5959,80 +7064,104 @@ end # Parent::Child &&= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#4891 +# source://prism/lib/prism/node.rb#4768 class Prism::ConstantPathAndWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathAndWriteNode] a new instance of ConstantPathAndWriteNode # - # source://prism/lib/prism/node.rb#4893 + # source://prism/lib/prism/node.rb#4770 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); 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#4864 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#4903 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4779 + 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#4908 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4784 + 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#4918 + # source://prism/lib/prism/node.rb#4794 + 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#4913 + # source://prism/lib/prism/node.rb#4789 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathAndWriteNode + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathAndWriteNode # - # source://prism/lib/prism/node.rb#4923 - sig { params(params: T.untyped).returns(Prism::ConstantPathAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4799 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#4908 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4784 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#4937 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4807 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#4960 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#4830 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#4955 + # source://prism/lib/prism/node.rb#4825 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#4945 + # source://prism/lib/prism/node.rb#4815 sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism/lib/prism/node.rb#4942 + # source://prism/lib/prism/node.rb#4812 sig { returns(Prism::ConstantPathNode) } def target; end @@ -6051,12 +7180,13 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#4984 + # source://prism/lib/prism/node.rb#4848 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#4951 + # source://prism/lib/prism/node.rb#4822 sig { returns(Prism::Node) } def value; end @@ -6068,7 +7198,7 @@ class Prism::ConstantPathAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#4994 + # source://prism/lib/prism/node.rb#4858 def type; end end end @@ -6078,97 +7208,159 @@ end # Foo::Bar # ^^^^^^^^ # -# source://prism/lib/prism/node.rb#5003 +# source://prism/lib/prism/node.rb#4876 class Prism::ConstantPathNode < ::Prism::Node - # def initialize: (Node? parent, Node child, Location delimiter_loc, Location location) -> void + # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void # # @return [ConstantPathNode] a new instance of ConstantPathNode # - # source://prism/lib/prism/node.rb#5005 - def initialize(source, parent, child, delimiter_loc, location); end + # source://prism/lib/prism/node.rb#4878 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, parent, name, delimiter_loc, name_loc, location); 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#5003 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5015 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#4888 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader child: Node + # Previously, we had a child node on this class that contained either a + # constant read or a missing node. To not cause a breaking change, we + # continue to supply that API. # - # source://prism/lib/prism/node.rb#5060 - sig { returns(Prism::Node) } + # source://prism/lib/prism/node_ext.rb#196 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5020 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4893 + 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#5033 + # source://prism/lib/prism/node.rb#4905 + 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#5025 + # source://prism/lib/prism/node.rb#4898 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathNode + # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathNode # - # source://prism/lib/prism/node.rb#5038 - sig { params(params: T.untyped).returns(Prism::ConstantPathNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#4910 + sig do + params( + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5020 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#4893 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Node?, child: Node, delimiter_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#5052 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#4918 + 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#5070 + # source://prism/lib/prism/node.rb#4964 sig { returns(String) } def delimiter; end - # attr_reader delimiter_loc: Location + # The location of the `::` delimiter. + # + # ::Foo + # ^^ + # + # One::Two + # ^^ # - # source://prism/lib/prism/node.rb#5063 + # source://prism/lib/prism/node.rb#4944 sig { returns(Prism::Location) } def delimiter_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns the full name of this constant path. For example: "Foo::Bar" # - # source://prism/lib/prism/node_ext.rb#129 + # source://prism/lib/prism/node_ext.rb#189 + 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#112 + # source://prism/lib/prism/node_ext.rb#167 + sig { returns(T::Array[Symbol]) } def full_name_parts; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String + # + # source://prism/lib/prism/node.rb#4969 + 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#4935 + sig { returns(T.nilable(Symbol)) } + def name; end + + # The location of the name of the constant. # - # source://prism/lib/prism/node.rb#5075 - def inspect(inspector = T.unsafe(nil)); end + # ::Foo + # ^^^ + # + # One::Two + # ^^^ + # + # source://prism/lib/prism/node.rb#4957 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader parent: Node? + # The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree. + # + # Foo::Bar + # ^^^ # - # source://prism/lib/prism/node.rb#5057 + # self::Test + # ^^^^ + # + # a.b::C + # ^^^ + # + # source://prism/lib/prism/node.rb#4932 sig { returns(T.nilable(Prism::Node)) } def parent; end @@ -6187,7 +7379,8 @@ class Prism::ConstantPathNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5103 + # source://prism/lib/prism/node.rb#4987 + sig { override.returns(Symbol) } def type; end class << self @@ -6198,7 +7391,7 @@ class Prism::ConstantPathNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5113 + # source://prism/lib/prism/node.rb#4997 def type; end end end @@ -6210,88 +7403,133 @@ end # var::Bar::Baz -> raises because the first part of the constant path is a # local variable # -# source://prism/lib/prism/node_ext.rb#108 +# source://prism/lib/prism/node_ext.rb#158 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#163 +class Prism::ConstantPathNode::MissingNodesInConstantPathError < ::StandardError; end + # Represents assigning to a constant path using an operator that isn't `=`. # # Parent::Child += value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#5122 +# source://prism/lib/prism/node.rb#5016 class Prism::ConstantPathOperatorWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Symbol operator, Location location) -> void + # def initialize: (ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void # # @return [ConstantPathOperatorWriteNode] a new instance of ConstantPathOperatorWriteNode # - # source://prism/lib/prism/node.rb#5124 - def initialize(source, target, operator_loc, value, operator, location); end + # source://prism/lib/prism/node.rb#5018 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, target, binary_operator_loc, value, binary_operator, location); 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#5111 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5135 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5028 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader binary_operator: Symbol + # + # source://prism/lib/prism/node.rb#5074 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#5064 + sig { returns(Prism::Location) } + def binary_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5140 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5033 + 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#5150 + # source://prism/lib/prism/node.rb#5043 + 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#5145 + # source://prism/lib/prism/node.rb#5038 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathOperatorWriteNode + # def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode # - # source://prism/lib/prism/node.rb#5155 - sig { params(params: T.untyped).returns(Prism::ConstantPathOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5048 + sig do + params( + target: Prism::ConstantPathNode, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5140 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5033 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#5170 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5056 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#5191 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5077 + sig { override.returns(String) } + def inspect; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#5187 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#371 def operator; end - # attr_reader operator_loc: Location + # 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.rb#5178 - sig { returns(Prism::Location) } + # source://prism/lib/prism/node_ext.rb#378 def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism/lib/prism/node.rb#5175 + # source://prism/lib/prism/node.rb#5061 sig { returns(Prism::ConstantPathNode) } def target; end @@ -6310,12 +7548,13 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5216 + # source://prism/lib/prism/node.rb#5095 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#5184 + # source://prism/lib/prism/node.rb#5071 sig { returns(Prism::Node) } def value; end @@ -6327,7 +7566,7 @@ class Prism::ConstantPathOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5226 + # source://prism/lib/prism/node.rb#5105 def type; end end end @@ -6337,80 +7576,104 @@ end # Parent::Child ||= value # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#5235 +# source://prism/lib/prism/node.rb#5124 class Prism::ConstantPathOrWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathOrWriteNode] a new instance of ConstantPathOrWriteNode # - # source://prism/lib/prism/node.rb#5237 + # source://prism/lib/prism/node.rb#5126 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); 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#5220 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5247 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5135 + 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#5252 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5140 + 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#5262 + # source://prism/lib/prism/node.rb#5150 + 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#5257 + # source://prism/lib/prism/node.rb#5145 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathOrWriteNode + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathOrWriteNode # - # source://prism/lib/prism/node.rb#5267 - sig { params(params: T.untyped).returns(Prism::ConstantPathOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5155 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5252 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#5281 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5163 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#5304 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5186 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#5299 + # source://prism/lib/prism/node.rb#5181 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#5289 + # source://prism/lib/prism/node.rb#5171 sig { returns(Prism::Location) } def operator_loc; end # attr_reader target: ConstantPathNode # - # source://prism/lib/prism/node.rb#5286 + # source://prism/lib/prism/node.rb#5168 sig { returns(Prism::ConstantPathNode) } def target; end @@ -6429,12 +7692,13 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5328 + # source://prism/lib/prism/node.rb#5204 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#5295 + # source://prism/lib/prism/node.rb#5178 sig { returns(Prism::Node) } def value; end @@ -6446,7 +7710,7 @@ class Prism::ConstantPathOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5338 + # source://prism/lib/prism/node.rb#5214 def type; end end end @@ -6456,97 +7720,138 @@ end # Foo::Foo, Bar::Bar = baz # ^^^^^^^^ ^^^^^^^^ # -# source://prism/lib/prism/node.rb#5347 +# source://prism/lib/prism/node.rb#5232 class Prism::ConstantPathTargetNode < ::Prism::Node - # def initialize: (Node? parent, Node child, Location delimiter_loc, Location location) -> void + # def initialize: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, Location location) -> void # # @return [ConstantPathTargetNode] a new instance of ConstantPathTargetNode # - # source://prism/lib/prism/node.rb#5349 - def initialize(source, parent, child, delimiter_loc, location); end + # source://prism/lib/prism/node.rb#5234 + sig do + params( + source: Prism::Source, + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, parent, name, delimiter_loc, name_loc, location); 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#5338 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5359 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5244 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader child: Node + # Previously, we had a child node on this class that contained either a + # constant read or a missing node. To not cause a breaking change, we + # continue to supply that API. # - # source://prism/lib/prism/node.rb#5404 - sig { returns(Prism::Node) } + # source://prism/lib/prism/node_ext.rb#232 def child; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5364 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5249 + 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#5377 + # source://prism/lib/prism/node.rb#5261 + 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#5369 + # source://prism/lib/prism/node.rb#5254 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathTargetNode + # def copy: (?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location, ?location: Location) -> ConstantPathTargetNode # - # source://prism/lib/prism/node.rb#5382 - sig { params(params: T.untyped).returns(Prism::ConstantPathTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5266 + sig do + params( + parent: T.nilable(Prism::Node), + name: T.nilable(Symbol), + delimiter_loc: Prism::Location, + name_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5364 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5249 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Node?, child: Node, delimiter_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#5396 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5274 + 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#5414 + # source://prism/lib/prism/node.rb#5299 sig { returns(String) } def delimiter; end # attr_reader delimiter_loc: Location # - # source://prism/lib/prism/node.rb#5407 + # source://prism/lib/prism/node.rb#5285 sig { returns(Prism::Location) } def delimiter_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # Returns 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#225 + 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#137 + # source://prism/lib/prism/node_ext.rb#205 + sig { returns(T::Array[Symbol]) } def full_name_parts; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String + # + # source://prism/lib/prism/node.rb#5304 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol? + # + # source://prism/lib/prism/node.rb#5282 + sig { returns(T.nilable(Symbol)) } + def name; end + + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#5419 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5292 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader parent: Node? + # attr_reader parent: Prism::node? # - # source://prism/lib/prism/node.rb#5401 + # source://prism/lib/prism/node.rb#5279 sig { returns(T.nilable(Prism::Node)) } def parent; end @@ -6565,7 +7870,8 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5447 + # source://prism/lib/prism/node.rb#5322 + sig { override.returns(Symbol) } def type; end class << self @@ -6576,7 +7882,7 @@ class Prism::ConstantPathTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5457 + # source://prism/lib/prism/node.rb#5332 def type; end end end @@ -6592,80 +7898,113 @@ end # ::Foo::Bar = 1 # ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#5472 +# source://prism/lib/prism/node.rb#5357 class Prism::ConstantPathWriteNode < ::Prism::Node - # def initialize: (ConstantPathNode target, Location operator_loc, Node value, Location location) -> void + # def initialize: (ConstantPathNode target, Location operator_loc, Prism::node value, Location location) -> void # # @return [ConstantPathWriteNode] a new instance of ConstantPathWriteNode # - # source://prism/lib/prism/node.rb#5474 + # source://prism/lib/prism/node.rb#5359 + sig do + params( + source: Prism::Source, + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, target, operator_loc, value, location); 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#5465 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5484 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5368 + 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#5489 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5373 + 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#5499 + # source://prism/lib/prism/node.rb#5383 + 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#5494 + # source://prism/lib/prism/node.rb#5378 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantPathWriteNode + # def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> ConstantPathWriteNode # - # source://prism/lib/prism/node.rb#5504 - sig { params(params: T.untyped).returns(Prism::ConstantPathWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5388 + sig do + params( + target: Prism::ConstantPathNode, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5489 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5373 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#5518 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5396 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#5541 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5431 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#5536 + # source://prism/lib/prism/node.rb#5426 sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. # - # source://prism/lib/prism/node.rb#5526 + # ::ABC = 123 + # ^ + # + # source://prism/lib/prism/node.rb#5413 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader target: ConstantPathNode + # A node representing the constant path being written to. # - # source://prism/lib/prism/node.rb#5523 + # Foo::Bar = 1 + # ^^^^^^^^ + # + # ::Foo = :abc + # ^^^^^ + # + # source://prism/lib/prism/node.rb#5407 sig { returns(Prism::ConstantPathNode) } def target; end @@ -6684,12 +8023,16 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5565 + # source://prism/lib/prism/node.rb#5449 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # The value to write to the constant path. 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#5532 + # FOO::BAR = :abc + # ^^^^ + # + # source://prism/lib/prism/node.rb#5423 sig { returns(Prism::Node) } def value; end @@ -6701,7 +8044,7 @@ class Prism::ConstantPathWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5575 + # source://prism/lib/prism/node.rb#5459 def type; end end end @@ -6711,75 +8054,86 @@ end # Foo # ^^^ # -# source://prism/lib/prism/node.rb#5584 +# source://prism/lib/prism/node.rb#5477 class Prism::ConstantReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ConstantReadNode] a new instance of ConstantReadNode # - # source://prism/lib/prism/node.rb#5586 + # source://prism/lib/prism/node.rb#5479 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#5560 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5594 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5486 + 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#5599 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5491 + 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#5609 + # source://prism/lib/prism/node.rb#5501 + 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#5604 + # source://prism/lib/prism/node.rb#5496 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantReadNode + # def copy: (?name: Symbol, ?location: Location) -> ConstantReadNode # - # source://prism/lib/prism/node.rb#5614 - sig { params(params: T.untyped).returns(Prism::ConstantReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5506 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5599 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5491 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#5626 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5514 + 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 + # Returns the full name of this constant. For example: "Foo" # - # source://prism/lib/prism/node_ext.rb#96 + # source://prism/lib/prism/node_ext.rb#133 + 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#91 + # source://prism/lib/prism/node_ext.rb#128 + sig { returns(T::Array[Symbol]) } def full_name_parts; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#5639 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5526 + sig { override.returns(String) } + def inspect; end # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). # @@ -6787,7 +8141,7 @@ class Prism::ConstantReadNode < ::Prism::Node # # SOME_CONSTANT # name `:SOME_CONSTANT` # - # source://prism/lib/prism/node.rb#5635 + # source://prism/lib/prism/node.rb#5523 sig { returns(Symbol) } def name; end @@ -6806,7 +8160,8 @@ class Prism::ConstantReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5659 + # source://prism/lib/prism/node.rb#5544 + sig { override.returns(Symbol) } def type; end class << self @@ -6817,7 +8172,7 @@ class Prism::ConstantReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5669 + # source://prism/lib/prism/node.rb#5554 def type; end end end @@ -6827,79 +8182,90 @@ end # Foo, Bar = baz # ^^^ ^^^ # -# source://prism/lib/prism/node.rb#5678 +# source://prism/lib/prism/node.rb#5570 class Prism::ConstantTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [ConstantTargetNode] a new instance of ConstantTargetNode # - # source://prism/lib/prism/node.rb#5680 + # source://prism/lib/prism/node.rb#5572 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#5649 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5688 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5579 + 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#5693 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5584 + 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#5703 + # source://prism/lib/prism/node.rb#5594 + 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#5698 + # source://prism/lib/prism/node.rb#5589 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantTargetNode + # def copy: (?name: Symbol, ?location: Location) -> ConstantTargetNode # - # source://prism/lib/prism/node.rb#5708 - sig { params(params: T.untyped).returns(Prism::ConstantTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5599 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::ConstantTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5693 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5584 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#5720 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5607 + 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 + # Returns the full name of this constant. For example: "Foo" # - # source://prism/lib/prism/node_ext.rb#165 + # source://prism/lib/prism/node_ext.rb#246 + 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#160 + # source://prism/lib/prism/node_ext.rb#241 + sig { returns(T::Array[Symbol]) } def full_name_parts; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#5729 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5615 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#5725 + # source://prism/lib/prism/node.rb#5612 sig { returns(Symbol) } def name; end @@ -6918,7 +8284,8 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5749 + # source://prism/lib/prism/node.rb#5633 + sig { override.returns(Symbol) } def type; end class << self @@ -6929,7 +8296,7 @@ class Prism::ConstantTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5759 + # source://prism/lib/prism/node.rb#5643 def type; end end end @@ -6939,86 +8306,135 @@ end # Foo = 1 # ^^^^^^^ # -# source://prism/lib/prism/node.rb#5768 +# source://prism/lib/prism/node.rb#5659 class Prism::ConstantWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [ConstantWriteNode] a new instance of ConstantWriteNode # - # source://prism/lib/prism/node.rb#5770 + # source://prism/lib/prism/node.rb#5661 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); 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#5779 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5781 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5671 + 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#5786 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5676 + 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#5796 + # source://prism/lib/prism/node.rb#5686 + 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#5791 + # source://prism/lib/prism/node.rb#5681 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ConstantWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> ConstantWriteNode # - # source://prism/lib/prism/node.rb#5801 - sig { params(params: T.untyped).returns(Prism::ConstantWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5691 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5786 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5676 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#5816 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5699 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Returns the full name of this constant. For example: "Foo" # - # source://prism/lib/prism/node.rb#5845 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node_ext.rb#146 + sig { returns(String) } + def full_name; end - # attr_reader name: Symbol + # Returns the list of parts for the full name of this constant. + # For example: [:Foo] + # + # source://prism/lib/prism/node_ext.rb#141 + sig { returns(T::Array[Symbol]) } + def full_name_parts; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#5745 + sig { override.returns(String) } + def inspect; end + + # The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants). + # + # Foo = :bar # name `:Foo` # - # source://prism/lib/prism/node.rb#5821 + # XYZ = 1 # name `:XYZ` + # + # source://prism/lib/prism/node.rb#5708 sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the constant name. + # + # FOO = 1 + # ^^^ # - # source://prism/lib/prism/node.rb#5824 + # source://prism/lib/prism/node.rb#5714 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#5840 + # source://prism/lib/prism/node.rb#5740 sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. + # + # FOO = :bar + # ^ # - # source://prism/lib/prism/node.rb#5833 + # source://prism/lib/prism/node.rb#5733 sig { returns(Prism::Location) } def operator_loc; end @@ -7037,12 +8453,19 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#5869 + # source://prism/lib/prism/node.rb#5763 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # FOO = :bar + # ^^^^ # - # source://prism/lib/prism/node.rb#5830 + # MyClass = Class.new + # ^^^^^^^^^ + # + # source://prism/lib/prism/node.rb#5727 sig { returns(Prism::Node) } def value; end @@ -7054,22 +8477,21 @@ class Prism::ConstantWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#5879 + # source://prism/lib/prism/node.rb#5773 def type; end end end -class Prism::DATAComment < Prism::Comment; end - # The DSL module provides a set of methods that can be used to create prism # nodes in a more concise manner. For example, instead of writing: # -# source = Prism::Source.new("[1]") +# source = Prism::Source.for("[1]") # # Prism::ArrayNode.new( # [ # Prism::IntegerNode.new( # Prism::IntegerBaseFlags::DECIMAL, +# 1, # Prism::Location.new(source, 1, 1), # source # ) @@ -7081,10 +8503,10 @@ class Prism::DATAComment < Prism::Comment; end # # you could instead write: # -# source = Prism::Source.new("[1]") +# source = Prism::Source.for("[1]") # # ArrayNode( -# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1)), source), +# IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source), # Location(source, 0, 1), # Location(source, 2, 1), # source @@ -7093,1002 +8515,983 @@ class Prism::DATAComment < Prism::Comment; end # This is mostly helpful in the context of writing tests, but can also be used # to generate trees programmatically. # -# source://prism/lib/prism/dsl.rb#40 +# source://prism/lib/prism/dsl.rb#42 module Prism::DSL private # Create a new AliasGlobalVariableNode node # - # source://prism/lib/prism/dsl.rb#49 + # source://prism/lib/prism/dsl.rb#51 def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AliasMethodNode node # - # source://prism/lib/prism/dsl.rb#54 + # source://prism/lib/prism/dsl.rb#56 def AliasMethodNode(new_name, old_name, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AlternationPatternNode node # - # source://prism/lib/prism/dsl.rb#59 + # source://prism/lib/prism/dsl.rb#61 def AlternationPatternNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AndNode node # - # source://prism/lib/prism/dsl.rb#64 + # source://prism/lib/prism/dsl.rb#66 def AndNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArgumentsNode node # - # source://prism/lib/prism/dsl.rb#69 + # source://prism/lib/prism/dsl.rb#71 def ArgumentsNode(flags, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArrayNode node # - # source://prism/lib/prism/dsl.rb#74 + # source://prism/lib/prism/dsl.rb#76 def ArrayNode(flags, elements, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ArrayPatternNode node # - # source://prism/lib/prism/dsl.rb#79 + # 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 # Create a new AssocNode node # - # source://prism/lib/prism/dsl.rb#84 + # source://prism/lib/prism/dsl.rb#86 def AssocNode(key, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new AssocSplatNode node # - # source://prism/lib/prism/dsl.rb#89 + # source://prism/lib/prism/dsl.rb#91 def AssocSplatNode(value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BackReferenceReadNode node # - # source://prism/lib/prism/dsl.rb#94 + # source://prism/lib/prism/dsl.rb#96 def BackReferenceReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BeginNode node # - # source://prism/lib/prism/dsl.rb#99 + # 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 # Create a new BlockArgumentNode node # - # source://prism/lib/prism/dsl.rb#104 + # source://prism/lib/prism/dsl.rb#106 def BlockArgumentNode(expression, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockLocalVariableNode node # - # source://prism/lib/prism/dsl.rb#109 + # source://prism/lib/prism/dsl.rb#111 def BlockLocalVariableNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockNode node # - # source://prism/lib/prism/dsl.rb#114 + # 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 # Create a new BlockParameterNode node # - # source://prism/lib/prism/dsl.rb#119 + # source://prism/lib/prism/dsl.rb#121 def BlockParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BlockParametersNode node # - # source://prism/lib/prism/dsl.rb#124 + # source://prism/lib/prism/dsl.rb#126 def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new BreakNode node # - # source://prism/lib/prism/dsl.rb#129 + # source://prism/lib/prism/dsl.rb#131 def BreakNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CallAndWriteNode node # - # source://prism/lib/prism/dsl.rb#134 + # 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 # Create a new CallNode node # - # source://prism/lib/prism/dsl.rb#139 + # 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 # Create a new CallOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#144 - def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new CallOrWriteNode node # - # source://prism/lib/prism/dsl.rb#149 + # 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 # Create a new CallTargetNode node # - # source://prism/lib/prism/dsl.rb#154 + # 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 # Create a new CapturePatternNode node # - # source://prism/lib/prism/dsl.rb#159 + # source://prism/lib/prism/dsl.rb#161 def CapturePatternNode(value, target, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new CaseMatchNode node # - # source://prism/lib/prism/dsl.rb#164 + # 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 # Create a new CaseNode node # - # source://prism/lib/prism/dsl.rb#169 + # 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 # Create a new ClassNode node # - # source://prism/lib/prism/dsl.rb#174 + # 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#179 + # 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#184 - def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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#189 + # 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#194 + # source://prism/lib/prism/dsl.rb#196 def ClassVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableTargetNode node # - # source://prism/lib/prism/dsl.rb#199 + # source://prism/lib/prism/dsl.rb#201 def ClassVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ClassVariableWriteNode node # - # source://prism/lib/prism/dsl.rb#204 + # source://prism/lib/prism/dsl.rb#206 def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantAndWriteNode node # - # source://prism/lib/prism/dsl.rb#209 + # source://prism/lib/prism/dsl.rb#211 def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#214 - def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new ConstantOrWriteNode node # - # source://prism/lib/prism/dsl.rb#219 + # source://prism/lib/prism/dsl.rb#221 def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathAndWriteNode node # - # source://prism/lib/prism/dsl.rb#224 + # source://prism/lib/prism/dsl.rb#226 def ConstantPathAndWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathNode node # - # source://prism/lib/prism/dsl.rb#229 - def ConstantPathNode(parent, child, delimiter_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#231 + def ConstantPathNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#234 - def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new ConstantPathOrWriteNode node # - # source://prism/lib/prism/dsl.rb#239 + # source://prism/lib/prism/dsl.rb#241 def ConstantPathOrWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathTargetNode node # - # source://prism/lib/prism/dsl.rb#244 - def ConstantPathTargetNode(parent, child, delimiter_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#246 + def ConstantPathTargetNode(parent, name, delimiter_loc, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantPathWriteNode node # - # source://prism/lib/prism/dsl.rb#249 + # source://prism/lib/prism/dsl.rb#251 def ConstantPathWriteNode(target, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantReadNode node # - # source://prism/lib/prism/dsl.rb#254 + # source://prism/lib/prism/dsl.rb#256 def ConstantReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantTargetNode node # - # source://prism/lib/prism/dsl.rb#259 + # source://prism/lib/prism/dsl.rb#261 def ConstantTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ConstantWriteNode node # - # source://prism/lib/prism/dsl.rb#264 + # source://prism/lib/prism/dsl.rb#266 def ConstantWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new DefNode node # - # source://prism/lib/prism/dsl.rb#269 + # 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 # Create a new DefinedNode node # - # source://prism/lib/prism/dsl.rb#274 + # 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 # Create a new ElseNode node # - # source://prism/lib/prism/dsl.rb#279 + # 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 # Create a new EmbeddedStatementsNode node # - # source://prism/lib/prism/dsl.rb#284 + # source://prism/lib/prism/dsl.rb#286 def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new EmbeddedVariableNode node # - # source://prism/lib/prism/dsl.rb#289 + # source://prism/lib/prism/dsl.rb#291 def EmbeddedVariableNode(operator_loc, variable, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new EnsureNode node # - # source://prism/lib/prism/dsl.rb#294 + # 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 # Create a new FalseNode node # - # source://prism/lib/prism/dsl.rb#299 + # source://prism/lib/prism/dsl.rb#301 def FalseNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FindPatternNode node # - # source://prism/lib/prism/dsl.rb#304 + # 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 # Create a new FlipFlopNode node # - # source://prism/lib/prism/dsl.rb#309 + # source://prism/lib/prism/dsl.rb#311 def FlipFlopNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new FloatNode node # - # source://prism/lib/prism/dsl.rb#314 - def FloatNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#316 + def FloatNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForNode node # - # source://prism/lib/prism/dsl.rb#319 + # 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 # Create a new ForwardingArgumentsNode node # - # source://prism/lib/prism/dsl.rb#324 + # source://prism/lib/prism/dsl.rb#326 def ForwardingArgumentsNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForwardingParameterNode node # - # source://prism/lib/prism/dsl.rb#329 + # source://prism/lib/prism/dsl.rb#331 def ForwardingParameterNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ForwardingSuperNode node # - # source://prism/lib/prism/dsl.rb#334 + # source://prism/lib/prism/dsl.rb#336 def ForwardingSuperNode(block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableAndWriteNode node # - # source://prism/lib/prism/dsl.rb#339 + # source://prism/lib/prism/dsl.rb#341 def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new GlobalVariableOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#344 - def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new GlobalVariableOrWriteNode node # - # source://prism/lib/prism/dsl.rb#349 + # 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#354 + # 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#359 + # 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#364 + # source://prism/lib/prism/dsl.rb#366 def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new HashNode node # - # source://prism/lib/prism/dsl.rb#369 + # source://prism/lib/prism/dsl.rb#371 def HashNode(opening_loc, elements, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new HashPatternNode node # - # source://prism/lib/prism/dsl.rb#374 + # 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 # Create a new IfNode node # - # source://prism/lib/prism/dsl.rb#379 + # 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 # Create a new ImaginaryNode node # - # source://prism/lib/prism/dsl.rb#384 + # source://prism/lib/prism/dsl.rb#386 def ImaginaryNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ImplicitNode node # - # source://prism/lib/prism/dsl.rb#389 + # source://prism/lib/prism/dsl.rb#391 def ImplicitNode(value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ImplicitRestNode node # - # source://prism/lib/prism/dsl.rb#394 + # source://prism/lib/prism/dsl.rb#396 def ImplicitRestNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InNode node # - # source://prism/lib/prism/dsl.rb#399 + # source://prism/lib/prism/dsl.rb#401 def InNode(pattern, statements, in_loc, then_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IndexAndWriteNode node # - # source://prism/lib/prism/dsl.rb#404 + # 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 # Create a new IndexOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#409 - def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new IndexOrWriteNode node # - # source://prism/lib/prism/dsl.rb#414 + # 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 # Create a new IndexTargetNode node # - # source://prism/lib/prism/dsl.rb#419 + # 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 # Create a new InstanceVariableAndWriteNode node # - # source://prism/lib/prism/dsl.rb#424 + # source://prism/lib/prism/dsl.rb#426 def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#429 - def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, source = T.unsafe(nil), location = T.unsafe(nil)); end + # 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 # Create a new InstanceVariableOrWriteNode node # - # source://prism/lib/prism/dsl.rb#434 + # source://prism/lib/prism/dsl.rb#436 def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableReadNode node # - # source://prism/lib/prism/dsl.rb#439 + # source://prism/lib/prism/dsl.rb#441 def InstanceVariableReadNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableTargetNode node # - # source://prism/lib/prism/dsl.rb#444 + # source://prism/lib/prism/dsl.rb#446 def InstanceVariableTargetNode(name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InstanceVariableWriteNode node # - # source://prism/lib/prism/dsl.rb#449 + # source://prism/lib/prism/dsl.rb#451 def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new IntegerNode node # - # source://prism/lib/prism/dsl.rb#454 - def IntegerNode(flags, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#456 + def IntegerNode(flags, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedMatchLastLineNode node # - # source://prism/lib/prism/dsl.rb#459 + # source://prism/lib/prism/dsl.rb#461 def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedRegularExpressionNode node # - # source://prism/lib/prism/dsl.rb#464 + # source://prism/lib/prism/dsl.rb#466 def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedStringNode node # - # source://prism/lib/prism/dsl.rb#469 - def InterpolatedStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#471 + def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedSymbolNode node # - # source://prism/lib/prism/dsl.rb#474 + # source://prism/lib/prism/dsl.rb#476 def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new InterpolatedXStringNode node # - # source://prism/lib/prism/dsl.rb#479 + # source://prism/lib/prism/dsl.rb#481 def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end + # Create a new ItLocalVariableReadNode node + # + # source://prism/lib/prism/dsl.rb#486 + def ItLocalVariableReadNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + + # Create a new ItParametersNode node + # + # source://prism/lib/prism/dsl.rb#491 + def ItParametersNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # Create a new KeywordHashNode node # - # source://prism/lib/prism/dsl.rb#484 + # source://prism/lib/prism/dsl.rb#496 def KeywordHashNode(flags, elements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new KeywordRestParameterNode node # - # source://prism/lib/prism/dsl.rb#489 + # source://prism/lib/prism/dsl.rb#501 def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LambdaNode node # - # source://prism/lib/prism/dsl.rb#494 + # source://prism/lib/prism/dsl.rb#506 def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableAndWriteNode node # - # source://prism/lib/prism/dsl.rb#499 + # source://prism/lib/prism/dsl.rb#511 def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableOperatorWriteNode node # - # source://prism/lib/prism/dsl.rb#504 - def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#516 + def LocalVariableOperatorWriteNode(name_loc, binary_operator_loc, value, name, binary_operator, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableOrWriteNode node # - # source://prism/lib/prism/dsl.rb#509 + # source://prism/lib/prism/dsl.rb#521 def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableReadNode node # - # source://prism/lib/prism/dsl.rb#514 + # source://prism/lib/prism/dsl.rb#526 def LocalVariableReadNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableTargetNode node # - # source://prism/lib/prism/dsl.rb#519 + # source://prism/lib/prism/dsl.rb#531 def LocalVariableTargetNode(name, depth, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new LocalVariableWriteNode node # - # source://prism/lib/prism/dsl.rb#524 + # source://prism/lib/prism/dsl.rb#536 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#44 + # source://prism/lib/prism/dsl.rb#46 def Location(source = T.unsafe(nil), start_offset = T.unsafe(nil), length = T.unsafe(nil)); end # Create a new MatchLastLineNode node # - # source://prism/lib/prism/dsl.rb#529 + # source://prism/lib/prism/dsl.rb#541 def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchPredicateNode node # - # source://prism/lib/prism/dsl.rb#534 + # source://prism/lib/prism/dsl.rb#546 def MatchPredicateNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchRequiredNode node # - # source://prism/lib/prism/dsl.rb#539 + # source://prism/lib/prism/dsl.rb#551 def MatchRequiredNode(value, pattern, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MatchWriteNode node # - # source://prism/lib/prism/dsl.rb#544 + # source://prism/lib/prism/dsl.rb#556 def MatchWriteNode(call, targets, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MissingNode node # - # source://prism/lib/prism/dsl.rb#549 + # source://prism/lib/prism/dsl.rb#561 def MissingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ModuleNode node # - # source://prism/lib/prism/dsl.rb#554 + # source://prism/lib/prism/dsl.rb#566 def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MultiTargetNode node # - # source://prism/lib/prism/dsl.rb#559 + # source://prism/lib/prism/dsl.rb#571 def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new MultiWriteNode node # - # source://prism/lib/prism/dsl.rb#564 + # source://prism/lib/prism/dsl.rb#576 def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NextNode node # - # source://prism/lib/prism/dsl.rb#569 + # source://prism/lib/prism/dsl.rb#581 def NextNode(arguments, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NilNode node # - # source://prism/lib/prism/dsl.rb#574 + # source://prism/lib/prism/dsl.rb#586 def NilNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NoKeywordsParameterNode node # - # source://prism/lib/prism/dsl.rb#579 + # source://prism/lib/prism/dsl.rb#591 def NoKeywordsParameterNode(operator_loc, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NumberedParametersNode node # - # source://prism/lib/prism/dsl.rb#584 + # source://prism/lib/prism/dsl.rb#596 def NumberedParametersNode(maximum, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new NumberedReferenceReadNode node # - # source://prism/lib/prism/dsl.rb#589 + # source://prism/lib/prism/dsl.rb#601 def NumberedReferenceReadNode(number, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OptionalKeywordParameterNode node # - # source://prism/lib/prism/dsl.rb#594 + # source://prism/lib/prism/dsl.rb#606 def OptionalKeywordParameterNode(flags, name, name_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OptionalParameterNode node # - # source://prism/lib/prism/dsl.rb#599 + # source://prism/lib/prism/dsl.rb#611 def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new OrNode node # - # source://prism/lib/prism/dsl.rb#604 + # source://prism/lib/prism/dsl.rb#616 def OrNode(left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ParametersNode node # - # source://prism/lib/prism/dsl.rb#609 + # source://prism/lib/prism/dsl.rb#621 def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ParenthesesNode node # - # source://prism/lib/prism/dsl.rb#614 + # source://prism/lib/prism/dsl.rb#626 def ParenthesesNode(body, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PinnedExpressionNode node # - # source://prism/lib/prism/dsl.rb#619 + # source://prism/lib/prism/dsl.rb#631 def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PinnedVariableNode node # - # source://prism/lib/prism/dsl.rb#624 + # source://prism/lib/prism/dsl.rb#636 def PinnedVariableNode(variable, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PostExecutionNode node # - # source://prism/lib/prism/dsl.rb#629 + # source://prism/lib/prism/dsl.rb#641 def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new PreExecutionNode node # - # source://prism/lib/prism/dsl.rb#634 + # source://prism/lib/prism/dsl.rb#646 def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ProgramNode node # - # source://prism/lib/prism/dsl.rb#639 + # source://prism/lib/prism/dsl.rb#651 def ProgramNode(locals, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RangeNode node # - # source://prism/lib/prism/dsl.rb#644 + # source://prism/lib/prism/dsl.rb#656 def RangeNode(flags, left, right, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RationalNode node # - # source://prism/lib/prism/dsl.rb#649 - def RationalNode(numeric, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#661 + def RationalNode(flags, numerator, denominator, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RedoNode node # - # source://prism/lib/prism/dsl.rb#654 + # source://prism/lib/prism/dsl.rb#666 def RedoNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RegularExpressionNode node # - # source://prism/lib/prism/dsl.rb#659 + # source://prism/lib/prism/dsl.rb#671 def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RequiredKeywordParameterNode node # - # source://prism/lib/prism/dsl.rb#664 + # source://prism/lib/prism/dsl.rb#676 def RequiredKeywordParameterNode(flags, name, name_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RequiredParameterNode node # - # source://prism/lib/prism/dsl.rb#669 + # source://prism/lib/prism/dsl.rb#681 def RequiredParameterNode(flags, name, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RescueModifierNode node # - # source://prism/lib/prism/dsl.rb#674 + # source://prism/lib/prism/dsl.rb#686 def RescueModifierNode(expression, keyword_loc, rescue_expression, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RescueNode node # - # source://prism/lib/prism/dsl.rb#679 + # source://prism/lib/prism/dsl.rb#691 def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RestParameterNode node # - # source://prism/lib/prism/dsl.rb#684 + # source://prism/lib/prism/dsl.rb#696 def RestParameterNode(flags, name, name_loc, operator_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new RetryNode node # - # source://prism/lib/prism/dsl.rb#689 + # source://prism/lib/prism/dsl.rb#701 def RetryNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new ReturnNode node # - # source://prism/lib/prism/dsl.rb#694 - def ReturnNode(keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#706 + def ReturnNode(flags, keyword_loc, arguments, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SelfNode node # - # source://prism/lib/prism/dsl.rb#699 + # source://prism/lib/prism/dsl.rb#711 def SelfNode(source = T.unsafe(nil), location = T.unsafe(nil)); end + # Create a new ShareableConstantNode node + # + # source://prism/lib/prism/dsl.rb#716 + def ShareableConstantNode(flags, write, source = T.unsafe(nil), location = T.unsafe(nil)); end + # Create a new SingletonClassNode node # - # source://prism/lib/prism/dsl.rb#704 + # source://prism/lib/prism/dsl.rb#721 def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceEncodingNode node # - # source://prism/lib/prism/dsl.rb#709 + # source://prism/lib/prism/dsl.rb#726 def SourceEncodingNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceFileNode node # - # source://prism/lib/prism/dsl.rb#714 - def SourceFileNode(filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#731 + def SourceFileNode(flags, filepath, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SourceLineNode node # - # source://prism/lib/prism/dsl.rb#719 + # source://prism/lib/prism/dsl.rb#736 def SourceLineNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SplatNode node # - # source://prism/lib/prism/dsl.rb#724 + # source://prism/lib/prism/dsl.rb#741 def SplatNode(operator_loc, expression, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new StatementsNode node # - # source://prism/lib/prism/dsl.rb#729 + # source://prism/lib/prism/dsl.rb#746 def StatementsNode(body, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new StringNode node # - # source://prism/lib/prism/dsl.rb#734 + # source://prism/lib/prism/dsl.rb#751 def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SuperNode node # - # source://prism/lib/prism/dsl.rb#739 + # source://prism/lib/prism/dsl.rb#756 def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new SymbolNode node # - # source://prism/lib/prism/dsl.rb#744 + # source://prism/lib/prism/dsl.rb#761 def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new TrueNode node # - # source://prism/lib/prism/dsl.rb#749 + # source://prism/lib/prism/dsl.rb#766 def TrueNode(source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UndefNode node # - # source://prism/lib/prism/dsl.rb#754 + # source://prism/lib/prism/dsl.rb#771 def UndefNode(names, keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UnlessNode node # - # source://prism/lib/prism/dsl.rb#759 + # source://prism/lib/prism/dsl.rb#776 def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new UntilNode node # - # source://prism/lib/prism/dsl.rb#764 + # source://prism/lib/prism/dsl.rb#781 def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new WhenNode node # - # source://prism/lib/prism/dsl.rb#769 - def WhenNode(keyword_loc, conditions, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end + # source://prism/lib/prism/dsl.rb#786 + def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new WhileNode node # - # source://prism/lib/prism/dsl.rb#774 + # source://prism/lib/prism/dsl.rb#791 def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new XStringNode node # - # source://prism/lib/prism/dsl.rb#779 + # source://prism/lib/prism/dsl.rb#796 def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = T.unsafe(nil), location = T.unsafe(nil)); end # Create a new YieldNode node # - # source://prism/lib/prism/dsl.rb#784 + # source://prism/lib/prism/dsl.rb#801 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 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 - end -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 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 - # - # 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 - # Represents a method definition. # # def method # end # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#5889 +# source://prism/lib/prism/node.rb#5793 class Prism::DefNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Node? receiver, ParametersNode? parameters, 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 + # 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 # - # source://prism/lib/prism/node.rb#5891 + # source://prism/lib/prism/node.rb#5795 + 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 + 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 + # 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#6008 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#5910 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#5813 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # attr_reader body: Prism::node? # - # source://prism/lib/prism/node.rb#5977 + # source://prism/lib/prism/node.rb#5866 sig { returns(T.nilable(Prism::Node)) } def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5915 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5818 + 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#5929 + # source://prism/lib/prism/node.rb#5832 + 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#5920 + # source://prism/lib/prism/node.rb#5823 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> DefNode + # 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 # - # source://prism/lib/prism/node.rb#5934 - sig { params(params: T.untyped).returns(Prism::DefNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#5837 + 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), + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#5915 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#5818 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: 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) -> { 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 } # - # source://prism/lib/prism/node.rb#5957 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#5845 + 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#6050 + # source://prism/lib/prism/node.rb#5944 sig { returns(String) } def def_keyword; end # attr_reader def_keyword_loc: Location # - # source://prism/lib/prism/node.rb#5983 + # source://prism/lib/prism/node.rb#5872 sig { returns(Prism::Location) } def def_keyword_loc; end # def end_keyword: () -> String? # - # source://prism/lib/prism/node.rb#6075 + # source://prism/lib/prism/node.rb#5969 sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism/lib/prism/node.rb#6037 + # source://prism/lib/prism/node.rb#5931 sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end # def equal: () -> String? # - # source://prism/lib/prism/node.rb#6070 + # source://prism/lib/prism/node.rb#5964 sig { returns(T.nilable(String)) } def equal; end # attr_reader equal_loc: Location? # - # source://prism/lib/prism/node.rb#6025 + # source://prism/lib/prism/node.rb#5918 sig { returns(T.nilable(Prism::Location)) } def equal_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6080 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#5974 + sig { override.returns(String) } + def inspect; end # attr_reader locals: Array[Symbol] # - # source://prism/lib/prism/node.rb#5980 + # source://prism/lib/prism/node.rb#5869 sig { returns(T::Array[Symbol]) } def locals; end # def lparen: () -> String? # - # source://prism/lib/prism/node.rb#6060 + # source://prism/lib/prism/node.rb#5954 sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism/lib/prism/node.rb#6001 + # source://prism/lib/prism/node.rb#5892 sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#5962 + # source://prism/lib/prism/node.rb#5850 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#5965 + # source://prism/lib/prism/node.rb#5853 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String? # - # source://prism/lib/prism/node.rb#6055 + # source://prism/lib/prism/node.rb#5949 sig { returns(T.nilable(String)) } def operator; end # attr_reader operator_loc: Location? # - # source://prism/lib/prism/node.rb#5989 + # source://prism/lib/prism/node.rb#5879 sig { returns(T.nilable(Prism::Location)) } def operator_loc; end # attr_reader parameters: ParametersNode? # - # source://prism/lib/prism/node.rb#5974 + # source://prism/lib/prism/node.rb#5863 sig { returns(T.nilable(Prism::ParametersNode)) } def parameters; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#5971 + # source://prism/lib/prism/node.rb#5860 sig { returns(T.nilable(Prism::Node)) } def receiver; end # def rparen: () -> String? # - # source://prism/lib/prism/node.rb#6065 + # source://prism/lib/prism/node.rb#5959 sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism/lib/prism/node.rb#6013 + # source://prism/lib/prism/node.rb#5905 sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end @@ -8107,7 +9510,8 @@ class Prism::DefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6126 + # source://prism/lib/prism/node.rb#5992 + sig { override.returns(Symbol) } def type; end class << self @@ -8118,7 +9522,7 @@ class Prism::DefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6136 + # source://prism/lib/prism/node.rb#6002 def type; end end end @@ -8128,98 +9532,124 @@ end # defined?(a) # ^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#6145 +# source://prism/lib/prism/node.rb#6030 class Prism::DefinedNode < ::Prism::Node - # def initialize: (Location? lparen_loc, Node value, Location? rparen_loc, Location keyword_loc, Location location) -> void + # def initialize: (Location? lparen_loc, Prism::node value, Location? rparen_loc, Location keyword_loc, Location location) -> void # # @return [DefinedNode] a new instance of DefinedNode # - # source://prism/lib/prism/node.rb#6147 + # source://prism/lib/prism/node.rb#6032 + sig do + params( + source: Prism::Source, + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, lparen_loc, value, rparen_loc, keyword_loc, location); 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#6160 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6158 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6042 + 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#6163 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6047 + 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#6173 + # source://prism/lib/prism/node.rb#6057 + 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#6168 + # source://prism/lib/prism/node.rb#6052 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> DefinedNode + # def copy: (?lparen_loc: Location?, ?value: Prism::node, ?rparen_loc: Location?, ?keyword_loc: Location, ?location: Location) -> DefinedNode # - # source://prism/lib/prism/node.rb#6178 - sig { params(params: T.untyped).returns(Prism::DefinedNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6062 + sig do + params( + lparen_loc: T.nilable(Prism::Location), + value: Prism::Node, + rparen_loc: T.nilable(Prism::Location), + keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6163 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6047 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Node, rparen_loc: Location?, keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { lparen_loc: Location?, value: Prism::node, rparen_loc: Location?, keyword_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#6193 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6070 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6247 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6126 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#6242 + # source://prism/lib/prism/node.rb#6121 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#6225 + # source://prism/lib/prism/node.rb#6104 sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism/lib/prism/node.rb#6232 + # source://prism/lib/prism/node.rb#6111 sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism/lib/prism/node.rb#6198 + # source://prism/lib/prism/node.rb#6075 sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism/lib/prism/node.rb#6237 + # source://prism/lib/prism/node.rb#6116 sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism/lib/prism/node.rb#6213 + # source://prism/lib/prism/node.rb#6091 sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end @@ -8238,12 +9668,13 @@ class Prism::DefinedNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6271 + # source://prism/lib/prism/node.rb#6144 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#6210 + # source://prism/lib/prism/node.rb#6088 sig { returns(Prism::Node) } def value; end @@ -8255,7 +9686,7 @@ class Prism::DefinedNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6281 + # source://prism/lib/prism/node.rb#6154 def type; end end end @@ -8301,7 +9732,7 @@ 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#216 +# source://prism/lib/prism/desugar_compiler.rb#218 class Prism::DesugarCompiler < ::Prism::MutationCompiler # @@foo &&= bar # @@ -8309,7 +9740,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo && @@foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#222 + # source://prism/lib/prism/desugar_compiler.rb#224 def visit_class_variable_and_write_node(node); end # @@foo += bar @@ -8318,7 +9749,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # @@foo = @@foo + bar # - # source://prism/lib/prism/desugar_compiler.rb#240 + # source://prism/lib/prism/desugar_compiler.rb#242 def visit_class_variable_operator_write_node(node); end # @@foo ||= bar @@ -8327,7 +9758,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(@@foo) ? @@foo : @@foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#231 + # source://prism/lib/prism/desugar_compiler.rb#233 def visit_class_variable_or_write_node(node); end # Foo &&= bar @@ -8336,7 +9767,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo && Foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#249 + # source://prism/lib/prism/desugar_compiler.rb#251 def visit_constant_and_write_node(node); end # Foo += bar @@ -8345,7 +9776,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # Foo = Foo + bar # - # source://prism/lib/prism/desugar_compiler.rb#267 + # source://prism/lib/prism/desugar_compiler.rb#269 def visit_constant_operator_write_node(node); end # Foo ||= bar @@ -8354,7 +9785,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?(Foo) ? Foo : Foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#258 + # source://prism/lib/prism/desugar_compiler.rb#260 def visit_constant_or_write_node(node); end # $foo &&= bar @@ -8363,7 +9794,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo && $foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#276 + # source://prism/lib/prism/desugar_compiler.rb#278 def visit_global_variable_and_write_node(node); end # $foo += bar @@ -8372,7 +9803,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # $foo = $foo + bar # - # source://prism/lib/prism/desugar_compiler.rb#294 + # source://prism/lib/prism/desugar_compiler.rb#296 def visit_global_variable_operator_write_node(node); end # $foo ||= bar @@ -8381,22 +9812,22 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # defined?($foo) ? $foo : $foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#285 + # source://prism/lib/prism/desugar_compiler.rb#287 def visit_global_variable_or_write_node(node); end # becomes # - # source://prism/lib/prism/desugar_compiler.rb#303 + # source://prism/lib/prism/desugar_compiler.rb#305 def visit_instance_variable_and_write_node(node); end # becomes # - # source://prism/lib/prism/desugar_compiler.rb#321 + # source://prism/lib/prism/desugar_compiler.rb#323 def visit_instance_variable_operator_write_node(node); end # becomes # - # source://prism/lib/prism/desugar_compiler.rb#312 + # source://prism/lib/prism/desugar_compiler.rb#314 def visit_instance_variable_or_write_node(node); end # foo &&= bar @@ -8405,7 +9836,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo && foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#330 + # source://prism/lib/prism/desugar_compiler.rb#332 def visit_local_variable_and_write_node(node); end # foo += bar @@ -8414,7 +9845,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo = foo + bar # - # source://prism/lib/prism/desugar_compiler.rb#348 + # source://prism/lib/prism/desugar_compiler.rb#350 def visit_local_variable_operator_write_node(node); end # foo ||= bar @@ -8423,7 +9854,7 @@ class Prism::DesugarCompiler < ::Prism::MutationCompiler # # foo || foo = bar # - # source://prism/lib/prism/desugar_compiler.rb#339 + # source://prism/lib/prism/desugar_compiler.rb#341 def visit_local_variable_or_write_node(node); end end @@ -8503,41 +9934,41 @@ class Prism::DesugarOrWriteDefinedNode def write_class; end end -# source://prism/lib/prism/desugar_compiler.rb#99 +# source://prism/lib/prism/desugar_compiler.rb#101 class Prism::DesugarOrWriteNode # @return [DesugarOrWriteNode] a new instance of DesugarOrWriteNode # - # source://prism/lib/prism/desugar_compiler.rb#102 + # source://prism/lib/prism/desugar_compiler.rb#104 def initialize(node, source, read_class, write_class, *arguments); end # Returns the value of attribute arguments. # - # source://prism/lib/prism/desugar_compiler.rb#100 + # source://prism/lib/prism/desugar_compiler.rb#102 def arguments; end # Desugar `x ||= y` to `x || x = y` # - # source://prism/lib/prism/desugar_compiler.rb#111 + # source://prism/lib/prism/desugar_compiler.rb#113 def compile; end # Returns the value of attribute node. # - # source://prism/lib/prism/desugar_compiler.rb#100 + # source://prism/lib/prism/desugar_compiler.rb#102 def node; end # Returns the value of attribute read_class. # - # source://prism/lib/prism/desugar_compiler.rb#100 + # source://prism/lib/prism/desugar_compiler.rb#102 def read_class; end # Returns the value of attribute source. # - # source://prism/lib/prism/desugar_compiler.rb#100 + # 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#100 + # source://prism/lib/prism/desugar_compiler.rb#102 def write_class; end end @@ -8572,2443 +10003,2491 @@ end # integer = result.value.statements.body.first.receiver.receiver # dispatcher.dispatch_once(integer) # -# source://prism/lib/prism/dispatcher.rb#40 +# source://prism/lib/prism/dispatcher.rb#41 class Prism::Dispatcher < ::Prism::Visitor # Initialize a new dispatcher. # # @return [Dispatcher] a new instance of Dispatcher # - # source://prism/lib/prism/dispatcher.rb#45 + # source://prism/lib/prism/dispatcher.rb#46 def initialize; end # Walks `root` dispatching events to all registered listeners. # # def dispatch: (Node) -> void # - # source://prism/lib/prism/visitor.rb#16 + # source://prism/lib/prism/visitor.rb#17 def dispatch(node); end # Dispatches a single event for `node` to all registered listeners. # # def dispatch_once: (Node) -> void # - # source://prism/lib/prism/dispatcher.rb#64 + # source://prism/lib/prism/dispatcher.rb#65 def dispatch_once(node); end # attr_reader listeners: Hash[Symbol, Array[Listener]] # - # source://prism/lib/prism/dispatcher.rb#42 + # source://prism/lib/prism/dispatcher.rb#43 def listeners; end # Register a listener for one or more events. # # def register: (Listener, *Symbol) -> void # - # source://prism/lib/prism/dispatcher.rb#52 + # source://prism/lib/prism/dispatcher.rb#53 def register(listener, *events); end # Dispatch enter and leave events for AliasGlobalVariableNode nodes and continue # walking the tree. # - # source://prism/lib/prism/dispatcher.rb#70 + # source://prism/lib/prism/dispatcher.rb#71 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#78 + # source://prism/lib/prism/dispatcher.rb#79 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#86 + # source://prism/lib/prism/dispatcher.rb#87 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#94 + # source://prism/lib/prism/dispatcher.rb#95 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#102 + # source://prism/lib/prism/dispatcher.rb#103 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#110 + # source://prism/lib/prism/dispatcher.rb#111 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#118 + # source://prism/lib/prism/dispatcher.rb#119 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#126 + # source://prism/lib/prism/dispatcher.rb#127 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#134 + # source://prism/lib/prism/dispatcher.rb#135 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#142 + # source://prism/lib/prism/dispatcher.rb#143 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#150 + # source://prism/lib/prism/dispatcher.rb#151 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#158 + # source://prism/lib/prism/dispatcher.rb#159 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#166 + # source://prism/lib/prism/dispatcher.rb#167 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#174 + # source://prism/lib/prism/dispatcher.rb#175 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#182 + # source://prism/lib/prism/dispatcher.rb#183 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#190 + # source://prism/lib/prism/dispatcher.rb#191 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#198 + # source://prism/lib/prism/dispatcher.rb#199 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#206 + # source://prism/lib/prism/dispatcher.rb#207 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#214 + # source://prism/lib/prism/dispatcher.rb#215 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#222 + # source://prism/lib/prism/dispatcher.rb#223 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#230 + # source://prism/lib/prism/dispatcher.rb#231 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#238 + # source://prism/lib/prism/dispatcher.rb#239 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#246 + # source://prism/lib/prism/dispatcher.rb#247 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#254 + # source://prism/lib/prism/dispatcher.rb#255 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#262 + # source://prism/lib/prism/dispatcher.rb#263 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#270 + # source://prism/lib/prism/dispatcher.rb#271 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#278 + # source://prism/lib/prism/dispatcher.rb#279 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#286 + # source://prism/lib/prism/dispatcher.rb#287 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#294 + # source://prism/lib/prism/dispatcher.rb#295 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#302 + # source://prism/lib/prism/dispatcher.rb#303 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#310 + # source://prism/lib/prism/dispatcher.rb#311 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#318 + # source://prism/lib/prism/dispatcher.rb#319 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#326 + # source://prism/lib/prism/dispatcher.rb#327 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#334 + # source://prism/lib/prism/dispatcher.rb#335 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#342 + # source://prism/lib/prism/dispatcher.rb#343 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#350 + # source://prism/lib/prism/dispatcher.rb#351 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#358 + # source://prism/lib/prism/dispatcher.rb#359 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#366 + # source://prism/lib/prism/dispatcher.rb#367 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#374 + # source://prism/lib/prism/dispatcher.rb#375 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#382 + # source://prism/lib/prism/dispatcher.rb#383 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#390 + # source://prism/lib/prism/dispatcher.rb#391 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#398 + # source://prism/lib/prism/dispatcher.rb#399 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#406 + # source://prism/lib/prism/dispatcher.rb#407 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#414 + # source://prism/lib/prism/dispatcher.rb#415 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#422 + # source://prism/lib/prism/dispatcher.rb#423 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#430 + # source://prism/lib/prism/dispatcher.rb#431 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#438 + # source://prism/lib/prism/dispatcher.rb#439 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#446 + # source://prism/lib/prism/dispatcher.rb#447 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#454 + # source://prism/lib/prism/dispatcher.rb#455 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#462 + # source://prism/lib/prism/dispatcher.rb#463 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#470 + # source://prism/lib/prism/dispatcher.rb#471 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#478 + # source://prism/lib/prism/dispatcher.rb#479 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#486 + # source://prism/lib/prism/dispatcher.rb#487 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#494 + # source://prism/lib/prism/dispatcher.rb#495 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#502 + # source://prism/lib/prism/dispatcher.rb#503 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#510 + # source://prism/lib/prism/dispatcher.rb#511 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#518 + # source://prism/lib/prism/dispatcher.rb#519 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#526 + # source://prism/lib/prism/dispatcher.rb#527 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#534 + # source://prism/lib/prism/dispatcher.rb#535 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#542 + # source://prism/lib/prism/dispatcher.rb#543 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#550 + # source://prism/lib/prism/dispatcher.rb#551 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#558 + # source://prism/lib/prism/dispatcher.rb#559 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#566 + # source://prism/lib/prism/dispatcher.rb#567 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#574 + # source://prism/lib/prism/dispatcher.rb#575 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#582 + # source://prism/lib/prism/dispatcher.rb#583 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#590 + # source://prism/lib/prism/dispatcher.rb#591 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#598 + # source://prism/lib/prism/dispatcher.rb#599 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#606 + # source://prism/lib/prism/dispatcher.rb#607 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#614 + # source://prism/lib/prism/dispatcher.rb#615 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#622 + # source://prism/lib/prism/dispatcher.rb#623 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#630 + # source://prism/lib/prism/dispatcher.rb#631 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#638 + # source://prism/lib/prism/dispatcher.rb#639 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#646 + # source://prism/lib/prism/dispatcher.rb#647 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#654 + # source://prism/lib/prism/dispatcher.rb#655 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#662 + # source://prism/lib/prism/dispatcher.rb#663 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#670 + # source://prism/lib/prism/dispatcher.rb#671 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#678 + # source://prism/lib/prism/dispatcher.rb#679 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#686 + # source://prism/lib/prism/dispatcher.rb#687 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#694 + # source://prism/lib/prism/dispatcher.rb#695 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#702 + # source://prism/lib/prism/dispatcher.rb#703 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#710 + # source://prism/lib/prism/dispatcher.rb#711 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#718 + # source://prism/lib/prism/dispatcher.rb#719 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#726 + # source://prism/lib/prism/dispatcher.rb#727 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#734 + # source://prism/lib/prism/dispatcher.rb#735 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#742 + # source://prism/lib/prism/dispatcher.rb#743 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#750 + # source://prism/lib/prism/dispatcher.rb#751 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#758 + # source://prism/lib/prism/dispatcher.rb#759 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#767 + 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#775 + 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#766 + # source://prism/lib/prism/dispatcher.rb#783 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#774 + # source://prism/lib/prism/dispatcher.rb#791 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#782 + # source://prism/lib/prism/dispatcher.rb#799 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#790 + # source://prism/lib/prism/dispatcher.rb#807 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#798 + # source://prism/lib/prism/dispatcher.rb#815 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#806 + # source://prism/lib/prism/dispatcher.rb#823 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#814 + # source://prism/lib/prism/dispatcher.rb#831 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#822 + # source://prism/lib/prism/dispatcher.rb#839 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#830 + # source://prism/lib/prism/dispatcher.rb#847 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#838 + # source://prism/lib/prism/dispatcher.rb#855 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#846 + # source://prism/lib/prism/dispatcher.rb#863 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#854 + # source://prism/lib/prism/dispatcher.rb#871 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#862 + # source://prism/lib/prism/dispatcher.rb#879 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#870 + # source://prism/lib/prism/dispatcher.rb#887 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#878 + # source://prism/lib/prism/dispatcher.rb#895 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#886 + # source://prism/lib/prism/dispatcher.rb#903 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#894 + # source://prism/lib/prism/dispatcher.rb#911 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#902 + # source://prism/lib/prism/dispatcher.rb#919 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#910 + # source://prism/lib/prism/dispatcher.rb#927 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#918 + # source://prism/lib/prism/dispatcher.rb#935 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#926 + # source://prism/lib/prism/dispatcher.rb#943 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#934 + # source://prism/lib/prism/dispatcher.rb#951 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#942 + # source://prism/lib/prism/dispatcher.rb#959 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#950 + # source://prism/lib/prism/dispatcher.rb#967 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#958 + # source://prism/lib/prism/dispatcher.rb#975 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#966 + # source://prism/lib/prism/dispatcher.rb#983 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#974 + # source://prism/lib/prism/dispatcher.rb#991 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#982 + # source://prism/lib/prism/dispatcher.rb#999 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#990 + # source://prism/lib/prism/dispatcher.rb#1007 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#998 + # source://prism/lib/prism/dispatcher.rb#1015 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#1006 + # source://prism/lib/prism/dispatcher.rb#1023 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#1014 + # source://prism/lib/prism/dispatcher.rb#1031 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#1022 + # source://prism/lib/prism/dispatcher.rb#1039 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#1030 + # source://prism/lib/prism/dispatcher.rb#1047 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#1038 + # source://prism/lib/prism/dispatcher.rb#1055 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#1046 + # source://prism/lib/prism/dispatcher.rb#1063 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#1054 + # source://prism/lib/prism/dispatcher.rb#1071 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#1062 + # source://prism/lib/prism/dispatcher.rb#1079 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#1070 + # source://prism/lib/prism/dispatcher.rb#1087 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#1078 + # source://prism/lib/prism/dispatcher.rb#1095 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#1086 + # source://prism/lib/prism/dispatcher.rb#1103 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#1094 + # source://prism/lib/prism/dispatcher.rb#1111 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#1102 + # source://prism/lib/prism/dispatcher.rb#1119 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#1110 + # source://prism/lib/prism/dispatcher.rb#1127 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#1135 + 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#1118 + # source://prism/lib/prism/dispatcher.rb#1143 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#1126 + # source://prism/lib/prism/dispatcher.rb#1151 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#1134 + # source://prism/lib/prism/dispatcher.rb#1159 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#1142 + # source://prism/lib/prism/dispatcher.rb#1167 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#1150 + # source://prism/lib/prism/dispatcher.rb#1175 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#1158 + # source://prism/lib/prism/dispatcher.rb#1183 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#1166 + # source://prism/lib/prism/dispatcher.rb#1191 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#1174 + # source://prism/lib/prism/dispatcher.rb#1199 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#1182 + # source://prism/lib/prism/dispatcher.rb#1207 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#1190 + # source://prism/lib/prism/dispatcher.rb#1215 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#1198 + # source://prism/lib/prism/dispatcher.rb#1223 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#1206 + # source://prism/lib/prism/dispatcher.rb#1231 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#1214 + # source://prism/lib/prism/dispatcher.rb#1239 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#1222 + # source://prism/lib/prism/dispatcher.rb#1247 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#1230 + # source://prism/lib/prism/dispatcher.rb#1255 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#1238 + # source://prism/lib/prism/dispatcher.rb#1263 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#1246 + # source://prism/lib/prism/dispatcher.rb#1271 def visit_yield_node(node); end end -# source://prism/lib/prism/dispatcher.rb#1252 +# source://prism/lib/prism/dispatcher.rb#1277 class Prism::Dispatcher::DispatchOnce < ::Prism::Visitor # @return [DispatchOnce] a new instance of DispatchOnce # - # source://prism/lib/prism/dispatcher.rb#1255 + # source://prism/lib/prism/dispatcher.rb#1280 def initialize(listeners); end # Returns the value of attribute listeners. # - # source://prism/lib/prism/dispatcher.rb#1253 + # source://prism/lib/prism/dispatcher.rb#1278 def listeners; end # Dispatch enter and leave events for AliasGlobalVariableNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1260 + # source://prism/lib/prism/dispatcher.rb#1285 def visit_alias_global_variable_node(node); end # Dispatch enter and leave events for AliasMethodNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1266 + # source://prism/lib/prism/dispatcher.rb#1291 def visit_alias_method_node(node); end # Dispatch enter and leave events for AlternationPatternNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1272 + # source://prism/lib/prism/dispatcher.rb#1297 def visit_alternation_pattern_node(node); end # Dispatch enter and leave events for AndNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1278 + # source://prism/lib/prism/dispatcher.rb#1303 def visit_and_node(node); end # Dispatch enter and leave events for ArgumentsNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1284 + # source://prism/lib/prism/dispatcher.rb#1309 def visit_arguments_node(node); end # Dispatch enter and leave events for ArrayNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1290 + # source://prism/lib/prism/dispatcher.rb#1315 def visit_array_node(node); end # Dispatch enter and leave events for ArrayPatternNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1296 + # source://prism/lib/prism/dispatcher.rb#1321 def visit_array_pattern_node(node); end # Dispatch enter and leave events for AssocNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1302 + # source://prism/lib/prism/dispatcher.rb#1327 def visit_assoc_node(node); end # Dispatch enter and leave events for AssocSplatNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1308 + # source://prism/lib/prism/dispatcher.rb#1333 def visit_assoc_splat_node(node); end # Dispatch enter and leave events for BackReferenceReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1314 + # source://prism/lib/prism/dispatcher.rb#1339 def visit_back_reference_read_node(node); end # Dispatch enter and leave events for BeginNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1320 + # source://prism/lib/prism/dispatcher.rb#1345 def visit_begin_node(node); end # Dispatch enter and leave events for BlockArgumentNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1326 + # source://prism/lib/prism/dispatcher.rb#1351 def visit_block_argument_node(node); end # Dispatch enter and leave events for BlockLocalVariableNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1332 + # source://prism/lib/prism/dispatcher.rb#1357 def visit_block_local_variable_node(node); end # Dispatch enter and leave events for BlockNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1338 + # source://prism/lib/prism/dispatcher.rb#1363 def visit_block_node(node); end # Dispatch enter and leave events for BlockParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1344 + # source://prism/lib/prism/dispatcher.rb#1369 def visit_block_parameter_node(node); end # Dispatch enter and leave events for BlockParametersNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1350 + # source://prism/lib/prism/dispatcher.rb#1375 def visit_block_parameters_node(node); end # Dispatch enter and leave events for BreakNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1356 + # source://prism/lib/prism/dispatcher.rb#1381 def visit_break_node(node); end # Dispatch enter and leave events for CallAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1362 + # source://prism/lib/prism/dispatcher.rb#1387 def visit_call_and_write_node(node); end # Dispatch enter and leave events for CallNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1368 + # source://prism/lib/prism/dispatcher.rb#1393 def visit_call_node(node); end # Dispatch enter and leave events for CallOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1374 + # source://prism/lib/prism/dispatcher.rb#1399 def visit_call_operator_write_node(node); end # Dispatch enter and leave events for CallOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1380 + # source://prism/lib/prism/dispatcher.rb#1405 def visit_call_or_write_node(node); end # Dispatch enter and leave events for CallTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1386 + # source://prism/lib/prism/dispatcher.rb#1411 def visit_call_target_node(node); end # Dispatch enter and leave events for CapturePatternNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1392 + # source://prism/lib/prism/dispatcher.rb#1417 def visit_capture_pattern_node(node); end # Dispatch enter and leave events for CaseMatchNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1398 + # source://prism/lib/prism/dispatcher.rb#1423 def visit_case_match_node(node); end # Dispatch enter and leave events for CaseNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1404 + # source://prism/lib/prism/dispatcher.rb#1429 def visit_case_node(node); end # Dispatch enter and leave events for ClassNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1410 + # source://prism/lib/prism/dispatcher.rb#1435 def visit_class_node(node); end # Dispatch enter and leave events for ClassVariableAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1416 + # source://prism/lib/prism/dispatcher.rb#1441 def visit_class_variable_and_write_node(node); end # Dispatch enter and leave events for ClassVariableOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1422 + # source://prism/lib/prism/dispatcher.rb#1447 def visit_class_variable_operator_write_node(node); end # Dispatch enter and leave events for ClassVariableOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1428 + # source://prism/lib/prism/dispatcher.rb#1453 def visit_class_variable_or_write_node(node); end # Dispatch enter and leave events for ClassVariableReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1434 + # source://prism/lib/prism/dispatcher.rb#1459 def visit_class_variable_read_node(node); end # Dispatch enter and leave events for ClassVariableTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1440 + # source://prism/lib/prism/dispatcher.rb#1465 def visit_class_variable_target_node(node); end # Dispatch enter and leave events for ClassVariableWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1446 + # source://prism/lib/prism/dispatcher.rb#1471 def visit_class_variable_write_node(node); end # Dispatch enter and leave events for ConstantAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1452 + # source://prism/lib/prism/dispatcher.rb#1477 def visit_constant_and_write_node(node); end # Dispatch enter and leave events for ConstantOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1458 + # source://prism/lib/prism/dispatcher.rb#1483 def visit_constant_operator_write_node(node); end # Dispatch enter and leave events for ConstantOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1464 + # source://prism/lib/prism/dispatcher.rb#1489 def visit_constant_or_write_node(node); end # Dispatch enter and leave events for ConstantPathAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1470 + # source://prism/lib/prism/dispatcher.rb#1495 def visit_constant_path_and_write_node(node); end # Dispatch enter and leave events for ConstantPathNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1476 + # source://prism/lib/prism/dispatcher.rb#1501 def visit_constant_path_node(node); end # Dispatch enter and leave events for ConstantPathOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1482 + # source://prism/lib/prism/dispatcher.rb#1507 def visit_constant_path_operator_write_node(node); end # Dispatch enter and leave events for ConstantPathOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1488 + # source://prism/lib/prism/dispatcher.rb#1513 def visit_constant_path_or_write_node(node); end # Dispatch enter and leave events for ConstantPathTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1494 + # source://prism/lib/prism/dispatcher.rb#1519 def visit_constant_path_target_node(node); end # Dispatch enter and leave events for ConstantPathWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1500 + # source://prism/lib/prism/dispatcher.rb#1525 def visit_constant_path_write_node(node); end # Dispatch enter and leave events for ConstantReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1506 + # source://prism/lib/prism/dispatcher.rb#1531 def visit_constant_read_node(node); end # Dispatch enter and leave events for ConstantTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1512 + # source://prism/lib/prism/dispatcher.rb#1537 def visit_constant_target_node(node); end # Dispatch enter and leave events for ConstantWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1518 + # source://prism/lib/prism/dispatcher.rb#1543 def visit_constant_write_node(node); end # Dispatch enter and leave events for DefNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1524 + # source://prism/lib/prism/dispatcher.rb#1549 def visit_def_node(node); end # Dispatch enter and leave events for DefinedNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1530 + # source://prism/lib/prism/dispatcher.rb#1555 def visit_defined_node(node); end # Dispatch enter and leave events for ElseNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1536 + # source://prism/lib/prism/dispatcher.rb#1561 def visit_else_node(node); end # Dispatch enter and leave events for EmbeddedStatementsNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1542 + # source://prism/lib/prism/dispatcher.rb#1567 def visit_embedded_statements_node(node); end # Dispatch enter and leave events for EmbeddedVariableNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1548 + # source://prism/lib/prism/dispatcher.rb#1573 def visit_embedded_variable_node(node); end # Dispatch enter and leave events for EnsureNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1554 + # source://prism/lib/prism/dispatcher.rb#1579 def visit_ensure_node(node); end # Dispatch enter and leave events for FalseNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1560 + # source://prism/lib/prism/dispatcher.rb#1585 def visit_false_node(node); end # Dispatch enter and leave events for FindPatternNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1566 + # source://prism/lib/prism/dispatcher.rb#1591 def visit_find_pattern_node(node); end # Dispatch enter and leave events for FlipFlopNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1572 + # source://prism/lib/prism/dispatcher.rb#1597 def visit_flip_flop_node(node); end # Dispatch enter and leave events for FloatNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1578 + # source://prism/lib/prism/dispatcher.rb#1603 def visit_float_node(node); end # Dispatch enter and leave events for ForNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1584 + # source://prism/lib/prism/dispatcher.rb#1609 def visit_for_node(node); end # Dispatch enter and leave events for ForwardingArgumentsNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1590 + # source://prism/lib/prism/dispatcher.rb#1615 def visit_forwarding_arguments_node(node); end # Dispatch enter and leave events for ForwardingParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1596 + # source://prism/lib/prism/dispatcher.rb#1621 def visit_forwarding_parameter_node(node); end # Dispatch enter and leave events for ForwardingSuperNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1602 + # source://prism/lib/prism/dispatcher.rb#1627 def visit_forwarding_super_node(node); end # Dispatch enter and leave events for GlobalVariableAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1608 + # source://prism/lib/prism/dispatcher.rb#1633 def visit_global_variable_and_write_node(node); end # Dispatch enter and leave events for GlobalVariableOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1614 + # source://prism/lib/prism/dispatcher.rb#1639 def visit_global_variable_operator_write_node(node); end # Dispatch enter and leave events for GlobalVariableOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1620 + # source://prism/lib/prism/dispatcher.rb#1645 def visit_global_variable_or_write_node(node); end # Dispatch enter and leave events for GlobalVariableReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1626 + # source://prism/lib/prism/dispatcher.rb#1651 def visit_global_variable_read_node(node); end # Dispatch enter and leave events for GlobalVariableTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1632 + # source://prism/lib/prism/dispatcher.rb#1657 def visit_global_variable_target_node(node); end # Dispatch enter and leave events for GlobalVariableWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1638 + # source://prism/lib/prism/dispatcher.rb#1663 def visit_global_variable_write_node(node); end # Dispatch enter and leave events for HashNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1644 + # source://prism/lib/prism/dispatcher.rb#1669 def visit_hash_node(node); end # Dispatch enter and leave events for HashPatternNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1650 + # source://prism/lib/prism/dispatcher.rb#1675 def visit_hash_pattern_node(node); end # Dispatch enter and leave events for IfNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1656 + # source://prism/lib/prism/dispatcher.rb#1681 def visit_if_node(node); end # Dispatch enter and leave events for ImaginaryNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1662 + # source://prism/lib/prism/dispatcher.rb#1687 def visit_imaginary_node(node); end # Dispatch enter and leave events for ImplicitNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1668 + # source://prism/lib/prism/dispatcher.rb#1693 def visit_implicit_node(node); end # Dispatch enter and leave events for ImplicitRestNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1674 + # source://prism/lib/prism/dispatcher.rb#1699 def visit_implicit_rest_node(node); end # Dispatch enter and leave events for InNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1680 + # source://prism/lib/prism/dispatcher.rb#1705 def visit_in_node(node); end # Dispatch enter and leave events for IndexAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1686 + # source://prism/lib/prism/dispatcher.rb#1711 def visit_index_and_write_node(node); end # Dispatch enter and leave events for IndexOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1692 + # source://prism/lib/prism/dispatcher.rb#1717 def visit_index_operator_write_node(node); end # Dispatch enter and leave events for IndexOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1698 + # source://prism/lib/prism/dispatcher.rb#1723 def visit_index_or_write_node(node); end # Dispatch enter and leave events for IndexTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1704 + # source://prism/lib/prism/dispatcher.rb#1729 def visit_index_target_node(node); end # Dispatch enter and leave events for InstanceVariableAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1710 + # source://prism/lib/prism/dispatcher.rb#1735 def visit_instance_variable_and_write_node(node); end # Dispatch enter and leave events for InstanceVariableOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1716 + # source://prism/lib/prism/dispatcher.rb#1741 def visit_instance_variable_operator_write_node(node); end # Dispatch enter and leave events for InstanceVariableOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1722 + # source://prism/lib/prism/dispatcher.rb#1747 def visit_instance_variable_or_write_node(node); end # Dispatch enter and leave events for InstanceVariableReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1728 + # source://prism/lib/prism/dispatcher.rb#1753 def visit_instance_variable_read_node(node); end # Dispatch enter and leave events for InstanceVariableTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1734 + # source://prism/lib/prism/dispatcher.rb#1759 def visit_instance_variable_target_node(node); end # Dispatch enter and leave events for InstanceVariableWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1740 + # source://prism/lib/prism/dispatcher.rb#1765 def visit_instance_variable_write_node(node); end # Dispatch enter and leave events for IntegerNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1746 + # source://prism/lib/prism/dispatcher.rb#1771 def visit_integer_node(node); end # Dispatch enter and leave events for InterpolatedMatchLastLineNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1752 + # source://prism/lib/prism/dispatcher.rb#1777 def visit_interpolated_match_last_line_node(node); end # Dispatch enter and leave events for InterpolatedRegularExpressionNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1758 + # source://prism/lib/prism/dispatcher.rb#1783 def visit_interpolated_regular_expression_node(node); end # Dispatch enter and leave events for InterpolatedStringNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1764 + # source://prism/lib/prism/dispatcher.rb#1789 def visit_interpolated_string_node(node); end # Dispatch enter and leave events for InterpolatedSymbolNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1770 + # source://prism/lib/prism/dispatcher.rb#1795 def visit_interpolated_symbol_node(node); end # Dispatch enter and leave events for InterpolatedXStringNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1776 + # source://prism/lib/prism/dispatcher.rb#1801 def visit_interpolated_x_string_node(node); end + # Dispatch enter and leave events for ItLocalVariableReadNode nodes. + # + # source://prism/lib/prism/dispatcher.rb#1807 + def visit_it_local_variable_read_node(node); end + + # Dispatch enter and leave events for ItParametersNode nodes. + # + # source://prism/lib/prism/dispatcher.rb#1813 + def visit_it_parameters_node(node); end + # Dispatch enter and leave events for KeywordHashNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1782 + # source://prism/lib/prism/dispatcher.rb#1819 def visit_keyword_hash_node(node); end # Dispatch enter and leave events for KeywordRestParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1788 + # source://prism/lib/prism/dispatcher.rb#1825 def visit_keyword_rest_parameter_node(node); end # Dispatch enter and leave events for LambdaNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1794 + # source://prism/lib/prism/dispatcher.rb#1831 def visit_lambda_node(node); end # Dispatch enter and leave events for LocalVariableAndWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1800 + # source://prism/lib/prism/dispatcher.rb#1837 def visit_local_variable_and_write_node(node); end # Dispatch enter and leave events for LocalVariableOperatorWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1806 + # source://prism/lib/prism/dispatcher.rb#1843 def visit_local_variable_operator_write_node(node); end # Dispatch enter and leave events for LocalVariableOrWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1812 + # source://prism/lib/prism/dispatcher.rb#1849 def visit_local_variable_or_write_node(node); end # Dispatch enter and leave events for LocalVariableReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1818 + # source://prism/lib/prism/dispatcher.rb#1855 def visit_local_variable_read_node(node); end # Dispatch enter and leave events for LocalVariableTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1824 + # source://prism/lib/prism/dispatcher.rb#1861 def visit_local_variable_target_node(node); end # Dispatch enter and leave events for LocalVariableWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1830 + # source://prism/lib/prism/dispatcher.rb#1867 def visit_local_variable_write_node(node); end # Dispatch enter and leave events for MatchLastLineNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1836 + # source://prism/lib/prism/dispatcher.rb#1873 def visit_match_last_line_node(node); end # Dispatch enter and leave events for MatchPredicateNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1842 + # source://prism/lib/prism/dispatcher.rb#1879 def visit_match_predicate_node(node); end # Dispatch enter and leave events for MatchRequiredNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1848 + # source://prism/lib/prism/dispatcher.rb#1885 def visit_match_required_node(node); end # Dispatch enter and leave events for MatchWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1854 + # source://prism/lib/prism/dispatcher.rb#1891 def visit_match_write_node(node); end # Dispatch enter and leave events for MissingNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1860 + # source://prism/lib/prism/dispatcher.rb#1897 def visit_missing_node(node); end # Dispatch enter and leave events for ModuleNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1866 + # source://prism/lib/prism/dispatcher.rb#1903 def visit_module_node(node); end # Dispatch enter and leave events for MultiTargetNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1872 + # source://prism/lib/prism/dispatcher.rb#1909 def visit_multi_target_node(node); end # Dispatch enter and leave events for MultiWriteNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1878 + # source://prism/lib/prism/dispatcher.rb#1915 def visit_multi_write_node(node); end # Dispatch enter and leave events for NextNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1884 + # source://prism/lib/prism/dispatcher.rb#1921 def visit_next_node(node); end # Dispatch enter and leave events for NilNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1890 + # source://prism/lib/prism/dispatcher.rb#1927 def visit_nil_node(node); end # Dispatch enter and leave events for NoKeywordsParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1896 + # source://prism/lib/prism/dispatcher.rb#1933 def visit_no_keywords_parameter_node(node); end # Dispatch enter and leave events for NumberedParametersNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1902 + # source://prism/lib/prism/dispatcher.rb#1939 def visit_numbered_parameters_node(node); end # Dispatch enter and leave events for NumberedReferenceReadNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1908 + # source://prism/lib/prism/dispatcher.rb#1945 def visit_numbered_reference_read_node(node); end # Dispatch enter and leave events for OptionalKeywordParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1914 + # source://prism/lib/prism/dispatcher.rb#1951 def visit_optional_keyword_parameter_node(node); end # Dispatch enter and leave events for OptionalParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1920 + # source://prism/lib/prism/dispatcher.rb#1957 def visit_optional_parameter_node(node); end # Dispatch enter and leave events for OrNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1926 + # source://prism/lib/prism/dispatcher.rb#1963 def visit_or_node(node); end # Dispatch enter and leave events for ParametersNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1932 + # source://prism/lib/prism/dispatcher.rb#1969 def visit_parameters_node(node); end # Dispatch enter and leave events for ParenthesesNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1938 + # source://prism/lib/prism/dispatcher.rb#1975 def visit_parentheses_node(node); end # Dispatch enter and leave events for PinnedExpressionNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1944 + # source://prism/lib/prism/dispatcher.rb#1981 def visit_pinned_expression_node(node); end # Dispatch enter and leave events for PinnedVariableNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1950 + # source://prism/lib/prism/dispatcher.rb#1987 def visit_pinned_variable_node(node); end # Dispatch enter and leave events for PostExecutionNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1956 + # source://prism/lib/prism/dispatcher.rb#1993 def visit_post_execution_node(node); end # Dispatch enter and leave events for PreExecutionNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1962 + # source://prism/lib/prism/dispatcher.rb#1999 def visit_pre_execution_node(node); end # Dispatch enter and leave events for ProgramNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1968 + # source://prism/lib/prism/dispatcher.rb#2005 def visit_program_node(node); end # Dispatch enter and leave events for RangeNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1974 + # source://prism/lib/prism/dispatcher.rb#2011 def visit_range_node(node); end # Dispatch enter and leave events for RationalNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1980 + # source://prism/lib/prism/dispatcher.rb#2017 def visit_rational_node(node); end # Dispatch enter and leave events for RedoNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1986 + # source://prism/lib/prism/dispatcher.rb#2023 def visit_redo_node(node); end # Dispatch enter and leave events for RegularExpressionNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1992 + # source://prism/lib/prism/dispatcher.rb#2029 def visit_regular_expression_node(node); end # Dispatch enter and leave events for RequiredKeywordParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#1998 + # source://prism/lib/prism/dispatcher.rb#2035 def visit_required_keyword_parameter_node(node); end # Dispatch enter and leave events for RequiredParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2004 + # source://prism/lib/prism/dispatcher.rb#2041 def visit_required_parameter_node(node); end # Dispatch enter and leave events for RescueModifierNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2010 + # source://prism/lib/prism/dispatcher.rb#2047 def visit_rescue_modifier_node(node); end # Dispatch enter and leave events for RescueNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2016 + # source://prism/lib/prism/dispatcher.rb#2053 def visit_rescue_node(node); end # Dispatch enter and leave events for RestParameterNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2022 + # source://prism/lib/prism/dispatcher.rb#2059 def visit_rest_parameter_node(node); end # Dispatch enter and leave events for RetryNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2028 + # source://prism/lib/prism/dispatcher.rb#2065 def visit_retry_node(node); end # Dispatch enter and leave events for ReturnNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2034 + # source://prism/lib/prism/dispatcher.rb#2071 def visit_return_node(node); end # Dispatch enter and leave events for SelfNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2040 + # source://prism/lib/prism/dispatcher.rb#2077 def visit_self_node(node); end + # Dispatch enter and leave events for ShareableConstantNode nodes. + # + # source://prism/lib/prism/dispatcher.rb#2083 + def visit_shareable_constant_node(node); end + # Dispatch enter and leave events for SingletonClassNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2046 + # source://prism/lib/prism/dispatcher.rb#2089 def visit_singleton_class_node(node); end # Dispatch enter and leave events for SourceEncodingNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2052 + # source://prism/lib/prism/dispatcher.rb#2095 def visit_source_encoding_node(node); end # Dispatch enter and leave events for SourceFileNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2058 + # source://prism/lib/prism/dispatcher.rb#2101 def visit_source_file_node(node); end # Dispatch enter and leave events for SourceLineNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2064 + # source://prism/lib/prism/dispatcher.rb#2107 def visit_source_line_node(node); end # Dispatch enter and leave events for SplatNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2070 + # source://prism/lib/prism/dispatcher.rb#2113 def visit_splat_node(node); end # Dispatch enter and leave events for StatementsNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2076 + # source://prism/lib/prism/dispatcher.rb#2119 def visit_statements_node(node); end # Dispatch enter and leave events for StringNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2082 + # source://prism/lib/prism/dispatcher.rb#2125 def visit_string_node(node); end # Dispatch enter and leave events for SuperNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2088 + # source://prism/lib/prism/dispatcher.rb#2131 def visit_super_node(node); end # Dispatch enter and leave events for SymbolNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2094 + # source://prism/lib/prism/dispatcher.rb#2137 def visit_symbol_node(node); end # Dispatch enter and leave events for TrueNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2100 + # source://prism/lib/prism/dispatcher.rb#2143 def visit_true_node(node); end # Dispatch enter and leave events for UndefNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2106 + # source://prism/lib/prism/dispatcher.rb#2149 def visit_undef_node(node); end # Dispatch enter and leave events for UnlessNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2112 + # source://prism/lib/prism/dispatcher.rb#2155 def visit_unless_node(node); end # Dispatch enter and leave events for UntilNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2118 + # source://prism/lib/prism/dispatcher.rb#2161 def visit_until_node(node); end # Dispatch enter and leave events for WhenNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2124 + # source://prism/lib/prism/dispatcher.rb#2167 def visit_when_node(node); end # Dispatch enter and leave events for WhileNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2130 + # source://prism/lib/prism/dispatcher.rb#2173 def visit_while_node(node); end # Dispatch enter and leave events for XStringNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2136 + # source://prism/lib/prism/dispatcher.rb#2179 def visit_x_string_node(node); end # Dispatch enter and leave events for YieldNode nodes. # - # source://prism/lib/prism/dispatcher.rb#2142 + # source://prism/lib/prism/dispatcher.rb#2185 def visit_yield_node(node); end end # This visitor provides the ability to call Node#to_dot, which converts a # subtree into a graphviz dot graph. # -# source://prism/lib/prism/dot_visitor.rb#13 +# source://prism/lib/prism/dot_visitor.rb#14 class Prism::DotVisitor < ::Prism::Visitor # Initialize a new dot visitor. # # @return [DotVisitor] a new instance of DotVisitor # - # source://prism/lib/prism/dot_visitor.rb#105 + # source://prism/lib/prism/dot_visitor.rb#106 def initialize; end # The digraph that is being built. # - # source://prism/lib/prism/dot_visitor.rb#102 + # source://prism/lib/prism/dot_visitor.rb#103 def digraph; end # Convert this visitor into a graphviz dot graph string. # - # source://prism/lib/prism/dot_visitor.rb#110 + # source://prism/lib/prism/dot_visitor.rb#111 def to_dot; end # Visit a AliasGlobalVariableNode node. # - # source://prism/lib/prism/dot_visitor.rb#115 + # source://prism/lib/prism/dot_visitor.rb#116 def visit_alias_global_variable_node(node); end # Visit a AliasMethodNode node. # - # source://prism/lib/prism/dot_visitor.rb#140 + # source://prism/lib/prism/dot_visitor.rb#141 def visit_alias_method_node(node); end # Visit a AlternationPatternNode node. # - # source://prism/lib/prism/dot_visitor.rb#165 + # source://prism/lib/prism/dot_visitor.rb#166 def visit_alternation_pattern_node(node); end # Visit a AndNode node. # - # source://prism/lib/prism/dot_visitor.rb#190 + # source://prism/lib/prism/dot_visitor.rb#191 def visit_and_node(node); end # Visit a ArgumentsNode node. # - # source://prism/lib/prism/dot_visitor.rb#215 + # source://prism/lib/prism/dot_visitor.rb#216 def visit_arguments_node(node); end # Visit a ArrayNode node. # - # source://prism/lib/prism/dot_visitor.rb#245 + # source://prism/lib/prism/dot_visitor.rb#246 def visit_array_node(node); end # Visit a ArrayPatternNode node. # - # source://prism/lib/prism/dot_visitor.rb#285 + # source://prism/lib/prism/dot_visitor.rb#286 def visit_array_pattern_node(node); end # Visit a AssocNode node. # - # source://prism/lib/prism/dot_visitor.rb#347 + # source://prism/lib/prism/dot_visitor.rb#348 def visit_assoc_node(node); end # Visit a AssocSplatNode node. # - # source://prism/lib/prism/dot_visitor.rb#374 + # source://prism/lib/prism/dot_visitor.rb#375 def visit_assoc_splat_node(node); end # Visit a BackReferenceReadNode node. # - # source://prism/lib/prism/dot_visitor.rb#397 + # source://prism/lib/prism/dot_visitor.rb#398 def visit_back_reference_read_node(node); end # Visit a BeginNode node. # - # source://prism/lib/prism/dot_visitor.rb#414 + # source://prism/lib/prism/dot_visitor.rb#415 def visit_begin_node(node); end # Visit a BlockArgumentNode node. # - # source://prism/lib/prism/dot_visitor.rb#462 + # source://prism/lib/prism/dot_visitor.rb#463 def visit_block_argument_node(node); end # Visit a BlockLocalVariableNode node. # - # source://prism/lib/prism/dot_visitor.rb#485 + # source://prism/lib/prism/dot_visitor.rb#486 def visit_block_local_variable_node(node); end # Visit a BlockNode node. # - # source://prism/lib/prism/dot_visitor.rb#505 + # source://prism/lib/prism/dot_visitor.rb#506 def visit_block_node(node); end # Visit a BlockParameterNode node. # - # source://prism/lib/prism/dot_visitor.rb#540 + # source://prism/lib/prism/dot_visitor.rb#541 def visit_block_parameter_node(node); end # Visit a BlockParametersNode node. # - # source://prism/lib/prism/dot_visitor.rb#568 + # source://prism/lib/prism/dot_visitor.rb#569 def visit_block_parameters_node(node); end # Visit a BreakNode node. # - # source://prism/lib/prism/dot_visitor.rb#611 + # source://prism/lib/prism/dot_visitor.rb#612 def visit_break_node(node); end # Visit a CallAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#634 + # source://prism/lib/prism/dot_visitor.rb#635 def visit_call_and_write_node(node); end # Visit a CallNode node. # - # source://prism/lib/prism/dot_visitor.rb#680 + # source://prism/lib/prism/dot_visitor.rb#681 def visit_call_node(node); end # Visit a CallOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#738 + # source://prism/lib/prism/dot_visitor.rb#739 def visit_call_operator_write_node(node); end # Visit a CallOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#787 + # source://prism/lib/prism/dot_visitor.rb#788 def visit_call_or_write_node(node); end # Visit a CallTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#833 + # source://prism/lib/prism/dot_visitor.rb#834 def visit_call_target_node(node); end # Visit a CapturePatternNode node. # - # source://prism/lib/prism/dot_visitor.rb#863 + # source://prism/lib/prism/dot_visitor.rb#864 def visit_capture_pattern_node(node); end # Visit a CaseMatchNode node. # - # source://prism/lib/prism/dot_visitor.rb#888 + # source://prism/lib/prism/dot_visitor.rb#889 def visit_case_match_node(node); end # Visit a CaseNode node. # - # source://prism/lib/prism/dot_visitor.rb#933 + # source://prism/lib/prism/dot_visitor.rb#934 def visit_case_node(node); end # Visit a ClassNode node. # - # source://prism/lib/prism/dot_visitor.rb#978 + # source://prism/lib/prism/dot_visitor.rb#979 def visit_class_node(node); end # Visit a ClassVariableAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1025 + # source://prism/lib/prism/dot_visitor.rb#1026 def visit_class_variable_and_write_node(node); end # Visit a ClassVariableOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1052 + # source://prism/lib/prism/dot_visitor.rb#1053 def visit_class_variable_operator_write_node(node); end # Visit a ClassVariableOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1082 + # source://prism/lib/prism/dot_visitor.rb#1083 def visit_class_variable_or_write_node(node); end # Visit a ClassVariableReadNode node. # - # source://prism/lib/prism/dot_visitor.rb#1109 + # source://prism/lib/prism/dot_visitor.rb#1110 def visit_class_variable_read_node(node); end # Visit a ClassVariableTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#1126 + # source://prism/lib/prism/dot_visitor.rb#1127 def visit_class_variable_target_node(node); end # Visit a ClassVariableWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1143 + # source://prism/lib/prism/dot_visitor.rb#1144 def visit_class_variable_write_node(node); end # Visit a ConstantAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1172 + # source://prism/lib/prism/dot_visitor.rb#1171 def visit_constant_and_write_node(node); end # Visit a ConstantOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1199 + # source://prism/lib/prism/dot_visitor.rb#1198 def visit_constant_operator_write_node(node); end # Visit a ConstantOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1229 + # source://prism/lib/prism/dot_visitor.rb#1228 def visit_constant_or_write_node(node); end # Visit a ConstantPathAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1256 + # source://prism/lib/prism/dot_visitor.rb#1255 def visit_constant_path_and_write_node(node); end # Visit a ConstantPathNode node. # - # source://prism/lib/prism/dot_visitor.rb#1281 + # source://prism/lib/prism/dot_visitor.rb#1280 def visit_constant_path_node(node); end # Visit a ConstantPathOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1308 + # source://prism/lib/prism/dot_visitor.rb#1309 def visit_constant_path_operator_write_node(node); end # Visit a ConstantPathOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1336 + # source://prism/lib/prism/dot_visitor.rb#1337 def visit_constant_path_or_write_node(node); end # Visit a ConstantPathTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#1361 + # source://prism/lib/prism/dot_visitor.rb#1362 def visit_constant_path_target_node(node); end # Visit a ConstantPathWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1388 + # source://prism/lib/prism/dot_visitor.rb#1391 def visit_constant_path_write_node(node); end # Visit a ConstantReadNode node. # - # source://prism/lib/prism/dot_visitor.rb#1413 + # source://prism/lib/prism/dot_visitor.rb#1416 def visit_constant_read_node(node); end # Visit a ConstantTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#1430 + # source://prism/lib/prism/dot_visitor.rb#1433 def visit_constant_target_node(node); end # Visit a ConstantWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1447 + # source://prism/lib/prism/dot_visitor.rb#1450 def visit_constant_write_node(node); end # Visit a DefNode node. # - # source://prism/lib/prism/dot_visitor.rb#1474 + # source://prism/lib/prism/dot_visitor.rb#1477 def visit_def_node(node); end # Visit a DefinedNode node. # - # source://prism/lib/prism/dot_visitor.rb#1543 + # source://prism/lib/prism/dot_visitor.rb#1546 def visit_defined_node(node); end # Visit a ElseNode node. # - # source://prism/lib/prism/dot_visitor.rb#1574 + # source://prism/lib/prism/dot_visitor.rb#1577 def visit_else_node(node); end # Visit a EmbeddedStatementsNode node. # - # source://prism/lib/prism/dot_visitor.rb#1602 + # source://prism/lib/prism/dot_visitor.rb#1605 def visit_embedded_statements_node(node); end # Visit a EmbeddedVariableNode node. # - # source://prism/lib/prism/dot_visitor.rb#1628 + # source://prism/lib/prism/dot_visitor.rb#1631 def visit_embedded_variable_node(node); end # Visit a EnsureNode node. # - # source://prism/lib/prism/dot_visitor.rb#1649 + # source://prism/lib/prism/dot_visitor.rb#1652 def visit_ensure_node(node); end # Visit a FalseNode node. # - # source://prism/lib/prism/dot_visitor.rb#1675 + # source://prism/lib/prism/dot_visitor.rb#1678 def visit_false_node(node); end # Visit a FindPatternNode node. # - # source://prism/lib/prism/dot_visitor.rb#1689 + # source://prism/lib/prism/dot_visitor.rb#1692 def visit_find_pattern_node(node); end # Visit a FlipFlopNode node. # - # source://prism/lib/prism/dot_visitor.rb#1740 + # source://prism/lib/prism/dot_visitor.rb#1743 def visit_flip_flop_node(node); end # Visit a FloatNode node. # - # source://prism/lib/prism/dot_visitor.rb#1772 + # source://prism/lib/prism/dot_visitor.rb#1775 def visit_float_node(node); end # Visit a ForNode node. # - # source://prism/lib/prism/dot_visitor.rb#1786 + # source://prism/lib/prism/dot_visitor.rb#1792 def visit_for_node(node); end # Visit a ForwardingArgumentsNode node. # - # source://prism/lib/prism/dot_visitor.rb#1828 + # source://prism/lib/prism/dot_visitor.rb#1834 def visit_forwarding_arguments_node(node); end # Visit a ForwardingParameterNode node. # - # source://prism/lib/prism/dot_visitor.rb#1842 + # source://prism/lib/prism/dot_visitor.rb#1848 def visit_forwarding_parameter_node(node); end # Visit a ForwardingSuperNode node. # - # source://prism/lib/prism/dot_visitor.rb#1856 + # source://prism/lib/prism/dot_visitor.rb#1862 def visit_forwarding_super_node(node); end # Visit a GlobalVariableAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1876 + # source://prism/lib/prism/dot_visitor.rb#1882 def visit_global_variable_and_write_node(node); end # Visit a GlobalVariableOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1903 + # source://prism/lib/prism/dot_visitor.rb#1909 def visit_global_variable_operator_write_node(node); end # Visit a GlobalVariableOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1933 + # source://prism/lib/prism/dot_visitor.rb#1939 def visit_global_variable_or_write_node(node); end # Visit a GlobalVariableReadNode node. # - # source://prism/lib/prism/dot_visitor.rb#1960 + # source://prism/lib/prism/dot_visitor.rb#1966 def visit_global_variable_read_node(node); end # Visit a GlobalVariableTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#1977 + # source://prism/lib/prism/dot_visitor.rb#1983 def visit_global_variable_target_node(node); end # Visit a GlobalVariableWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#1994 + # source://prism/lib/prism/dot_visitor.rb#2000 def visit_global_variable_write_node(node); end # Visit a HashNode node. # - # source://prism/lib/prism/dot_visitor.rb#2021 + # source://prism/lib/prism/dot_visitor.rb#2027 def visit_hash_node(node); end # Visit a HashPatternNode node. # - # source://prism/lib/prism/dot_visitor.rb#2054 + # source://prism/lib/prism/dot_visitor.rb#2060 def visit_hash_pattern_node(node); end # Visit a IfNode node. # - # source://prism/lib/prism/dot_visitor.rb#2103 + # source://prism/lib/prism/dot_visitor.rb#2109 def visit_if_node(node); end # Visit a ImaginaryNode node. # - # source://prism/lib/prism/dot_visitor.rb#2148 + # source://prism/lib/prism/dot_visitor.rb#2154 def visit_imaginary_node(node); end # Visit a ImplicitNode node. # - # source://prism/lib/prism/dot_visitor.rb#2166 + # source://prism/lib/prism/dot_visitor.rb#2172 def visit_implicit_node(node); end # Visit a ImplicitRestNode node. # - # source://prism/lib/prism/dot_visitor.rb#2184 + # source://prism/lib/prism/dot_visitor.rb#2190 def visit_implicit_rest_node(node); end # Visit a InNode node. # - # source://prism/lib/prism/dot_visitor.rb#2198 + # source://prism/lib/prism/dot_visitor.rb#2204 def visit_in_node(node); end # Visit a IndexAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2230 + # source://prism/lib/prism/dot_visitor.rb#2236 def visit_index_and_write_node(node); end # Visit a IndexOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2283 + # source://prism/lib/prism/dot_visitor.rb#2289 def visit_index_operator_write_node(node); end # Visit a IndexOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2339 + # source://prism/lib/prism/dot_visitor.rb#2345 def visit_index_or_write_node(node); end # Visit a IndexTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#2392 + # source://prism/lib/prism/dot_visitor.rb#2398 def visit_index_target_node(node); end # Visit a InstanceVariableAndWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2431 + # source://prism/lib/prism/dot_visitor.rb#2437 def visit_instance_variable_and_write_node(node); end # Visit a InstanceVariableOperatorWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2458 + # source://prism/lib/prism/dot_visitor.rb#2464 def visit_instance_variable_operator_write_node(node); end # Visit a InstanceVariableOrWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2488 + # source://prism/lib/prism/dot_visitor.rb#2494 def visit_instance_variable_or_write_node(node); end # Visit a InstanceVariableReadNode node. # - # source://prism/lib/prism/dot_visitor.rb#2515 + # source://prism/lib/prism/dot_visitor.rb#2521 def visit_instance_variable_read_node(node); end # Visit a InstanceVariableTargetNode node. # - # source://prism/lib/prism/dot_visitor.rb#2532 + # source://prism/lib/prism/dot_visitor.rb#2538 def visit_instance_variable_target_node(node); end # Visit a InstanceVariableWriteNode node. # - # source://prism/lib/prism/dot_visitor.rb#2549 + # source://prism/lib/prism/dot_visitor.rb#2555 def visit_instance_variable_write_node(node); end # Visit a IntegerNode node. # - # source://prism/lib/prism/dot_visitor.rb#2576 + # source://prism/lib/prism/dot_visitor.rb#2582 def visit_integer_node(node); end # Visit a InterpolatedMatchLastLineNode node. # - # source://prism/lib/prism/dot_visitor.rb#2593 + # source://prism/lib/prism/dot_visitor.rb#2602 def visit_interpolated_match_last_line_node(node); end # Visit a InterpolatedRegularExpressionNode node. # - # source://prism/lib/prism/dot_visitor.rb#2629 + # source://prism/lib/prism/dot_visitor.rb#2638 def visit_interpolated_regular_expression_node(node); end # Visit a InterpolatedStringNode node. # - # source://prism/lib/prism/dot_visitor.rb#2665 + # source://prism/lib/prism/dot_visitor.rb#2674 def visit_interpolated_string_node(node); end # Visit a InterpolatedSymbolNode node. # - # source://prism/lib/prism/dot_visitor.rb#2702 + # source://prism/lib/prism/dot_visitor.rb#2714 def visit_interpolated_symbol_node(node); end # Visit a InterpolatedXStringNode node. # - # source://prism/lib/prism/dot_visitor.rb#2739 + # source://prism/lib/prism/dot_visitor.rb#2751 def visit_interpolated_x_string_node(node); end + # 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#2772 + # 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#2802 + # 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#2830 + # 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#2868 + # 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#2898 + # 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#2931 + # 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#2961 + # 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#2981 + # 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#3001 + # 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#3031 + # 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#3060 + # 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#3085 + # 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#3110 + # 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#3141 + # 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#3155 + # 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#3191 + # 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#3247 + # 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#3310 + # 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#3333 + # 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#3347 + # 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#3367 + # 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#3384 + # 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#3401 + # 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#3428 + # 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#3458 + # 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#3483 + # 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#3567 + # 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#3593 + # 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#3620 + # 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#3641 + # 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#3670 + # 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#3699 + # 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#3720 + # 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#3752 + # 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#3770 + # 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#3784 + # 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#3813 + # 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#3836 + # 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#3856 + # 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#3881 + # 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#3934 + # 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#3962 + # 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#3976 + # 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#3999 + # source://prism/lib/prism/dot_visitor.rb#4047 def visit_self_node(node); end + # Visit a ShareableConstantNode node. + # + # source://prism/lib/prism/dot_visitor.rb#4061 + def visit_shareable_constant_node(node); end + # Visit a SingletonClassNode node. # - # source://prism/lib/prism/dot_visitor.rb#4013 + # source://prism/lib/prism/dot_visitor.rb#4082 def visit_singleton_class_node(node); end # Visit a SourceEncodingNode node. # - # source://prism/lib/prism/dot_visitor.rb#4049 + # source://prism/lib/prism/dot_visitor.rb#4118 def visit_source_encoding_node(node); end # Visit a SourceFileNode node. # - # source://prism/lib/prism/dot_visitor.rb#4063 + # source://prism/lib/prism/dot_visitor.rb#4132 def visit_source_file_node(node); end # Visit a SourceLineNode node. # - # source://prism/lib/prism/dot_visitor.rb#4080 + # source://prism/lib/prism/dot_visitor.rb#4152 def visit_source_line_node(node); end # Visit a SplatNode node. # - # source://prism/lib/prism/dot_visitor.rb#4094 + # source://prism/lib/prism/dot_visitor.rb#4166 def visit_splat_node(node); end # Visit a StatementsNode node. # - # source://prism/lib/prism/dot_visitor.rb#4117 + # source://prism/lib/prism/dot_visitor.rb#4189 def visit_statements_node(node); end # Visit a StringNode node. # - # source://prism/lib/prism/dot_visitor.rb#4144 + # source://prism/lib/prism/dot_visitor.rb#4216 def visit_string_node(node); end # Visit a SuperNode node. # - # source://prism/lib/prism/dot_visitor.rb#4177 + # source://prism/lib/prism/dot_visitor.rb#4249 def visit_super_node(node); end # Visit a SymbolNode node. # - # source://prism/lib/prism/dot_visitor.rb#4216 + # source://prism/lib/prism/dot_visitor.rb#4288 def visit_symbol_node(node); end # Visit a TrueNode node. # - # source://prism/lib/prism/dot_visitor.rb#4251 + # source://prism/lib/prism/dot_visitor.rb#4323 def visit_true_node(node); end # Visit a UndefNode node. # - # source://prism/lib/prism/dot_visitor.rb#4265 + # source://prism/lib/prism/dot_visitor.rb#4337 def visit_undef_node(node); end # Visit a UnlessNode node. # - # source://prism/lib/prism/dot_visitor.rb#4295 + # source://prism/lib/prism/dot_visitor.rb#4367 def visit_unless_node(node); end # Visit a UntilNode node. # - # source://prism/lib/prism/dot_visitor.rb#4338 + # source://prism/lib/prism/dot_visitor.rb#4410 def visit_until_node(node); end # Visit a WhenNode node. # - # source://prism/lib/prism/dot_visitor.rb#4373 + # source://prism/lib/prism/dot_visitor.rb#4445 def visit_when_node(node); end # Visit a WhileNode node. # - # source://prism/lib/prism/dot_visitor.rb#4409 + # source://prism/lib/prism/dot_visitor.rb#4486 def visit_while_node(node); end # Visit a XStringNode node. # - # source://prism/lib/prism/dot_visitor.rb#4444 + # source://prism/lib/prism/dot_visitor.rb#4521 def visit_x_string_node(node); end # Visit a YieldNode node. # - # source://prism/lib/prism/dot_visitor.rb#4473 + # source://prism/lib/prism/dot_visitor.rb#4550 def visit_yield_node(node); end private @@ -11016,168 +12495,186 @@ 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#4519 + # source://prism/lib/prism/dot_visitor.rb#4596 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#4527 + # 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#4535 + # 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#4546 + # 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#4555 + # 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#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#4566 + # 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#4513 + # source://prism/lib/prism/dot_visitor.rb#4590 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#4574 + # 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#4508 + # source://prism/lib/prism/dot_visitor.rb#4585 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#4582 + # 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#4590 + # 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#4598 + # 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#4703 + 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#4711 + 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#4616 + # source://prism/lib/prism/dot_visitor.rb#4721 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#4626 + # source://prism/lib/prism/dot_visitor.rb#4732 def symbol_flags_inspect(node); end end -# source://prism/lib/prism/dot_visitor.rb#58 +# source://prism/lib/prism/dot_visitor.rb#59 class Prism::DotVisitor::Digraph # @return [Digraph] a new instance of Digraph # - # source://prism/lib/prism/dot_visitor.rb#61 + # source://prism/lib/prism/dot_visitor.rb#62 def initialize; end - # source://prism/lib/prism/dot_visitor.rb#75 + # source://prism/lib/prism/dot_visitor.rb#76 def edge(value); end # Returns the value of attribute edges. # - # source://prism/lib/prism/dot_visitor.rb#59 + # source://prism/lib/prism/dot_visitor.rb#60 def edges; end - # source://prism/lib/prism/dot_visitor.rb#67 + # source://prism/lib/prism/dot_visitor.rb#68 def node(value); end # Returns the value of attribute nodes. # - # source://prism/lib/prism/dot_visitor.rb#59 + # source://prism/lib/prism/dot_visitor.rb#60 def nodes; end - # source://prism/lib/prism/dot_visitor.rb#79 + # source://prism/lib/prism/dot_visitor.rb#80 def to_dot; end - # source://prism/lib/prism/dot_visitor.rb#71 + # source://prism/lib/prism/dot_visitor.rb#72 def waypoint(value); end # Returns the value of attribute waypoints. # - # source://prism/lib/prism/dot_visitor.rb#59 + # source://prism/lib/prism/dot_visitor.rb#60 def waypoints; end end -# source://prism/lib/prism/dot_visitor.rb#14 +# source://prism/lib/prism/dot_visitor.rb#15 class Prism::DotVisitor::Field # @return [Field] a new instance of Field # - # source://prism/lib/prism/dot_visitor.rb#17 + # source://prism/lib/prism/dot_visitor.rb#18 def initialize(name, value, port); end # Returns the value of attribute name. # - # source://prism/lib/prism/dot_visitor.rb#15 + # source://prism/lib/prism/dot_visitor.rb#16 def name; end # Returns the value of attribute port. # - # source://prism/lib/prism/dot_visitor.rb#15 + # source://prism/lib/prism/dot_visitor.rb#16 def port; end - # source://prism/lib/prism/dot_visitor.rb#23 + # source://prism/lib/prism/dot_visitor.rb#24 def to_dot; end # Returns the value of attribute value. # - # source://prism/lib/prism/dot_visitor.rb#15 + # source://prism/lib/prism/dot_visitor.rb#16 def value; end end -# source://prism/lib/prism/dot_visitor.rb#32 +# source://prism/lib/prism/dot_visitor.rb#33 class Prism::DotVisitor::Table # @return [Table] a new instance of Table # - # source://prism/lib/prism/dot_visitor.rb#35 + # source://prism/lib/prism/dot_visitor.rb#36 def initialize(name); end - # source://prism/lib/prism/dot_visitor.rb#40 + # source://prism/lib/prism/dot_visitor.rb#41 def field(name, value = T.unsafe(nil), port: T.unsafe(nil)); end # Returns the value of attribute fields. # - # source://prism/lib/prism/dot_visitor.rb#33 + # source://prism/lib/prism/dot_visitor.rb#34 def fields; end # Returns the value of attribute name. # - # source://prism/lib/prism/dot_visitor.rb#33 + # source://prism/lib/prism/dot_visitor.rb#34 def name; end - # source://prism/lib/prism/dot_visitor.rb#44 + # source://prism/lib/prism/dot_visitor.rb#45 def to_dot; end end @@ -11186,92 +12683,116 @@ end # if a then b else c end # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#6290 +# source://prism/lib/prism/node.rb#6173 class Prism::ElseNode < ::Prism::Node # def initialize: (Location else_keyword_loc, StatementsNode? statements, Location? end_keyword_loc, Location location) -> void # # @return [ElseNode] a new instance of ElseNode # - # source://prism/lib/prism/node.rb#6292 + # source://prism/lib/prism/node.rb#6175 + sig do + params( + source: Prism::Source, + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, else_keyword_loc, statements, end_keyword_loc, location); 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#6286 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6302 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6184 + 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#6307 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6189 + 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#6319 + # source://prism/lib/prism/node.rb#6201 + 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#6312 + # source://prism/lib/prism/node.rb#6194 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ElseNode + # def copy: (?else_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location?, ?location: Location) -> ElseNode # - # source://prism/lib/prism/node.rb#6324 - sig { params(params: T.untyped).returns(Prism::ElseNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6206 + sig do + params( + else_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6307 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6189 + 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 } # - # source://prism/lib/prism/node.rb#6338 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6214 + 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#6365 + # source://prism/lib/prism/node.rb#6242 sig { returns(String) } def else_keyword; end # attr_reader else_keyword_loc: Location # - # source://prism/lib/prism/node.rb#6343 + # source://prism/lib/prism/node.rb#6219 sig { returns(Prism::Location) } def else_keyword_loc; end # def end_keyword: () -> String? # - # source://prism/lib/prism/node.rb#6370 + # source://prism/lib/prism/node.rb#6247 sig { returns(T.nilable(String)) } def end_keyword; end # attr_reader end_keyword_loc: Location? # - # source://prism/lib/prism/node.rb#6352 + # source://prism/lib/prism/node.rb#6229 sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6375 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6252 + sig { override.returns(String) } + def inspect; end # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#6349 + # source://prism/lib/prism/node.rb#6226 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -11290,7 +12811,8 @@ class Prism::ElseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6402 + # source://prism/lib/prism/node.rb#6270 + sig { override.returns(Symbol) } def type; end class << self @@ -11301,7 +12823,7 @@ class Prism::ElseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6412 + # source://prism/lib/prism/node.rb#6280 def type; end end end @@ -11309,18 +12831,20 @@ end # EmbDocComment objects correspond to comments that are surrounded by =begin # and =end. # -# source://prism/lib/prism/parse_result.rb#290 +# source://prism/lib/prism/parse_result.rb#403 class Prism::EmbDocComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism/lib/prism/parse_result.rb#297 + # source://prism/lib/prism/parse_result.rb#410 + sig { returns(String) } def inspect; end # This can only be true for inline comments. # # @return [Boolean] # - # source://prism/lib/prism/parse_result.rb#292 + # source://prism/lib/prism/parse_result.rb#405 + sig { override.returns(T::Boolean) } def trailing?; end end @@ -11329,92 +12853,116 @@ end # "foo #{bar}" # ^^^^^^ # -# source://prism/lib/prism/node.rb#6421 +# source://prism/lib/prism/node.rb#6298 class Prism::EmbeddedStatementsNode < ::Prism::Node # def initialize: (Location opening_loc, StatementsNode? statements, Location closing_loc, Location location) -> void # # @return [EmbeddedStatementsNode] a new instance of EmbeddedStatementsNode # - # source://prism/lib/prism/node.rb#6423 + # source://prism/lib/prism/node.rb#6300 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, opening_loc, statements, closing_loc, location); 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#6405 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6433 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6309 + 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#6438 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6314 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#6495 + # source://prism/lib/prism/node.rb#6366 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#6483 + # source://prism/lib/prism/node.rb#6354 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#6450 + # source://prism/lib/prism/node.rb#6326 + 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#6443 + # source://prism/lib/prism/node.rb#6319 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> EmbeddedStatementsNode + # def copy: (?opening_loc: Location, ?statements: StatementsNode?, ?closing_loc: Location, ?location: Location) -> EmbeddedStatementsNode # - # source://prism/lib/prism/node.rb#6455 - sig { params(params: T.untyped).returns(Prism::EmbeddedStatementsNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6331 + sig do + params( + opening_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6438 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6314 + 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 } # - # source://prism/lib/prism/node.rb#6469 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6339 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6500 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6371 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#6490 + # source://prism/lib/prism/node.rb#6361 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#6474 + # source://prism/lib/prism/node.rb#6344 sig { returns(Prism::Location) } def opening_loc; end # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#6480 + # source://prism/lib/prism/node.rb#6351 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -11433,7 +12981,8 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6527 + # source://prism/lib/prism/node.rb#6389 + sig { override.returns(Symbol) } def type; end class << self @@ -11444,7 +12993,7 @@ class Prism::EmbeddedStatementsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6537 + # source://prism/lib/prism/node.rb#6399 def type; end end end @@ -11454,74 +13003,96 @@ end # "foo #@bar" # ^^^^^ # -# source://prism/lib/prism/node.rb#6546 +# source://prism/lib/prism/node.rb#6417 class Prism::EmbeddedVariableNode < ::Prism::Node - # def initialize: (Location operator_loc, Node variable, Location location) -> void + # def initialize: (Location operator_loc, Prism::node variable, Location location) -> void # # @return [EmbeddedVariableNode] a new instance of EmbeddedVariableNode # - # source://prism/lib/prism/node.rb#6548 + # source://prism/lib/prism/node.rb#6419 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, operator_loc, variable, location); 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#6509 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6557 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6427 + 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#6562 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6432 + 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#6572 + # source://prism/lib/prism/node.rb#6442 + 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#6567 + # source://prism/lib/prism/node.rb#6437 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> EmbeddedVariableNode + # def copy: (?operator_loc: Location, ?variable: Prism::node, ?location: Location) -> EmbeddedVariableNode # - # source://prism/lib/prism/node.rb#6577 - sig { params(params: T.untyped).returns(Prism::EmbeddedVariableNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6447 + sig do + params( + operator_loc: Prism::Location, + variable: Prism::Node, + location: Prism::Location + ).returns(Prism::EmbeddedVariableNode) + end + def copy(operator_loc: T.unsafe(nil), variable: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6562 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, variable: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#6590 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6455 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6610 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6475 + sig { override.returns(String) } + def inspect; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#6605 + # source://prism/lib/prism/node.rb#6470 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#6595 + # source://prism/lib/prism/node.rb#6460 sig { returns(Prism::Location) } def operator_loc; end @@ -11540,12 +13111,13 @@ class Prism::EmbeddedVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6632 + # source://prism/lib/prism/node.rb#6493 + sig { override.returns(Symbol) } def type; end - # attr_reader variable: Node + # attr_reader variable: Prism::node # - # source://prism/lib/prism/node.rb#6601 + # source://prism/lib/prism/node.rb#6467 sig { returns(Prism::Node) } def variable; end @@ -11557,24 +13129,24 @@ class Prism::EmbeddedVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6642 + # source://prism/lib/prism/node.rb#6503 def type; end end end # Flags for nodes that have unescaped content. # -# source://prism/lib/prism/node.rb#19268 +# source://prism/lib/prism/node.rb#19157 module Prism::EncodingFlags; end # internal bytes forced the encoding to binary # -# source://prism/lib/prism/node.rb#19273 +# source://prism/lib/prism/node.rb#19162 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#19270 +# source://prism/lib/prism/node.rb#19159 Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # Represents an `ensure` clause in a `begin` statement. @@ -11586,92 +13158,116 @@ Prism::EncodingFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) # bar # end # -# source://prism/lib/prism/node.rb#6655 +# source://prism/lib/prism/node.rb#6524 class Prism::EnsureNode < ::Prism::Node # def initialize: (Location ensure_keyword_loc, StatementsNode? statements, Location end_keyword_loc, Location location) -> void # # @return [EnsureNode] a new instance of EnsureNode # - # source://prism/lib/prism/node.rb#6657 + # source://prism/lib/prism/node.rb#6526 + sig do + params( + source: Prism::Source, + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, ensure_keyword_loc, statements, end_keyword_loc, location); 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#6631 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6667 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6535 + 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#6672 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6540 + 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#6684 + # source://prism/lib/prism/node.rb#6552 + 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#6677 + # source://prism/lib/prism/node.rb#6545 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> EnsureNode + # def copy: (?ensure_keyword_loc: Location, ?statements: StatementsNode?, ?end_keyword_loc: Location, ?location: Location) -> EnsureNode # - # source://prism/lib/prism/node.rb#6689 - sig { params(params: T.untyped).returns(Prism::EnsureNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6557 + sig do + params( + ensure_keyword_loc: Prism::Location, + statements: T.nilable(Prism::StatementsNode), + end_keyword_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6672 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6540 + 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 } # - # source://prism/lib/prism/node.rb#6703 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6565 + 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#6729 + # source://prism/lib/prism/node.rb#6592 sig { returns(String) } def end_keyword; end # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/node.rb#6717 + # source://prism/lib/prism/node.rb#6580 sig { returns(Prism::Location) } def end_keyword_loc; end # def ensure_keyword: () -> String # - # source://prism/lib/prism/node.rb#6724 + # source://prism/lib/prism/node.rb#6587 sig { returns(String) } def ensure_keyword; end # attr_reader ensure_keyword_loc: Location # - # source://prism/lib/prism/node.rb#6708 + # source://prism/lib/prism/node.rb#6570 sig { returns(Prism::Location) } def ensure_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6734 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6597 + sig { override.returns(String) } + def inspect; end # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#6714 + # source://prism/lib/prism/node.rb#6577 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -11690,7 +13286,8 @@ class Prism::EnsureNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6761 + # source://prism/lib/prism/node.rb#6615 + sig { override.returns(Symbol) } def type; end class << self @@ -11701,7 +13298,7 @@ class Prism::EnsureNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6771 + # source://prism/lib/prism/node.rb#6625 def type; end end end @@ -11711,64 +13308,73 @@ end # false # ^^^^^ # -# source://prism/lib/prism/node.rb#6780 +# source://prism/lib/prism/node.rb#6643 class Prism::FalseNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [FalseNode] a new instance of FalseNode # - # source://prism/lib/prism/node.rb#6782 + # source://prism/lib/prism/node.rb#6645 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); 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#6718 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6789 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6651 + 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#6794 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6656 + 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#6804 + # source://prism/lib/prism/node.rb#6666 + 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#6799 + # source://prism/lib/prism/node.rb#6661 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> FalseNode + # def copy: (?location: Location) -> FalseNode # - # source://prism/lib/prism/node.rb#6809 - sig { params(params: T.untyped).returns(Prism::FalseNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6671 + sig { params(location: Prism::Location).returns(Prism::FalseNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6794 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6656 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#6820 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6679 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6826 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6684 + 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 @@ -11785,7 +13391,8 @@ class Prism::FalseNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#6845 + # source://prism/lib/prism/node.rb#6702 + sig { override.returns(Symbol) } def type; end class << self @@ -11796,7 +13403,7 @@ class Prism::FalseNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#6855 + # source://prism/lib/prism/node.rb#6712 def type; end end end @@ -11812,110 +13419,140 @@ end # foo in Foo(*bar, baz, *qux) # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#6870 +# source://prism/lib/prism/node.rb#6733 class Prism::FindPatternNode < ::Prism::Node - # def initialize: (Node? constant, Node left, Array[Node] requireds, Node right, Location? opening_loc, Location? closing_loc, Location location) -> void + # def initialize: (Prism::node? constant, Prism::node left, Array[Prism::node] requireds, Prism::node right, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [FindPatternNode] a new instance of FindPatternNode # - # source://prism/lib/prism/node.rb#6872 + # source://prism/lib/prism/node.rb#6735 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, constant, left, requireds, right, opening_loc, closing_loc, location); 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#6867 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#6885 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6747 + 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#6890 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6752 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#6974 + # source://prism/lib/prism/node.rb#6828 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#6956 + # source://prism/lib/prism/node.rb#6810 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#6905 + # source://prism/lib/prism/node.rb#6767 + 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#6895 + # source://prism/lib/prism/node.rb#6757 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader constant: Node? + # attr_reader constant: Prism::node? # - # source://prism/lib/prism/node.rb#6932 + # source://prism/lib/prism/node.rb#6785 sig { returns(T.nilable(Prism::Node)) } def constant; end - # def copy: (**params) -> FindPatternNode + # def copy: (?constant: Prism::node?, ?left: Prism::node, ?requireds: Array[Prism::node], ?right: Prism::node, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> FindPatternNode # - # source://prism/lib/prism/node.rb#6910 - sig { params(params: T.untyped).returns(Prism::FindPatternNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6772 + sig do + params( + constant: T.nilable(Prism::Node), + left: Prism::Node, + requireds: T::Array[Prism::Node], + right: Prism::Node, + opening_loc: T.nilable(Prism::Location), + closing_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#6890 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6752 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, left: Node, requireds: Array[Node], right: Node, opening_loc: Location?, closing_loc: Location?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#6927 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6780 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#6979 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6833 + sig { override.returns(String) } + def inspect; end - # attr_reader left: Node + # attr_reader left: Prism::node # - # source://prism/lib/prism/node.rb#6935 + # source://prism/lib/prism/node.rb#6788 sig { returns(Prism::Node) } def left; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#6969 + # source://prism/lib/prism/node.rb#6823 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#6944 + # source://prism/lib/prism/node.rb#6797 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # attr_reader requireds: Array[Node] + # attr_reader requireds: Array[Prism::node] # - # source://prism/lib/prism/node.rb#6938 + # source://prism/lib/prism/node.rb#6791 sig { returns(T::Array[Prism::Node]) } def requireds; end - # attr_reader right: Node + # attr_reader right: Prism::node # - # source://prism/lib/prism/node.rb#6941 + # source://prism/lib/prism/node.rb#6794 sig { returns(Prism::Node) } def right; end @@ -11934,7 +13571,8 @@ class Prism::FindPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7011 + # source://prism/lib/prism/node.rb#6851 + sig { override.returns(Symbol) } def type; end class << self @@ -11945,7 +13583,7 @@ class Prism::FindPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7021 + # source://prism/lib/prism/node.rb#6861 def type; end end end @@ -11955,94 +13593,120 @@ end # baz if foo .. bar # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#7030 +# source://prism/lib/prism/node.rb#6883 class Prism::FlipFlopNode < ::Prism::Node - # def initialize: (Integer flags, Node? left, Node? right, Location operator_loc, Location location) -> void + # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void # # @return [FlipFlopNode] a new instance of FlipFlopNode # - # source://prism/lib/prism/node.rb#7032 + # source://prism/lib/prism/node.rb#6885 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, flags, left, right, operator_loc, location); 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#6992 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7043 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#6895 + 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#7048 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6900 + 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#7061 + # source://prism/lib/prism/node.rb#6913 + 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#7053 + # source://prism/lib/prism/node.rb#6905 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> FlipFlopNode + # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> FlipFlopNode # - # source://prism/lib/prism/node.rb#7066 - sig { params(params: T.untyped).returns(Prism::FlipFlopNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#6918 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7048 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#6900 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#7081 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#6926 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # def exclude_end?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#7103 + # source://prism/lib/prism/node.rb#6948 sig { returns(T::Boolean) } def exclude_end?; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7113 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#6958 + sig { override.returns(String) } + def inspect; end - # attr_reader left: Node? + # attr_reader left: Prism::node? # - # source://prism/lib/prism/node.rb#7090 + # source://prism/lib/prism/node.rb#6935 sig { returns(T.nilable(Prism::Node)) } def left; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#7108 + # source://prism/lib/prism/node.rb#6953 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#7096 + # source://prism/lib/prism/node.rb#6941 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader right: Node? + # attr_reader right: Prism::node? # - # source://prism/lib/prism/node.rb#7093 + # source://prism/lib/prism/node.rb#6938 sig { returns(T.nilable(Prism::Node)) } def right; end @@ -12061,14 +13725,15 @@ class Prism::FlipFlopNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7147 + # source://prism/lib/prism/node.rb#6976 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#7086 + # source://prism/lib/prism/node.rb#6931 sig { returns(Integer) } def flags; end @@ -12080,7 +13745,7 @@ class Prism::FlipFlopNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7157 + # source://prism/lib/prism/node.rb#6986 def type; end end end @@ -12090,64 +13755,73 @@ end # 1.0 # ^^^ # -# source://prism/lib/prism/node.rb#7166 +# source://prism/lib/prism/node.rb#7005 class Prism::FloatNode < ::Prism::Node - # def initialize: (Location location) -> void + # def initialize: (Float value, Location location) -> void # # @return [FloatNode] a new instance of FloatNode # - # source://prism/lib/prism/node.rb#7168 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#7007 + sig { params(source: Prism::Source, value: Float, location: Prism::Location).void } + def initialize(source, value, location); 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#7084 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7175 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7014 + 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#7180 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7019 + 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#7190 + # source://prism/lib/prism/node.rb#7029 + 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#7185 + # source://prism/lib/prism/node.rb#7024 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> FloatNode + # def copy: (?value: Float, ?location: Location) -> FloatNode # - # source://prism/lib/prism/node.rb#7195 - sig { params(params: T.untyped).returns(Prism::FloatNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7034 + sig { params(value: Float, location: Prism::Location).returns(Prism::FloatNode) } + def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7180 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7019 + 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) -> { value: Float, location: Location } # - # source://prism/lib/prism/node.rb#7206 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7042 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7212 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7050 + 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 @@ -12164,12 +13838,14 @@ class Prism::FloatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7231 + # source://prism/lib/prism/node.rb#7068 + sig { override.returns(Symbol) } def type; end - # Returns the value of the node as a Ruby Float. + # The value of the floating point number as a Float. # - # source://prism/lib/prism/node_ext.rb#62 + # source://prism/lib/prism/node.rb#7047 + sig { returns(Float) } def value; end class << self @@ -12180,7 +13856,7 @@ class Prism::FloatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7241 + # source://prism/lib/prism/node.rb#7078 def type; end end end @@ -12190,128 +13866,183 @@ end # for i in a end # ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#7250 +# source://prism/lib/prism/node.rb#7094 class Prism::ForNode < ::Prism::Node - # def initialize: (Node index, Node collection, StatementsNode? statements, Location for_keyword_loc, Location in_keyword_loc, Location? do_keyword_loc, Location end_keyword_loc, Location location) -> void + # 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 # # @return [ForNode] a new instance of ForNode # - # source://prism/lib/prism/node.rb#7252 + # source://prism/lib/prism/node.rb#7096 + sig do + params( + source: Prism::Source, + index: Prism::Node, + 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 + ).void + end def initialize(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location); end - # def accept: (Visitor visitor) -> void + # 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#7266 - sig { params(visitor: Prism::Visitor).void } + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#7109 + 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#7271 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7114 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # attr_reader collection: Node + # The collection to iterate over. + # + # for i in a end + # ^ # - # source://prism/lib/prism/node.rb#7316 + # source://prism/lib/prism/node.rb#7155 sig { returns(Prism::Node) } def collection; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#7285 + # source://prism/lib/prism/node.rb#7128 + 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#7276 + # source://prism/lib/prism/node.rb#7119 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ForNode + # 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 # - # source://prism/lib/prism/node.rb#7290 - sig { params(params: T.untyped).returns(Prism::ForNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7133 + sig do + params( + index: Prism::Node, + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7271 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7114 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { index: Node, collection: 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) -> { 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 } # - # source://prism/lib/prism/node.rb#7308 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7141 + 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#7363 + # source://prism/lib/prism/node.rb#7222 sig { returns(T.nilable(String)) } def do_keyword; end - # attr_reader do_keyword_loc: Location? + # The location of the `do` keyword, if present. + # + # for i in a do end + # ^^ # - # source://prism/lib/prism/node.rb#7334 + # source://prism/lib/prism/node.rb#7189 sig { returns(T.nilable(Prism::Location)) } def do_keyword_loc; end # def end_keyword: () -> String # - # source://prism/lib/prism/node.rb#7368 + # source://prism/lib/prism/node.rb#7227 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#7346 + # source://prism/lib/prism/node.rb#7205 sig { returns(Prism::Location) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def for_keyword: () -> String # - # source://prism/lib/prism/node.rb#7353 + # source://prism/lib/prism/node.rb#7212 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#7322 + # source://prism/lib/prism/node.rb#7169 sig { returns(Prism::Location) } def for_keyword_loc; end # def in_keyword: () -> String # - # source://prism/lib/prism/node.rb#7358 + # source://prism/lib/prism/node.rb#7217 sig { returns(String) } def in_keyword; end - # attr_reader in_keyword_loc: Location + # The location of the `in` keyword. + # + # for i in a end + # ^^ # - # source://prism/lib/prism/node.rb#7328 + # source://prism/lib/prism/node.rb#7179 sig { returns(Prism::Location) } def in_keyword_loc; end - # attr_reader index: Node + # The index expression for `for` loops. + # + # for i in a end + # ^ # - # source://prism/lib/prism/node.rb#7313 + # source://prism/lib/prism/node.rb#7149 sig { returns(Prism::Node) } def index; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#7373 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7232 + sig { override.returns(String) } + def inspect; end - # attr_reader statements: StatementsNode? + # Represents the body of statements to execute for each iteration of the loop. + # + # for i in a + # foo(i) + # ^^^^^^ + # end # - # source://prism/lib/prism/node.rb#7319 + # source://prism/lib/prism/node.rb#7163 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -12330,7 +14061,8 @@ class Prism::ForNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7406 + # source://prism/lib/prism/node.rb#7250 + sig { override.returns(Symbol) } def type; end class << self @@ -12341,7 +14073,7 @@ class Prism::ForNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7416 + # source://prism/lib/prism/node.rb#7260 def type; end end end @@ -12353,64 +14085,73 @@ end # ^^^ # end # -# source://prism/lib/prism/node.rb#7427 +# source://prism/lib/prism/node.rb#7284 class Prism::ForwardingArgumentsNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ForwardingArgumentsNode] a new instance of ForwardingArgumentsNode # - # source://prism/lib/prism/node.rb#7429 + # source://prism/lib/prism/node.rb#7286 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); 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#7359 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7436 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7292 + 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#7441 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7297 + 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#7451 + # source://prism/lib/prism/node.rb#7307 + 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#7446 + # source://prism/lib/prism/node.rb#7302 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ForwardingArgumentsNode + # def copy: (?location: Location) -> ForwardingArgumentsNode # - # source://prism/lib/prism/node.rb#7456 - sig { params(params: T.untyped).returns(Prism::ForwardingArgumentsNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7312 + sig { params(location: Prism::Location).returns(Prism::ForwardingArgumentsNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7441 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#7467 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7320 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7473 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7325 + 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 @@ -12427,7 +14168,8 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7492 + # source://prism/lib/prism/node.rb#7343 + sig { override.returns(Symbol) } def type; end class << self @@ -12438,7 +14180,7 @@ class Prism::ForwardingArgumentsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7502 + # source://prism/lib/prism/node.rb#7353 def type; end end end @@ -12449,64 +14191,73 @@ end # ^^^ # end # -# source://prism/lib/prism/node.rb#7512 +# source://prism/lib/prism/node.rb#7369 class Prism::ForwardingParameterNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ForwardingParameterNode] a new instance of ForwardingParameterNode # - # source://prism/lib/prism/node.rb#7514 + # source://prism/lib/prism/node.rb#7371 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); 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#7444 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7521 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7377 + 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#7526 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7382 + 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#7536 + # source://prism/lib/prism/node.rb#7392 + 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#7531 + # source://prism/lib/prism/node.rb#7387 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ForwardingParameterNode + # def copy: (?location: Location) -> ForwardingParameterNode # - # source://prism/lib/prism/node.rb#7541 - sig { params(params: T.untyped).returns(Prism::ForwardingParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7397 + sig { params(location: Prism::Location).returns(Prism::ForwardingParameterNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7526 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7382 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#7552 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7405 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7558 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7410 + 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 @@ -12523,7 +14274,8 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7577 + # source://prism/lib/prism/node.rb#7428 + sig { override.returns(Symbol) } def type; end class << self @@ -12534,7 +14286,7 @@ class Prism::ForwardingParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7587 + # source://prism/lib/prism/node.rb#7438 def type; end end end @@ -12544,70 +14296,79 @@ end # super # ^^^^^ # -# source://prism/lib/prism/node.rb#7596 +# source://prism/lib/prism/node.rb#7453 class Prism::ForwardingSuperNode < ::Prism::Node # def initialize: (BlockNode? block, Location location) -> void # # @return [ForwardingSuperNode] a new instance of ForwardingSuperNode # - # source://prism/lib/prism/node.rb#7598 + # source://prism/lib/prism/node.rb#7455 + sig { params(source: Prism::Source, block: T.nilable(Prism::BlockNode), location: Prism::Location).void } def initialize(source, block, location); 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#7534 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7606 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7462 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader block: BlockNode? # - # source://prism/lib/prism/node.rb#7645 + # source://prism/lib/prism/node.rb#7497 sig { returns(T.nilable(Prism::BlockNode)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7611 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7467 + 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#7479 + 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#7616 + # source://prism/lib/prism/node.rb#7472 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ForwardingSuperNode + # def copy: (?block: BlockNode?, ?location: Location) -> ForwardingSuperNode # - # source://prism/lib/prism/node.rb#7628 - sig { params(params: T.untyped).returns(Prism::ForwardingSuperNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7484 + sig { params(block: T.nilable(Prism::BlockNode), location: Prism::Location).returns(Prism::ForwardingSuperNode) } + def copy(block: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7611 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7467 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { block: BlockNode?, location: Location } # - # source://prism/lib/prism/node.rb#7640 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7492 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7649 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7500 + 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 @@ -12624,7 +14385,8 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7674 + # source://prism/lib/prism/node.rb#7518 + sig { override.returns(Symbol) } def type; end class << self @@ -12635,7 +14397,7 @@ class Prism::ForwardingSuperNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7684 + # source://prism/lib/prism/node.rb#7528 def type; end end end @@ -12645,89 +14407,115 @@ end # $target &&= value # ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#7693 +# source://prism/lib/prism/node.rb#7544 class Prism::GlobalVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [GlobalVariableAndWriteNode] a new instance of GlobalVariableAndWriteNode # - # source://prism/lib/prism/node.rb#7695 + # source://prism/lib/prism/node.rb#7546 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#7648 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7706 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7556 + 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#7711 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7561 + 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#7721 + # source://prism/lib/prism/node.rb#7571 + 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#7716 + # source://prism/lib/prism/node.rb#7566 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableAndWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableAndWriteNode # - # source://prism/lib/prism/node.rb#7726 - sig { params(params: T.untyped).returns(Prism::GlobalVariableAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7576 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7711 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7561 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#7741 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7584 + 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#161 + # source://prism/lib/prism/desugar_compiler.rb#163 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7770 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7614 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#7746 + # source://prism/lib/prism/node.rb#7589 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#7749 + # source://prism/lib/prism/node.rb#7592 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#7765 + # source://prism/lib/prism/node.rb#7609 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#7755 + # source://prism/lib/prism/node.rb#7599 sig { returns(Prism::Location) } def operator_loc; end @@ -12746,12 +14534,13 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7794 + # source://prism/lib/prism/node.rb#7632 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#7761 + # source://prism/lib/prism/node.rb#7606 sig { returns(Prism::Node) } def value; end @@ -12763,7 +14552,7 @@ class Prism::GlobalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7804 + # source://prism/lib/prism/node.rb#7642 def type; end end end @@ -12773,90 +14562,130 @@ end # $target += value # ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#7813 +# source://prism/lib/prism/node.rb#7661 class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void # # @return [GlobalVariableOperatorWriteNode] a new instance of GlobalVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#7815 - def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # source://prism/lib/prism/node.rb#7663 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); 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#7764 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7827 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7674 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader binary_operator: Symbol + # + # source://prism/lib/prism/node.rb#7727 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#7717 + sig { returns(Prism::Location) } + def binary_operator_loc; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7832 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7679 + 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#7842 + # source://prism/lib/prism/node.rb#7689 + 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#7837 + # source://prism/lib/prism/node.rb#7684 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableOperatorWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#7847 - sig { params(params: T.untyped).returns(Prism::GlobalVariableOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7694 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7832 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7679 + 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: Node, operator: Symbol, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#7863 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7702 + 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#173 + # source://prism/lib/prism/desugar_compiler.rb#175 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#7890 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7730 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#7868 + # source://prism/lib/prism/node.rb#7707 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#7871 + # source://prism/lib/prism/node.rb#7710 sig { returns(Prism::Location) } def name_loc; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#7886 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#387 def operator; end - # attr_reader operator_loc: Location + # 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.rb#7877 - sig { returns(Prism::Location) } + # source://prism/lib/prism/node_ext.rb#394 def operator_loc; end # Sometimes you want to check an instance of a node against a list of @@ -12874,12 +14703,13 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#7915 + # source://prism/lib/prism/node.rb#7748 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#7883 + # source://prism/lib/prism/node.rb#7724 sig { returns(Prism::Node) } def value; end @@ -12891,7 +14721,7 @@ class Prism::GlobalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#7925 + # source://prism/lib/prism/node.rb#7758 def type; end end end @@ -12901,89 +14731,115 @@ end # $target ||= value # ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#7934 +# source://prism/lib/prism/node.rb#7778 class Prism::GlobalVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # # @return [GlobalVariableOrWriteNode] a new instance of GlobalVariableOrWriteNode # - # source://prism/lib/prism/node.rb#7936 + # source://prism/lib/prism/node.rb#7780 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, operator_loc, value, location); 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#7882 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#7947 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7790 + 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#7952 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7795 + 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#7962 + # source://prism/lib/prism/node.rb#7805 + 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#7957 + # source://prism/lib/prism/node.rb#7800 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableOrWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> GlobalVariableOrWriteNode # - # source://prism/lib/prism/node.rb#7967 - sig { params(params: T.untyped).returns(Prism::GlobalVariableOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7810 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#7952 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7795 + 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: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#7982 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7818 + 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#167 + # source://prism/lib/prism/desugar_compiler.rb#169 def desugar; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8011 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7848 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#7987 + # source://prism/lib/prism/node.rb#7823 sig { returns(Symbol) } def name; end # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#7990 + # source://prism/lib/prism/node.rb#7826 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#8006 + # source://prism/lib/prism/node.rb#7843 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#7996 + # source://prism/lib/prism/node.rb#7833 sig { returns(Prism::Location) } def operator_loc; end @@ -13002,12 +14858,13 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8035 + # source://prism/lib/prism/node.rb#7866 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#8002 + # source://prism/lib/prism/node.rb#7840 sig { returns(Prism::Node) } def value; end @@ -13019,7 +14876,7 @@ class Prism::GlobalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8045 + # source://prism/lib/prism/node.rb#7876 def type; end end end @@ -13029,64 +14886,73 @@ end # $foo # ^^^^ # -# source://prism/lib/prism/node.rb#8054 +# source://prism/lib/prism/node.rb#7895 class Prism::GlobalVariableReadNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [GlobalVariableReadNode] a new instance of GlobalVariableReadNode # - # source://prism/lib/prism/node.rb#8056 + # source://prism/lib/prism/node.rb#7897 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#7978 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8064 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7904 + 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#8069 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7909 + 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#8079 + # source://prism/lib/prism/node.rb#7919 + 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#8074 + # source://prism/lib/prism/node.rb#7914 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableReadNode + # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableReadNode # - # source://prism/lib/prism/node.rb#8084 - sig { params(params: T.untyped).returns(Prism::GlobalVariableReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#7924 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8069 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#7909 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#8096 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#7932 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8109 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#7944 + sig { override.returns(String) } + def inspect; end # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. # @@ -13094,7 +14960,7 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # $_Test # name `:$_Test` # - # source://prism/lib/prism/node.rb#8105 + # source://prism/lib/prism/node.rb#7941 sig { returns(Symbol) } def name; end @@ -13113,7 +14979,8 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8129 + # source://prism/lib/prism/node.rb#7962 + sig { override.returns(Symbol) } def type; end class << self @@ -13124,7 +14991,7 @@ class Prism::GlobalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8139 + # source://prism/lib/prism/node.rb#7972 def type; end end end @@ -13134,68 +15001,77 @@ end # $foo, $bar = baz # ^^^^ ^^^^ # -# source://prism/lib/prism/node.rb#8148 +# source://prism/lib/prism/node.rb#7988 class Prism::GlobalVariableTargetNode < ::Prism::Node # def initialize: (Symbol name, Location location) -> void # # @return [GlobalVariableTargetNode] a new instance of GlobalVariableTargetNode # - # source://prism/lib/prism/node.rb#8150 + # source://prism/lib/prism/node.rb#7990 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } def initialize(source, name, location); 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#8067 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8158 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#7997 + 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#8163 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8002 + 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#8173 + # source://prism/lib/prism/node.rb#8012 + 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#8168 + # source://prism/lib/prism/node.rb#8007 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableTargetNode + # def copy: (?name: Symbol, ?location: Location) -> GlobalVariableTargetNode # - # source://prism/lib/prism/node.rb#8178 - sig { params(params: T.untyped).returns(Prism::GlobalVariableTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8017 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::GlobalVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8163 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8002 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#8190 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8025 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8199 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8033 + sig { override.returns(String) } + def inspect; end # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#8195 + # source://prism/lib/prism/node.rb#8030 sig { returns(Symbol) } def name; end @@ -13214,7 +15090,8 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8219 + # source://prism/lib/prism/node.rb#8051 + sig { override.returns(Symbol) } def type; end class << self @@ -13225,7 +15102,7 @@ class Prism::GlobalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8229 + # source://prism/lib/prism/node.rb#8061 def type; end end end @@ -13235,86 +15112,122 @@ end # $foo = 1 # ^^^^^^^^ # -# source://prism/lib/prism/node.rb#8238 +# source://prism/lib/prism/node.rb#8077 class Prism::GlobalVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # # @return [GlobalVariableWriteNode] a new instance of GlobalVariableWriteNode # - # source://prism/lib/prism/node.rb#8240 + # source://prism/lib/prism/node.rb#8079 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, name, name_loc, value, operator_loc, location); 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#8197 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8251 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8089 + 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#8256 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8094 + 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#8266 + # source://prism/lib/prism/node.rb#8104 + 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#8261 + # source://prism/lib/prism/node.rb#8099 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> GlobalVariableWriteNode + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> GlobalVariableWriteNode # - # source://prism/lib/prism/node.rb#8271 - sig { params(params: T.untyped).returns(Prism::GlobalVariableWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8109 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8256 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#8286 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8117 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8315 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8163 + sig { override.returns(String) } + def inspect; end - # attr_reader name: Symbol + # The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. + # + # $foo = :bar # name `:$foo` # - # source://prism/lib/prism/node.rb#8291 + # $_Test = 123 # name `:$_Test` + # + # source://prism/lib/prism/node.rb#8126 sig { returns(Symbol) } def name; end - # attr_reader name_loc: Location + # The location of the global variable's name. # - # source://prism/lib/prism/node.rb#8294 + # $foo = :bar + # ^^^^ + # + # source://prism/lib/prism/node.rb#8132 sig { returns(Prism::Location) } def name_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#8310 + # source://prism/lib/prism/node.rb#8158 sig { returns(String) } def operator; end - # attr_reader operator_loc: Location + # The location of the `=` operator. # - # source://prism/lib/prism/node.rb#8303 + # $foo = :bar + # ^ + # + # source://prism/lib/prism/node.rb#8151 sig { returns(Prism::Location) } def operator_loc; end @@ -13333,12 +15246,19 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8339 + # source://prism/lib/prism/node.rb#8181 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # $foo = :bar + # ^^^^ + # + # $-xyz = 123 + # ^^^ # - # source://prism/lib/prism/node.rb#8300 + # source://prism/lib/prism/node.rb#8145 sig { returns(Prism::Node) } def value; end @@ -13350,7 +15270,7 @@ class Prism::GlobalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8349 + # source://prism/lib/prism/node.rb#8191 def type; end end end @@ -13360,30 +15280,45 @@ end # { a => b } # ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#8358 +# source://prism/lib/prism/node.rb#8210 class Prism::HashNode < ::Prism::Node - # def initialize: (Location opening_loc, Array[Node] elements, Location closing_loc, Location location) -> void + # def initialize: (Location opening_loc, Array[AssocNode | AssocSplatNode] elements, Location closing_loc, Location location) -> void # # @return [HashNode] a new instance of HashNode # - # source://prism/lib/prism/node.rb#8360 + # source://prism/lib/prism/node.rb#8212 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, opening_loc, elements, closing_loc, location); 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#8327 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8370 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8221 + 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#8375 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#8442 + # source://prism/lib/prism/node.rb#8288 sig { returns(String) } def closing; end @@ -13392,41 +15327,46 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism/lib/prism/node.rb#8430 + # source://prism/lib/prism/node.rb#8276 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#8385 + # source://prism/lib/prism/node.rb#8236 + 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#8380 + # source://prism/lib/prism/node.rb#8231 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> HashNode + # def copy: (?opening_loc: Location, ?elements: Array[AssocNode | AssocSplatNode], ?closing_loc: Location, ?location: Location) -> HashNode # - # source://prism/lib/prism/node.rb#8390 - sig { params(params: T.untyped).returns(Prism::HashNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8241 + sig do + params( + opening_loc: Prism::Location, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8375 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8226 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[Node], closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, elements: Array[AssocNode | AssocSplatNode], closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#8404 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8249 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end # The elements of the hash. These can be either `AssocNode`s or `AssocSplatNode`s. @@ -13437,18 +15377,22 @@ class Prism::HashNode < ::Prism::Node # { **foo } # ^^^^^ # - # source://prism/lib/prism/node.rb#8424 - sig { returns(T::Array[Prism::Node]) } + # source://prism/lib/prism/node.rb#8270 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } def elements; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8447 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8293 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#8437 + # source://prism/lib/prism/node.rb#8283 sig { returns(String) } def opening; end @@ -13457,7 +15401,7 @@ class Prism::HashNode < ::Prism::Node # { a => b } # ^ # - # source://prism/lib/prism/node.rb#8412 + # source://prism/lib/prism/node.rb#8257 sig { returns(Prism::Location) } def opening_loc; end @@ -13476,7 +15420,8 @@ class Prism::HashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8469 + # source://prism/lib/prism/node.rb#8311 + sig { override.returns(Symbol) } def type; end class << self @@ -13487,7 +15432,7 @@ class Prism::HashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8479 + # source://prism/lib/prism/node.rb#8321 def type; end end end @@ -13500,105 +15445,133 @@ end # foo => { a: 1, b: 2, **c } # ^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#8491 +# source://prism/lib/prism/node.rb#8343 class Prism::HashPatternNode < ::Prism::Node - # def initialize: (Node? constant, Array[Node] elements, Node? rest, Location? opening_loc, Location? closing_loc, Location location) -> void + # def initialize: (Prism::node? constant, Array[AssocNode] elements, AssocSplatNode | NoKeywordsParameterNode | nil rest, Location? opening_loc, Location? closing_loc, Location location) -> void # # @return [HashPatternNode] a new instance of HashPatternNode # - # source://prism/lib/prism/node.rb#8493 + # source://prism/lib/prism/node.rb#8345 + sig do + params( + source: Prism::Source, + constant: T.nilable(Prism::Node), + 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 + ).void + end def initialize(source, constant, elements, rest, opening_loc, closing_loc, location); 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#8472 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8505 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8356 + 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#8510 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#8589 + # source://prism/lib/prism/node.rb#8433 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#8571 + # source://prism/lib/prism/node.rb#8415 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#8524 + # source://prism/lib/prism/node.rb#8375 + 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#8515 + # source://prism/lib/prism/node.rb#8366 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader constant: Node? + # attr_reader constant: Prism::node? # - # source://prism/lib/prism/node.rb#8550 + # source://prism/lib/prism/node.rb#8393 sig { returns(T.nilable(Prism::Node)) } def constant; end - # def copy: (**params) -> HashPatternNode + # def copy: (?constant: Prism::node?, ?elements: Array[AssocNode], ?rest: AssocSplatNode | NoKeywordsParameterNode | nil, ?opening_loc: Location?, ?closing_loc: Location?, ?location: Location) -> HashPatternNode # - # source://prism/lib/prism/node.rb#8529 - sig { params(params: T.untyped).returns(Prism::HashPatternNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8380 + sig do + params( + constant: T.nilable(Prism::Node), + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8510 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8361 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Node?, elements: Array[Node], rest: Node?, opening_loc: Location?, closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { constant: Prism::node?, elements: Array[AssocNode], rest: AssocSplatNode | NoKeywordsParameterNode | nil, opening_loc: Location?, closing_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#8545 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8388 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] + # attr_reader elements: Array[AssocNode] # - # source://prism/lib/prism/node.rb#8553 - sig { returns(T::Array[Prism::Node]) } + # source://prism/lib/prism/node.rb#8396 + sig { returns(T::Array[Prism::AssocNode]) } def elements; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8594 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8438 + sig { override.returns(String) } + def inspect; end # def opening: () -> String? # - # source://prism/lib/prism/node.rb#8584 + # source://prism/lib/prism/node.rb#8428 sig { returns(T.nilable(String)) } def opening; end # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#8559 + # source://prism/lib/prism/node.rb#8402 sig { returns(T.nilable(Prism::Location)) } def opening_loc; end - # attr_reader rest: Node? + # attr_reader rest: AssocSplatNode | NoKeywordsParameterNode | nil # - # source://prism/lib/prism/node.rb#8556 - sig { returns(T.nilable(Prism::Node)) } + # source://prism/lib/prism/node.rb#8399 + 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 @@ -13616,7 +15589,8 @@ class Prism::HashPatternNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8628 + # source://prism/lib/prism/node.rb#8456 + sig { override.returns(Symbol) } def type; end class << self @@ -13627,22 +15601,22 @@ class Prism::HashPatternNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8638 + # source://prism/lib/prism/node.rb#8466 def type; end end end -# source://prism/lib/prism/node_ext.rb#35 +# source://prism/lib/prism/node_ext.rb#49 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#37 + # source://prism/lib/prism/node_ext.rb#51 def heredoc?; end end -# Represents the use of the `if` keyword, either in the block form or the modifier form. +# Represents the use of the `if` keyword, either in the block form or the modifier form, or a ternary expression. # # bar if foo # ^^^^^^^^^^ @@ -13650,119 +15624,198 @@ end # if foo then bar end # ^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#8650 +# foo ? bar : baz +# ^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#8493 class Prism::IfNode < ::Prism::Node - # def initialize: (Location? if_keyword_loc, Node predicate, Location? then_keyword_loc, StatementsNode? statements, Node? consequent, Location? end_keyword_loc, Location location) -> void + # 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 # # @return [IfNode] a new instance of IfNode # - # source://prism/lib/prism/node.rb#8652 + # source://prism/lib/prism/node.rb#8495 + sig do + params( + source: Prism::Source, + 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 + ).void + end def initialize(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); 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#8687 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8665 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8507 + 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#8674 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8512 + 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#8688 + # source://prism/lib/prism/node.rb#8526 + 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#8679 + # source://prism/lib/prism/node.rb#8517 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader consequent: Node? + # 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 + # ^^^ # - # source://prism/lib/prism/node.rb#8745 + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/node.rb#8617 sig { returns(T.nilable(Prism::Node)) } def consequent; end - # def copy: (**params) -> IfNode + # 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 # - # source://prism/lib/prism/node.rb#8693 - sig { params(params: T.untyped).returns(Prism::IfNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8531 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8674 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8512 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { if_keyword_loc: Location?, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#8710 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8539 + 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#8771 + # source://prism/lib/prism/node.rb#8648 sig { returns(T.nilable(String)) } def end_keyword; end - # attr_reader end_keyword_loc: Location? + # The location of the `end` keyword if present, `nil` otherwise. + # + # if foo + # bar + # end + # ^^^ # - # source://prism/lib/prism/node.rb#8748 + # source://prism/lib/prism/node.rb#8625 sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + # def if_keyword: () -> String? # - # source://prism/lib/prism/node.rb#8761 + # source://prism/lib/prism/node.rb#8638 sig { returns(T.nilable(String)) } def if_keyword; end - # attr_reader if_keyword_loc: Location? + # The location of the `if` keyword if present. + # + # bar if foo + # ^^ # - # source://prism/lib/prism/node.rb#8715 + # The `if_keyword_loc` field will be `nil` when the `IfNode` represents a ternary expression. + # + # source://prism/lib/prism/node.rb#8549 sig { returns(T.nilable(Prism::Location)) } def if_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#8776 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8653 + sig { override.returns(String) } + def inspect; end - # attr_reader predicate: Node + # source://prism/lib/prism/parse_result/newlines.rb#91 + def newline!(lines); end + + # The node for the condition the `IfNode` is testing. + # + # if foo + # ^^^ + # bar + # end # - # source://prism/lib/prism/node.rb#8727 + # bar if foo + # ^^^ + # + # foo ? bar : baz + # ^^^ + # + # source://prism/lib/prism/node.rb#8573 sig { returns(Prism::Node) } def predicate; end - # source://prism/lib/prism/node.rb#8669 - def set_newline_flag(newline_marked); end - - # attr_reader statements: StatementsNode? + # 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 + # bar + # ^^^ + # baz + # ^^^ + # end # - # source://prism/lib/prism/node.rb#8742 + # source://prism/lib/prism/node.rb#8602 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism/lib/prism/node.rb#8766 + # source://prism/lib/prism/node.rb#8643 sig { returns(T.nilable(String)) } def then_keyword; end - # attr_reader then_keyword_loc: Location? + # The location of the `then` keyword (if present) or the `?` in a ternary expression, `nil` otherwise. + # + # if foo then bar end + # ^^^^ + # + # a ? b : c + # ^ # - # source://prism/lib/prism/node.rb#8730 + # source://prism/lib/prism/node.rb#8582 sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end @@ -13781,7 +15834,8 @@ class Prism::IfNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8812 + # source://prism/lib/prism/node.rb#8671 + sig { override.returns(Symbol) } def type; end class << self @@ -13792,7 +15846,7 @@ class Prism::IfNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8822 + # source://prism/lib/prism/node.rb#8681 def type; end end end @@ -13802,69 +15856,89 @@ end # 1.0i # ^^^^ # -# source://prism/lib/prism/node.rb#8831 +# source://prism/lib/prism/node.rb#8702 class Prism::ImaginaryNode < ::Prism::Node - # def initialize: (Node numeric, Location location) -> void + # def initialize: (FloatNode | IntegerNode | RationalNode numeric, Location location) -> void # # @return [ImaginaryNode] a new instance of ImaginaryNode # - # source://prism/lib/prism/node.rb#8833 + # source://prism/lib/prism/node.rb#8704 + sig do + params( + source: Prism::Source, + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).void + end def initialize(source, numeric, location); 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#8781 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8841 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8711 + 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#8846 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8716 + 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#8856 + # source://prism/lib/prism/node.rb#8726 + 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#8851 + # source://prism/lib/prism/node.rb#8721 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ImaginaryNode + # def copy: (?numeric: FloatNode | IntegerNode | RationalNode, ?location: Location) -> ImaginaryNode # - # source://prism/lib/prism/node.rb#8861 - sig { params(params: T.untyped).returns(Prism::ImaginaryNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8731 + sig do + params( + numeric: T.any(Prism::FloatNode, Prism::IntegerNode, Prism::RationalNode), + location: Prism::Location + ).returns(Prism::ImaginaryNode) + end + def copy(numeric: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8846 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8716 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: FloatNode | IntegerNode | RationalNode, location: Location } # - # source://prism/lib/prism/node.rb#8873 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8739 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8882 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8747 + sig { override.returns(String) } + def inspect; end - # attr_reader numeric: Node + # attr_reader numeric: FloatNode | IntegerNode | RationalNode # - # source://prism/lib/prism/node.rb#8878 - sig { returns(Prism::Node) } + # source://prism/lib/prism/node.rb#8744 + 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 @@ -13882,12 +15956,14 @@ class Prism::ImaginaryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#8903 + # source://prism/lib/prism/node.rb#8765 + sig { override.returns(Symbol) } def type; end # Returns the value of the node as a Ruby Complex. # - # source://prism/lib/prism/node_ext.rb#69 + # source://prism/lib/prism/node_ext.rb#101 + sig { returns(Complex) } def value; end class << self @@ -13898,7 +15974,7 @@ class Prism::ImaginaryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#8913 + # source://prism/lib/prism/node.rb#8775 def type; end end end @@ -13914,64 +15990,73 @@ end # foo in { bar: } # ^^^^ # -# source://prism/lib/prism/node.rb#8928 +# source://prism/lib/prism/node.rb#8797 class Prism::ImplicitNode < ::Prism::Node - # def initialize: (Node value, Location location) -> void + # def initialize: (Prism::node value, Location location) -> void # # @return [ImplicitNode] a new instance of ImplicitNode # - # source://prism/lib/prism/node.rb#8930 + # source://prism/lib/prism/node.rb#8799 + sig { params(source: Prism::Source, value: Prism::Node, location: Prism::Location).void } def initialize(source, value, location); 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#8876 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#8938 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8806 + 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#8943 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8811 + 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#8953 + # source://prism/lib/prism/node.rb#8821 + 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#8948 + # source://prism/lib/prism/node.rb#8816 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ImplicitNode + # def copy: (?value: Prism::node, ?location: Location) -> ImplicitNode # - # source://prism/lib/prism/node.rb#8958 - sig { params(params: T.untyped).returns(Prism::ImplicitNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8826 + sig { params(value: Prism::Node, location: Prism::Location).returns(Prism::ImplicitNode) } + def copy(value: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#8943 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8811 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#8970 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8834 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#8979 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#8842 + 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 @@ -13988,12 +16073,13 @@ class Prism::ImplicitNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9000 + # source://prism/lib/prism/node.rb#8860 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#8975 + # source://prism/lib/prism/node.rb#8839 sig { returns(Prism::Node) } def value; end @@ -14005,7 +16091,7 @@ class Prism::ImplicitNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9010 + # source://prism/lib/prism/node.rb#8870 def type; end end end @@ -14024,64 +16110,73 @@ end # foo, = bar # ^ # -# source://prism/lib/prism/node.rb#9028 +# source://prism/lib/prism/node.rb#8895 class Prism::ImplicitRestNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [ImplicitRestNode] a new instance of ImplicitRestNode # - # source://prism/lib/prism/node.rb#9030 + # source://prism/lib/prism/node.rb#8897 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); 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#8970 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9037 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8903 + 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#9042 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8908 + 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#9052 + # source://prism/lib/prism/node.rb#8918 + 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#9047 + # source://prism/lib/prism/node.rb#8913 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ImplicitRestNode + # def copy: (?location: Location) -> ImplicitRestNode # - # source://prism/lib/prism/node.rb#9057 - sig { params(params: T.untyped).returns(Prism::ImplicitRestNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#8923 + sig { params(location: Prism::Location).returns(Prism::ImplicitRestNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9042 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8908 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#9068 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#8931 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#9074 - def inspect(inspector = T.unsafe(nil)); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#8936 + 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 @@ -14098,7 +16193,8 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9093 + # source://prism/lib/prism/node.rb#8954 + sig { override.returns(Symbol) } def type; end class << self @@ -14109,7 +16205,7 @@ class Prism::ImplicitRestNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9103 + # source://prism/lib/prism/node.rb#8964 def type; end end end @@ -14119,98 +16215,124 @@ end # case a; in b then c end # ^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#9112 +# source://prism/lib/prism/node.rb#8979 class Prism::InNode < ::Prism::Node - # def initialize: (Node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void + # def initialize: (Prism::node pattern, StatementsNode? statements, Location in_loc, Location? then_loc, Location location) -> void # # @return [InNode] a new instance of InNode # - # source://prism/lib/prism/node.rb#9114 + # source://prism/lib/prism/node.rb#8981 + sig do + params( + source: Prism::Source, + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, pattern, statements, in_loc, then_loc, location); 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#9097 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9125 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#8991 + 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#9130 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8996 + 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#9143 + # source://prism/lib/prism/node.rb#9009 + 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#9135 + # source://prism/lib/prism/node.rb#9001 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> InNode + # def copy: (?pattern: Prism::node, ?statements: StatementsNode?, ?in_loc: Location, ?then_loc: Location?, ?location: Location) -> InNode # - # source://prism/lib/prism/node.rb#9148 - sig { params(params: T.untyped).returns(Prism::InNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#9014 + sig do + params( + pattern: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + in_loc: Prism::Location, + then_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9130 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#8996 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { pattern: Prism::node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#9163 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#9022 + 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 in: () -> String # - # source://prism/lib/prism/node.rb#9193 + # source://prism/lib/prism/node.rb#9053 sig { returns(String) } def in; end # attr_reader in_loc: Location # - # source://prism/lib/prism/node.rb#9174 + # source://prism/lib/prism/node.rb#9033 sig { returns(Prism::Location) } def in_loc; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#9203 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9063 + sig { override.returns(String) } + def inspect; end - # attr_reader pattern: Node + # attr_reader pattern: Prism::node # - # source://prism/lib/prism/node.rb#9168 + # source://prism/lib/prism/node.rb#9027 sig { returns(Prism::Node) } def pattern; end # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#9171 + # source://prism/lib/prism/node.rb#9030 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then: () -> String? # - # source://prism/lib/prism/node.rb#9198 + # source://prism/lib/prism/node.rb#9058 sig { returns(T.nilable(String)) } def then; end # attr_reader then_loc: Location? # - # source://prism/lib/prism/node.rb#9180 + # source://prism/lib/prism/node.rb#9040 sig { returns(T.nilable(Prism::Location)) } def then_loc; end @@ -14229,7 +16351,8 @@ class Prism::InNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9232 + # source://prism/lib/prism/node.rb#9081 + sig { override.returns(Symbol) } def type; end class << self @@ -14240,7 +16363,7 @@ class Prism::InNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9242 + # source://prism/lib/prism/node.rb#9091 def type; end end end @@ -14250,24 +16373,45 @@ end # foo.bar[baz] &&= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#9251 +# source://prism/lib/prism/node.rb#9110 class Prism::IndexAndWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [IndexAndWriteNode] a new instance of IndexAndWriteNode # - # source://prism/lib/prism/node.rb#9253 + # source://prism/lib/prism/node.rb#9112 + sig do + params( + source: Prism::Source, + 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), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); 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#9289 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9269 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#9127 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#9344 + # source://prism/lib/prism/node.rb#9192 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -14275,119 +16419,134 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9376 + # source://prism/lib/prism/node.rb#9225 sig { returns(T::Boolean) } def attribute_write?; end - # attr_reader block: Node? + # attr_reader block: Prism::node? # - # source://prism/lib/prism/node.rb#9353 + # source://prism/lib/prism/node.rb#9202 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#9386 + # source://prism/lib/prism/node.rb#9235 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#9326 + # source://prism/lib/prism/node.rb#9172 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9274 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#9396 + # source://prism/lib/prism/node.rb#9245 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#9347 + # source://prism/lib/prism/node.rb#9195 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#9289 + # source://prism/lib/prism/node.rb#9147 + 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#9279 + # source://prism/lib/prism/node.rb#9137 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> IndexAndWriteNode + # 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 # - # source://prism/lib/prism/node.rb#9294 - sig { params(params: T.untyped).returns(Prism::IndexAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#9152 + sig do + params( + 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), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9274 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9132 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#9314 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#9160 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9381 + # source://prism/lib/prism/node.rb#9230 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#9406 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9255 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#9391 + # source://prism/lib/prism/node.rb#9240 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#9338 + # source://prism/lib/prism/node.rb#9185 sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#9401 + # source://prism/lib/prism/node.rb#9250 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#9356 + # source://prism/lib/prism/node.rb#9205 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#9323 + # source://prism/lib/prism/node.rb#9169 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -14395,7 +16554,7 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9366 + # source://prism/lib/prism/node.rb#9215 sig { returns(T::Boolean) } def safe_navigation?; end @@ -14414,12 +16573,13 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9451 + # source://prism/lib/prism/node.rb#9273 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#9362 + # source://prism/lib/prism/node.rb#9212 sig { returns(Prism::Node) } def value; end @@ -14427,15 +16587,15 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9371 + # source://prism/lib/prism/node.rb#9220 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#9319 + # source://prism/lib/prism/node.rb#9165 sig { returns(Integer) } def flags; end @@ -14447,7 +16607,7 @@ class Prism::IndexAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9461 + # source://prism/lib/prism/node.rb#9283 def type; end end end @@ -14457,24 +16617,46 @@ end # foo.bar[baz] += value # ^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#9470 +# source://prism/lib/prism/node.rb#9307 class Prism::IndexOperatorWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Symbol operator, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [IndexOperatorWriteNode] a new instance of IndexOperatorWriteNode # - # source://prism/lib/prism/node.rb#9472 - def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location); end + # source://prism/lib/prism/node.rb#9309 + sig do + params( + source: Prism::Source, + 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), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location); 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#9485 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9489 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#9325 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#9565 + # source://prism/lib/prism/node.rb#9390 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -14482,119 +16664,147 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9600 + # source://prism/lib/prism/node.rb#9426 sig { returns(T::Boolean) } def attribute_write?; end - # attr_reader block: Node? + # attr_reader binary_operator: Symbol # - # source://prism/lib/prism/node.rb#9574 + # source://prism/lib/prism/node.rb#9403 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#9406 + sig { returns(Prism::Location) } + def binary_operator_loc; end + + # attr_reader block: Prism::node? + # + # source://prism/lib/prism/node.rb#9400 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#9610 + # source://prism/lib/prism/node.rb#9436 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#9547 + # source://prism/lib/prism/node.rb#9370 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9494 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9330 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#9620 + # source://prism/lib/prism/node.rb#9446 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#9568 + # source://prism/lib/prism/node.rb#9393 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#9509 + # source://prism/lib/prism/node.rb#9345 + 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#9499 + # source://prism/lib/prism/node.rb#9335 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> IndexOperatorWriteNode + # 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 # - # source://prism/lib/prism/node.rb#9514 - sig { params(params: T.untyped).returns(Prism::IndexOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#9350 + sig do + params( + 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), + binary_operator: Symbol, + binary_operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9494 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9330 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator: Symbol, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#9535 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#9358 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9605 + # source://prism/lib/prism/node.rb#9431 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#9625 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9451 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#9615 + # source://prism/lib/prism/node.rb#9441 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#9559 + # source://prism/lib/prism/node.rb#9383 sig { returns(Prism::Location) } def opening_loc; end - # attr_reader operator: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#9577 - sig { returns(Symbol) } + # source://prism/lib/prism/node_ext.rb#403 def operator; end - # attr_reader operator_loc: Location + # 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.rb#9580 - sig { returns(Prism::Location) } + # source://prism/lib/prism/node_ext.rb#410 def operator_loc; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#9544 + # source://prism/lib/prism/node.rb#9367 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -14602,7 +16812,7 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9590 + # source://prism/lib/prism/node.rb#9416 sig { returns(T::Boolean) } def safe_navigation?; end @@ -14621,12 +16831,13 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9671 + # source://prism/lib/prism/node.rb#9469 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#9586 + # source://prism/lib/prism/node.rb#9413 sig { returns(Prism::Node) } def value; end @@ -14634,15 +16845,15 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9595 + # source://prism/lib/prism/node.rb#9421 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#9540 + # source://prism/lib/prism/node.rb#9363 sig { returns(Integer) } def flags; end @@ -14654,7 +16865,7 @@ class Prism::IndexOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9681 + # source://prism/lib/prism/node.rb#9479 def type; end end end @@ -14664,24 +16875,45 @@ end # foo.bar[baz] ||= value # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#9690 +# source://prism/lib/prism/node.rb#9504 class Prism::IndexOrWriteNode < ::Prism::Node - # def initialize: (Integer flags, Node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location operator_loc, Node value, Location location) -> void + # 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 # # @return [IndexOrWriteNode] a new instance of IndexOrWriteNode # - # source://prism/lib/prism/node.rb#9692 + # source://prism/lib/prism/node.rb#9506 + sig do + params( + source: Prism::Source, + 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), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location); 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#9683 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9708 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#9521 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#9783 + # source://prism/lib/prism/node.rb#9586 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -14689,119 +16921,134 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9815 + # source://prism/lib/prism/node.rb#9619 sig { returns(T::Boolean) } def attribute_write?; end - # attr_reader block: Node? + # attr_reader block: Prism::node? # - # source://prism/lib/prism/node.rb#9792 + # source://prism/lib/prism/node.rb#9596 sig { returns(T.nilable(Prism::Node)) } def block; end # def call_operator: () -> String? # - # source://prism/lib/prism/node.rb#9825 + # source://prism/lib/prism/node.rb#9629 sig { returns(T.nilable(String)) } def call_operator; end # attr_reader call_operator_loc: Location? # - # source://prism/lib/prism/node.rb#9765 + # source://prism/lib/prism/node.rb#9566 sig { returns(T.nilable(Prism::Location)) } def call_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9713 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9526 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#9835 + # source://prism/lib/prism/node.rb#9639 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#9786 + # source://prism/lib/prism/node.rb#9589 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#9728 + # source://prism/lib/prism/node.rb#9541 + 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#9718 + # source://prism/lib/prism/node.rb#9531 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> IndexOrWriteNode + # 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 # - # source://prism/lib/prism/node.rb#9733 - sig { params(params: T.untyped).returns(Prism::IndexOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#9546 + sig do + params( + 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), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9713 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9526 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#9753 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#9554 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9820 + # source://prism/lib/prism/node.rb#9624 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#9845 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9649 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#9830 + # source://prism/lib/prism/node.rb#9634 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#9777 + # source://prism/lib/prism/node.rb#9579 sig { returns(Prism::Location) } def opening_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#9840 + # source://prism/lib/prism/node.rb#9644 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#9795 + # source://prism/lib/prism/node.rb#9599 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader receiver: Node? + # attr_reader receiver: Prism::node? # - # source://prism/lib/prism/node.rb#9762 + # source://prism/lib/prism/node.rb#9563 sig { returns(T.nilable(Prism::Node)) } def receiver; end @@ -14809,7 +17056,7 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9805 + # source://prism/lib/prism/node.rb#9609 sig { returns(T::Boolean) } def safe_navigation?; end @@ -14828,12 +17075,13 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#9890 + # source://prism/lib/prism/node.rb#9667 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#9801 + # source://prism/lib/prism/node.rb#9606 sig { returns(Prism::Node) } def value; end @@ -14841,15 +17089,15 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#9810 + # source://prism/lib/prism/node.rb#9614 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#9758 + # source://prism/lib/prism/node.rb#9559 sig { returns(Integer) } def flags; end @@ -14861,7 +17109,7 @@ class Prism::IndexOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#9900 + # source://prism/lib/prism/node.rb#9677 def type; end end end @@ -14879,24 +17127,42 @@ end # for foo[bar] in baz do end # ^^^^^^^^ # -# source://prism/lib/prism/node.rb#9917 +# source://prism/lib/prism/node.rb#9709 class Prism::IndexTargetNode < ::Prism::Node - # def initialize: (Integer flags, Node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Node? block, Location location) -> void + # def initialize: (Integer flags, Prism::node receiver, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location location) -> void # # @return [IndexTargetNode] a new instance of IndexTargetNode # - # source://prism/lib/prism/node.rb#9919 + # source://prism/lib/prism/node.rb#9711 + sig do + params( + source: Prism::Source, + 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 + ).void + end def initialize(source, flags, receiver, opening_loc, arguments, closing_loc, block, location); 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#9851 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#9932 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#9723 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#9991 + # source://prism/lib/prism/node.rb#9774 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end @@ -14904,95 +17170,107 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#10014 + # source://prism/lib/prism/node.rb#9797 sig { returns(T::Boolean) } def attribute_write?; end - # attr_reader block: Node? + # attr_reader block: Prism::node? # - # source://prism/lib/prism/node.rb#10000 + # source://prism/lib/prism/node.rb#9784 sig { returns(T.nilable(Prism::Node)) } def block; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9937 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9728 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#10029 + # source://prism/lib/prism/node.rb#9812 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#9994 + # source://prism/lib/prism/node.rb#9777 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#9951 + # source://prism/lib/prism/node.rb#9742 + 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#9942 + # source://prism/lib/prism/node.rb#9733 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> IndexTargetNode + # def copy: (?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?location: Location) -> IndexTargetNode # - # source://prism/lib/prism/node.rb#9956 - sig { params(params: T.untyped).returns(Prism::IndexTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#9747 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#9937 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#9728 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, location: Location } # - # source://prism/lib/prism/node.rb#9973 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#9755 + 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 ignore_visibility?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#10019 + # source://prism/lib/prism/node.rb#9802 sig { returns(T::Boolean) } def ignore_visibility?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#10034 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9817 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#10024 + # source://prism/lib/prism/node.rb#9807 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#9985 + # source://prism/lib/prism/node.rb#9767 sig { returns(Prism::Location) } def opening_loc; end - # attr_reader receiver: Node + # attr_reader receiver: Prism::node # - # source://prism/lib/prism/node.rb#9982 + # source://prism/lib/prism/node.rb#9764 sig { returns(Prism::Node) } def receiver; end @@ -15000,7 +17278,7 @@ class Prism::IndexTargetNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#10004 + # source://prism/lib/prism/node.rb#9787 sig { returns(T::Boolean) } def safe_navigation?; end @@ -15019,22 +17297,23 @@ class Prism::IndexTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#10071 + # source://prism/lib/prism/node.rb#9835 + sig { override.returns(Symbol) } def type; end # def variable_call?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#10009 + # source://prism/lib/prism/node.rb#9792 sig { returns(T::Boolean) } def variable_call?; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#9978 + # source://prism/lib/prism/node.rb#9760 sig { returns(Integer) } def flags; end @@ -15046,7 +17325,7 @@ class Prism::IndexTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#10081 + # source://prism/lib/prism/node.rb#9845 def type; end end end @@ -15054,11 +17333,12 @@ 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#275 +# source://prism/lib/prism/parse_result.rb#388 class Prism::InlineComment < ::Prism::Comment # Returns a string representation of this comment. # - # source://prism/lib/prism/parse_result.rb#283 + # source://prism/lib/prism/parse_result.rb#396 + sig { returns(String) } def inspect; end # Returns true if this comment happens on the same line as other code and @@ -15066,1061 +17346,949 @@ class Prism::InlineComment < ::Prism::Comment # # @return [Boolean] # - # source://prism/lib/prism/parse_result.rb#278 + # source://prism/lib/prism/parse_result.rb#391 sig { override.returns(T::Boolean) } def trailing?; end end -# Represents the use of the `&&=` operator for assignment to an instance variable. -# -# @target &&= value -# ^^^^^^^^^^^^^^^^^ +# This visitor is responsible for composing the strings that get returned by +# the various #inspect methods defined on each of the nodes. # -# source://prism/lib/prism/node.rb#10090 -class Prism::InstanceVariableAndWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void +# source://prism/lib/prism/inspect_visitor.rb#12 +class Prism::InspectVisitor < ::Prism::Visitor + # Initializes a new instance of the InspectVisitor. # - # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode + # @return [InspectVisitor] a new instance of InspectVisitor # - # source://prism/lib/prism/node.rb#10092 - def initialize(source, name, name_loc, operator_loc, value, location); end + # source://prism/lib/prism/inspect_visitor.rb#35 + sig { params(indent: String).void } + def initialize(indent = T.unsafe(nil)); end - # def accept: (Visitor visitor) -> void + # The list of commands that we need to execute in order to compose the + # final string. # - # source://prism/lib/prism/node.rb#10103 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#32 + def commands; end - # def child_nodes: () -> Array[nil | Node] + # Compose the final string. # - # source://prism/lib/prism/node.rb#10108 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#48 + sig { returns(String) } + def compose; end - # def comment_targets: () -> Array[Node | Location] + # The current prefix string. # - # source://prism/lib/prism/node.rb#10118 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#28 + def indent; end - # def compact_child_nodes: () -> Array[Node] + # Inspect a AliasGlobalVariableNode node. # - # source://prism/lib/prism/node.rb#10113 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#77 + def visit_alias_global_variable_node(node); end - # def copy: (**params) -> InstanceVariableAndWriteNode + # Inspect a AliasMethodNode node. # - # source://prism/lib/prism/node.rb#10123 - sig { params(params: T.untyped).returns(Prism::InstanceVariableAndWriteNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#87 + def visit_alias_method_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a AlternationPatternNode node. # - # source://prism/lib/prism/node.rb#10108 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#97 + def visit_alternation_pattern_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } + # Inspect a AndNode node. # - # source://prism/lib/prism/node.rb#10138 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#107 + def visit_and_node(node); end - # source://prism/lib/prism/desugar_compiler.rb#179 - def desugar; end + # Inspect a ArgumentsNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#117 + def visit_arguments_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a ArrayNode node. # - # source://prism/lib/prism/node.rb#10167 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#133 + def visit_array_node(node); end - # attr_reader name: Symbol + # Inspect a ArrayPatternNode node. # - # source://prism/lib/prism/node.rb#10143 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#151 + def visit_array_pattern_node(node); end - # attr_reader name_loc: Location + # Inspect a AssocNode node. # - # source://prism/lib/prism/node.rb#10146 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/inspect_visitor.rb#188 + def visit_assoc_node(node); end - # def operator: () -> String + # Inspect a AssocSplatNode node. # - # source://prism/lib/prism/node.rb#10162 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/inspect_visitor.rb#198 + def visit_assoc_splat_node(node); end - # attr_reader operator_loc: Location + # Inspect a BackReferenceReadNode node. # - # source://prism/lib/prism/node.rb#10152 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/inspect_visitor.rb#210 + def visit_back_reference_read_node(node); 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. + # Inspect a BeginNode node. # - # 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/inspect_visitor.rb#216 + def visit_begin_node(node); end + + # Inspect a BlockArgumentNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#247 + def visit_block_argument_node(node); end + + # Inspect a BlockLocalVariableNode node. # - # source://prism/lib/prism/node.rb#10191 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#259 + def visit_block_local_variable_node(node); end - # attr_reader value: Node + # Inspect a BlockNode node. # - # source://prism/lib/prism/node.rb#10158 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/inspect_visitor.rb#267 + def visit_block_node(node); 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 - # - # source://prism/lib/prism/node.rb#10201 - def type; end - end -end + # Inspect a BlockParameterNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#287 + def visit_block_parameter_node(node); end -# Represents assigning to an instance variable using an operator that isn't `=`. -# -# @target += value -# ^^^^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#10210 -class Prism::InstanceVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Symbol operator, Location location) -> void + # Inspect a BlockParametersNode node. # - # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode + # source://prism/lib/prism/inspect_visitor.rb#301 + def visit_block_parameters_node(node); end + + # Inspect a BreakNode node. # - # source://prism/lib/prism/node.rb#10212 - def initialize(source, name, name_loc, operator_loc, value, operator, location); end + # source://prism/lib/prism/inspect_visitor.rb#323 + def visit_break_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a CallAndWriteNode node. # - # source://prism/lib/prism/node.rb#10224 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#335 + def visit_call_and_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a CallNode node. # - # source://prism/lib/prism/node.rb#10229 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#355 + def visit_call_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a CallOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10239 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#385 + def visit_call_operator_write_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a CallOrWriteNode node. # - # source://prism/lib/prism/node.rb#10234 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#406 + def visit_call_or_write_node(node); end - # def copy: (**params) -> InstanceVariableOperatorWriteNode + # Inspect a CallTargetNode node. # - # source://prism/lib/prism/node.rb#10244 - sig { params(params: T.untyped).returns(Prism::InstanceVariableOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#426 + def visit_call_target_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a CapturePatternNode node. # - # source://prism/lib/prism/node.rb#10229 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#438 + def visit_capture_pattern_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location } + # Inspect a CaseMatchNode node. # - # source://prism/lib/prism/node.rb#10260 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#448 + def visit_case_match_node(node); end - # source://prism/lib/prism/desugar_compiler.rb#191 - def desugar; end + # Inspect a CaseNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#476 + def visit_case_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a ClassNode node. # - # source://prism/lib/prism/node.rb#10287 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#504 + def visit_class_node(node); end - # attr_reader name: Symbol + # Inspect a ClassVariableAndWriteNode node. # - # source://prism/lib/prism/node.rb#10265 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#528 + def visit_class_variable_and_write_node(node); end - # attr_reader name_loc: Location + # Inspect a ClassVariableOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10268 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/inspect_visitor.rb#538 + def visit_class_variable_operator_write_node(node); end - # attr_reader operator: Symbol + # Inspect a ClassVariableOrWriteNode node. # - # source://prism/lib/prism/node.rb#10283 - sig { returns(Symbol) } - def operator; end + # source://prism/lib/prism/inspect_visitor.rb#549 + def visit_class_variable_or_write_node(node); end - # attr_reader operator_loc: Location + # Inspect a ClassVariableReadNode node. # - # source://prism/lib/prism/node.rb#10274 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/inspect_visitor.rb#559 + def visit_class_variable_read_node(node); 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. + # Inspect a ClassVariableTargetNode node. # - # 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/inspect_visitor.rb#565 + def visit_class_variable_target_node(node); end + + # Inspect a ClassVariableWriteNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#571 + def visit_class_variable_write_node(node); end + + # Inspect a ConstantAndWriteNode node. # - # source://prism/lib/prism/node.rb#10312 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#581 + def visit_constant_and_write_node(node); end - # attr_reader value: Node + # Inspect a ConstantOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10280 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/inspect_visitor.rb#591 + def visit_constant_operator_write_node(node); 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 - # - # source://prism/lib/prism/node.rb#10322 - def type; end - end -end + # Inspect a ConstantOrWriteNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#602 + def visit_constant_or_write_node(node); end -# Represents the use of the `||=` operator for assignment to an instance variable. -# -# @target ||= value -# ^^^^^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#10331 -class Prism::InstanceVariableOrWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void + # Inspect a ConstantPathAndWriteNode node. # - # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode + # source://prism/lib/prism/inspect_visitor.rb#612 + def visit_constant_path_and_write_node(node); end + + # Inspect a ConstantPathNode node. # - # source://prism/lib/prism/node.rb#10333 - def initialize(source, name, name_loc, operator_loc, value, location); end + # source://prism/lib/prism/inspect_visitor.rb#622 + def visit_constant_path_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a ConstantPathOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10344 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#640 + def visit_constant_path_operator_write_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a ConstantPathOrWriteNode node. # - # source://prism/lib/prism/node.rb#10349 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#651 + def visit_constant_path_or_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a ConstantPathTargetNode node. # - # source://prism/lib/prism/node.rb#10359 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#661 + def visit_constant_path_target_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a ConstantPathWriteNode node. # - # source://prism/lib/prism/node.rb#10354 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#679 + def visit_constant_path_write_node(node); end - # def copy: (**params) -> InstanceVariableOrWriteNode + # Inspect a ConstantReadNode node. # - # source://prism/lib/prism/node.rb#10364 - sig { params(params: T.untyped).returns(Prism::InstanceVariableOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#689 + def visit_constant_read_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a ConstantTargetNode node. # - # source://prism/lib/prism/node.rb#10349 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#695 + def visit_constant_target_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } + # Inspect a ConstantWriteNode node. # - # source://prism/lib/prism/node.rb#10379 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#701 + def visit_constant_write_node(node); end - # source://prism/lib/prism/desugar_compiler.rb#185 - def desugar; end + # Inspect a DefNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#711 + def visit_def_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a DefinedNode node. # - # source://prism/lib/prism/node.rb#10408 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#743 + def visit_defined_node(node); end - # attr_reader name: Symbol + # Inspect a ElseNode node. # - # source://prism/lib/prism/node.rb#10384 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#753 + def visit_else_node(node); end - # attr_reader name_loc: Location + # Inspect a EmbeddedStatementsNode node. # - # source://prism/lib/prism/node.rb#10387 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/inspect_visitor.rb#766 + def visit_embedded_statements_node(node); end - # def operator: () -> String + # Inspect a EmbeddedVariableNode node. # - # source://prism/lib/prism/node.rb#10403 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/inspect_visitor.rb#779 + def visit_embedded_variable_node(node); end - # attr_reader operator_loc: Location + # Inspect a EnsureNode node. # - # source://prism/lib/prism/node.rb#10393 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/inspect_visitor.rb#787 + def visit_ensure_node(node); 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. + # Inspect a FalseNode node. # - # 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/inspect_visitor.rb#800 + def visit_false_node(node); end + + # Inspect a FindPatternNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#805 + def visit_find_pattern_node(node); end + + # Inspect a FlipFlopNode node. # - # source://prism/lib/prism/node.rb#10432 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#831 + def visit_flip_flop_node(node); end - # attr_reader value: Node + # Inspect a FloatNode node. # - # source://prism/lib/prism/node.rb#10399 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/inspect_visitor.rb#851 + def visit_float_node(node); 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 - # - # source://prism/lib/prism/node.rb#10442 - def type; end - end -end + # Inspect a ForNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#857 + def visit_for_node(node); end -# Represents referencing an instance variable. -# -# @foo -# ^^^^ -# -# source://prism/lib/prism/node.rb#10451 -class Prism::InstanceVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Inspect a ForwardingArgumentsNode node. # - # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode + # source://prism/lib/prism/inspect_visitor.rb#876 + def visit_forwarding_arguments_node(node); end + + # Inspect a ForwardingParameterNode node. # - # source://prism/lib/prism/node.rb#10453 - def initialize(source, name, location); end + # source://prism/lib/prism/inspect_visitor.rb#881 + def visit_forwarding_parameter_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a ForwardingSuperNode node. # - # source://prism/lib/prism/node.rb#10461 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#886 + def visit_forwarding_super_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a GlobalVariableAndWriteNode node. # - # source://prism/lib/prism/node.rb#10466 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#897 + def visit_global_variable_and_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a GlobalVariableOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10476 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#907 + def visit_global_variable_operator_write_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a GlobalVariableOrWriteNode node. # - # source://prism/lib/prism/node.rb#10471 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#918 + def visit_global_variable_or_write_node(node); end - # def copy: (**params) -> InstanceVariableReadNode + # Inspect a GlobalVariableReadNode node. # - # source://prism/lib/prism/node.rb#10481 - sig { params(params: T.untyped).returns(Prism::InstanceVariableReadNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#928 + def visit_global_variable_read_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a GlobalVariableTargetNode node. # - # source://prism/lib/prism/node.rb#10466 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#934 + def visit_global_variable_target_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # Inspect a GlobalVariableWriteNode node. # - # source://prism/lib/prism/node.rb#10493 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#940 + def visit_global_variable_write_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a HashNode node. # - # source://prism/lib/prism/node.rb#10506 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#950 + def visit_hash_node(node); end - # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # Inspect a HashPatternNode node. # - # @x # name `:@x` + # source://prism/lib/prism/inspect_visitor.rb#966 + def visit_hash_pattern_node(node); end + + # Inspect a IfNode node. # - # @_test # name `:@_test` + # source://prism/lib/prism/inspect_visitor.rb#994 + def visit_if_node(node); end + + # Inspect a ImaginaryNode node. # - # source://prism/lib/prism/node.rb#10502 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#1016 + def visit_imaginary_node(node); 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. + # Inspect a ImplicitNode node. # - # 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/inspect_visitor.rb#1023 + def visit_implicit_node(node); end + + # Inspect a ImplicitRestNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#1030 + def visit_implicit_rest_node(node); end + + # Inspect a InNode node. # - # source://prism/lib/prism/node.rb#10526 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#1035 + def visit_in_node(node); 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 - # - # source://prism/lib/prism/node.rb#10536 - def type; end - end -end + # Inspect a IndexAndWriteNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1050 + def visit_index_and_write_node(node); end -# Represents writing to an instance variable in a context that doesn't have an explicit value. -# -# @foo, @bar = baz -# ^^^^ ^^^^ -# -# source://prism/lib/prism/node.rb#10545 -class Prism::InstanceVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Location location) -> void + # Inspect a IndexOperatorWriteNode node. # - # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode + # source://prism/lib/prism/inspect_visitor.rb#1081 + def visit_index_operator_write_node(node); end + + # Inspect a IndexOrWriteNode node. # - # source://prism/lib/prism/node.rb#10547 - def initialize(source, name, location); end + # source://prism/lib/prism/inspect_visitor.rb#1113 + def visit_index_or_write_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a IndexTargetNode node. # - # source://prism/lib/prism/node.rb#10555 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#1144 + def visit_index_target_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a InstanceVariableAndWriteNode node. # - # source://prism/lib/prism/node.rb#10560 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1167 + def visit_instance_variable_and_write_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a InstanceVariableOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10570 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#1177 + def visit_instance_variable_operator_write_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a InstanceVariableOrWriteNode node. # - # source://prism/lib/prism/node.rb#10565 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1188 + def visit_instance_variable_or_write_node(node); end - # def copy: (**params) -> InstanceVariableTargetNode + # Inspect a InstanceVariableReadNode node. # - # source://prism/lib/prism/node.rb#10575 - sig { params(params: T.untyped).returns(Prism::InstanceVariableTargetNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#1198 + def visit_instance_variable_read_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a InstanceVariableTargetNode node. # - # source://prism/lib/prism/node.rb#10560 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#1204 + def visit_instance_variable_target_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } + # Inspect a InstanceVariableWriteNode node. # - # source://prism/lib/prism/node.rb#10587 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#1210 + def visit_instance_variable_write_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a IntegerNode node. # - # source://prism/lib/prism/node.rb#10596 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#1220 + def visit_integer_node(node); end - # attr_reader name: Symbol + # Inspect a InterpolatedMatchLastLineNode node. # - # source://prism/lib/prism/node.rb#10592 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#1228 + def visit_interpolated_match_last_line_node(node); 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. + # Inspect a InterpolatedRegularExpressionNode node. # - # 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/inspect_visitor.rb#1246 + def visit_interpolated_regular_expression_node(node); end + + # Inspect a InterpolatedStringNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#1264 + def visit_interpolated_string_node(node); end + + # Inspect a InterpolatedSymbolNode node. # - # source://prism/lib/prism/node.rb#10616 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#1282 + def visit_interpolated_symbol_node(node); 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 - # - # source://prism/lib/prism/node.rb#10626 - def type; end - end -end + # Inspect a InterpolatedXStringNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1298 + def visit_interpolated_x_string_node(node); end -# Represents writing to an instance variable. -# -# @foo = 1 -# ^^^^^^^^ -# -# source://prism/lib/prism/node.rb#10635 -class Prism::InstanceVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Location name_loc, Node value, Location operator_loc, Location location) -> void + # Inspect a ItLocalVariableReadNode node. # - # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode + # source://prism/lib/prism/inspect_visitor.rb#1314 + def visit_it_local_variable_read_node(node); end + + # Inspect a ItParametersNode node. # - # source://prism/lib/prism/node.rb#10637 - def initialize(source, name, name_loc, value, operator_loc, location); end + # source://prism/lib/prism/inspect_visitor.rb#1319 + def visit_it_parameters_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a KeywordHashNode node. # - # source://prism/lib/prism/node.rb#10648 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#1324 + def visit_keyword_hash_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a KeywordRestParameterNode node. # - # source://prism/lib/prism/node.rb#10653 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1340 + def visit_keyword_rest_parameter_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a LambdaNode node. # - # source://prism/lib/prism/node.rb#10663 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#1354 + def visit_lambda_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a LocalVariableAndWriteNode node. # - # source://prism/lib/prism/node.rb#10658 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1375 + def visit_local_variable_and_write_node(node); end - # def copy: (**params) -> InstanceVariableWriteNode + # Inspect a LocalVariableOperatorWriteNode node. # - # source://prism/lib/prism/node.rb#10668 - sig { params(params: T.untyped).returns(Prism::InstanceVariableWriteNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#1386 + def visit_local_variable_operator_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a LocalVariableOrWriteNode node. # - # source://prism/lib/prism/node.rb#10653 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#1398 + def visit_local_variable_or_write_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location } + # Inspect a LocalVariableReadNode node. # - # source://prism/lib/prism/node.rb#10683 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#1409 + def visit_local_variable_read_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a LocalVariableTargetNode node. # - # source://prism/lib/prism/node.rb#10712 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#1416 + def visit_local_variable_target_node(node); end - # attr_reader name: Symbol + # Inspect a LocalVariableWriteNode node. # - # source://prism/lib/prism/node.rb#10688 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/inspect_visitor.rb#1423 + def visit_local_variable_write_node(node); end - # attr_reader name_loc: Location + # Inspect a MatchLastLineNode node. # - # source://prism/lib/prism/node.rb#10691 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/inspect_visitor.rb#1434 + def visit_match_last_line_node(node); end - # def operator: () -> String + # Inspect a MatchPredicateNode node. # - # source://prism/lib/prism/node.rb#10707 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/inspect_visitor.rb#1445 + def visit_match_predicate_node(node); end - # attr_reader operator_loc: Location + # Inspect a MatchRequiredNode node. # - # source://prism/lib/prism/node.rb#10700 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/inspect_visitor.rb#1455 + def visit_match_required_node(node); 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. + # Inspect a MatchWriteNode node. # - # 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/inspect_visitor.rb#1465 + def visit_match_write_node(node); end + + # Inspect a MissingNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#1481 + def visit_missing_node(node); end + + # Inspect a ModuleNode node. # - # source://prism/lib/prism/node.rb#10736 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#1486 + def visit_module_node(node); end - # attr_reader value: Node + # Inspect a MultiTargetNode node. # - # source://prism/lib/prism/node.rb#10697 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/inspect_visitor.rb#1503 + def visit_multi_target_node(node); 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 - # - # source://prism/lib/prism/node.rb#10746 - def type; end - end -end + # Inspect a MultiWriteNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1534 + def visit_multi_write_node(node); end -# Flags for integer nodes that correspond to the base of the integer. -# -# source://prism/lib/prism/node.rb#19277 -module Prism::IntegerBaseFlags; end + # Inspect a NextNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1568 + def visit_next_node(node); end -# 0b prefix -# -# source://prism/lib/prism/node.rb#19279 -Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) + # Inspect a NilNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1580 + def visit_nil_node(node); end -# 0d or no prefix -# -# source://prism/lib/prism/node.rb#19282 -Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + # Inspect a NoKeywordsParameterNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1585 + def visit_no_keywords_parameter_node(node); end -# 0x prefix -# -# source://prism/lib/prism/node.rb#19288 -Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + # Inspect a NumberedParametersNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1592 + def visit_numbered_parameters_node(node); end -# 0o or 0 prefix -# -# source://prism/lib/prism/node.rb#19285 -Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + # Inspect a NumberedReferenceReadNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1598 + def visit_numbered_reference_read_node(node); end -# Represents an integer number literal. -# -# 1 -# ^ -# -# source://prism/lib/prism/node.rb#10755 -class Prism::IntegerNode < ::Prism::Node - # def initialize: (Integer flags, Location location) -> void + # Inspect a OptionalKeywordParameterNode node. # - # @return [IntegerNode] a new instance of IntegerNode + # source://prism/lib/prism/inspect_visitor.rb#1604 + def visit_optional_keyword_parameter_node(node); end + + # Inspect a OptionalParameterNode node. # - # source://prism/lib/prism/node.rb#10757 - def initialize(source, flags, location); end + # source://prism/lib/prism/inspect_visitor.rb#1615 + def visit_optional_parameter_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a OrNode node. # - # source://prism/lib/prism/node.rb#10765 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#1627 + def visit_or_node(node); end - # def binary?: () -> bool + # Inspect a ParametersNode node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#1637 + def visit_parameters_node(node); end + + # Inspect a ParenthesesNode node. # - # source://prism/lib/prism/node.rb#10807 - sig { returns(T::Boolean) } - def binary?; end + # source://prism/lib/prism/inspect_visitor.rb#1696 + def visit_parentheses_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a PinnedExpressionNode node. # - # source://prism/lib/prism/node.rb#10770 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1709 + def visit_pinned_expression_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a PinnedVariableNode node. # - # source://prism/lib/prism/node.rb#10780 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#1719 + def visit_pinned_variable_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a PostExecutionNode node. # - # source://prism/lib/prism/node.rb#10775 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#1727 + def visit_post_execution_node(node); end - # def copy: (**params) -> IntegerNode + # Inspect a PreExecutionNode node. # - # source://prism/lib/prism/node.rb#10785 - sig { params(params: T.untyped).returns(Prism::IntegerNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#1741 + def visit_pre_execution_node(node); end - # def decimal?: () -> bool + # Inspect a ProgramNode node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#1755 + def visit_program_node(node); end + + # Inspect a RangeNode node. # - # source://prism/lib/prism/node.rb#10812 - sig { returns(T::Boolean) } - def decimal?; end + # source://prism/lib/prism/inspect_visitor.rb#1763 + def visit_range_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a RationalNode node. # - # source://prism/lib/prism/node.rb#10770 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#1783 + def visit_rational_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, location: Location } + # Inspect a RedoNode node. # - # source://prism/lib/prism/node.rb#10797 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#1792 + def visit_redo_node(node); end - # def hexadecimal?: () -> bool + # Inspect a RegularExpressionNode node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#1797 + def visit_regular_expression_node(node); end + + # Inspect a RequiredKeywordParameterNode node. # - # source://prism/lib/prism/node.rb#10822 - sig { returns(T::Boolean) } - def hexadecimal?; end + # source://prism/lib/prism/inspect_visitor.rb#1808 + def visit_required_keyword_parameter_node(node); end - # def inspect(NodeInspector inspector) -> String + # Inspect a RequiredParameterNode node. # - # source://prism/lib/prism/node.rb#10827 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/inspect_visitor.rb#1817 + def visit_required_parameter_node(node); end - # def octal?: () -> bool + # Inspect a RescueModifierNode node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#1825 + def visit_rescue_modifier_node(node); end + + # Inspect a RescueNode node. # - # source://prism/lib/prism/node.rb#10817 - sig { returns(T::Boolean) } - def octal?; end + # source://prism/lib/prism/inspect_visitor.rb#1835 + def visit_rescue_node(node); 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. + # Inspect a RestParameterNode node. # - # 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/inspect_visitor.rb#1869 + def visit_rest_parameter_node(node); end + + # Inspect a RetryNode node. # - # def type: () -> Symbol + # source://prism/lib/prism/inspect_visitor.rb#1883 + def visit_retry_node(node); end + + # Inspect a ReturnNode node. # - # source://prism/lib/prism/node.rb#10848 - def type; end + # source://prism/lib/prism/inspect_visitor.rb#1888 + def visit_return_node(node); end - # Returns the value of the node as a Ruby Integer. + # Inspect a SelfNode node. # - # source://prism/lib/prism/node_ext.rb#76 - def value; end + # source://prism/lib/prism/inspect_visitor.rb#1902 + def visit_self_node(node); end - private + # Inspect a ShareableConstantNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1907 + def visit_shareable_constant_node(node); end - # private attr_reader flags: Integer + # Inspect a SingletonClassNode node. # - # source://prism/lib/prism/node.rb#10802 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/inspect_visitor.rb#1916 + def visit_singleton_class_node(node); 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 - # - # source://prism/lib/prism/node.rb#10858 - def type; end - end -end + # Inspect a SourceEncodingNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1933 + def visit_source_encoding_node(node); end -# Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object. -# -# if /foo #{bar} baz/ then end -# ^^^^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#10867 -class Prism::InterpolatedMatchLastLineNode < ::Prism::Node - include ::Prism::RegularExpressionOptions + # Inspect a SourceFileNode node. + # + # source://prism/lib/prism/inspect_visitor.rb#1938 + def visit_source_file_node(node); end - # def initialize: (Integer flags, Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void + # Inspect a SourceLineNode node. # - # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode + # source://prism/lib/prism/inspect_visitor.rb#1946 + def visit_source_line_node(node); end + + # Inspect a SplatNode node. # - # source://prism/lib/prism/node.rb#10869 - def initialize(source, flags, opening_loc, parts, closing_loc, location); end + # source://prism/lib/prism/inspect_visitor.rb#1951 + def visit_splat_node(node); end - # def accept: (Visitor visitor) -> void + # Inspect a StatementsNode node. # - # source://prism/lib/prism/node.rb#10880 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/inspect_visitor.rb#1963 + def visit_statements_node(node); end - # def ascii_8bit?: () -> bool + # Inspect a StringNode node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#1977 + def visit_string_node(node); end + + # Inspect a SuperNode node. # - # source://prism/lib/prism/node.rb#10970 - sig { returns(T::Boolean) } - def ascii_8bit?; end + # source://prism/lib/prism/inspect_visitor.rb#1988 + def visit_super_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Inspect a SymbolNode node. # - # source://prism/lib/prism/node.rb#10890 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#2008 + def visit_symbol_node(node); end - # def closing: () -> String + # Inspect a TrueNode node. # - # source://prism/lib/prism/node.rb#11005 - sig { returns(String) } - def closing; end + # source://prism/lib/prism/inspect_visitor.rb#2019 + def visit_true_node(node); end - # attr_reader closing_loc: Location + # Inspect a UndefNode node. # - # source://prism/lib/prism/node.rb#10938 - sig { returns(Prism::Location) } - def closing_loc; end + # source://prism/lib/prism/inspect_visitor.rb#2024 + def visit_undef_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Inspect a UnlessNode node. # - # source://prism/lib/prism/node.rb#10900 - def comment_targets; end + # source://prism/lib/prism/inspect_visitor.rb#2039 + def visit_unless_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Inspect a UntilNode node. # - # source://prism/lib/prism/node.rb#10895 - def compact_child_nodes; end + # source://prism/lib/prism/inspect_visitor.rb#2061 + def visit_until_node(node); end - # def copy: (**params) -> InterpolatedMatchLastLineNode + # Inspect a WhenNode node. # - # source://prism/lib/prism/node.rb#10905 - sig { params(params: T.untyped).returns(Prism::InterpolatedMatchLastLineNode) } - def copy(**params); end + # source://prism/lib/prism/inspect_visitor.rb#2078 + def visit_when_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Inspect a WhileNode node. # - # source://prism/lib/prism/node.rb#10890 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/inspect_visitor.rb#2100 + def visit_while_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location } + # Inspect a XStringNode node. # - # source://prism/lib/prism/node.rb#10920 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/inspect_visitor.rb#2117 + def visit_x_string_node(node); end - # def euc_jp?: () -> bool + # Inspect a YieldNode node. # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#10965 - sig { returns(T::Boolean) } - def euc_jp?; end + # source://prism/lib/prism/inspect_visitor.rb#2128 + def visit_yield_node(node); end - # def extended?: () -> bool - # - # @return [Boolean] + private + + # Compose a string representing the given inner location field. # - # source://prism/lib/prism/node.rb#10950 - sig { returns(T::Boolean) } - def extended?; end + # source://prism/lib/prism/inspect_visitor.rb#2150 + def inspect_location(location); end - # def forced_binary_encoding?: () -> bool + # Compose a header for the given node. # - # @return [Boolean] + # source://prism/lib/prism/inspect_visitor.rb#2144 + def inspect_node(name, node); end + + class << self + # Compose an inspect string for the given node. + # + # source://prism/lib/prism/inspect_visitor.rb#41 + sig { params(node: Prism::Node).returns(String) } + def compose(node); end + end +end + +# Most of the time, we can simply pass down the indent to the next node. +# However, when we are inside a list we want some extra special formatting +# when we hit an element in that list. In this case, we have a special +# command that replaces the subsequent indent with the given value. +# +# source://prism/lib/prism/inspect_visitor.rb#17 +class Prism::InspectVisitor::Replace + # @return [Replace] a new instance of Replace # - # source://prism/lib/prism/node.rb#10990 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end + # source://prism/lib/prism/inspect_visitor.rb#20 + def initialize(value); end - # def forced_us_ascii_encoding?: () -> bool + # source://prism/lib/prism/inspect_visitor.rb#18 + def value; end +end + +# Represents the use of the `&&=` operator for assignment to an instance variable. +# +# @target &&= value +# ^^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#9866 +class Prism::InstanceVariableAndWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # - # @return [Boolean] + # @return [InstanceVariableAndWriteNode] a new instance of InstanceVariableAndWriteNode # - # source://prism/lib/prism/node.rb#10995 - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end + # source://prism/lib/prism/node.rb#9868 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); end - # def forced_utf8_encoding?: () -> bool + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. # - # @return [Boolean] + # source://prism/lib/prism/node.rb#9970 + def ===(other); end + + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#10985 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end + # source://prism/lib/prism/node.rb#9878 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # def ignore_case?: () -> bool + # def child_nodes: () -> Array[nil | Node] # - # @return [Boolean] + # source://prism/lib/prism/node.rb#9883 + 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#10945 - sig { returns(T::Boolean) } - def ignore_case?; end + # source://prism/lib/prism/node.rb#9893 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # def inspect(NodeInspector inspector) -> String + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/node.rb#11010 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#9888 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # def multi_line?: () -> bool + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableAndWriteNode # - # @return [Boolean] + # source://prism/lib/prism/node.rb#9898 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#10955 - sig { returns(T::Boolean) } - def multi_line?; end + # source://prism/lib/prism/node.rb#9883 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # def once?: () -> bool + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # @return [Boolean] + # source://prism/lib/prism/node.rb#9906 + 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 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#10960 - sig { returns(T::Boolean) } - def once?; end + # source://prism/lib/prism/node.rb#9936 + sig { override.returns(String) } + def inspect; end - # def opening: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#11000 - sig { returns(String) } - def opening; end + # source://prism/lib/prism/node.rb#9911 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#10929 + # source://prism/lib/prism/node.rb#9914 sig { returns(Prism::Location) } - def opening_loc; end + def name_loc; end - # attr_reader parts: Array[Node] + # def operator: () -> String # - # source://prism/lib/prism/node.rb#10935 - sig { returns(T::Array[Prism::Node]) } - def parts; end + # source://prism/lib/prism/node.rb#9931 + sig { returns(String) } + def operator; end - # source://prism/lib/prism/node.rb#10884 - def set_newline_flag(newline_marked); end + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#9921 + 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 @@ -16137,32 +18305,15 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11034 + # source://prism/lib/prism/node.rb#9954 + sig { override.returns(Symbol) } def type; end - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#10980 - sig { returns(T::Boolean) } - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#10975 - sig { returns(T::Boolean) } - def windows_31j?; end - - private - - # private attr_reader flags: Integer + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#10925 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/node.rb#9928 + sig { returns(Prism::Node) } + def value; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -16172,181 +18323,141 @@ class Prism::InterpolatedMatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11044 + # source://prism/lib/prism/node.rb#9964 def type; end end end -# Represents a regular expression literal that contains interpolation. +# Represents assigning to an instance variable using an operator that isn't `=`. # -# /foo #{bar} baz/ +# @target += value # ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#11053 -class Prism::InterpolatedRegularExpressionNode < ::Prism::Node - include ::Prism::RegularExpressionOptions - - # def initialize: (Integer flags, Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#9983 +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 # - # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode + # @return [InstanceVariableOperatorWriteNode] a new instance of InstanceVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#11055 - def initialize(source, flags, opening_loc, parts, closing_loc, location); end + # source://prism/lib/prism/node.rb#9985 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); 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#10086 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11066 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#9996 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # def ascii_8bit?: () -> bool + # attr_reader binary_operator: Symbol # - # @return [Boolean] + # source://prism/lib/prism/node.rb#10049 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location # - # source://prism/lib/prism/node.rb#11156 - sig { returns(T::Boolean) } - def ascii_8bit?; end + # source://prism/lib/prism/node.rb#10039 + sig { returns(Prism::Location) } + def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11076 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10001 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#11191 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#11124 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#11086 + # source://prism/lib/prism/node.rb#10011 + 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#11081 + # source://prism/lib/prism/node.rb#10006 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> InterpolatedRegularExpressionNode + # def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#11091 - sig { params(params: T.untyped).returns(Prism::InterpolatedRegularExpressionNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10016 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + binary_operator: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11076 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10001 + 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[Node], closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#11106 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10024 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11151 - sig { returns(T::Boolean) } - def euc_jp?; end - - # def extended?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11136 - sig { returns(T::Boolean) } - def extended?; end - - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11176 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end - - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11181 - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11171 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # def ignore_case?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11131 - sig { returns(T::Boolean) } - def ignore_case?; end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#11196 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/desugar_compiler.rb#193 + def desugar; end - # def multi_line?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11141 - sig { returns(T::Boolean) } - def multi_line?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def once?: () -> bool - # - # @return [Boolean] + # def inspect -> String # - # source://prism/lib/prism/node.rb#11146 - sig { returns(T::Boolean) } - def once?; end + # source://prism/lib/prism/node.rb#10052 + sig { override.returns(String) } + def inspect; end - # def opening: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#11186 - sig { returns(String) } - def opening; end + # source://prism/lib/prism/node.rb#10029 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#11115 + # source://prism/lib/prism/node.rb#10032 sig { returns(Prism::Location) } - def opening_loc; end + def name_loc; end - # attr_reader parts: Array[Node] + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#11121 - sig { returns(T::Array[Prism::Node]) } - def parts; end + # source://prism/lib/prism/node_ext.rb#419 + def operator; end - # source://prism/lib/prism/node.rb#11070 - def set_newline_flag(newline_marked); 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 + 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 @@ -16363,32 +18474,15 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11220 + # source://prism/lib/prism/node.rb#10070 + sig { override.returns(Symbol) } def type; end - # def utf_8?: () -> bool - # - # @return [Boolean] + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#11166 - sig { returns(T::Boolean) } - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#11161 - sig { returns(T::Boolean) } - def windows_31j?; end - - private - - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#11111 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/node.rb#10046 + sig { returns(Prism::Node) } + def value; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -16398,109 +18492,127 @@ class Prism::InterpolatedRegularExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11230 + # source://prism/lib/prism/node.rb#10080 def type; end end end -# Represents a string literal that contains interpolation. +# Represents the use of the `||=` operator for assignment to an instance variable. # -# "foo #{bar} baz" -# ^^^^^^^^^^^^^^^^ +# @target ||= value +# ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#11239 -class Prism::InterpolatedStringNode < ::Prism::Node - include ::Prism::HeredocQuery - - # def initialize: (Location? opening_loc, Array[Node] parts, Location? closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#10100 +class Prism::InstanceVariableOrWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # - # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode + # @return [InstanceVariableOrWriteNode] a new instance of InstanceVariableOrWriteNode # - # source://prism/lib/prism/node.rb#11241 - def initialize(source, opening_loc, parts, closing_loc, location); end + # source://prism/lib/prism/node.rb#10102 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, operator_loc, value, location); 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#10204 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11251 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10112 + 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#11261 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism/lib/prism/node.rb#11328 - sig { returns(T.nilable(String)) } - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism/lib/prism/node.rb#11310 - sig { returns(T.nilable(Prism::Location)) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#11271 + # source://prism/lib/prism/node.rb#10127 + 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#11266 + # source://prism/lib/prism/node.rb#10122 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> InterpolatedStringNode + # def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> InstanceVariableOrWriteNode # - # source://prism/lib/prism/node.rb#11276 - sig { params(params: T.untyped).returns(Prism::InterpolatedStringNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10132 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11261 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10117 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#11290 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10140 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # source://prism/lib/prism/desugar_compiler.rb#187 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#11333 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#10170 + sig { override.returns(String) } + def inspect; end - # def opening: () -> String? + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#11323 - sig { returns(T.nilable(String)) } - def opening; end + # source://prism/lib/prism/node.rb#10145 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location? + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#11295 - sig { returns(T.nilable(Prism::Location)) } - def opening_loc; end + # source://prism/lib/prism/node.rb#10148 + sig { returns(Prism::Location) } + def name_loc; end - # attr_reader parts: Array[Node] + # def operator: () -> String # - # source://prism/lib/prism/node.rb#11307 - sig { returns(T::Array[Prism::Node]) } - def parts; end + # source://prism/lib/prism/node.rb#10165 + sig { returns(String) } + def operator; end - # source://prism/lib/prism/node.rb#11255 - def set_newline_flag(newline_marked); end + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#10155 + 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 @@ -16517,9 +18629,16 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11355 + # source://prism/lib/prism/node.rb#10188 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#10162 + 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. @@ -16528,107 +18647,93 @@ class Prism::InterpolatedStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11365 + # source://prism/lib/prism/node.rb#10198 def type; end end end -# Represents a symbol literal that contains interpolation. +# Represents referencing an instance variable. # -# :"foo #{bar} baz" -# ^^^^^^^^^^^^^^^^^ +# @foo +# ^^^^ # -# source://prism/lib/prism/node.rb#11374 -class Prism::InterpolatedSymbolNode < ::Prism::Node - # def initialize: (Location? opening_loc, Array[Node] parts, Location? closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#10217 +class Prism::InstanceVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode + # @return [InstanceVariableReadNode] a new instance of InstanceVariableReadNode # - # source://prism/lib/prism/node.rb#11376 - def initialize(source, opening_loc, parts, closing_loc, location); end + # source://prism/lib/prism/node.rb#10219 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); 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#10300 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11386 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10226 + 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#11396 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10231 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism/lib/prism/node.rb#11463 - sig { returns(T.nilable(String)) } - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism/lib/prism/node.rb#11445 - sig { returns(T.nilable(Prism::Location)) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#11406 + # source://prism/lib/prism/node.rb#10241 + 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#11401 + # source://prism/lib/prism/node.rb#10236 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> InterpolatedSymbolNode + # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableReadNode # - # source://prism/lib/prism/node.rb#11411 - sig { params(params: T.untyped).returns(Prism::InterpolatedSymbolNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10246 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableReadNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11396 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10231 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#11425 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10254 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#11468 - def inspect(inspector = T.unsafe(nil)); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def opening: () -> String? + # def inspect -> String # - # source://prism/lib/prism/node.rb#11458 - sig { returns(T.nilable(String)) } - def opening; end + # source://prism/lib/prism/node.rb#10266 + sig { override.returns(String) } + def inspect; end - # attr_reader opening_loc: Location? + # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # - # source://prism/lib/prism/node.rb#11430 - sig { returns(T.nilable(Prism::Location)) } - def opening_loc; end - - # attr_reader parts: Array[Node] + # @x # name `:@x` # - # source://prism/lib/prism/node.rb#11442 - sig { returns(T::Array[Prism::Node]) } - def parts; end - - # source://prism/lib/prism/node.rb#11390 - def set_newline_flag(newline_marked); end + # @_test # name `:@_test` + # + # source://prism/lib/prism/node.rb#10263 + 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 @@ -16645,7 +18750,8 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11490 + # source://prism/lib/prism/node.rb#10284 + sig { override.returns(Symbol) } def type; end class << self @@ -16656,109 +18762,89 @@ class Prism::InterpolatedSymbolNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11500 + # source://prism/lib/prism/node.rb#10294 def type; end end end -# Represents an xstring literal that contains interpolation. +# Represents writing to an instance variable in a context that doesn't have an explicit value. # -# `foo #{bar} baz` -# ^^^^^^^^^^^^^^^^ +# @foo, @bar = baz +# ^^^^ ^^^^ # -# source://prism/lib/prism/node.rb#11509 -class Prism::InterpolatedXStringNode < ::Prism::Node - include ::Prism::HeredocQuery - - # def initialize: (Location opening_loc, Array[Node] parts, Location closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#10310 +class Prism::InstanceVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Location location) -> void # - # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode + # @return [InstanceVariableTargetNode] a new instance of InstanceVariableTargetNode # - # source://prism/lib/prism/node.rb#11511 - def initialize(source, opening_loc, parts, closing_loc, location); end + # source://prism/lib/prism/node.rb#10312 + sig { params(source: Prism::Source, name: Symbol, location: Prism::Location).void } + def initialize(source, name, location); 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#10389 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11521 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10319 + 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#11531 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#11586 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#11574 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#11541 + # source://prism/lib/prism/node.rb#10334 + 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#11536 + # source://prism/lib/prism/node.rb#10329 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> InterpolatedXStringNode + # def copy: (?name: Symbol, ?location: Location) -> InstanceVariableTargetNode # - # source://prism/lib/prism/node.rb#11546 - sig { params(params: T.untyped).returns(Prism::InterpolatedXStringNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10339 + sig { params(name: Symbol, location: Prism::Location).returns(Prism::InstanceVariableTargetNode) } + def copy(name: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11531 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#11560 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10347 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#11591 - def inspect(inspector = T.unsafe(nil)); end - - # def opening: () -> String - # - # source://prism/lib/prism/node.rb#11581 - sig { returns(String) } - def opening; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader opening_loc: Location + # def inspect -> String # - # source://prism/lib/prism/node.rb#11565 - sig { returns(Prism::Location) } - def opening_loc; end + # source://prism/lib/prism/node.rb#10355 + sig { override.returns(String) } + def inspect; end - # attr_reader parts: Array[Node] + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#11571 - sig { returns(T::Array[Prism::Node]) } - def parts; end - - # source://prism/lib/prism/node.rb#11525 - def set_newline_flag(newline_marked); end + # source://prism/lib/prism/node.rb#10352 + 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 @@ -16775,7 +18861,8 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11613 + # source://prism/lib/prism/node.rb#10373 + sig { override.returns(Symbol) } def type; end class << self @@ -16786,88 +18873,134 @@ class Prism::InterpolatedXStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11623 + # source://prism/lib/prism/node.rb#10383 def type; end end end -# Represents a hash literal without opening and closing braces. +# Represents writing to an instance variable. # -# foo(a: b) -# ^^^^ +# @foo = 1 +# ^^^^^^^^ # -# source://prism/lib/prism/node.rb#11632 -class Prism::KeywordHashNode < ::Prism::Node - # def initialize: (Integer flags, Array[Node] elements, Location location) -> void +# source://prism/lib/prism/node.rb#10399 +class Prism::InstanceVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # - # @return [KeywordHashNode] a new instance of KeywordHashNode + # @return [InstanceVariableWriteNode] a new instance of InstanceVariableWriteNode # - # source://prism/lib/prism/node.rb#11634 - def initialize(source, flags, elements, location); end + # source://prism/lib/prism/node.rb#10401 + sig do + params( + source: Prism::Source, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, name_loc, value, operator_loc, location); 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#10519 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11643 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10411 + 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#11648 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10416 + 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#11658 + # source://prism/lib/prism/node.rb#10426 + 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#11653 + # source://prism/lib/prism/node.rb#10421 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> KeywordHashNode + # def copy: (?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> InstanceVariableWriteNode # - # source://prism/lib/prism/node.rb#11663 - sig { params(params: T.untyped).returns(Prism::KeywordHashNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10431 + sig do + params( + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11648 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10416 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[Node], location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#11676 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10439 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader elements: Array[Node] + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#11685 - sig { returns(T::Array[Prism::Node]) } - def elements; end + # source://prism/lib/prism/node.rb#10485 + sig { override.returns(String) } + def inspect; end - # def inspect(NodeInspector inspector) -> String + # The name of the instance variable, which is a `@` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). + # + # @x = :y # name `:@x` + # + # @_foo = "bar" # name `@_foo` # - # source://prism/lib/prism/node.rb#11694 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#10448 + sig { returns(Symbol) } + def name; end - # def symbol_keys?: () -> bool + # The location of the variable name. # - # @return [Boolean] + # @_x = 1 + # ^^^ # - # source://prism/lib/prism/node.rb#11689 - sig { returns(T::Boolean) } - def symbol_keys?; end + # source://prism/lib/prism/node.rb#10454 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#10480 + sig { returns(String) } + def operator; end + + # The location of the `=` operator. + # + # @x = y + # ^ + # + # source://prism/lib/prism/node.rb#10473 + 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 @@ -16884,16 +19017,21 @@ class Prism::KeywordHashNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11716 + # source://prism/lib/prism/node.rb#10503 + sig { override.returns(Symbol) } def type; end - private - - # private attr_reader flags: Integer + # The value to write to the instance variable. 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#11681 - sig { returns(Integer) } - def flags; end + # @foo = :bar + # ^^^^ + # + # @_x = 1234 + # ^^^^ + # + # source://prism/lib/prism/node.rb#10467 + sig { returns(Prism::Node) } + def value; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -16903,117 +19041,140 @@ class Prism::KeywordHashNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11726 + # source://prism/lib/prism/node.rb#10513 def type; end end end -# Flags for keyword hash nodes. +# Flags for integer nodes that correspond to the base of the integer. # -# source://prism/lib/prism/node.rb#19292 -module Prism::KeywordHashNodeFlags; end +# source://prism/lib/prism/node.rb#19166 +module Prism::IntegerBaseFlags; end -# a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments +# 0b prefix # -# source://prism/lib/prism/node.rb#19294 -Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) +# source://prism/lib/prism/node.rb#19168 +Prism::IntegerBaseFlags::BINARY = T.let(T.unsafe(nil), Integer) -# Represents a keyword rest parameter to a method, block, or lambda definition. +# 0d or no prefix # -# def a(**b) -# ^^^ -# end +# source://prism/lib/prism/node.rb#19171 +Prism::IntegerBaseFlags::DECIMAL = T.let(T.unsafe(nil), Integer) + +# 0x prefix # -# source://prism/lib/prism/node.rb#11736 -class Prism::KeywordRestParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void +# source://prism/lib/prism/node.rb#19177 +Prism::IntegerBaseFlags::HEXADECIMAL = T.let(T.unsafe(nil), Integer) + +# 0o or 0 prefix +# +# source://prism/lib/prism/node.rb#19174 +Prism::IntegerBaseFlags::OCTAL = T.let(T.unsafe(nil), Integer) + +# Represents an integer number literal. +# +# 1 +# ^ +# +# source://prism/lib/prism/node.rb#10532 +class Prism::IntegerNode < ::Prism::Node + # def initialize: (Integer flags, Integer value, Location location) -> void # - # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode + # @return [IntegerNode] a new instance of IntegerNode # - # source://prism/lib/prism/node.rb#11738 - def initialize(source, flags, name, name_loc, operator_loc, location); end + # source://prism/lib/prism/node.rb#10534 + sig { params(source: Prism::Source, flags: Integer, value: Integer, location: Prism::Location).void } + def initialize(source, flags, value, location); 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#10636 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11749 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10542 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # def binary?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10582 + sig { returns(T::Boolean) } + def binary?; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11754 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10547 + 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#11764 + # source://prism/lib/prism/node.rb#10557 + 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#11759 + # source://prism/lib/prism/node.rb#10552 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> KeywordRestParameterNode + # def copy: (?flags: Integer, ?value: Integer, ?location: Location) -> IntegerNode # - # source://prism/lib/prism/node.rb#11769 - sig { params(params: T.untyped).returns(Prism::KeywordRestParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10562 + 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 + + # def decimal?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10587 + sig { returns(T::Boolean) } + def decimal?; end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11754 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10547 + 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) -> { flags: Integer, value: Integer, location: Location } # - # source://prism/lib/prism/node.rb#11784 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10570 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#11825 - def inspect(inspector = T.unsafe(nil)); end - - # attr_reader name: Symbol? - # - # source://prism/lib/prism/node.rb#11793 - sig { returns(T.nilable(Symbol)) } - def name; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader name_loc: Location? + # def hexadecimal?: () -> bool # - # source://prism/lib/prism/node.rb#11796 - sig { returns(T.nilable(Prism::Location)) } - def name_loc; end - - # def operator: () -> String + # @return [Boolean] # - # source://prism/lib/prism/node.rb#11820 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node.rb#10597 + sig { returns(T::Boolean) } + def hexadecimal?; end - # attr_reader operator_loc: Location + # def inspect -> String # - # source://prism/lib/prism/node.rb#11808 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/node.rb#10602 + sig { override.returns(String) } + def inspect; end - # def repeated_parameter?: () -> bool + # def octal?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#11815 + # source://prism/lib/prism/node.rb#10592 sig { returns(T::Boolean) } - def repeated_parameter?; end + 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 @@ -17030,14 +19191,21 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#11853 + # source://prism/lib/prism/node.rb#10620 + sig { override.returns(Symbol) } def type; end - private + # The value of the integer literal as a number. + # + # source://prism/lib/prism/node.rb#10579 + sig { returns(Integer) } + def value; end + + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#11789 + # source://prism/lib/prism/node.rb#10575 sig { returns(Integer) } def flags; end @@ -17049,128 +19217,210 @@ class Prism::KeywordRestParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#11863 + # source://prism/lib/prism/node.rb#10630 def type; end end end -# Represents using a lambda literal (not the lambda method call). +# Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object. # -# ->(value) { value * 2 } -# ^^^^^^^^^^^^^^^^^^^^^^^ +# if /foo #{bar} baz/ then end +# ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#11872 -class Prism::LambdaNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, Location operator_loc, Location opening_loc, Location closing_loc, Node? parameters, Node? body, Location location) -> void +# source://prism/lib/prism/node.rb#10647 +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 # - # @return [LambdaNode] a new instance of LambdaNode + # @return [InterpolatedMatchLastLineNode] a new instance of InterpolatedMatchLastLineNode # - # source://prism/lib/prism/node.rb#11874 - def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end + # source://prism/lib/prism/node.rb#10649 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); 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#10812 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#11887 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#10659 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # def ascii_8bit?: () -> bool # - # source://prism/lib/prism/node.rb#11956 - sig { returns(T.nilable(Prism::Node)) } - def body; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10738 + sig { returns(T::Boolean) } + def ascii_8bit?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11892 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10664 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#11970 + # source://prism/lib/prism/node.rb#10773 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#11947 + # source://prism/lib/prism/node.rb#10706 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#11905 + # source://prism/lib/prism/node.rb#10674 + 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#11897 + # source://prism/lib/prism/node.rb#10669 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LambdaNode + # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedMatchLastLineNode # - # source://prism/lib/prism/node.rb#11910 - sig { params(params: T.untyped).returns(Prism::LambdaNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#10679 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#11892 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#10664 + 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: Node?, body: Node?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#11927 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#10687 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # def euc_jp?: () -> bool # - # source://prism/lib/prism/node.rb#11975 - def inspect(inspector = T.unsafe(nil)); end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10733 + sig { returns(T::Boolean) } + def euc_jp?; end - # attr_reader locals: Array[Symbol] + # def extended?: () -> bool # - # source://prism/lib/prism/node.rb#11932 - sig { returns(T::Array[Symbol]) } - def locals; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10718 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10758 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10763 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10753 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10713 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#10778 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10723 + sig { returns(T::Boolean) } + def multi_line?; end + + # source://prism/lib/prism/parse_result/newlines.rb#121 + def newline!(lines); end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10728 + sig { returns(T::Boolean) } + def once?; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#11965 + # source://prism/lib/prism/node.rb#10768 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#11941 + # source://prism/lib/prism/node.rb#10696 sig { returns(Prism::Location) } def opening_loc; end - # def operator: () -> String - # - # source://prism/lib/prism/node.rb#11960 - sig { returns(String) } - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism/lib/prism/node.rb#11935 - sig { returns(Prism::Location) } - def operator_loc; end + sig { returns(Integer) } + def options; end - # attr_reader parameters: Node? + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism/lib/prism/node.rb#11953 - sig { returns(T.nilable(Prism::Node)) } - def parameters; end + # source://prism/lib/prism/node.rb#10703 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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 @@ -17187,9 +19437,34 @@ class Prism::LambdaNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12010 + # source://prism/lib/prism/node.rb#10796 + sig { override.returns(Symbol) } def type; end + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10748 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10743 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#10692 + 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. @@ -17198,356 +19473,210 @@ class Prism::LambdaNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12020 + # source://prism/lib/prism/node.rb#10806 def type; end end end -# This class is responsible for lexing the source using prism and then -# converting those tokens to be compatible with Ripper. In the vast majority -# of cases, this is a one-to-one mapping of the token type. Everything else -# generally lines up. However, there are a few cases that require special -# handling. +# Represents a regular expression literal that contains interpolation. # -# source://prism/lib/prism/lex_compat.rb#12 -class Prism::LexCompat - # @return [LexCompat] a new instance of LexCompat +# /foo #{bar} baz/ +# ^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#10826 +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 # - # source://prism/lib/prism/lex_compat.rb#600 - def initialize(source, **options); end + # @return [InterpolatedRegularExpressionNode] a new instance of InterpolatedRegularExpressionNode + # + # source://prism/lib/prism/node.rb#10828 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); end - # Returns the value of attribute options. + # 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/lex_compat.rb#598 - def options; end + # source://prism/lib/prism/node.rb#10991 + def ===(other); end - # source://prism/lib/prism/lex_compat.rb#605 - def result; end + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#10838 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Returns the value of attribute source. + # def ascii_8bit?: () -> bool # - # source://prism/lib/prism/lex_compat.rb#598 - def source; end -end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10917 + sig { returns(T::Boolean) } + def ascii_8bit?; end -# Ripper doesn't include the rest of the token in the event, so we need to -# trim it down to just the content on the first line when comparing. -# -# source://prism/lib/prism/lex_compat.rb#211 -class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token - # source://prism/lib/prism/lex_compat.rb#212 - def ==(other); end -end + # def child_nodes: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#10843 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end -# A heredoc in this case is a list of tokens that belong to the body of the -# heredoc that should be appended onto the list of tokens when the heredoc -# closes. -# -# source://prism/lib/prism/lex_compat.rb#272 -module Prism::LexCompat::Heredoc - class << self - # Here we will split between the two types of heredocs and return the - # object that will store their tokens. - # - # source://prism/lib/prism/lex_compat.rb#584 - def build(opening); end - end -end - -# Dash heredocs are a little more complicated. They are a list of tokens -# that need to be split on "\\\n" to mimic Ripper's behavior. We also need -# to keep track of the state that the heredoc was opened in. -# -# source://prism/lib/prism/lex_compat.rb#296 -class Prism::LexCompat::Heredoc::DashHeredoc - # @return [DashHeredoc] a new instance of DashHeredoc - # - # source://prism/lib/prism/lex_compat.rb#299 - def initialize(split); end - - # source://prism/lib/prism/lex_compat.rb#304 - def <<(token); end - - # source://prism/lib/prism/lex_compat.rb#297 - def split; end - - # source://prism/lib/prism/lex_compat.rb#308 - def to_a; end - - # source://prism/lib/prism/lex_compat.rb#297 - def tokens; end -end - -# Heredocs that are dedenting heredocs are a little more complicated. -# Ripper outputs on_ignored_sp tokens for the whitespace that is being -# removed from the output. prism only modifies the node itself and keeps -# the token the same. This simplifies prism, but makes comparing against -# Ripper much harder because there is a length mismatch. -# -# Fortunately, we already have to pull out the heredoc tokens in order to -# insert them into the stream in the correct order. As such, we can do -# some extra manipulation on the tokens to make them match Ripper's -# output by mirroring the dedent logic that Ripper uses. -# -# source://prism/lib/prism/lex_compat.rb#355 -class Prism::LexCompat::Heredoc::DedentingHeredoc - # @return [DedentingHeredoc] a new instance of DedentingHeredoc - # - # source://prism/lib/prism/lex_compat.rb#360 - def initialize; end - - # As tokens are coming in, we track the minimum amount of common leading - # whitespace on plain string content tokens. This allows us to later - # remove that amount of whitespace from the beginning of each line. + # def closing: () -> String # - # source://prism/lib/prism/lex_compat.rb#371 - def <<(token); end + # source://prism/lib/prism/node.rb#10952 + sig { returns(String) } + def closing; end - # Returns the value of attribute dedent. + # attr_reader closing_loc: Location # - # source://prism/lib/prism/lex_compat.rb#358 - def dedent; end + # source://prism/lib/prism/node.rb#10885 + sig { returns(Prism::Location) } + def closing_loc; end - # Returns the value of attribute dedent_next. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/lex_compat.rb#358 - def dedent_next; end + # source://prism/lib/prism/node.rb#10853 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Returns the value of attribute embexpr_balance. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/lex_compat.rb#358 - def embexpr_balance; end - - # source://prism/lib/prism/lex_compat.rb#408 - def to_a; end + # source://prism/lib/prism/node.rb#10848 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Returns the value of attribute tokens. + # def copy: (?flags: Integer, ?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedRegularExpressionNode # - # source://prism/lib/prism/lex_compat.rb#358 - def tokens; end -end - -# source://prism/lib/prism/lex_compat.rb#356 -Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) + # source://prism/lib/prism/node.rb#10858 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: 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 -# Heredocs that are no dash or tilde heredocs are just a list of tokens. -# We need to keep them around so that we can insert them in the correct -# order back into the token stream and set the state of the last token to -# the state that the heredoc was opened in. -# -# source://prism/lib/prism/lex_compat.rb#277 -class Prism::LexCompat::Heredoc::PlainHeredoc - # @return [PlainHeredoc] a new instance of PlainHeredoc + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/lex_compat.rb#280 - def initialize; end - - # source://prism/lib/prism/lex_compat.rb#284 - def <<(token); end - - # source://prism/lib/prism/lex_compat.rb#288 - def to_a; end - - # source://prism/lib/prism/lex_compat.rb#278 - def tokens; end -end - -# Ident tokens for the most part are exactly the same, except sometimes we -# know an ident is a local when ripper doesn't (when they are introduced -# through named captures in regular expressions). In that case we don't -# compare the state. -# -# source://prism/lib/prism/lex_compat.rb#229 -class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token - # source://prism/lib/prism/lex_compat.rb#230 - def ==(other); end -end - -# Tokens where state should be ignored -# used for :on_comment, :on_heredoc_end, :on_embexpr_end -# -# source://prism/lib/prism/lex_compat.rb#219 -class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token - # source://prism/lib/prism/lex_compat.rb#220 - def ==(other); end -end - -# Ignored newlines can occasionally have a LABEL state attached to them, so -# we compare the state differently here. -# -# source://prism/lib/prism/lex_compat.rb#240 -class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token - # source://prism/lib/prism/lex_compat.rb#241 - def ==(other); end -end - -# If we have an identifier that follows a method name like: -# -# def foo bar -# -# then Ripper will mark bar as END|LABEL if there is a local in a parent -# scope named bar because it hasn't pushed the local table yet. We do this -# more accurately, so we need to allow comparing against both END and -# END|LABEL. -# -# source://prism/lib/prism/lex_compat.rb#260 -class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token - # source://prism/lib/prism/lex_compat.rb#261 - def ==(other); end -end - -# This is a mapping of prism token types to Ripper token types. This is a -# many-to-one mapping because we split up our token types, whereas Ripper -# tends to group them. -# -# source://prism/lib/prism/lex_compat.rb#16 -Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) + # source://prism/lib/prism/node.rb#10843 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end -# When we produce tokens, we produce the same arrays that Ripper does. -# However, we add a couple of convenience methods onto them to make them a -# little easier to work with. We delegate all other methods to the array. -# -# source://prism/lib/prism/lex_compat.rb#187 -class Prism::LexCompat::Token < ::SimpleDelegator - # The type of the token. + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism/lib/prism/lex_compat.rb#194 - def event; end + # source://prism/lib/prism/node.rb#10866 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # The location of the token in the source. + # def euc_jp?: () -> bool # - # source://prism/lib/prism/lex_compat.rb#189 - def location; end - - # The state of the lexer when this token was produced. + # @return [Boolean] # - # source://prism/lib/prism/lex_compat.rb#204 - def state; end + # source://prism/lib/prism/node.rb#10912 + sig { returns(T::Boolean) } + def euc_jp?; end - # The slice of the source that this token represents. + # def extended?: () -> bool # - # source://prism/lib/prism/lex_compat.rb#199 - def value; end -end - -# This is a class that wraps the Ripper lexer to produce almost exactly the -# same tokens. -# -# source://prism/lib/prism/lex_compat.rb#853 -class Prism::LexRipper - # @return [LexRipper] a new instance of LexRipper + # @return [Boolean] # - # source://prism/lib/prism/lex_compat.rb#856 - def initialize(source); end - - # source://prism/lib/prism/lex_compat.rb#860 - def result; end - - # source://prism/lib/prism/lex_compat.rb#854 - def source; end - - private + # source://prism/lib/prism/node.rb#10897 + sig { returns(T::Boolean) } + def extended?; end - # source://prism/lib/prism/lex_compat.rb#894 - def lex(source); end -end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end -# Represents the use of the `&&=` operator for assignment to a local variable. -# -# target &&= value -# ^^^^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#12029 -class Prism::LocalVariableAndWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Integer depth, Location location) -> void + # def forced_binary_encoding?: () -> bool # - # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode + # @return [Boolean] # - # source://prism/lib/prism/node.rb#12031 - def initialize(source, name_loc, operator_loc, value, name, depth, location); end + # source://prism/lib/prism/node.rb#10937 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # def accept: (Visitor visitor) -> void + # def forced_us_ascii_encoding?: () -> bool # - # source://prism/lib/prism/node.rb#12043 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end - - # def child_nodes: () -> Array[nil | Node] + # @return [Boolean] # - # source://prism/lib/prism/node.rb#12048 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/node.rb#10942 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end - # def comment_targets: () -> Array[Node | Location] + # def forced_utf8_encoding?: () -> bool # - # source://prism/lib/prism/node.rb#12058 - def comment_targets; end - - # def compact_child_nodes: () -> Array[Node] + # @return [Boolean] # - # source://prism/lib/prism/node.rb#12053 - def compact_child_nodes; end + # source://prism/lib/prism/node.rb#10932 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # def copy: (**params) -> LocalVariableAndWriteNode + # def ignore_case?: () -> bool # - # source://prism/lib/prism/node.rb#12063 - sig { params(params: T.untyped).returns(Prism::LocalVariableAndWriteNode) } - def copy(**params); end - - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # @return [Boolean] # - # source://prism/lib/prism/node.rb#12048 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/node.rb#10892 + sig { returns(T::Boolean) } + def ignore_case?; end - # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location } + # def inspect -> String # - # source://prism/lib/prism/node.rb#12079 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/node.rb#10957 + sig { override.returns(String) } + def inspect; end - # attr_reader depth: Integer + # def multi_line?: () -> bool # - # source://prism/lib/prism/node.rb#12102 - sig { returns(Integer) } - def depth; end - - # source://prism/lib/prism/desugar_compiler.rb#197 - def desugar; end - - # def inspect(NodeInspector inspector) -> String + # @return [Boolean] # - # source://prism/lib/prism/node.rb#12111 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#10902 + sig { returns(T::Boolean) } + def multi_line?; end - # attr_reader name: Symbol - # - # source://prism/lib/prism/node.rb#12099 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/parse_result/newlines.rb#128 + def newline!(lines); end - # attr_reader name_loc: Location + # def once?: () -> bool # - # source://prism/lib/prism/node.rb#12084 - sig { returns(Prism::Location) } - def name_loc; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10907 + sig { returns(T::Boolean) } + def once?; end - # def operator: () -> String + # def opening: () -> String # - # source://prism/lib/prism/node.rb#12106 + # source://prism/lib/prism/node.rb#10947 sig { returns(String) } - def operator; end + def opening; end - # attr_reader operator_loc: Location + # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#12090 + # source://prism/lib/prism/node.rb#10875 sig { returns(Prism::Location) } - def operator_loc; end + def opening_loc; end + + sig { returns(Integer) } + def options; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] + # + # source://prism/lib/prism/node.rb#10882 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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 @@ -17564,14 +19693,33 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12136 + # source://prism/lib/prism/node.rb#10975 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # def utf_8?: () -> bool # - # source://prism/lib/prism/node.rb#12096 - sig { returns(Prism::Node) } - def value; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10927 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#10922 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#10871 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -17581,107 +19729,156 @@ class Prism::LocalVariableAndWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12146 + # source://prism/lib/prism/node.rb#10985 def type; end end end -# Represents assigning to a local variable using an operator that isn't `=`. +# Represents a string literal that contains interpolation. # -# target += value -# ^^^^^^^^^^^^^^^ +# "foo #{bar} baz" +# ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#12155 -class Prism::LocalVariableOperatorWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Symbol operator, Integer depth, Location location) -> void +# source://prism/lib/prism/node.rb#11005 +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 # - # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode + # @return [InterpolatedStringNode] a new instance of InterpolatedStringNode + # + # source://prism/lib/prism/node.rb#11007 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, flags, opening_loc, parts, closing_loc, location); 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#12157 - def initialize(source, name_loc, operator_loc, value, name, operator, depth, location); end + # source://prism/lib/prism/node.rb#11137 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12170 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11017 + 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#12175 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11022 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String? + # + # source://prism/lib/prism/node.rb#11098 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism/lib/prism/node.rb#11070 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#12185 + # source://prism/lib/prism/node.rb#11032 + 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#12180 + # source://prism/lib/prism/node.rb#11027 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LocalVariableOperatorWriteNode + # def copy: (?flags: Integer, ?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedStringNode # - # source://prism/lib/prism/node.rb#12190 - sig { params(params: T.untyped).returns(Prism::LocalVariableOperatorWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11037 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12175 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11022 + 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: Node, name: Symbol, operator: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode], closing_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#12207 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11045 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader depth: Integer + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def frozen?: () -> bool # - # source://prism/lib/prism/node.rb#12233 - sig { returns(Integer) } - def depth; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#11083 + sig { returns(T::Boolean) } + def frozen?; end - # source://prism/lib/prism/desugar_compiler.rb#209 - def desugar; end + sig { returns(T::Boolean) } + def heredoc?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#12237 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11103 + sig { override.returns(String) } + def inspect; end - # attr_reader name: Symbol + # def mutable?: () -> bool # - # source://prism/lib/prism/node.rb#12227 - sig { returns(Symbol) } - def name; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#11088 + sig { returns(T::Boolean) } + def mutable?; end - # attr_reader name_loc: Location + # source://prism/lib/prism/parse_result/newlines.rb#135 + def newline!(lines); end + + # def opening: () -> String? # - # source://prism/lib/prism/node.rb#12212 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/node.rb#11093 + sig { returns(T.nilable(String)) } + def opening; end - # attr_reader operator: Symbol + # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#12230 - sig { returns(Symbol) } - def operator; end + # source://prism/lib/prism/node.rb#11054 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end - # attr_reader operator_loc: Location + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode | InterpolatedStringNode] # - # source://prism/lib/prism/node.rb#12218 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/node.rb#11067 + sig do + returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode, Prism::InterpolatedStringNode)]) + end + def parts; 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 @@ -17698,14 +19895,17 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12263 + # source://prism/lib/prism/node.rb#11121 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + protected + + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#12224 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/node.rb#11050 + sig { returns(Integer) } + def flags; end class << self # Similar to #type, this method returns a symbol that you can use for @@ -17715,107 +19915,142 @@ class Prism::LocalVariableOperatorWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12273 + # source://prism/lib/prism/node.rb#11131 def type; end end end -# Represents the use of the `||=` operator for assignment to a local variable. +# Flags for interpolated string nodes that indicated mutability if they are also marked as literals. # -# target ||= value -# ^^^^^^^^^^^^^^^^ +# source://prism/lib/prism/node.rb#19181 +module Prism::InterpolatedStringNodeFlags; end + +# source://prism/lib/prism/node.rb#19183 +Prism::InterpolatedStringNodeFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# source://prism/lib/prism/node.rb#19186 +Prism::InterpolatedStringNodeFlags::MUTABLE = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal that contains interpolation. # -# source://prism/lib/prism/node.rb#12282 -class Prism::LocalVariableOrWriteNode < ::Prism::Node - # def initialize: (Location name_loc, Location operator_loc, Node value, Symbol name, Integer depth, Location location) -> void +# :"foo #{bar} baz" +# ^^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#11151 +class Prism::InterpolatedSymbolNode < ::Prism::Node + # def initialize: (Location? opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location? closing_loc, Location location) -> void # - # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode + # @return [InterpolatedSymbolNode] a new instance of InterpolatedSymbolNode # - # source://prism/lib/prism/node.rb#12284 - def initialize(source, name_loc, operator_loc, value, name, depth, location); end + # source://prism/lib/prism/node.rb#11153 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, opening_loc, parts, closing_loc, location); 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#11268 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12296 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11162 + 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#12301 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11167 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String? + # + # source://prism/lib/prism/node.rb#11229 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism/lib/prism/node.rb#11211 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#12311 + # source://prism/lib/prism/node.rb#11177 + 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#12306 + # source://prism/lib/prism/node.rb#11172 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LocalVariableOrWriteNode + # def copy: (?opening_loc: Location?, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location?, ?location: Location) -> InterpolatedSymbolNode # - # source://prism/lib/prism/node.rb#12316 - sig { params(params: T.untyped).returns(Prism::LocalVariableOrWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11182 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12301 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11167 + 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: Node, name: Symbol, depth: Integer, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { opening_loc: Location?, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location?, location: Location } # - # source://prism/lib/prism/node.rb#12332 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11190 + 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#12355 - sig { returns(Integer) } - def depth; end - - # source://prism/lib/prism/desugar_compiler.rb#203 - def desugar; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#12364 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11234 + sig { override.returns(String) } + def inspect; end - # attr_reader name: Symbol - # - # source://prism/lib/prism/node.rb#12352 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/parse_result/newlines.rb#142 + def newline!(lines); end - # attr_reader name_loc: Location + # def opening: () -> String? # - # source://prism/lib/prism/node.rb#12337 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/node.rb#11224 + sig { returns(T.nilable(String)) } + def opening; end - # def operator: () -> String + # attr_reader opening_loc: Location? # - # source://prism/lib/prism/node.rb#12359 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node.rb#11195 + sig { returns(T.nilable(Prism::Location)) } + def opening_loc; end - # attr_reader operator_loc: Location + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism/lib/prism/node.rb#12343 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/node.rb#11208 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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 @@ -17832,15 +20067,10 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12389 + # source://prism/lib/prism/node.rb#11252 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node - # - # source://prism/lib/prism/node.rb#12349 - 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. @@ -17849,104 +20079,136 @@ class Prism::LocalVariableOrWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12399 + # source://prism/lib/prism/node.rb#11262 def type; end end end -# Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. +# Represents an xstring literal that contains interpolation. # -# foo -# ^^^ +# `foo #{bar} baz` +# ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#12408 -class Prism::LocalVariableReadNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location location) -> void +# source://prism/lib/prism/node.rb#11281 +class Prism::InterpolatedXStringNode < ::Prism::Node + include ::Prism::HeredocQuery + + # def initialize: (Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, Location location) -> void # - # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode + # @return [InterpolatedXStringNode] a new instance of InterpolatedXStringNode # - # source://prism/lib/prism/node.rb#12410 - def initialize(source, name, depth, location); end + # source://prism/lib/prism/node.rb#11283 + sig do + params( + source: Prism::Source, + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, opening_loc, parts, closing_loc, location); 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#11386 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12419 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11292 + 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#12424 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11297 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism/lib/prism/node.rb#11347 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism/lib/prism/node.rb#11335 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#12434 + # source://prism/lib/prism/node.rb#11307 + 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#12429 + # source://prism/lib/prism/node.rb#11302 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LocalVariableReadNode + # def copy: (?opening_loc: Location, ?parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], ?closing_loc: Location, ?location: Location) -> InterpolatedXStringNode # - # source://prism/lib/prism/node.rb#12439 - sig { params(params: T.untyped).returns(Prism::LocalVariableReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11312 + sig do + params( + opening_loc: Prism::Location, + parts: T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)], + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12424 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11297 + 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) -> { opening_loc: Location, parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode], closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#12452 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11320 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # The number of visible scopes that should be searched to find the origin of this local variable. - # - # foo = 1; foo # depth 0 - # - # bar = 2; tap { bar } # depth 1 - # - # 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#12478 - sig { returns(Integer) } - def depth; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#12482 - def inspect(inspector = T.unsafe(nil)); end + sig { returns(T::Boolean) } + def heredoc?; end - # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). - # - # x # name `:x` - # - # _Test # name `:_Test` - # - # Note that this can also be an underscore followed by a number for the default block parameters. + # def inspect -> String # - # _1 # name `:_1` + # source://prism/lib/prism/node.rb#11352 + sig { override.returns(String) } + def inspect; end + + # source://prism/lib/prism/parse_result/newlines.rb#149 + def newline!(lines); end + + # def opening: () -> String # - # 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. + # source://prism/lib/prism/node.rb#11342 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location # - # it # name `:0it` + # source://prism/lib/prism/node.rb#11325 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader parts: Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] # - # source://prism/lib/prism/node.rb#12469 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/node.rb#11332 + sig { returns(T::Array[T.any(Prism::StringNode, Prism::EmbeddedStatementsNode, Prism::EmbeddedVariableNode)]) } + def parts; 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 @@ -17963,7 +20225,8 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12503 + # source://prism/lib/prism/node.rb#11370 + sig { override.returns(Symbol) } def type; end class << self @@ -17974,86 +20237,83 @@ class Prism::LocalVariableReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12513 + # source://prism/lib/prism/node.rb#11380 def type; end end end -# Represents writing to a local variable in a context that doesn't have an explicit value. +# Represents reading from the implicit `it` local variable. # -# foo, bar = baz -# ^^^ ^^^ +# -> { it } +# ^^ # -# source://prism/lib/prism/node.rb#12522 -class Prism::LocalVariableTargetNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location location) -> void +# source://prism/lib/prism/node.rb#11399 +class Prism::ItLocalVariableReadNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode + # @return [ItLocalVariableReadNode] a new instance of ItLocalVariableReadNode # - # source://prism/lib/prism/node.rb#12524 - def initialize(source, name, depth, location); end + # source://prism/lib/prism/node.rb#11401 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); 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#11474 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12533 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11407 + 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#12538 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11412 + 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#12548 + # source://prism/lib/prism/node.rb#11422 + 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#12543 + # source://prism/lib/prism/node.rb#11417 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LocalVariableTargetNode + # def copy: (?location: Location) -> ItLocalVariableReadNode # - # source://prism/lib/prism/node.rb#12553 - sig { params(params: T.untyped).returns(Prism::LocalVariableTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11427 + sig { params(location: Prism::Location).returns(Prism::ItLocalVariableReadNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12538 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11412 + 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) -> { location: Location } # - # source://prism/lib/prism/node.rb#12566 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11435 + 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#12574 - sig { returns(Integer) } - def depth; end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#12578 - def inspect(inspector = T.unsafe(nil)); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader name: Symbol + # def inspect -> String # - # source://prism/lib/prism/node.rb#12571 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/node.rb#11440 + 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 @@ -18070,7 +20330,8 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12599 + # source://prism/lib/prism/node.rb#11458 + sig { override.returns(Symbol) } def type; end class << self @@ -18081,104 +20342,83 @@ class Prism::LocalVariableTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12609 + # source://prism/lib/prism/node.rb#11468 def type; end end end -# Represents writing to a local variable. +# Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda. # -# foo = 1 -# ^^^^^^^ +# -> { it + it } +# ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#12618 -class Prism::LocalVariableWriteNode < ::Prism::Node - # def initialize: (Symbol name, Integer depth, Location name_loc, Node value, Location operator_loc, Location location) -> void +# source://prism/lib/prism/node.rb#11483 +class Prism::ItParametersNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode + # @return [ItParametersNode] a new instance of ItParametersNode # - # source://prism/lib/prism/node.rb#12620 - def initialize(source, name, depth, name_loc, value, operator_loc, location); end + # source://prism/lib/prism/node.rb#11485 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); 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#11558 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12632 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11491 + 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#12637 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11496 + 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#12647 + # source://prism/lib/prism/node.rb#11506 + 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#12642 + # source://prism/lib/prism/node.rb#11501 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> LocalVariableWriteNode + # def copy: (?location: Location) -> ItParametersNode # - # source://prism/lib/prism/node.rb#12652 - sig { params(params: T.untyped).returns(Prism::LocalVariableWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11511 + sig { params(location: Prism::Location).returns(Prism::ItParametersNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12637 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11496 + 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: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#12668 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11519 + 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#12676 - sig { returns(Integer) } - def depth; end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#12700 - def inspect(inspector = T.unsafe(nil)); end - - # attr_reader name: Symbol - # - # source://prism/lib/prism/node.rb#12673 - sig { returns(Symbol) } - def name; end - - # attr_reader name_loc: Location - # - # source://prism/lib/prism/node.rb#12679 - sig { returns(Prism::Location) } - def name_loc; end - - # def operator: () -> String - # - # source://prism/lib/prism/node.rb#12695 - sig { returns(String) } - def operator; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader operator_loc: Location + # def inspect -> String # - # source://prism/lib/prism/node.rb#12688 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/node.rb#11524 + 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 @@ -18195,15 +20435,10 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12725 + # source://prism/lib/prism/node.rb#11542 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node - # - # source://prism/lib/prism/node.rb#12685 - 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. @@ -18212,407 +20447,283 @@ class Prism::LocalVariableWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12735 + # source://prism/lib/prism/node.rb#11552 def type; end end end -# This represents a location in the source. +# Represents a hash literal without opening and closing braces. # -# source://prism/lib/prism/parse_result.rb#98 -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 +# foo(a: b) +# ^^^^ +# +# source://prism/lib/prism/node.rb#11567 +class Prism::KeywordHashNode < ::Prism::Node + # def initialize: (Integer flags, Array[AssocNode | AssocSplatNode] elements, Location location) -> void # - # source://prism/lib/prism/parse_result.rb#116 - 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. + # @return [KeywordHashNode] a new instance of KeywordHashNode # - # source://prism/lib/prism/parse_result.rb#232 - def ==(other); end + # source://prism/lib/prism/node.rb#11569 + sig do + params( + source: Prism::Source, + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).void + end + def initialize(source, flags, elements, location); end - # The list of comments attached to this location + # 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/parse_result.rb#112 - sig { returns(T::Array[Prism::Comment]) } - def comments; end + # source://prism/lib/prism/node.rb#11656 + def ===(other); end - # Create a new location object with the given options. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/parse_result.rb#124 - sig { params(options: T.untyped).returns(Prism::Location) } - def copy(**options); end + # source://prism/lib/prism/node.rb#11577 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Implement the hash pattern matching interface for Location. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#222 - def deconstruct_keys(keys); end + # source://prism/lib/prism/node.rb#11582 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The column number in characters where this location ends from the start of - # the line. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/parse_result.rb#211 - def end_character_column; end + # source://prism/lib/prism/node.rb#11592 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # The character offset from the beginning of the source where this location - # ends. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/parse_result.rb#160 - def end_character_offset; end + # source://prism/lib/prism/node.rb#11587 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # The column number in code units of the given encoding where this location - # ends from the start of the line. + # def copy: (?flags: Integer, ?elements: Array[AssocNode | AssocSplatNode], ?location: Location) -> KeywordHashNode # - # source://prism/lib/prism/parse_result.rb#217 - def end_code_units_column(encoding = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11597 + sig do + params( + flags: Integer, + elements: T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)], + location: Prism::Location + ).returns(Prism::KeywordHashNode) + end + def copy(flags: T.unsafe(nil), elements: T.unsafe(nil), location: T.unsafe(nil)); end - # The offset from the start of the file in code units of the given encoding. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#165 - def end_code_units_offset(encoding = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11582 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # The column number in bytes where this location ends from the start of the - # line. + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, elements: Array[AssocNode | AssocSplatNode], location: Location } # - # source://prism/lib/prism/parse_result.rb#205 - sig { returns(Integer) } - def end_column; end + # source://prism/lib/prism/node.rb#11605 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # The line number where this location ends. + # attr_reader elements: Array[AssocNode | AssocSplatNode] # - # source://prism/lib/prism/parse_result.rb#181 - sig { returns(Integer) } - def end_line; end + # source://prism/lib/prism/node.rb#11614 + sig { returns(T::Array[T.any(Prism::AssocNode, Prism::AssocSplatNode)]) } + def elements; end - # The byte offset from the beginning of the source where this location ends. - # - # source://prism/lib/prism/parse_result.rb#154 - sig { returns(Integer) } - def end_offset; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Returns a string representation of this location. + # def inspect -> String # - # source://prism/lib/prism/parse_result.rb#133 + # source://prism/lib/prism/node.rb#11622 + sig { override.returns(String) } def inspect; end - # Returns a new location that stretches from this location to the given - # 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#241 - def join(other); end - - # The length of this location in bytes. - # - # source://prism/lib/prism/parse_result.rb#109 - def length; end - - # Implement the pretty print interface for Location. - # - # source://prism/lib/prism/parse_result.rb#227 - def pretty_print(q); end - - # The source code that this location represents. - # - # source://prism/lib/prism/parse_result.rb#138 - sig { returns(String) } - def slice; end - - # The column number in characters where this location ends from the start of - # the line. - # - # source://prism/lib/prism/parse_result.rb#193 - 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#144 - 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#199 - 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. + # def symbol_keys?: () -> bool # - # source://prism/lib/prism/parse_result.rb#149 - 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. + # @return [Boolean] # - # source://prism/lib/prism/parse_result.rb#187 - sig { returns(Integer) } - def start_column; end + # source://prism/lib/prism/node.rb#11617 + sig { returns(T::Boolean) } + def symbol_keys?; end - # The line number where this location starts. + # 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. # - # source://prism/lib/prism/parse_result.rb#170 - sig { returns(Integer) } - def start_line; end - - # The content of the line where this location starts before this location. + # 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/parse_result.rb#175 - def start_line_slice; end - - # The byte offset from the beginning of the source where this location - # starts. + # def type: () -> Symbol # - # source://prism/lib/prism/parse_result.rb#106 - sig { returns(Integer) } - def start_offset; end + # source://prism/lib/prism/node.rb#11640 + sig { override.returns(Symbol) } + def type; end protected - # A Source object that is used to determine more information from the given - # offset and length. + # protected attr_reader flags: Integer # - # source://prism/lib/prism/parse_result.rb#101 - def source; end + # source://prism/lib/prism/node.rb#11610 + sig { returns(Integer) } + def flags; end class << self - # Returns a null location that does not correspond to a source and points to - # the beginning of the file. Useful for when you want a location object but - # do not care where it points. + # 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 # - # source://prism/lib/prism/parse_result.rb#251 - def null; end + # source://prism/lib/prism/node.rb#11650 + def type; end end end -# Flags for while and until loop nodes. +# Flags for keyword hash nodes. # -# source://prism/lib/prism/node.rb#19298 -module Prism::LoopFlags; end +# source://prism/lib/prism/node.rb#19190 +module Prism::KeywordHashNodeFlags; end -# a loop after a begin statement, so the body is executed first before the condition +# 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#19300 -Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) +# source://prism/lib/prism/node.rb#19192 +Prism::KeywordHashNodeFlags::SYMBOL_KEYS = T.let(T.unsafe(nil), Integer) -# This represents a magic comment that was encountered during parsing. +# Represents a keyword rest parameter to a method, block, or lambda definition. # -# source://prism/lib/prism/parse_result.rb#303 -class Prism::MagicComment - # Create a new magic comment object with the given key and value locations. +# def a(**b) +# ^^^ +# end +# +# source://prism/lib/prism/node.rb#11669 +class Prism::KeywordRestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # - # @return [MagicComment] a new instance of MagicComment + # @return [KeywordRestParameterNode] a new instance of KeywordRestParameterNode # - # source://prism/lib/prism/parse_result.rb#311 - def initialize(key_loc, value_loc); end + # source://prism/lib/prism/node.rb#11671 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, location); end - # Implement the hash pattern matching interface for MagicComment. + # 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/parse_result.rb#327 - def deconstruct_keys(keys); end - - # Returns a string representation of this magic comment. - # - # source://prism/lib/prism/parse_result.rb#332 - def inspect; end - - # Returns the key of the magic comment by slicing it from the source code. - # - # source://prism/lib/prism/parse_result.rb#317 - def key; end - - # A Location object representing the location of the key in the source. - # - # source://prism/lib/prism/parse_result.rb#305 - 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#322 - def value; end - - # A Location object representing the location of the value in the source. - # - # source://prism/lib/prism/parse_result.rb#308 - def value_loc; end -end - -# Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. -# -# if /foo/i then end -# ^^^^^^ -# -# source://prism/lib/prism/node.rb#12744 -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 - # - # @return [MatchLastLineNode] a new instance of MatchLastLineNode - # - # source://prism/lib/prism/node.rb#12746 - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism/lib/prism/node.rb#11785 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12758 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11681 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # def ascii_8bit?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12850 - sig { returns(T::Boolean) } - def ascii_8bit?; end - # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12763 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11686 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#12890 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#12815 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#12773 + # source://prism/lib/prism/node.rb#11696 + 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#12768 + # source://prism/lib/prism/node.rb#11691 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def content: () -> String - # - # source://prism/lib/prism/node.rb#12885 - sig { returns(String) } - def content; end - - # attr_reader content_loc: Location - # - # source://prism/lib/prism/node.rb#12809 - sig { returns(Prism::Location) } - def content_loc; end - - # def copy: (**params) -> MatchLastLineNode + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> KeywordRestParameterNode # - # source://prism/lib/prism/node.rb#12778 - sig { params(params: T.untyped).returns(Prism::MatchLastLineNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11701 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12763 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11686 + 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) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#12794 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11709 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12845 - sig { returns(T::Boolean) } - def euc_jp?; end - - # def extended?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12830 - sig { returns(T::Boolean) } - def extended?; end - - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12870 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] + # def inspect -> String # - # source://prism/lib/prism/node.rb#12875 - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end + # source://prism/lib/prism/node.rb#11751 + sig { override.returns(String) } + def inspect; end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] + # attr_reader name: Symbol? # - # source://prism/lib/prism/node.rb#12865 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end + # source://prism/lib/prism/node.rb#11718 + sig { returns(T.nilable(Symbol)) } + def name; end - # def ignore_case?: () -> bool - # - # @return [Boolean] + # attr_reader name_loc: Location? # - # source://prism/lib/prism/node.rb#12825 - sig { returns(T::Boolean) } - def ignore_case?; end + # source://prism/lib/prism/node.rb#11721 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end - # def inspect(NodeInspector inspector) -> String + # def operator: () -> String # - # source://prism/lib/prism/node.rb#12895 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11746 + sig { returns(String) } + def operator; end - # def multi_line?: () -> bool - # - # @return [Boolean] + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#12835 - sig { returns(T::Boolean) } - def multi_line?; end + # source://prism/lib/prism/node.rb#11734 + sig { returns(Prism::Location) } + def operator_loc; end - # def once?: () -> bool + # def repeated_parameter?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#12840 + # source://prism/lib/prism/node.rb#11741 sig { returns(T::Boolean) } - def once?; end - - # def opening: () -> String - # - # source://prism/lib/prism/node.rb#12880 - sig { returns(String) } - def opening; end - - # attr_reader opening_loc: Location - # - # source://prism/lib/prism/node.rb#12803 - sig { returns(Prism::Location) } - def opening_loc; end + 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 @@ -18629,36 +20740,15 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#12920 + # source://prism/lib/prism/node.rb#11769 + sig { override.returns(Symbol) } def type; end - # attr_reader unescaped: String - # - # source://prism/lib/prism/node.rb#12821 - sig { returns(String) } - def unescaped; end - - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12860 - sig { returns(T::Boolean) } - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#12855 - sig { returns(T::Boolean) } - def windows_31j?; end - - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#12799 + # source://prism/lib/prism/node.rb#11714 sig { returns(Integer) } def flags; end @@ -18670,92 +20760,158 @@ class Prism::MatchLastLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#12930 + # source://prism/lib/prism/node.rb#11779 def type; end end end -# Represents the use of the modifier `in` operator. +# Represents using a lambda literal (not the lambda method call). # -# foo in bar -# ^^^^^^^^^^ +# ->(value) { value * 2 } +# ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#12939 -class Prism::MatchPredicateNode < ::Prism::Node - # def initialize: (Node value, Node pattern, Location operator_loc, Location location) -> void +# source://prism/lib/prism/node.rb#11798 +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 # - # @return [MatchPredicateNode] a new instance of MatchPredicateNode + # @return [LambdaNode] a new instance of LambdaNode # - # source://prism/lib/prism/node.rb#12941 - def initialize(source, value, pattern, operator_loc, location); end + # source://prism/lib/prism/node.rb#11800 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location); 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#11927 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#12951 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11812 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader body: Prism::node? + # + # source://prism/lib/prism/node.rb#11875 + sig { returns(T.nilable(Prism::Node)) } + def body; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12956 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11817 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism/lib/prism/node.rb#11888 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism/lib/prism/node.rb#11865 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#12966 + # source://prism/lib/prism/node.rb#11830 + 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#12961 + # source://prism/lib/prism/node.rb#11822 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> MatchPredicateNode + # def copy: (?locals: Array[Symbol], ?operator_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?parameters: Prism::node?, ?body: Prism::node?, ?location: Location) -> LambdaNode # - # source://prism/lib/prism/node.rb#12971 - sig { params(params: T.untyped).returns(Prism::MatchPredicateNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11835 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#12956 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11817 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, pattern: Node, operator_loc: Location, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#12985 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11843 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#11893 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] + # + # source://prism/lib/prism/node.rb#11848 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def opening: () -> String + # + # source://prism/lib/prism/node.rb#11883 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#13008 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#11858 + sig { returns(Prism::Location) } + def opening_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#13003 + # source://prism/lib/prism/node.rb#11878 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#12996 + # source://prism/lib/prism/node.rb#11851 sig { returns(Prism::Location) } def operator_loc; end - # attr_reader pattern: Node + # attr_reader parameters: Prism::node? # - # source://prism/lib/prism/node.rb#12993 - sig { returns(Prism::Node) } - def pattern; end + # source://prism/lib/prism/node.rb#11872 + sig { returns(T.nilable(Prism::Node)) } + 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 @@ -18772,15 +20928,10 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13032 + # source://prism/lib/prism/node.rb#11911 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node - # - # source://prism/lib/prism/node.rb#12990 - 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. @@ -18789,297 +20940,441 @@ class Prism::MatchPredicateNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13042 + # source://prism/lib/prism/node.rb#11921 def type; end end end -# Represents the use of the `=>` operator. -# -# foo => bar -# ^^^^^^^^^^ +# This class is responsible for lexing the source using prism and then +# converting those tokens to be compatible with Ripper. In the vast majority +# of cases, this is a one-to-one mapping of the token type. Everything else +# generally lines up. However, there are a few cases that require special +# handling. # -# source://prism/lib/prism/node.rb#13051 -class Prism::MatchRequiredNode < ::Prism::Node - # def initialize: (Node value, Node pattern, Location operator_loc, Location location) -> void - # - # @return [MatchRequiredNode] a new instance of MatchRequiredNode +# source://prism/lib/prism/lex_compat.rb#12 +class Prism::LexCompat + # @return [LexCompat] a new instance of LexCompat # - # source://prism/lib/prism/node.rb#13053 - def initialize(source, value, pattern, operator_loc, location); end + # source://prism/lib/prism/lex_compat.rb#619 + def initialize(source, **options); end - # def accept: (Visitor visitor) -> void + # Returns the value of attribute options. # - # source://prism/lib/prism/node.rb#13063 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/lex_compat.rb#617 + def options; end - # def child_nodes: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#13068 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/lex_compat.rb#624 + def result; end - # def comment_targets: () -> Array[Node | Location] + # Returns the value of attribute source. # - # source://prism/lib/prism/node.rb#13078 - def comment_targets; end + # source://prism/lib/prism/lex_compat.rb#617 + def source; end +end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism/lib/prism/node.rb#13073 - def compact_child_nodes; end +# Ripper doesn't include the rest of the token in the event, so we need to +# trim it down to just the content on the first line when comparing. +# +# source://prism/lib/prism/lex_compat.rb#230 +class Prism::LexCompat::EndContentToken < ::Prism::LexCompat::Token + # source://prism/lib/prism/lex_compat.rb#231 + def ==(other); end +end - # def copy: (**params) -> MatchRequiredNode - # - # source://prism/lib/prism/node.rb#13083 - sig { params(params: T.untyped).returns(Prism::MatchRequiredNode) } - def copy(**params); end +# A heredoc in this case is a list of tokens that belong to the body of the +# heredoc that should be appended onto the list of tokens when the heredoc +# closes. +# +# source://prism/lib/prism/lex_compat.rb#291 +module Prism::LexCompat::Heredoc + class << self + # Here we will split between the two types of heredocs and return the + # object that will store their tokens. + # + # source://prism/lib/prism/lex_compat.rb#603 + def build(opening); end + end +end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] +# Dash heredocs are a little more complicated. They are a list of tokens +# that need to be split on "\\\n" to mimic Ripper's behavior. We also need +# to keep track of the state that the heredoc was opened in. +# +# source://prism/lib/prism/lex_compat.rb#315 +class Prism::LexCompat::Heredoc::DashHeredoc + # @return [DashHeredoc] a new instance of DashHeredoc # - # source://prism/lib/prism/node.rb#13068 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/lex_compat.rb#318 + def initialize(split); end - # def deconstruct_keys: (Array[Symbol] keys) -> { value: Node, pattern: Node, operator_loc: Location, location: Location } - # - # source://prism/lib/prism/node.rb#13097 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/lex_compat.rb#323 + def <<(token); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#13120 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/lex_compat.rb#316 + def split; end - # def operator: () -> String + # source://prism/lib/prism/lex_compat.rb#327 + def to_a; end + + # source://prism/lib/prism/lex_compat.rb#316 + def tokens; end +end + +# Heredocs that are dedenting heredocs are a little more complicated. +# Ripper outputs on_ignored_sp tokens for the whitespace that is being +# removed from the output. prism only modifies the node itself and keeps +# the token the same. This simplifies prism, but makes comparing against +# Ripper much harder because there is a length mismatch. +# +# Fortunately, we already have to pull out the heredoc tokens in order to +# insert them into the stream in the correct order. As such, we can do +# some extra manipulation on the tokens to make them match Ripper's +# output by mirroring the dedent logic that Ripper uses. +# +# source://prism/lib/prism/lex_compat.rb#374 +class Prism::LexCompat::Heredoc::DedentingHeredoc + # @return [DedentingHeredoc] a new instance of DedentingHeredoc # - # source://prism/lib/prism/node.rb#13115 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/lex_compat.rb#379 + def initialize; end - # attr_reader operator_loc: Location + # As tokens are coming in, we track the minimum amount of common leading + # whitespace on plain string content tokens. This allows us to later + # remove that amount of whitespace from the beginning of each line. # - # source://prism/lib/prism/node.rb#13108 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/lex_compat.rb#390 + def <<(token); end - # attr_reader pattern: Node + # Returns the value of attribute dedent. # - # source://prism/lib/prism/node.rb#13105 - sig { returns(Prism::Node) } - def pattern; end + # source://prism/lib/prism/lex_compat.rb#377 + def dedent; 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. + # Returns the value of attribute dedent_next. # - # 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/lex_compat.rb#377 + def dedent_next; end + + # Returns the value of attribute embexpr_balance. # - # def type: () -> Symbol + # source://prism/lib/prism/lex_compat.rb#377 + def embexpr_balance; end + + # source://prism/lib/prism/lex_compat.rb#427 + def to_a; end + + # Returns the value of attribute tokens. # - # source://prism/lib/prism/node.rb#13144 - def type; end + # source://prism/lib/prism/lex_compat.rb#377 + def tokens; end +end + +# source://prism/lib/prism/lex_compat.rb#375 +Prism::LexCompat::Heredoc::DedentingHeredoc::TAB_WIDTH = T.let(T.unsafe(nil), Integer) - # attr_reader value: Node +# Heredocs that are no dash or tilde heredocs are just a list of tokens. +# We need to keep them around so that we can insert them in the correct +# order back into the token stream and set the state of the last token to +# the state that the heredoc was opened in. +# +# source://prism/lib/prism/lex_compat.rb#296 +class Prism::LexCompat::Heredoc::PlainHeredoc + # @return [PlainHeredoc] a new instance of PlainHeredoc # - # source://prism/lib/prism/node.rb#13102 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/lex_compat.rb#299 + def initialize; 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 - # - # source://prism/lib/prism/node.rb#13154 - def type; end - end + # source://prism/lib/prism/lex_compat.rb#303 + def <<(token); end + + # source://prism/lib/prism/lex_compat.rb#307 + def to_a; end + + # source://prism/lib/prism/lex_compat.rb#297 + def tokens; end end -# Represents writing local variables using a regular expression match with named capture groups. +# Ident tokens for the most part are exactly the same, except sometimes we +# know an ident is a local when ripper doesn't (when they are introduced +# through named captures in regular expressions). In that case we don't +# compare the state. # -# /(?bar)/ =~ baz -# ^^^^^^^^^^^^^^^^^^^^ +# source://prism/lib/prism/lex_compat.rb#248 +class Prism::LexCompat::IdentToken < ::Prism::LexCompat::Token + # source://prism/lib/prism/lex_compat.rb#249 + def ==(other); end +end + +# Tokens where state should be ignored +# used for :on_comment, :on_heredoc_end, :on_embexpr_end # -# source://prism/lib/prism/node.rb#13163 -class Prism::MatchWriteNode < ::Prism::Node - # def initialize: (CallNode call, Array[Node] targets, Location location) -> void +# source://prism/lib/prism/lex_compat.rb#238 +class Prism::LexCompat::IgnoreStateToken < ::Prism::LexCompat::Token + # source://prism/lib/prism/lex_compat.rb#239 + def ==(other); end +end + +# Ignored newlines can occasionally have a LABEL state attached to them, so +# we compare the state differently here. +# +# source://prism/lib/prism/lex_compat.rb#259 +class Prism::LexCompat::IgnoredNewlineToken < ::Prism::LexCompat::Token + # source://prism/lib/prism/lex_compat.rb#260 + def ==(other); end +end + +# If we have an identifier that follows a method name like: +# +# def foo bar +# +# then Ripper will mark bar as END|LABEL if there is a local in a parent +# scope named bar because it hasn't pushed the local table yet. We do this +# more accurately, so we need to allow comparing against both END and +# END|LABEL. +# +# source://prism/lib/prism/lex_compat.rb#279 +class Prism::LexCompat::ParamToken < ::Prism::LexCompat::Token + # source://prism/lib/prism/lex_compat.rb#280 + def ==(other); end +end + +# This is a mapping of prism token types to Ripper token types. This is a +# many-to-one mapping because we split up our token types, whereas Ripper +# tends to group them. +# +# source://prism/lib/prism/lex_compat.rb#33 +Prism::LexCompat::RIPPER = T.let(T.unsafe(nil), Hash) + +# A result class specialized for holding tokens produced by the lexer. +# +# source://prism/lib/prism/lex_compat.rb#14 +class Prism::LexCompat::Result < ::Prism::Result + # Create a new lex compat result object with the given values. # - # @return [MatchWriteNode] a new instance of MatchWriteNode + # @return [Result] a new instance of Result # - # source://prism/lib/prism/node.rb#13165 - def initialize(source, call, targets, location); end + # source://prism/lib/prism/lex_compat.rb#19 + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - # def accept: (Visitor visitor) -> void + # Implement the hash pattern matching interface for Result. # - # source://prism/lib/prism/node.rb#13174 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/lex_compat.rb#25 + def deconstruct_keys(keys); end - # attr_reader call: CallNode + # The list of tokens that were produced by the lexer. # - # source://prism/lib/prism/node.rb#13212 - sig { returns(Prism::CallNode) } - def call; end + # source://prism/lib/prism/lex_compat.rb#16 + def value; end +end - # def child_nodes: () -> Array[nil | Node] +# When we produce tokens, we produce the same arrays that Ripper does. +# However, we add a couple of convenience methods onto them to make them a +# little easier to work with. We delegate all other methods to the array. +# +# source://prism/lib/prism/lex_compat.rb#204 +class Prism::LexCompat::Token < ::SimpleDelegator + # The type of the token. # - # source://prism/lib/prism/node.rb#13179 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/lex_compat.rb#213 + def event; end - # def comment_targets: () -> Array[Node | Location] + # The location of the token in the source. # - # source://prism/lib/prism/node.rb#13189 - def comment_targets; end + # source://prism/lib/prism/lex_compat.rb#208 + def location; end - # def compact_child_nodes: () -> Array[Node] + # The state of the lexer when this token was produced. # - # source://prism/lib/prism/node.rb#13184 - def compact_child_nodes; end + # source://prism/lib/prism/lex_compat.rb#223 + def state; end - # def copy: (**params) -> MatchWriteNode + # The slice of the source that this token represents. # - # source://prism/lib/prism/node.rb#13194 - sig { params(params: T.untyped).returns(Prism::MatchWriteNode) } - def copy(**params); end + # source://prism/lib/prism/lex_compat.rb#218 + def value; end +end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] +# This is a result specific to the `lex` and `lex_file` methods. +# +# source://prism/lib/prism/parse_result.rb#610 +class Prism::LexResult < ::Prism::Result + # Create a new lex result object with the given values. # - # source://prism/lib/prism/node.rb#13179 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end - - # def deconstruct_keys: (Array[Symbol] keys) -> { call: CallNode, targets: Array[Node], location: Location } + # @return [LexResult] a new instance of LexResult # - # source://prism/lib/prism/node.rb#13207 + # source://prism/lib/prism/parse_result.rb#615 sig do params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + value: T::Array[T.untyped], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void end - def deconstruct_keys(keys); end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - # def inspect(NodeInspector inspector) -> String + # Implement the hash pattern matching interface for LexResult. # - # source://prism/lib/prism/node.rb#13219 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/parse_result.rb#621 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # attr_reader targets: Array[Node] + # The list of tokens that were parsed from the source code. # - # source://prism/lib/prism/node.rb#13215 - sig { returns(T::Array[Prism::Node]) } - def targets; end + # source://prism/lib/prism/parse_result.rb#612 + sig { returns(T::Array[T.untyped]) } + def value; end +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 +# This is a class that wraps the Ripper lexer to produce almost exactly the +# same tokens. +# +# source://prism/lib/prism/lex_compat.rb#872 +class Prism::LexRipper + # @return [LexRipper] a new instance of LexRipper # - # source://prism/lib/prism/node.rb#13241 - def type; end + # source://prism/lib/prism/lex_compat.rb#875 + def initialize(source); 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 - # - # source://prism/lib/prism/node.rb#13251 - def type; end - end + # source://prism/lib/prism/lex_compat.rb#879 + def result; end + + # source://prism/lib/prism/lex_compat.rb#873 + def source; end + + private + + # source://prism/lib/prism/lex_compat.rb#913 + def lex(source); end end -# Represents a node that is missing from the source and results in a syntax error. +# Represents the use of the `&&=` operator for assignment to a local variable. # -# source://prism/lib/prism/node.rb#13257 -class Prism::MissingNode < ::Prism::Node - # def initialize: (Location location) -> void +# target &&= value +# ^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#11943 +class Prism::LocalVariableAndWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void # - # @return [MissingNode] a new instance of MissingNode + # @return [LocalVariableAndWriteNode] a new instance of LocalVariableAndWriteNode # - # source://prism/lib/prism/node.rb#13259 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#11945 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, operator_loc, value, name, depth, location); 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#12051 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13266 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#11956 + 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#13271 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11961 + 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#13281 + # source://prism/lib/prism/node.rb#11971 + 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#13276 + # source://prism/lib/prism/node.rb#11966 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> MissingNode + # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableAndWriteNode # - # source://prism/lib/prism/node.rb#13286 - sig { params(params: T.untyped).returns(Prism::MissingNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#11976 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13271 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#11961 + 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) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } # - # source://prism/lib/prism/node.rb#13297 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#11984 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # attr_reader depth: Integer # - # source://prism/lib/prism/node.rb#13303 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#12009 + sig { returns(Integer) } + def depth; end + + # source://prism/lib/prism/desugar_compiler.rb#199 + def desugar; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#12017 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism/lib/prism/node.rb#12006 + sig { returns(Symbol) } + def name; end + + # attr_reader name_loc: Location + # + # source://prism/lib/prism/node.rb#11989 + sig { returns(Prism::Location) } + def name_loc; end + + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#12012 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#11996 + 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 @@ -19096,9 +21391,16 @@ class Prism::MissingNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13322 + # source://prism/lib/prism/node.rb#12035 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#12003 + 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. @@ -19107,122 +21409,149 @@ class Prism::MissingNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13332 + # source://prism/lib/prism/node.rb#12045 def type; end end end -# Represents a module declaration involving the `module` keyword. +# Represents assigning to a local variable using an operator that isn't `=`. # -# module Foo end -# ^^^^^^^^^^^^^^ +# target += value +# ^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#13341 -class Prism::ModuleNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, Location module_keyword_loc, Node constant_path, Node? body, Location end_keyword_loc, Symbol name, Location location) -> void +# source://prism/lib/prism/node.rb#12065 +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 # - # @return [ModuleNode] a new instance of ModuleNode + # @return [LocalVariableOperatorWriteNode] a new instance of LocalVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#13343 - def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end + # source://prism/lib/prism/node.rb#12067 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location); 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#12172 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13356 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#12079 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # attr_reader binary_operator: Symbol # - # source://prism/lib/prism/node.rb#13413 - sig { returns(T.nilable(Prism::Node)) } - def body; end + # source://prism/lib/prism/node.rb#12132 + sig { returns(Symbol) } + def binary_operator; end + + # attr_reader binary_operator_loc: Location + # + # source://prism/lib/prism/node.rb#12119 + sig { returns(Prism::Location) } + def binary_operator_loc; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13361 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12084 + 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#13374 + # source://prism/lib/prism/node.rb#12094 + 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#13366 + # source://prism/lib/prism/node.rb#12089 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader constant_path: Node - # - # source://prism/lib/prism/node.rb#13410 - sig { returns(Prism::Node) } - def constant_path; end - - # def copy: (**params) -> ModuleNode + # def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode # - # source://prism/lib/prism/node.rb#13379 - sig { params(params: T.untyped).returns(Prism::ModuleNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#12099 + sig do + params( + name_loc: Prism::Location, + binary_operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + binary_operator: Symbol, + depth: Integer, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13361 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12084 + 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: Node, body: Node?, end_keyword_loc: Location, name: Symbol, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#13396 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#12107 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def end_keyword: () -> String + # attr_reader depth: Integer # - # source://prism/lib/prism/node.rb#13431 - sig { returns(String) } - def end_keyword; end + # source://prism/lib/prism/node.rb#12135 + sig { returns(Integer) } + def depth; end - # attr_reader end_keyword_loc: Location - # - # source://prism/lib/prism/node.rb#13416 - sig { returns(Prism::Location) } - def end_keyword_loc; end + # source://prism/lib/prism/desugar_compiler.rb#211 + def desugar; end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#13436 - def inspect(inspector = T.unsafe(nil)); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader locals: Array[Symbol] + # def inspect -> String # - # source://prism/lib/prism/node.rb#13401 - sig { returns(T::Array[Symbol]) } - def locals; end + # source://prism/lib/prism/node.rb#12138 + sig { override.returns(String) } + def inspect; end - # def module_keyword: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#13426 - sig { returns(String) } - def module_keyword; end + # source://prism/lib/prism/node.rb#12129 + sig { returns(Symbol) } + def name; end - # attr_reader module_keyword_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#13404 + # source://prism/lib/prism/node.rb#12112 sig { returns(Prism::Location) } - def module_keyword_loc; end + def name_loc; end - # attr_reader name: Symbol + # Returns the binary operator used to modify the receiver. This method is + # deprecated in favor of #binary_operator. # - # source://prism/lib/prism/node.rb#13422 - sig { returns(Symbol) } - def name; end + # 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#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 @@ -19239,9 +21568,16 @@ class Prism::ModuleNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13467 + # source://prism/lib/prism/node.rb#12156 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#12126 + 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. @@ -19250,116 +21586,135 @@ class Prism::ModuleNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13477 + # source://prism/lib/prism/node.rb#12166 def type; end end end -# Represents a multi-target expression. +# Represents the use of the `||=` operator for assignment to a local variable. # -# a, (b, c) = 1, 2, 3 -# ^^^^^^ +# target ||= value +# ^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#13486 -class Prism::MultiTargetNode < ::Prism::Node - # def initialize: (Array[Node] lefts, Node? rest, Array[Node] rights, Location? lparen_loc, Location? rparen_loc, Location location) -> void +# source://prism/lib/prism/node.rb#12187 +class Prism::LocalVariableOrWriteNode < ::Prism::Node + # def initialize: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, Location location) -> void # - # @return [MultiTargetNode] a new instance of MultiTargetNode + # @return [LocalVariableOrWriteNode] a new instance of LocalVariableOrWriteNode # - # source://prism/lib/prism/node.rb#13488 - def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); end + # source://prism/lib/prism/node.rb#12189 + sig do + params( + source: Prism::Source, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).void + end + def initialize(source, name_loc, operator_loc, value, name, depth, location); 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#12295 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13500 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#12200 + 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#13505 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12205 + 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#13519 + # source://prism/lib/prism/node.rb#12215 + 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#13510 + # source://prism/lib/prism/node.rb#12210 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> MultiTargetNode + # def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOrWriteNode # - # source://prism/lib/prism/node.rb#13524 - sig { params(params: T.untyped).returns(Prism::MultiTargetNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#12220 + sig do + params( + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + name: Symbol, + depth: Integer, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13505 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12205 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, depth: Integer, location: Location } # - # source://prism/lib/prism/node.rb#13540 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#12228 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # attr_reader depth: Integer # - # source://prism/lib/prism/node.rb#13589 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#12253 + sig { returns(Integer) } + def depth; end - # attr_reader lefts: Array[Node] - # - # source://prism/lib/prism/node.rb#13545 - sig { returns(T::Array[Prism::Node]) } - def lefts; end + # source://prism/lib/prism/desugar_compiler.rb#205 + def desugar; end - # def lparen: () -> String? - # - # source://prism/lib/prism/node.rb#13579 - sig { returns(T.nilable(String)) } - def lparen; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader lparen_loc: Location? + # def inspect -> String # - # source://prism/lib/prism/node.rb#13554 - sig { returns(T.nilable(Prism::Location)) } - def lparen_loc; end + # source://prism/lib/prism/node.rb#12261 + sig { override.returns(String) } + def inspect; end - # attr_reader rest: Node? + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#13548 - sig { returns(T.nilable(Prism::Node)) } - def rest; end + # source://prism/lib/prism/node.rb#12250 + sig { returns(Symbol) } + def name; end - # attr_reader rights: Array[Node] + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#13551 - sig { returns(T::Array[Prism::Node]) } - def rights; end + # source://prism/lib/prism/node.rb#12233 + sig { returns(Prism::Location) } + def name_loc; end - # def rparen: () -> String? + # def operator: () -> String # - # source://prism/lib/prism/node.rb#13584 - sig { returns(T.nilable(String)) } - def rparen; end + # source://prism/lib/prism/node.rb#12256 + sig { returns(String) } + def operator; end - # attr_reader rparen_loc: Location? + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#13566 - sig { returns(T.nilable(Prism::Location)) } - def rparen_loc; end + # source://prism/lib/prism/node.rb#12240 + 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 @@ -19376,9 +21731,16 @@ class Prism::MultiTargetNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13618 + # source://prism/lib/prism/node.rb#12279 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#12247 + 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. @@ -19387,128 +21749,109 @@ class Prism::MultiTargetNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13628 + # source://prism/lib/prism/node.rb#12289 def type; end end end -# Represents a write to a multi-target expression. +# Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call. # -# a, b, c = 1, 2, 3 -# ^^^^^^^^^^^^^^^^^ +# foo +# ^^^ # -# source://prism/lib/prism/node.rb#13637 -class Prism::MultiWriteNode < ::Prism::Node - # def initialize: (Array[Node] lefts, Node? rest, Array[Node] rights, Location? lparen_loc, Location? rparen_loc, Location operator_loc, Node value, Location location) -> void +# source://prism/lib/prism/node.rb#12309 +class Prism::LocalVariableReadNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void # - # @return [MultiWriteNode] a new instance of MultiWriteNode + # @return [LocalVariableReadNode] a new instance of LocalVariableReadNode # - # source://prism/lib/prism/node.rb#13639 - def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); end + # source://prism/lib/prism/node.rb#12311 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } + def initialize(source, name, depth, location); 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#12406 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13653 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#12319 + 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#13658 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12324 + 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#13673 + # source://prism/lib/prism/node.rb#12334 + 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#13663 + # source://prism/lib/prism/node.rb#12329 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> MultiWriteNode + # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableReadNode # - # source://prism/lib/prism/node.rb#13678 - sig { params(params: T.untyped).returns(Prism::MultiWriteNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#12339 + 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 # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13658 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12324 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { lefts: Array[Node], rest: Node?, rights: Array[Node], lparen_loc: Location?, rparen_loc: Location?, operator_loc: Location, value: Node, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism/lib/prism/node.rb#13696 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#12347 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # The number of visible scopes that should be searched to find the origin of this local variable. # - # source://prism/lib/prism/node.rb#13759 - def inspect(inspector = T.unsafe(nil)); end - - # attr_reader lefts: Array[Node] + # foo = 1; foo # depth 0 # - # source://prism/lib/prism/node.rb#13701 - sig { returns(T::Array[Prism::Node]) } - def lefts; end + # bar = 2; tap { bar } # depth 1 + # + # 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#12369 + sig { returns(Integer) } + def depth; end - # def lparen: () -> String? + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#13744 - sig { returns(T.nilable(String)) } - def lparen; end + # source://prism/lib/prism/node.rb#12372 + sig { override.returns(String) } + def inspect; end - # attr_reader lparen_loc: Location? + # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # - # source://prism/lib/prism/node.rb#13710 - sig { returns(T.nilable(Prism::Location)) } - def lparen_loc; end - - # def operator: () -> String - # - # source://prism/lib/prism/node.rb#13754 - sig { returns(String) } - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism/lib/prism/node.rb#13734 - sig { returns(Prism::Location) } - def operator_loc; end - - # attr_reader rest: Node? + # x # name `:x` # - # source://prism/lib/prism/node.rb#13704 - sig { returns(T.nilable(Prism::Node)) } - def rest; end - - # attr_reader rights: Array[Node] + # _Test # name `:_Test` # - # source://prism/lib/prism/node.rb#13707 - sig { returns(T::Array[Prism::Node]) } - def rights; end - - # def rparen: () -> String? + # Note that this can also be an underscore followed by a number for the default block parameters. # - # source://prism/lib/prism/node.rb#13749 - sig { returns(T.nilable(String)) } - def rparen; end - - # attr_reader rparen_loc: Location? + # _1 # name `:_1` # - # source://prism/lib/prism/node.rb#13722 - sig { returns(T.nilable(Prism::Location)) } - def rparen_loc; end + # source://prism/lib/prism/node.rb#12360 + 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 @@ -19525,15 +21868,10 @@ class Prism::MultiWriteNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13791 + # source://prism/lib/prism/node.rb#12390 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node - # - # source://prism/lib/prism/node.rb#13740 - 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. @@ -19542,839 +21880,977 @@ class Prism::MultiWriteNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13801 + # source://prism/lib/prism/node.rb#12400 def type; end end end -# This visitor walks through the tree and copies each node as it is being -# visited. This is useful for consumers that want to mutate the tree, as you -# can change subtrees in place without effecting the rest of the tree. +# Represents writing to a local variable in a context that doesn't have an explicit value. # -# source://prism/lib/prism/mutation_compiler.rb#12 -class Prism::MutationCompiler < ::Prism::Compiler - # Copy a AliasGlobalVariableNode node +# foo, bar = baz +# ^^^ ^^^ +# +# source://prism/lib/prism/node.rb#12417 +class Prism::LocalVariableTargetNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location location) -> void # - # source://prism/lib/prism/mutation_compiler.rb#14 - def visit_alias_global_variable_node(node); end - - # Copy a AliasMethodNode node + # @return [LocalVariableTargetNode] a new instance of LocalVariableTargetNode # - # source://prism/lib/prism/mutation_compiler.rb#19 - def visit_alias_method_node(node); end + # source://prism/lib/prism/node.rb#12419 + sig { params(source: Prism::Source, name: Symbol, depth: Integer, location: Prism::Location).void } + def initialize(source, name, depth, location); end - # Copy a AlternationPatternNode node + # 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/mutation_compiler.rb#24 - def visit_alternation_pattern_node(node); end + # source://prism/lib/prism/node.rb#12500 + def ===(other); end - # Copy a AndNode node + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/mutation_compiler.rb#29 - def visit_and_node(node); end + # source://prism/lib/prism/node.rb#12427 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Copy a ArgumentsNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#34 - def visit_arguments_node(node); end + # source://prism/lib/prism/node.rb#12432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a ArrayNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/mutation_compiler.rb#39 - def visit_array_node(node); end + # source://prism/lib/prism/node.rb#12442 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Copy a ArrayPatternNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/mutation_compiler.rb#44 - def visit_array_pattern_node(node); end + # source://prism/lib/prism/node.rb#12437 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Copy a AssocNode node + # def copy: (?name: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableTargetNode # - # source://prism/lib/prism/mutation_compiler.rb#49 - def visit_assoc_node(node); end + # source://prism/lib/prism/node.rb#12447 + 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 - # Copy a AssocSplatNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#54 - def visit_assoc_splat_node(node); end + # source://prism/lib/prism/node.rb#12432 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a BackReferenceReadNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, location: Location } # - # source://prism/lib/prism/mutation_compiler.rb#59 - def visit_back_reference_read_node(node); end + # source://prism/lib/prism/node.rb#12455 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Copy a BeginNode node + # attr_reader depth: Integer # - # source://prism/lib/prism/mutation_compiler.rb#64 - def visit_begin_node(node); end + # source://prism/lib/prism/node.rb#12463 + sig { returns(Integer) } + def depth; end - # Copy a BlockArgumentNode node - # - # source://prism/lib/prism/mutation_compiler.rb#69 - def visit_block_argument_node(node); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Copy a BlockLocalVariableNode node + # def inspect -> String # - # source://prism/lib/prism/mutation_compiler.rb#74 - def visit_block_local_variable_node(node); end + # source://prism/lib/prism/node.rb#12466 + sig { override.returns(String) } + def inspect; end - # Copy a BlockNode node + # attr_reader name: Symbol # - # source://prism/lib/prism/mutation_compiler.rb#79 - def visit_block_node(node); end + # source://prism/lib/prism/node.rb#12460 + sig { returns(Symbol) } + def name; end - # Copy a BlockParameterNode node + # 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. # - # source://prism/lib/prism/mutation_compiler.rb#84 - def visit_block_parameter_node(node); end - - # Copy a BlockParametersNode node + # 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/mutation_compiler.rb#89 - def visit_block_parameters_node(node); end - - # Copy a BreakNode node + # def type: () -> Symbol # - # source://prism/lib/prism/mutation_compiler.rb#94 - def visit_break_node(node); end + # source://prism/lib/prism/node.rb#12484 + sig { override.returns(Symbol) } + def type; end - # Copy a CallAndWriteNode node - # - # source://prism/lib/prism/mutation_compiler.rb#99 - def visit_call_and_write_node(node); 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 + # + # source://prism/lib/prism/node.rb#12494 + def type; end + end +end - # Copy a CallNode node +# Represents writing to a local variable. +# +# foo = 1 +# ^^^^^^^ +# +# source://prism/lib/prism/node.rb#12511 +class Prism::LocalVariableWriteNode < ::Prism::Node + # def initialize: (Symbol name, Integer depth, Location name_loc, Prism::node value, Location operator_loc, Location location) -> void # - # source://prism/lib/prism/mutation_compiler.rb#104 - def visit_call_node(node); end - - # Copy a CallOperatorWriteNode node + # @return [LocalVariableWriteNode] a new instance of LocalVariableWriteNode # - # source://prism/lib/prism/mutation_compiler.rb#109 - def visit_call_operator_write_node(node); end + # source://prism/lib/prism/node.rb#12513 + sig do + params( + source: Prism::Source, + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, name, depth, name_loc, value, operator_loc, location); end - # Copy a CallOrWriteNode node + # 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/mutation_compiler.rb#114 - def visit_call_or_write_node(node); end + # source://prism/lib/prism/node.rb#12645 + def ===(other); end - # Copy a CallTargetNode node + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/mutation_compiler.rb#119 - def visit_call_target_node(node); end + # source://prism/lib/prism/node.rb#12524 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Copy a CapturePatternNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#124 - def visit_capture_pattern_node(node); end + # source://prism/lib/prism/node.rb#12529 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a CaseMatchNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/mutation_compiler.rb#129 - def visit_case_match_node(node); end + # source://prism/lib/prism/node.rb#12539 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Copy a CaseNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/mutation_compiler.rb#134 - def visit_case_node(node); end + # source://prism/lib/prism/node.rb#12534 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Copy a ClassNode node + # def copy: (?name: Symbol, ?depth: Integer, ?name_loc: Location, ?value: Prism::node, ?operator_loc: Location, ?location: Location) -> LocalVariableWriteNode # - # source://prism/lib/prism/mutation_compiler.rb#139 - def visit_class_node(node); end + # source://prism/lib/prism/node.rb#12544 + sig do + params( + name: Symbol, + depth: Integer, + name_loc: Prism::Location, + value: Prism::Node, + operator_loc: Prism::Location, + location: 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 - # Copy a ClassVariableAndWriteNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#144 - def visit_class_variable_and_write_node(node); end + # source://prism/lib/prism/node.rb#12529 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a ClassVariableOperatorWriteNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, depth: Integer, name_loc: Location, value: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/mutation_compiler.rb#149 - def visit_class_variable_operator_write_node(node); end + # source://prism/lib/prism/node.rb#12552 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Copy a ClassVariableOrWriteNode node + # The number of semantic scopes we have to traverse to find the declaration of this variable. # - # source://prism/lib/prism/mutation_compiler.rb#154 - def visit_class_variable_or_write_node(node); end - - # Copy a ClassVariableReadNode node + # foo = 1 # depth 0 # - # source://prism/lib/prism/mutation_compiler.rb#159 - def visit_class_variable_read_node(node); end - - # Copy a ClassVariableTargetNode node + # tap { foo = 1 } # depth 1 # - # source://prism/lib/prism/mutation_compiler.rb#164 - def visit_class_variable_target_node(node); end - - # Copy a ClassVariableWriteNode 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/mutation_compiler.rb#169 - def visit_class_variable_write_node(node); end + # source://prism/lib/prism/node.rb#12570 + sig { returns(Integer) } + def depth; end - # Copy a ConstantAndWriteNode node - # - # source://prism/lib/prism/mutation_compiler.rb#174 - def visit_constant_and_write_node(node); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Copy a ConstantOperatorWriteNode node + # def inspect -> String # - # source://prism/lib/prism/mutation_compiler.rb#179 - def visit_constant_operator_write_node(node); end + # source://prism/lib/prism/node.rb#12611 + sig { override.returns(String) } + def inspect; end - # Copy a ConstantOrWriteNode node + # The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers). # - # source://prism/lib/prism/mutation_compiler.rb#184 - def visit_constant_or_write_node(node); end - - # Copy a ConstantPathAndWriteNode node + # foo = :bar # name `:foo` # - # source://prism/lib/prism/mutation_compiler.rb#189 - def visit_constant_path_and_write_node(node); end - - # Copy a ConstantPathNode node + # abc = 123 # name `:abc` # - # source://prism/lib/prism/mutation_compiler.rb#194 - def visit_constant_path_node(node); end + # source://prism/lib/prism/node.rb#12561 + sig { returns(Symbol) } + def name; end - # Copy a ConstantPathOperatorWriteNode node + # The location of the variable name. # - # source://prism/lib/prism/mutation_compiler.rb#199 - def visit_constant_path_operator_write_node(node); end - - # Copy a ConstantPathOrWriteNode node + # foo = :bar + # ^^^ # - # source://prism/lib/prism/mutation_compiler.rb#204 - def visit_constant_path_or_write_node(node); end + # source://prism/lib/prism/node.rb#12576 + sig { returns(Prism::Location) } + def name_loc; end - # Copy a ConstantPathTargetNode node + # def operator: () -> String # - # source://prism/lib/prism/mutation_compiler.rb#209 - def visit_constant_path_target_node(node); end + # source://prism/lib/prism/node.rb#12606 + sig { returns(String) } + def operator; end - # Copy a ConstantPathWriteNode node + # The location of the `=` operator. # - # source://prism/lib/prism/mutation_compiler.rb#214 - def visit_constant_path_write_node(node); end - - # Copy a ConstantReadNode node + # x = :y + # ^ # - # source://prism/lib/prism/mutation_compiler.rb#219 - def visit_constant_read_node(node); end + # source://prism/lib/prism/node.rb#12599 + sig { returns(Prism::Location) } + def operator_loc; end - # Copy a ConstantTargetNode node + # 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. # - # source://prism/lib/prism/mutation_compiler.rb#224 - def visit_constant_target_node(node); end - - # Copy a ConstantWriteNode node + # 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/mutation_compiler.rb#229 - def visit_constant_write_node(node); end - - # Copy a DefNode node + # def type: () -> Symbol # - # source://prism/lib/prism/mutation_compiler.rb#234 - def visit_def_node(node); end + # source://prism/lib/prism/node.rb#12629 + sig { override.returns(Symbol) } + def type; end - # Copy a DefinedNode node + # The value to write to the local variable. 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/mutation_compiler.rb#239 - def visit_defined_node(node); end - - # Copy a ElseNode node + # foo = :bar + # ^^^^ # - # source://prism/lib/prism/mutation_compiler.rb#244 - def visit_else_node(node); end - - # Copy a EmbeddedStatementsNode node + # abc = 1234 + # ^^^^ # - # source://prism/lib/prism/mutation_compiler.rb#249 - def visit_embedded_statements_node(node); end - - # Copy a EmbeddedVariableNode node + # Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write. # - # source://prism/lib/prism/mutation_compiler.rb#254 - def visit_embedded_variable_node(node); end - - # Copy a EnsureNode node + # foo = foo # - # source://prism/lib/prism/mutation_compiler.rb#259 - def visit_ensure_node(node); end + # source://prism/lib/prism/node.rb#12593 + sig { returns(Prism::Node) } + def value; end - # Copy a FalseNode node - # - # source://prism/lib/prism/mutation_compiler.rb#264 - def visit_false_node(node); 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 + # + # source://prism/lib/prism/node.rb#12639 + def type; end + end +end - # Copy a FindPatternNode node +# This represents a location in the source. +# +# source://prism/lib/prism/parse_result.rb#156 +class Prism::Location + # Create a new location object with the given source, start byte offset, and + # byte length. # - # source://prism/lib/prism/mutation_compiler.rb#269 - def visit_find_pattern_node(node); end - - # Copy a FlipFlopNode node + # @return [Location] a new instance of Location # - # source://prism/lib/prism/mutation_compiler.rb#274 - def visit_flip_flop_node(node); end + # source://prism/lib/prism/parse_result.rb#171 + sig { params(source: Prism::Source, start_offset: Integer, length: Integer).void } + def initialize(source, start_offset, length); end - # Copy a FloatNode node + # Returns true if the given other location is equal to this location. # - # source://prism/lib/prism/mutation_compiler.rb#279 - def visit_float_node(node); end + # source://prism/lib/prism/parse_result.rb#335 + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other); end - # Copy a ForNode node + # Join this location with the first occurrence of the string in the source + # 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/mutation_compiler.rb#284 - def visit_for_node(node); end + # source://prism/lib/prism/parse_result.rb#354 + sig { params(string: String).returns(Prism::Location) } + def adjoin(string); end - # Copy a ForwardingArgumentsNode node + # Returns a new location that is the result of chopping off the last byte. # - # source://prism/lib/prism/mutation_compiler.rb#289 - def visit_forwarding_arguments_node(node); end + # source://prism/lib/prism/parse_result.rb#217 + sig { returns(Prism::Location) } + def chop; end - # Copy a ForwardingParameterNode node + # Returns all comments that are associated with this location (both leading + # and trailing comments). # - # source://prism/lib/prism/mutation_compiler.rb#294 - def visit_forwarding_parameter_node(node); end + # source://prism/lib/prism/parse_result.rb#207 + sig { returns(T::Array[Prism::Comment]) } + def comments; end - # Copy a ForwardingSuperNode node + # Create a new location object with the given options. # - # source://prism/lib/prism/mutation_compiler.rb#299 - def visit_forwarding_super_node(node); end + # source://prism/lib/prism/parse_result.rb#212 + 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 - # Copy a GlobalVariableAndWriteNode node + # Implement the hash pattern matching interface for Location. # - # source://prism/lib/prism/mutation_compiler.rb#304 - def visit_global_variable_and_write_node(node); end + # source://prism/lib/prism/parse_result.rb#325 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Copy a GlobalVariableOperatorWriteNode node + # The column number in characters where this location ends from the start of + # the line. # - # source://prism/lib/prism/mutation_compiler.rb#309 - def visit_global_variable_operator_write_node(node); end + # source://prism/lib/prism/parse_result.rb#314 + sig { returns(Integer) } + def end_character_column; end - # Copy a GlobalVariableOrWriteNode node + # The character offset from the beginning of the source where this location + # ends. # - # source://prism/lib/prism/mutation_compiler.rb#314 - def visit_global_variable_or_write_node(node); end + # source://prism/lib/prism/parse_result.rb#263 + sig { returns(Integer) } + def end_character_offset; end - # Copy a GlobalVariableReadNode node + # The column number in code units of the given encoding where this location + # ends from the start of the line. # - # source://prism/lib/prism/mutation_compiler.rb#319 - def visit_global_variable_read_node(node); end + # source://prism/lib/prism/parse_result.rb#320 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_column(encoding = T.unsafe(nil)); end - # Copy a GlobalVariableTargetNode node + # The offset from the start of the file in code units of the given encoding. # - # source://prism/lib/prism/mutation_compiler.rb#324 - def visit_global_variable_target_node(node); end + # source://prism/lib/prism/parse_result.rb#268 + sig { params(encoding: Encoding).returns(Integer) } + def end_code_units_offset(encoding = T.unsafe(nil)); end - # Copy a GlobalVariableWriteNode node + # The column number in bytes where this location ends from the start of the + # line. # - # source://prism/lib/prism/mutation_compiler.rb#329 - def visit_global_variable_write_node(node); end + # source://prism/lib/prism/parse_result.rb#308 + sig { returns(Integer) } + def end_column; end - # Copy a HashNode node + # The line number where this location ends. # - # source://prism/lib/prism/mutation_compiler.rb#334 - def visit_hash_node(node); end + # source://prism/lib/prism/parse_result.rb#284 + sig { returns(Integer) } + def end_line; end - # Copy a HashPatternNode node + # The byte offset from the beginning of the source where this location ends. # - # source://prism/lib/prism/mutation_compiler.rb#339 - def visit_hash_pattern_node(node); end + # source://prism/lib/prism/parse_result.rb#257 + sig { returns(Integer) } + def end_offset; end - # Copy a IfNode node + # Returns a string representation of this location. # - # source://prism/lib/prism/mutation_compiler.rb#344 - def visit_if_node(node); end + # source://prism/lib/prism/parse_result.rb#222 + sig { returns(String) } + def inspect; end - # Copy a ImaginaryNode node + # Returns a new location that stretches from this location to the given + # 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/mutation_compiler.rb#349 - def visit_imaginary_node(node); end + # source://prism/lib/prism/parse_result.rb#344 + sig { params(other: Prism::Location).returns(Prism::Location) } + def join(other); end - # Copy a ImplicitNode node + # Attach a comment to the leading comments of this location. # - # source://prism/lib/prism/mutation_compiler.rb#354 - def visit_implicit_node(node); end + # source://prism/lib/prism/parse_result.rb#190 + sig { params(comment: Prism::Comment).void } + def leading_comment(comment); end - # Copy a ImplicitRestNode node + # These are the comments that are associated with this location that exist + # before the start of this location. # - # source://prism/lib/prism/mutation_compiler.rb#359 - def visit_implicit_rest_node(node); end + # source://prism/lib/prism/parse_result.rb#185 + sig { returns(T::Array[Prism::Comment]) } + def leading_comments; end - # Copy a InNode node + # The length of this location in bytes. # - # source://prism/lib/prism/mutation_compiler.rb#364 - def visit_in_node(node); end + # source://prism/lib/prism/parse_result.rb#167 + sig { returns(Integer) } + def length; end - # Copy a IndexAndWriteNode node + # Implement the pretty print interface for Location. # - # source://prism/lib/prism/mutation_compiler.rb#369 - def visit_index_and_write_node(node); end + # source://prism/lib/prism/parse_result.rb#330 + sig { params(q: T.untyped).void } + def pretty_print(q); end - # Copy a IndexOperatorWriteNode node + # The source code that this location represents. # - # source://prism/lib/prism/mutation_compiler.rb#374 - def visit_index_operator_write_node(node); end + # source://prism/lib/prism/parse_result.rb#232 + sig { returns(String) } + def slice; end - # Copy a IndexOrWriteNode node + # The source code that this location represents starting from the beginning + # of the line that this location starts on to the end of the line that this + # location ends on. # - # source://prism/lib/prism/mutation_compiler.rb#379 - def visit_index_or_write_node(node); end + # source://prism/lib/prism/parse_result.rb#239 + def slice_lines; end - # Copy a IndexTargetNode node + # Returns all of the lines of the source code associated with this location. # - # source://prism/lib/prism/mutation_compiler.rb#384 - def visit_index_target_node(node); end + # source://prism/lib/prism/parse_result.rb#227 + sig { returns(T::Array[String]) } + def source_lines; end - # Copy a InstanceVariableAndWriteNode node + # The column number in characters where this location ends from the start of + # the line. # - # source://prism/lib/prism/mutation_compiler.rb#389 - def visit_instance_variable_and_write_node(node); end + # source://prism/lib/prism/parse_result.rb#296 + sig { returns(Integer) } + def start_character_column; end - # Copy a InstanceVariableOperatorWriteNode node + # The character offset from the beginning of the source where this location + # starts. # - # source://prism/lib/prism/mutation_compiler.rb#394 - def visit_instance_variable_operator_write_node(node); end + # source://prism/lib/prism/parse_result.rb#247 + sig { returns(Integer) } + def start_character_offset; end - # Copy a InstanceVariableOrWriteNode node + # The column number in code units of the given encoding where this location + # starts from the start of the line. # - # source://prism/lib/prism/mutation_compiler.rb#399 - def visit_instance_variable_or_write_node(node); end + # source://prism/lib/prism/parse_result.rb#302 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_column(encoding = T.unsafe(nil)); end - # Copy a InstanceVariableReadNode node + # The offset from the start of the file in code units of the given encoding. # - # source://prism/lib/prism/mutation_compiler.rb#404 - def visit_instance_variable_read_node(node); end + # source://prism/lib/prism/parse_result.rb#252 + sig { params(encoding: Encoding).returns(Integer) } + def start_code_units_offset(encoding = T.unsafe(nil)); end - # Copy a InstanceVariableTargetNode node + # The column number in bytes where this location starts from the start of + # the line. # - # source://prism/lib/prism/mutation_compiler.rb#409 - def visit_instance_variable_target_node(node); end + # source://prism/lib/prism/parse_result.rb#290 + sig { returns(Integer) } + def start_column; end - # Copy a InstanceVariableWriteNode node + # The line number where this location starts. # - # source://prism/lib/prism/mutation_compiler.rb#414 - def visit_instance_variable_write_node(node); end + # source://prism/lib/prism/parse_result.rb#273 + sig { returns(Integer) } + def start_line; end - # Copy a IntegerNode node + # The content of the line where this location starts before this location. # - # source://prism/lib/prism/mutation_compiler.rb#419 - def visit_integer_node(node); end + # source://prism/lib/prism/parse_result.rb#278 + sig { returns(String) } + def start_line_slice; end - # Copy a InterpolatedMatchLastLineNode node + # The byte offset from the beginning of the source where this location + # starts. # - # source://prism/lib/prism/mutation_compiler.rb#424 - def visit_interpolated_match_last_line_node(node); end + # source://prism/lib/prism/parse_result.rb#164 + sig { returns(Integer) } + def start_offset; end - # Copy a InterpolatedRegularExpressionNode node + # Attach a comment to the trailing comments of this location. # - # source://prism/lib/prism/mutation_compiler.rb#429 - def visit_interpolated_regular_expression_node(node); end + # source://prism/lib/prism/parse_result.rb#201 + sig { params(comment: Prism::Comment).void } + def trailing_comment(comment); end - # Copy a InterpolatedStringNode node + # These are the comments that are associated with this location that exist + # after the end of this location. # - # source://prism/lib/prism/mutation_compiler.rb#434 - def visit_interpolated_string_node(node); end + # source://prism/lib/prism/parse_result.rb#196 + sig { returns(T::Array[Prism::Comment]) } + def trailing_comments; end - # Copy a InterpolatedSymbolNode node - # - # source://prism/lib/prism/mutation_compiler.rb#439 - def visit_interpolated_symbol_node(node); end + protected - # Copy a InterpolatedXStringNode node + # A Source object that is used to determine more information from the given + # offset and length. # - # source://prism/lib/prism/mutation_compiler.rb#444 - def visit_interpolated_x_string_node(node); end + # source://prism/lib/prism/parse_result.rb#159 + sig { returns(Prism::Source) } + def source; end +end - # Copy a KeywordHashNode node - # - # source://prism/lib/prism/mutation_compiler.rb#449 - def visit_keyword_hash_node(node); end +# Flags for while and until loop nodes. +# +# source://prism/lib/prism/node.rb#19196 +module Prism::LoopFlags; end - # Copy a KeywordRestParameterNode node - # - # source://prism/lib/prism/mutation_compiler.rb#454 - def visit_keyword_rest_parameter_node(node); end +# a loop after a begin statement, so the body is executed first before the condition +# +# source://prism/lib/prism/node.rb#19198 +Prism::LoopFlags::BEGIN_MODIFIER = T.let(T.unsafe(nil), Integer) - # Copy a LambdaNode node +# This represents a magic comment that was encountered during parsing. +# +# source://prism/lib/prism/parse_result.rb#416 +class Prism::MagicComment + # Create a new magic comment object with the given key and value locations. # - # source://prism/lib/prism/mutation_compiler.rb#459 - def visit_lambda_node(node); end - - # Copy a LocalVariableAndWriteNode node + # @return [MagicComment] a new instance of MagicComment # - # source://prism/lib/prism/mutation_compiler.rb#464 - def visit_local_variable_and_write_node(node); end + # source://prism/lib/prism/parse_result.rb#424 + sig { params(key_loc: Prism::Location, value_loc: Prism::Location).void } + def initialize(key_loc, value_loc); end - # Copy a LocalVariableOperatorWriteNode node + # Implement the hash pattern matching interface for MagicComment. # - # source://prism/lib/prism/mutation_compiler.rb#469 - def visit_local_variable_operator_write_node(node); end + # source://prism/lib/prism/parse_result.rb#440 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Copy a LocalVariableOrWriteNode node + # Returns a string representation of this magic comment. # - # source://prism/lib/prism/mutation_compiler.rb#474 - def visit_local_variable_or_write_node(node); end + # source://prism/lib/prism/parse_result.rb#445 + sig { returns(String) } + def inspect; end - # Copy a LocalVariableReadNode node + # Returns the key of the magic comment by slicing it from the source code. # - # source://prism/lib/prism/mutation_compiler.rb#479 - def visit_local_variable_read_node(node); end + # source://prism/lib/prism/parse_result.rb#430 + sig { returns(String) } + def key; end - # Copy a LocalVariableTargetNode node + # A Location object representing the location of the key in the source. # - # source://prism/lib/prism/mutation_compiler.rb#484 - def visit_local_variable_target_node(node); end + # source://prism/lib/prism/parse_result.rb#418 + sig { returns(Prism::Location) } + def key_loc; end - # Copy a LocalVariableWriteNode node + # Returns the value of the magic comment by slicing it from the source code. # - # source://prism/lib/prism/mutation_compiler.rb#489 - def visit_local_variable_write_node(node); end + # source://prism/lib/prism/parse_result.rb#435 + sig { returns(String) } + def value; end - # Copy a MatchLastLineNode node + # A Location object representing the location of the value in the source. # - # source://prism/lib/prism/mutation_compiler.rb#494 - def visit_match_last_line_node(node); end + # source://prism/lib/prism/parse_result.rb#421 + sig { returns(Prism::Location) } + def value_loc; end +end - # Copy a MatchPredicateNode node - # - # source://prism/lib/prism/mutation_compiler.rb#499 - def visit_match_predicate_node(node); end +# Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object. +# +# if /foo/i then end +# ^^^^^^ +# +# source://prism/lib/prism/node.rb#12659 +class Prism::MatchLastLineNode < ::Prism::Node + include ::Prism::RegularExpressionOptions - # Copy a MatchRequiredNode node + # def initialize: (Integer flags, Location opening_loc, Location content_loc, Location closing_loc, String unescaped, Location location) -> void # - # source://prism/lib/prism/mutation_compiler.rb#504 - def visit_match_required_node(node); end - - # Copy a MatchWriteNode node + # @return [MatchLastLineNode] a new instance of MatchLastLineNode # - # source://prism/lib/prism/mutation_compiler.rb#509 - def visit_match_write_node(node); end + # source://prism/lib/prism/node.rb#12661 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end - # Copy a MissingNode node + # 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/mutation_compiler.rb#514 - def visit_missing_node(node); end + # source://prism/lib/prism/node.rb#12837 + def ===(other); end - # Copy a ModuleNode node + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/mutation_compiler.rb#519 - def visit_module_node(node); end + # source://prism/lib/prism/node.rb#12672 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Copy a MultiTargetNode node + # def ascii_8bit?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#524 - def visit_multi_target_node(node); end - - # Copy a MultiWriteNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#529 - def visit_multi_write_node(node); end + # source://prism/lib/prism/node.rb#12758 + sig { returns(T::Boolean) } + def ascii_8bit?; end - # Copy a NextNode node + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#534 - def visit_next_node(node); end + # source://prism/lib/prism/node.rb#12677 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Copy a NilNode node + # def closing: () -> String # - # source://prism/lib/prism/mutation_compiler.rb#539 - def visit_nil_node(node); end + # source://prism/lib/prism/node.rb#12798 + sig { returns(String) } + def closing; end - # Copy a NoKeywordsParameterNode node + # attr_reader closing_loc: Location # - # source://prism/lib/prism/mutation_compiler.rb#544 - def visit_no_keywords_parameter_node(node); end + # source://prism/lib/prism/node.rb#12723 + sig { returns(Prism::Location) } + def closing_loc; end - # Copy a NumberedParametersNode node + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/mutation_compiler.rb#549 - def visit_numbered_parameters_node(node); end + # source://prism/lib/prism/node.rb#12687 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Copy a NumberedReferenceReadNode node + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/mutation_compiler.rb#554 - def visit_numbered_reference_read_node(node); end + # source://prism/lib/prism/node.rb#12682 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Copy a OptionalKeywordParameterNode node + # def content: () -> String # - # source://prism/lib/prism/mutation_compiler.rb#559 - def visit_optional_keyword_parameter_node(node); end + # source://prism/lib/prism/node.rb#12793 + sig { returns(String) } + def content; end - # Copy a OptionalParameterNode node + # attr_reader content_loc: Location # - # source://prism/lib/prism/mutation_compiler.rb#564 - def visit_optional_parameter_node(node); end + # source://prism/lib/prism/node.rb#12716 + sig { returns(Prism::Location) } + def content_loc; end - # Copy a OrNode node + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> MatchLastLineNode # - # source://prism/lib/prism/mutation_compiler.rb#569 - def visit_or_node(node); end + # source://prism/lib/prism/node.rb#12692 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).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 - # Copy a ParametersNode node + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/mutation_compiler.rb#574 - def visit_parameters_node(node); end + # source://prism/lib/prism/node.rb#12677 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Copy a ParenthesesNode node + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # source://prism/lib/prism/mutation_compiler.rb#579 - def visit_parentheses_node(node); end + # source://prism/lib/prism/node.rb#12700 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Copy a PinnedExpressionNode node + # def euc_jp?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#584 - def visit_pinned_expression_node(node); end - - # Copy a PinnedVariableNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#589 - def visit_pinned_variable_node(node); end + # source://prism/lib/prism/node.rb#12753 + sig { returns(T::Boolean) } + def euc_jp?; end - # Copy a PostExecutionNode node + # def extended?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#594 - def visit_post_execution_node(node); end - - # Copy a PreExecutionNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#599 - def visit_pre_execution_node(node); end + # source://prism/lib/prism/node.rb#12738 + sig { returns(T::Boolean) } + def extended?; end - # Copy a ProgramNode node - # - # source://prism/lib/prism/mutation_compiler.rb#604 - def visit_program_node(node); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Copy a RangeNode node + # def forced_binary_encoding?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#609 - def visit_range_node(node); end - - # Copy a RationalNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#614 - def visit_rational_node(node); end + # source://prism/lib/prism/node.rb#12778 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # Copy a RedoNode node + # def forced_us_ascii_encoding?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#619 - def visit_redo_node(node); end - - # Copy a RegularExpressionNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#624 - def visit_regular_expression_node(node); end + # source://prism/lib/prism/node.rb#12783 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end - # Copy a RequiredKeywordParameterNode node + # def forced_utf8_encoding?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#629 - def visit_required_keyword_parameter_node(node); end - - # Copy a RequiredParameterNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#634 - def visit_required_parameter_node(node); end + # source://prism/lib/prism/node.rb#12773 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # Copy a RescueModifierNode node + # def ignore_case?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#639 - def visit_rescue_modifier_node(node); end - - # Copy a RescueNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#644 - def visit_rescue_node(node); end + # source://prism/lib/prism/node.rb#12733 + sig { returns(T::Boolean) } + def ignore_case?; end - # Copy a RestParameterNode node + # def inspect -> String # - # source://prism/lib/prism/mutation_compiler.rb#649 - def visit_rest_parameter_node(node); end + # source://prism/lib/prism/node.rb#12803 + sig { override.returns(String) } + def inspect; end - # Copy a RetryNode node + # def multi_line?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#654 - def visit_retry_node(node); end - - # Copy a ReturnNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#659 - def visit_return_node(node); end + # source://prism/lib/prism/node.rb#12743 + sig { returns(T::Boolean) } + def multi_line?; end - # Copy a SelfNode node + # def once?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#664 - def visit_self_node(node); end - - # Copy a SingletonClassNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#669 - def visit_singleton_class_node(node); end + # source://prism/lib/prism/node.rb#12748 + sig { returns(T::Boolean) } + def once?; end - # Copy a SourceEncodingNode node + # def opening: () -> String # - # source://prism/lib/prism/mutation_compiler.rb#674 - def visit_source_encoding_node(node); end + # source://prism/lib/prism/node.rb#12788 + sig { returns(String) } + def opening; end - # Copy a SourceFileNode node + # attr_reader opening_loc: Location # - # source://prism/lib/prism/mutation_compiler.rb#679 - def visit_source_file_node(node); end + # source://prism/lib/prism/node.rb#12709 + sig { returns(Prism::Location) } + def opening_loc; end - # Copy a SourceLineNode node - # - # source://prism/lib/prism/mutation_compiler.rb#684 - def visit_source_line_node(node); end + sig { returns(Integer) } + def options; end - # Copy a SplatNode node + # 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. # - # source://prism/lib/prism/mutation_compiler.rb#689 - def visit_splat_node(node); end - - # Copy a StatementsNode node + # 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/mutation_compiler.rb#694 - def visit_statements_node(node); end - - # Copy a StringNode node + # def type: () -> Symbol # - # source://prism/lib/prism/mutation_compiler.rb#699 - def visit_string_node(node); end + # source://prism/lib/prism/node.rb#12821 + sig { override.returns(Symbol) } + def type; end - # Copy a SuperNode node + # attr_reader unescaped: String # - # source://prism/lib/prism/mutation_compiler.rb#704 - def visit_super_node(node); end + # source://prism/lib/prism/node.rb#12730 + sig { returns(String) } + def unescaped; end - # Copy a SymbolNode node + # def utf_8?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#709 - def visit_symbol_node(node); end - - # Copy a TrueNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#714 - def visit_true_node(node); end + # source://prism/lib/prism/node.rb#12768 + sig { returns(T::Boolean) } + def utf_8?; end - # Copy a UndefNode node + # def windows_31j?: () -> bool # - # source://prism/lib/prism/mutation_compiler.rb#719 - def visit_undef_node(node); end - - # Copy a UnlessNode node + # @return [Boolean] # - # source://prism/lib/prism/mutation_compiler.rb#724 - def visit_unless_node(node); end + # source://prism/lib/prism/node.rb#12763 + sig { returns(T::Boolean) } + def windows_31j?; end - # Copy a UntilNode node - # - # source://prism/lib/prism/mutation_compiler.rb#729 - def visit_until_node(node); end + protected - # Copy a WhenNode node + # protected attr_reader flags: Integer # - # source://prism/lib/prism/mutation_compiler.rb#734 - def visit_when_node(node); end + # source://prism/lib/prism/node.rb#12705 + sig { returns(Integer) } + def flags; end - # Copy a WhileNode node - # - # source://prism/lib/prism/mutation_compiler.rb#739 - def visit_while_node(node); 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 + # + # source://prism/lib/prism/node.rb#12831 + def type; end + end +end - # Copy a XStringNode node - # - # source://prism/lib/prism/mutation_compiler.rb#744 - def visit_x_string_node(node); end - - # Copy a YieldNode node - # - # source://prism/lib/prism/mutation_compiler.rb#749 - def visit_yield_node(node); end -end - -# Represents the use of the `next` keyword. +# Represents the use of the modifier `in` operator. # -# next 1 -# ^^^^^^ +# foo in bar +# ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#13810 -class Prism::NextNode < ::Prism::Node - # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void +# source://prism/lib/prism/node.rb#12851 +class Prism::MatchPredicateNode < ::Prism::Node + # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void # - # @return [NextNode] a new instance of NextNode + # @return [MatchPredicateNode] a new instance of MatchPredicateNode # - # source://prism/lib/prism/node.rb#13812 - def initialize(source, arguments, keyword_loc, location); end + # source://prism/lib/prism/node.rb#12853 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, pattern, operator_loc, location); end - # def accept: (Visitor visitor) -> void + # 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#13821 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#12947 + def ===(other); end - # attr_reader arguments: ArgumentsNode? + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13861 - sig { returns(T.nilable(Prism::ArgumentsNode)) } - def arguments; end + # source://prism/lib/prism/node.rb#12862 + 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#13826 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12867 + 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#13838 + # source://prism/lib/prism/node.rb#12877 + 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#13831 + # source://prism/lib/prism/node.rb#12872 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> NextNode + # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchPredicateNode # - # source://prism/lib/prism/node.rb#13843 - sig { params(params: T.untyped).returns(Prism::NextNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#12882 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13826 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12867 + 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) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#13856 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#12890 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#13876 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#12913 + sig { override.returns(String) } + def inspect; end - # def keyword: () -> String + # def operator: () -> String # - # source://prism/lib/prism/node.rb#13871 + # source://prism/lib/prism/node.rb#12908 sig { returns(String) } - def keyword; end + def operator; end - # attr_reader keyword_loc: Location + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#13864 + # source://prism/lib/prism/node.rb#12901 sig { returns(Prism::Location) } - def keyword_loc; end + def operator_loc; end + + # attr_reader pattern: Prism::node + # + # source://prism/lib/prism/node.rb#12898 + 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 @@ -20391,9 +22867,16 @@ class Prism::NextNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13902 + # source://prism/lib/prism/node.rb#12931 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#12895 + 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. @@ -20402,74 +22885,116 @@ class Prism::NextNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13912 + # source://prism/lib/prism/node.rb#12941 def type; end end end -# Represents the use of the `nil` keyword. +# Represents the use of the `=>` operator. # -# nil -# ^^^ +# foo => bar +# ^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#13921 -class Prism::NilNode < ::Prism::Node - # def initialize: (Location location) -> void +# source://prism/lib/prism/node.rb#12959 +class Prism::MatchRequiredNode < ::Prism::Node + # def initialize: (Prism::node value, Prism::node pattern, Location operator_loc, Location location) -> void # - # @return [NilNode] a new instance of NilNode + # @return [MatchRequiredNode] a new instance of MatchRequiredNode # - # source://prism/lib/prism/node.rb#13923 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#12961 + sig do + params( + source: Prism::Source, + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, value, pattern, operator_loc, location); 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#13055 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#13930 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#12970 + 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#13935 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12975 + 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#13945 + # source://prism/lib/prism/node.rb#12985 + 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#13940 + # source://prism/lib/prism/node.rb#12980 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> NilNode + # def copy: (?value: Prism::node, ?pattern: Prism::node, ?operator_loc: Location, ?location: Location) -> MatchRequiredNode # - # source://prism/lib/prism/node.rb#13950 - sig { params(params: T.untyped).returns(Prism::NilNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#12990 + sig do + params( + value: Prism::Node, + pattern: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#13935 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#12975 + 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) -> { value: Prism::node, pattern: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#13961 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#12998 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#13021 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#13016 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#13009 + sig { returns(Prism::Location) } + def operator_loc; end + + # attr_reader pattern: Prism::node # - # source://prism/lib/prism/node.rb#13967 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#13006 + 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 @@ -20486,9 +23011,16 @@ class Prism::NilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#13986 + # source://prism/lib/prism/node.rb#13039 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#13003 + 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. @@ -20497,99 +23029,108 @@ class Prism::NilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#13996 + # source://prism/lib/prism/node.rb#13049 def type; end end end -# Represents the use of `**nil` inside method arguments. +# Represents writing local variables using a regular expression match with named capture groups. # -# def a(**nil) -# ^^^^^ -# end +# /(?bar)/ =~ baz +# ^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#14006 -class Prism::NoKeywordsParameterNode < ::Prism::Node - # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void +# source://prism/lib/prism/node.rb#13067 +class Prism::MatchWriteNode < ::Prism::Node + # def initialize: (CallNode call, Array[LocalVariableTargetNode] targets, Location location) -> void # - # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode + # @return [MatchWriteNode] a new instance of MatchWriteNode # - # source://prism/lib/prism/node.rb#14008 - def initialize(source, operator_loc, keyword_loc, location); end + # source://prism/lib/prism/node.rb#13069 + sig do + params( + source: Prism::Source, + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).void + end + def initialize(source, call, targets, location); 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#13150 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#14017 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#13077 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader call: CallNode + # + # source://prism/lib/prism/node.rb#13110 + sig { returns(Prism::CallNode) } + def call; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14022 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13082 + 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#14032 + # source://prism/lib/prism/node.rb#13092 + 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#14027 + # source://prism/lib/prism/node.rb#13087 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> NoKeywordsParameterNode + # def copy: (?call: CallNode, ?targets: Array[LocalVariableTargetNode], ?location: Location) -> MatchWriteNode # - # source://prism/lib/prism/node.rb#14037 - sig { params(params: T.untyped).returns(Prism::NoKeywordsParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#13097 + sig do + params( + call: Prism::CallNode, + targets: T::Array[Prism::LocalVariableTargetNode], + location: Prism::Location + ).returns(Prism::MatchWriteNode) + end + def copy(call: T.unsafe(nil), targets: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14022 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13082 + 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) -> { call: CallNode, targets: Array[LocalVariableTargetNode], location: Location } # - # source://prism/lib/prism/node.rb#14050 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#13105 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#14078 - def inspect(inspector = T.unsafe(nil)); end - - # def keyword: () -> String - # - # source://prism/lib/prism/node.rb#14073 - sig { returns(String) } - def keyword; end - - # attr_reader keyword_loc: Location - # - # source://prism/lib/prism/node.rb#14061 - sig { returns(Prism::Location) } - def keyword_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def operator: () -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#14068 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node.rb#13116 + sig { override.returns(String) } + def inspect; end - # attr_reader operator_loc: Location + # attr_reader targets: Array[LocalVariableTargetNode] # - # source://prism/lib/prism/node.rb#14055 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/node.rb#13113 + 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 @@ -20606,7 +23147,8 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#14099 + # source://prism/lib/prism/node.rb#13134 + sig { override.returns(Symbol) } def type; end class << self @@ -20617,243 +23159,254 @@ class Prism::NoKeywordsParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#14109 + # source://prism/lib/prism/node.rb#13144 def type; end end end -# This represents a node in the tree. It is the parent class of all of the -# various node types. +# Represents a node that is missing from the source and results in a syntax error. # -# source://prism/lib/prism/node.rb#11 -class Prism::Node - # Accepts a visitor and calls back into the specialized visit function. +# source://prism/lib/prism/node.rb#13159 +class Prism::MissingNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @raise [NoMethodError] + # @return [MissingNode] a new instance of MissingNode # - # source://prism/lib/prism/node.rb#62 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#13161 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # Returns an array of child nodes, including `nil`s in the place of optional - # nodes that were not present. + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. # - # @raise [NoMethodError] + # source://prism/lib/prism/node.rb#13234 + def ===(other); end + + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#68 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/node.rb#13167 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Returns an array of child nodes and locations that could potentially have - # comments attached to them. + # def child_nodes: () -> Array[nil | Node] # - # @raise [NoMethodError] + # source://prism/lib/prism/node.rb#13172 + 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#82 + # source://prism/lib/prism/node.rb#13182 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } def comment_targets; end - # Returns an array of child nodes, excluding any `nil`s in the place of - # optional nodes that were not present. - # - # @raise [NoMethodError] + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/node.rb#76 - sig { returns(T::Array[Prism::Node]) } + # source://prism/lib/prism/node.rb#13177 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; 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#68 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end - - # A Location instance that represents the location of this node in the - # source. + # def copy: (?location: Location) -> MissingNode # - # source://prism/lib/prism/node.rb#18 - sig { returns(Prism::Location) } - def location; end + # source://prism/lib/prism/node.rb#13187 + sig { params(location: Prism::Location).returns(Prism::MissingNode) } + def copy(location: T.unsafe(nil)); end - # @return [Boolean] + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#23 - def newline?; end + # source://prism/lib/prism/node.rb#13172 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Similar to inspect, but respects the current level of indentation given by - # the pretty print object. + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#42 - def pretty_print(q); end + # source://prism/lib/prism/node.rb#13195 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # source://prism/lib/prism/node.rb#27 - def set_newline_flag(newline_marked); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Slice the location of the node from the source. + # def inspect -> String # - # source://prism/lib/prism/node.rb#36 - sig { returns(String) } - def slice; end + # source://prism/lib/prism/node.rb#13200 + sig { override.returns(String) } + def inspect; end - # Convert this node into a graphviz dot graph string. + # 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. # - # source://prism/lib/prism/node.rb#50 - sig { returns(String) } - def to_dot; end - - # Returns a symbol symbolizing the type of node that this represents. This - # is particularly useful for case statements and array comparisons. + # 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] + # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#88 - sig { returns(Symbol) } + # source://prism/lib/prism/node.rb#13218 + sig { override.returns(Symbol) } def type; end - private + 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 + # + # source://prism/lib/prism/node.rb#13228 + def type; end + end +end - # A pointer to the source that this node was created from. - # - # source://prism/lib/prism/node.rb#13 - def source; end -end - -# This object is responsible for generating the output for the inspect method -# implementations of child nodes. +# Represents a module declaration involving the `module` keyword. # -# source://prism/lib/prism/node_inspector.rb#6 -class Prism::NodeInspector - # @return [NodeInspector] a new instance of NodeInspector +# module Foo end +# ^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#13243 +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 # - # source://prism/lib/prism/node_inspector.rb#9 - def initialize(prefix = T.unsafe(nil)); end - - # Appends a line to the output with the current prefix. + # @return [ModuleNode] a new instance of ModuleNode # - # source://prism/lib/prism/node_inspector.rb#15 - sig { params(line: String).void } - def <<(line); end + # source://prism/lib/prism/node.rb#13245 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).void + end + def initialize(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location); end - # Returns a new inspector that can be used to inspect a child node. + # 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_inspector.rb#59 - sig { params(append: String).returns(Prism::NodeInspector) } - def child_inspector(append); end + # source://prism/lib/prism/node.rb#13363 + def ===(other); end - # Generates a string that represents a child node. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node_inspector.rb#54 - sig { params(node: Prism::Node, append: String).returns(String) } - def child_node(node, append); end + # source://prism/lib/prism/node.rb#13257 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # This generates a string that is used as the header of the inspect output - # for any given node. + # attr_reader body: Prism::node? # - # source://prism/lib/prism/node_inspector.rb#21 - # This generates a string that is used as the header of the inspect output - sig { params(node: Prism::Node).returns(String) } - def header(node); end + # source://prism/lib/prism/node.rb#13306 + sig { returns(T.nilable(Prism::Node)) } + def body; end - # Generates a string that represents a list of nodes. It handles properly - # using the box drawing characters to make the output look nice. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node_inspector.rb#31 - # Generates a string that represents a list of nodes. It handles properly - sig { params(prefix: String, nodes: T::Array[Prism::Node]).returns(String) } - def list(prefix, nodes); end + # source://prism/lib/prism/node.rb#13262 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Generates a string that represents a location field on a node. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node_inspector.rb#45 - sig { params(value: Prism::Location).returns(String) } - def location(value); end - - # source://prism/lib/prism/node_inspector.rb#7 - sig { returns(String) } - def output; end - - # source://prism/lib/prism/node_inspector.rb#7 - sig { returns(String) } - def prefix; end + # source://prism/lib/prism/node.rb#13275 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Returns the output as a string. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/node_inspector.rb#64 - sig { returns(String) } - def to_str; end -end + # source://prism/lib/prism/node.rb#13267 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end -# 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#14118 -class Prism::NumberedParametersNode < ::Prism::Node - # def initialize: (Integer maximum, Location location) -> void - # - # @return [NumberedParametersNode] a new instance of NumberedParametersNode + # attr_reader constant_path: Prism::node # - # source://prism/lib/prism/node.rb#14120 - def initialize(source, maximum, location); end + # source://prism/lib/prism/node.rb#13303 + sig { returns(Prism::Node) } + def constant_path; end - # def accept: (Visitor visitor) -> void + # 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 # - # source://prism/lib/prism/node.rb#14128 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#13280 + sig do + params( + locals: T::Array[Symbol], + module_keyword_loc: Prism::Location, + constant_path: Prism::Node, + body: T.nilable(Prism::Node), + end_keyword_loc: Prism::Location, + name: Symbol, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14133 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/node.rb#13262 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # def comment_targets: () -> Array[Node | Location] + # 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 } # - # source://prism/lib/prism/node.rb#14143 - def comment_targets; end + # source://prism/lib/prism/node.rb#13288 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # def compact_child_nodes: () -> Array[Node] + # def end_keyword: () -> String # - # source://prism/lib/prism/node.rb#14138 - def compact_child_nodes; end + # source://prism/lib/prism/node.rb#13324 + sig { returns(String) } + def end_keyword; end - # def copy: (**params) -> NumberedParametersNode + # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/node.rb#14148 - sig { params(params: T.untyped).returns(Prism::NumberedParametersNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#13309 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#14133 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/node.rb#13329 + sig { override.returns(String) } + def inspect; end - # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } + # attr_reader locals: Array[Symbol] # - # source://prism/lib/prism/node.rb#14160 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/node.rb#13293 + sig { returns(T::Array[Symbol]) } + def locals; end + + # def module_keyword: () -> String + # + # source://prism/lib/prism/node.rb#13319 + sig { returns(String) } + def module_keyword; end - # def inspect(NodeInspector inspector) -> String + # attr_reader module_keyword_loc: Location # - # source://prism/lib/prism/node.rb#14169 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#13296 + sig { returns(Prism::Location) } + def module_keyword_loc; end - # attr_reader maximum: Integer + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#14165 - sig { returns(Integer) } - def maximum; end + # source://prism/lib/prism/node.rb#13316 + 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 @@ -20870,7 +23423,8 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#14189 + # source://prism/lib/prism/node.rb#13347 + sig { override.returns(Symbol) } def type; end class << self @@ -20881,86 +23435,148 @@ class Prism::NumberedParametersNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#14199 + # source://prism/lib/prism/node.rb#13357 def type; end end end -# Represents reading a numbered reference to a capture in the previous match. +# Represents a multi-target expression. # -# $1 -# ^^ +# a, (b, c) = 1, 2, 3 +# ^^^^^^ # -# source://prism/lib/prism/node.rb#14208 -class Prism::NumberedReferenceReadNode < ::Prism::Node - # def initialize: (Integer number, Location location) -> void +# source://prism/lib/prism/node.rb#13379 +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 # - # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode + # @return [MultiTargetNode] a new instance of MultiTargetNode # - # source://prism/lib/prism/node.rb#14210 - def initialize(source, number, location); end + # source://prism/lib/prism/node.rb#13381 + 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, 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, location); 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#13508 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#14218 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#13392 + 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#14223 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13397 + 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#14233 + # source://prism/lib/prism/node.rb#13411 + 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#14228 + # source://prism/lib/prism/node.rb#13402 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> NumberedReferenceReadNode + # 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 # - # source://prism/lib/prism/node.rb#14238 - sig { params(params: T.untyped).returns(Prism::NumberedReferenceReadNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#13416 + 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, 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14223 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13397 + 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) -> { 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 } + # + # source://prism/lib/prism/node.rb#13424 + 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 + # + # source://prism/lib/prism/node.rb#13474 + sig { override.returns(String) } + def inspect; end + + # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode | NumberedReferenceReadNode] # - # source://prism/lib/prism/node.rb#14250 + # source://prism/lib/prism/node.rb#13429 sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + 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 deconstruct_keys(keys); end + def lefts; end - # def inspect(NodeInspector inspector) -> String + # def lparen: () -> String? # - # source://prism/lib/prism/node.rb#14265 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#13464 + sig { returns(T.nilable(String)) } + def lparen; end - # The (1-indexed, from the left) number of the capture group. Numbered references that would overflow a `uint32` result in a `number` of exactly `2**32 - 1`. + # attr_reader lparen_loc: Location? # - # $1 # number `1` + # source://prism/lib/prism/node.rb#13438 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # attr_reader rest: Prism::node? # - # $5432 # number `5432` + # source://prism/lib/prism/node.rb#13432 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode | RequiredParameterNode | BackReferenceReadNode] + # + # source://prism/lib/prism/node.rb#13435 + 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)]) + end + def rights; end + + # def rparen: () -> String? # - # $4294967296 # number `4294967295` + # source://prism/lib/prism/node.rb#13469 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? # - # source://prism/lib/prism/node.rb#14261 - sig { returns(Integer) } - def number; end + # source://prism/lib/prism/node.rb#13451 + 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 @@ -20977,7 +23593,8 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#14285 + # source://prism/lib/prism/node.rb#13492 + sig { override.returns(Symbol) } def type; end class << self @@ -20988,95 +23605,164 @@ class Prism::NumberedReferenceReadNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#14295 + # source://prism/lib/prism/node.rb#13502 def type; end end end -# Represents an optional keyword parameter to a method, block, or lambda definition. +# Represents a write to a multi-target expression. # -# def a(b: 1) -# ^^^^ -# end +# a, b, c = 1, 2, 3 +# ^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#14305 -class Prism::OptionalKeywordParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Node value, Location location) -> void +# source://prism/lib/prism/node.rb#13524 +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 # - # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode + # @return [MultiWriteNode] a new instance of MultiWriteNode # - # source://prism/lib/prism/node.rb#14307 - def initialize(source, flags, name, name_loc, value, location); end + # source://prism/lib/prism/node.rb#13526 + 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location); 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#13671 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#14318 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#13539 + 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#14323 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13544 + 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#14333 + # source://prism/lib/prism/node.rb#13559 + 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#14328 + # source://prism/lib/prism/node.rb#13549 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> OptionalKeywordParameterNode + # 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 # - # source://prism/lib/prism/node.rb#14338 - sig { params(params: T.untyped).returns(Prism::OptionalKeywordParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#13564 + 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)], + lparen_loc: T.nilable(Prism::Location), + rparen_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14323 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13544 + 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: Node, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#14353 + # source://prism/lib/prism/node.rb#13572 + 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 + # + # source://prism/lib/prism/node.rb#13637 + sig { override.returns(String) } + def inspect; end + + # attr_reader lefts: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] + # + # source://prism/lib/prism/node.rb#13577 sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + returns(T::Array[T.any(Prism::LocalVariableTargetNode, Prism::InstanceVariableTargetNode, Prism::ClassVariableTargetNode, Prism::GlobalVariableTargetNode, Prism::ConstantTargetNode, Prism::ConstantPathTargetNode, Prism::CallTargetNode, Prism::IndexTargetNode, Prism::MultiTargetNode)]) end - def deconstruct_keys(keys); end + def lefts; end - # def inspect(NodeInspector inspector) -> String + # def lparen: () -> String? # - # source://prism/lib/prism/node.rb#14380 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#13622 + sig { returns(T.nilable(String)) } + def lparen; end - # attr_reader name: Symbol + # attr_reader lparen_loc: Location? # - # source://prism/lib/prism/node.rb#14362 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/node.rb#13586 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end - # attr_reader name_loc: Location + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#13632 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#14365 + # source://prism/lib/prism/node.rb#13612 sig { returns(Prism::Location) } - def name_loc; end + def operator_loc; end - # def repeated_parameter?: () -> bool + # attr_reader rest: Prism::node? # - # @return [Boolean] + # source://prism/lib/prism/node.rb#13580 + sig { returns(T.nilable(Prism::Node)) } + def rest; end + + # attr_reader rights: Array[LocalVariableTargetNode | InstanceVariableTargetNode | ClassVariableTargetNode | GlobalVariableTargetNode | ConstantTargetNode | ConstantPathTargetNode | CallTargetNode | IndexTargetNode | MultiTargetNode] # - # source://prism/lib/prism/node.rb#14375 - sig { returns(T::Boolean) } - def repeated_parameter?; end + # source://prism/lib/prism/node.rb#13583 + 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)]) + end + def rights; end + + # def rparen: () -> String? + # + # source://prism/lib/prism/node.rb#13627 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism/lib/prism/node.rb#13599 + 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 @@ -21093,23 +23779,16 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#14405 + # source://prism/lib/prism/node.rb#13655 + sig { override.returns(Symbol) } def type; end - # attr_reader value: Node + # attr_reader value: Prism::node # - # source://prism/lib/prism/node.rb#14371 + # source://prism/lib/prism/node.rb#13619 sig { returns(Prism::Node) } def value; end - private - - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#14358 - 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. @@ -21118,778 +23797,876 @@ class Prism::OptionalKeywordParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#14415 + # source://prism/lib/prism/node.rb#13665 def type; end end end -# Represents an optional parameter to a method, block, or lambda definition. -# -# def a(b = 1) -# ^^^^^ -# end +# This visitor walks through the tree and copies each node as it is being +# visited. This is useful for consumers that want to mutate the tree, as you +# can change subtrees in place without effecting the rest of the tree. # -# source://prism/lib/prism/node.rb#14425 -class Prism::OptionalParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Node value, Location location) -> void - # - # @return [OptionalParameterNode] a new instance of OptionalParameterNode +# source://prism/lib/prism/mutation_compiler.rb#13 +class Prism::MutationCompiler < ::Prism::Compiler + # Copy a AliasGlobalVariableNode node # - # source://prism/lib/prism/node.rb#14427 - def initialize(source, flags, name, name_loc, operator_loc, value, location); end + # source://prism/lib/prism/mutation_compiler.rb#15 + def visit_alias_global_variable_node(node); end - # def accept: (Visitor visitor) -> void + # Copy a AliasMethodNode node # - # source://prism/lib/prism/node.rb#14439 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/mutation_compiler.rb#20 + def visit_alias_method_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a AlternationPatternNode node # - # source://prism/lib/prism/node.rb#14444 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#25 + def visit_alternation_pattern_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a AndNode node # - # source://prism/lib/prism/node.rb#14454 - def comment_targets; end + # source://prism/lib/prism/mutation_compiler.rb#30 + def visit_and_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a ArgumentsNode node # - # source://prism/lib/prism/node.rb#14449 - def compact_child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#35 + def visit_arguments_node(node); end - # def copy: (**params) -> OptionalParameterNode + # Copy a ArrayNode node # - # source://prism/lib/prism/node.rb#14459 - sig { params(params: T.untyped).returns(Prism::OptionalParameterNode) } - def copy(**params); end + # source://prism/lib/prism/mutation_compiler.rb#40 + def visit_array_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a ArrayPatternNode node # - # source://prism/lib/prism/node.rb#14444 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/mutation_compiler.rb#45 + def visit_array_pattern_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location } + # Copy a AssocNode node # - # source://prism/lib/prism/node.rb#14475 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/mutation_compiler.rb#50 + def visit_assoc_node(node); end - # def inspect(NodeInspector inspector) -> String + # Copy a AssocSplatNode node # - # source://prism/lib/prism/node.rb#14513 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/mutation_compiler.rb#55 + def visit_assoc_splat_node(node); end - # attr_reader name: Symbol + # Copy a BackReferenceReadNode node # - # source://prism/lib/prism/node.rb#14484 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/mutation_compiler.rb#60 + def visit_back_reference_read_node(node); end - # attr_reader name_loc: Location + # Copy a BeginNode node # - # source://prism/lib/prism/node.rb#14487 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/mutation_compiler.rb#65 + def visit_begin_node(node); end - # def operator: () -> String + # Copy a BlockArgumentNode node # - # source://prism/lib/prism/node.rb#14508 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/mutation_compiler.rb#70 + def visit_block_argument_node(node); end - # attr_reader operator_loc: Location + # Copy a BlockLocalVariableNode node # - # source://prism/lib/prism/node.rb#14493 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/mutation_compiler.rb#75 + def visit_block_local_variable_node(node); end - # def repeated_parameter?: () -> bool + # Copy a BlockNode node # - # @return [Boolean] + # source://prism/lib/prism/mutation_compiler.rb#80 + def visit_block_node(node); end + + # Copy a BlockParameterNode node # - # source://prism/lib/prism/node.rb#14503 - sig { returns(T::Boolean) } - def repeated_parameter?; end + # source://prism/lib/prism/mutation_compiler.rb#85 + def visit_block_parameter_node(node); 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. + # Copy a BlockParametersNode node # - # 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/mutation_compiler.rb#90 + def visit_block_parameters_node(node); end + + # Copy a BreakNode node # - # def type: () -> Symbol + # source://prism/lib/prism/mutation_compiler.rb#95 + def visit_break_node(node); end + + # Copy a CallAndWriteNode node # - # source://prism/lib/prism/node.rb#14539 - def type; end + # source://prism/lib/prism/mutation_compiler.rb#100 + def visit_call_and_write_node(node); end - # attr_reader value: Node + # Copy a CallNode node # - # source://prism/lib/prism/node.rb#14499 - sig { returns(Prism::Node) } - def value; end + # source://prism/lib/prism/mutation_compiler.rb#105 + def visit_call_node(node); end - private + # Copy a CallOperatorWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#110 + def visit_call_operator_write_node(node); end - # private attr_reader flags: Integer + # Copy a CallOrWriteNode node # - # source://prism/lib/prism/node.rb#14480 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/mutation_compiler.rb#115 + def visit_call_or_write_node(node); 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 - # - # source://prism/lib/prism/node.rb#14549 - def type; end - end -end + # Copy a CallTargetNode node + # + # source://prism/lib/prism/mutation_compiler.rb#120 + def visit_call_target_node(node); end -# Represents the use of the `||` operator or the `or` keyword. -# -# left or right -# ^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#14558 -class Prism::OrNode < ::Prism::Node - # def initialize: (Node left, Node right, Location operator_loc, Location location) -> void + # Copy a CapturePatternNode node # - # @return [OrNode] a new instance of OrNode + # source://prism/lib/prism/mutation_compiler.rb#125 + def visit_capture_pattern_node(node); end + + # Copy a CaseMatchNode node # - # source://prism/lib/prism/node.rb#14560 - def initialize(source, left, right, operator_loc, location); end + # source://prism/lib/prism/mutation_compiler.rb#130 + def visit_case_match_node(node); end - # def accept: (Visitor visitor) -> void + # Copy a CaseNode node # - # source://prism/lib/prism/node.rb#14570 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/mutation_compiler.rb#135 + def visit_case_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a ClassNode node # - # source://prism/lib/prism/node.rb#14575 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#140 + def visit_class_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a ClassVariableAndWriteNode node # - # source://prism/lib/prism/node.rb#14585 - def comment_targets; end + # source://prism/lib/prism/mutation_compiler.rb#145 + def visit_class_variable_and_write_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a ClassVariableOperatorWriteNode node # - # source://prism/lib/prism/node.rb#14580 - def compact_child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#150 + def visit_class_variable_operator_write_node(node); end - # def copy: (**params) -> OrNode + # Copy a ClassVariableOrWriteNode node # - # source://prism/lib/prism/node.rb#14590 - sig { params(params: T.untyped).returns(Prism::OrNode) } - def copy(**params); end + # source://prism/lib/prism/mutation_compiler.rb#155 + def visit_class_variable_or_write_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a ClassVariableReadNode node # - # source://prism/lib/prism/node.rb#14575 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/mutation_compiler.rb#160 + def visit_class_variable_read_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { left: Node, right: Node, operator_loc: Location, location: Location } + # Copy a ClassVariableTargetNode node # - # source://prism/lib/prism/node.rb#14604 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/mutation_compiler.rb#165 + def visit_class_variable_target_node(node); end - # def inspect(NodeInspector inspector) -> String + # Copy a ClassVariableWriteNode node # - # source://prism/lib/prism/node.rb#14642 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/mutation_compiler.rb#170 + def visit_class_variable_write_node(node); end - # Represents the left 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). + # Copy a ConstantAndWriteNode node # - # left or right - # ^^^^ + # source://prism/lib/prism/mutation_compiler.rb#175 + def visit_constant_and_write_node(node); end + + # Copy a ConstantOperatorWriteNode node # - # 1 || 2 - # ^ + # source://prism/lib/prism/mutation_compiler.rb#180 + def visit_constant_operator_write_node(node); end + + # Copy a ConstantOrWriteNode node # - # source://prism/lib/prism/node.rb#14615 - sig { returns(Prism::Node) } - def left; end + # source://prism/lib/prism/mutation_compiler.rb#185 + def visit_constant_or_write_node(node); end - # def operator: () -> String + # Copy a ConstantPathAndWriteNode node # - # source://prism/lib/prism/node.rb#14637 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/mutation_compiler.rb#190 + def visit_constant_path_and_write_node(node); end - # The location of the `or` keyword or the `||` operator. + # Copy a ConstantPathNode node # - # left or right - # ^^ + # source://prism/lib/prism/mutation_compiler.rb#195 + def visit_constant_path_node(node); end + + # Copy a ConstantPathOperatorWriteNode node # - # source://prism/lib/prism/node.rb#14630 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/mutation_compiler.rb#200 + def visit_constant_path_operator_write_node(node); 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). + # Copy a ConstantPathOrWriteNode node # - # left || right - # ^^^^^ + # source://prism/lib/prism/mutation_compiler.rb#205 + def visit_constant_path_or_write_node(node); end + + # Copy a ConstantPathTargetNode node # - # 1 or 2 - # ^ + # source://prism/lib/prism/mutation_compiler.rb#210 + def visit_constant_path_target_node(node); end + + # Copy a ConstantPathWriteNode node # - # source://prism/lib/prism/node.rb#14624 - sig { returns(Prism::Node) } - def right; end + # source://prism/lib/prism/mutation_compiler.rb#215 + def visit_constant_path_write_node(node); 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. + # Copy a ConstantReadNode node # - # 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/mutation_compiler.rb#220 + def visit_constant_read_node(node); end + + # Copy a ConstantTargetNode node # - # def type: () -> Symbol + # source://prism/lib/prism/mutation_compiler.rb#225 + def visit_constant_target_node(node); end + + # Copy a ConstantWriteNode node # - # source://prism/lib/prism/node.rb#14666 - def type; end + # source://prism/lib/prism/mutation_compiler.rb#230 + def visit_constant_write_node(node); 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 - # - # source://prism/lib/prism/node.rb#14676 - def type; end - end -end + # Copy a DefNode node + # + # source://prism/lib/prism/mutation_compiler.rb#235 + def visit_def_node(node); end -# A parser for the pack template language. -# -# source://prism/lib/prism/pack.rb#5 -module Prism::Pack - class << self - def parse(_arg0, _arg1, _arg2); end - end -end + # Copy a DefinedNode node + # + # source://prism/lib/prism/mutation_compiler.rb#240 + def visit_defined_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a ElseNode node + # + # source://prism/lib/prism/mutation_compiler.rb#245 + def visit_else_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) + # Copy a EmbeddedStatementsNode node + # + # source://prism/lib/prism/mutation_compiler.rb#250 + def visit_embedded_statements_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) + # Copy a EmbeddedVariableNode node + # + # source://prism/lib/prism/mutation_compiler.rb#255 + def visit_embedded_variable_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a EnsureNode node + # + # source://prism/lib/prism/mutation_compiler.rb#260 + def visit_ensure_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) + # Copy a FalseNode node + # + # source://prism/lib/prism/mutation_compiler.rb#265 + def visit_false_node(node); end -# A directive in the pack template language. -# -# source://prism/lib/prism/pack.rb#59 -class Prism::Pack::Directive - # Initialize a new directive with the given values. + # Copy a FindPatternNode node # - # @return [Directive] a new instance of Directive + # source://prism/lib/prism/mutation_compiler.rb#270 + def visit_find_pattern_node(node); end + + # Copy a FlipFlopNode node # - # source://prism/lib/prism/pack.rb#88 - def initialize(version, variant, source, type, signed, endian, size, length_type, length); end + # source://prism/lib/prism/mutation_compiler.rb#275 + def visit_flip_flop_node(node); end - # Provide a human-readable description of the directive. + # Copy a FloatNode node # - # source://prism/lib/prism/pack.rb#130 - def describe; end + # source://prism/lib/prism/mutation_compiler.rb#280 + def visit_float_node(node); end - # The type of endianness of the directive. + # Copy a ForNode node # - # source://prism/lib/prism/pack.rb#76 - def endian; end + # source://prism/lib/prism/mutation_compiler.rb#285 + def visit_for_node(node); end - # The length of this directive (used for integers). + # Copy a ForwardingArgumentsNode node # - # source://prism/lib/prism/pack.rb#85 - def length; end + # source://prism/lib/prism/mutation_compiler.rb#290 + def visit_forwarding_arguments_node(node); end - # The length type of this directive (used for integers). + # Copy a ForwardingParameterNode node # - # source://prism/lib/prism/pack.rb#82 - def length_type; end + # source://prism/lib/prism/mutation_compiler.rb#295 + def visit_forwarding_parameter_node(node); end - # The type of signedness of the directive. + # Copy a ForwardingSuperNode node # - # source://prism/lib/prism/pack.rb#73 - def signed; end + # source://prism/lib/prism/mutation_compiler.rb#300 + def visit_forwarding_super_node(node); end - # The size of the directive. + # Copy a GlobalVariableAndWriteNode node # - # source://prism/lib/prism/pack.rb#79 - def size; end + # source://prism/lib/prism/mutation_compiler.rb#305 + def visit_global_variable_and_write_node(node); end - # A byteslice of the source string that this directive represents. + # Copy a GlobalVariableOperatorWriteNode node # - # source://prism/lib/prism/pack.rb#67 - def source; end + # source://prism/lib/prism/mutation_compiler.rb#310 + def visit_global_variable_operator_write_node(node); end - # The type of the directive. + # Copy a GlobalVariableOrWriteNode node # - # source://prism/lib/prism/pack.rb#70 - def type; end + # source://prism/lib/prism/mutation_compiler.rb#315 + def visit_global_variable_or_write_node(node); end - # A symbol representing whether or not we are packing or unpacking. + # Copy a GlobalVariableReadNode node # - # source://prism/lib/prism/pack.rb#64 - def variant; end + # source://prism/lib/prism/mutation_compiler.rb#320 + def visit_global_variable_read_node(node); end - # A symbol representing the version of Ruby. + # Copy a GlobalVariableTargetNode node # - # source://prism/lib/prism/pack.rb#61 - def version; end -end + # source://prism/lib/prism/mutation_compiler.rb#325 + def visit_global_variable_target_node(node); end -# The descriptions of the various types of endianness. -# -# source://prism/lib/prism/pack.rb#101 -Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a GlobalVariableWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#330 + def visit_global_variable_write_node(node); end -# The descriptions of the various types of signedness. -# -# source://prism/lib/prism/pack.rb#110 -Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a HashNode node + # + # source://prism/lib/prism/mutation_compiler.rb#335 + def visit_hash_node(node); end -# The descriptions of the various types of sizes. -# -# source://prism/lib/prism/pack.rb#117 -Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + # Copy a HashPatternNode node + # + # source://prism/lib/prism/mutation_compiler.rb#340 + def visit_hash_pattern_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + # Copy a IfNode node + # + # source://prism/lib/prism/mutation_compiler.rb#345 + def visit_if_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + # Copy a ImaginaryNode node + # + # source://prism/lib/prism/mutation_compiler.rb#350 + def visit_imaginary_node(node); end -# The result of parsing a pack template. -# -# source://prism/lib/prism/pack.rb#195 -class Prism::Pack::Format - # Create a new Format with the given directives and encoding. + # Copy a ImplicitNode node # - # @return [Format] a new instance of Format + # source://prism/lib/prism/mutation_compiler.rb#355 + def visit_implicit_node(node); end + + # Copy a ImplicitRestNode node # - # source://prism/lib/prism/pack.rb#203 - def initialize(directives, encoding); end + # source://prism/lib/prism/mutation_compiler.rb#360 + def visit_implicit_rest_node(node); end - # Provide a human-readable description of the format. + # Copy a InNode node # - # source://prism/lib/prism/pack.rb#209 - def describe; end + # source://prism/lib/prism/mutation_compiler.rb#365 + def visit_in_node(node); end - # A list of the directives in the template. + # Copy a IndexAndWriteNode node # - # source://prism/lib/prism/pack.rb#197 - def directives; end + # source://prism/lib/prism/mutation_compiler.rb#370 + def visit_index_and_write_node(node); end - # The encoding of the template. + # Copy a IndexOperatorWriteNode node # - # source://prism/lib/prism/pack.rb#200 - def encoding; end -end + # source://prism/lib/prism/mutation_compiler.rb#375 + def visit_index_operator_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) + # Copy a IndexOrWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#380 + def visit_index_or_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) + # Copy a IndexTargetNode node + # + # source://prism/lib/prism/mutation_compiler.rb#385 + def visit_index_target_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableAndWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#390 + def visit_instance_variable_and_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableOperatorWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#395 + def visit_instance_variable_operator_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableOrWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#400 + def visit_instance_variable_or_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableReadNode node + # + # source://prism/lib/prism/mutation_compiler.rb#405 + def visit_instance_variable_read_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableTargetNode node + # + # source://prism/lib/prism/mutation_compiler.rb#410 + def visit_instance_variable_target_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) + # Copy a InstanceVariableWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#415 + def visit_instance_variable_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) + # Copy a IntegerNode node + # + # source://prism/lib/prism/mutation_compiler.rb#420 + def visit_integer_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedMatchLastLineNode node + # + # source://prism/lib/prism/mutation_compiler.rb#425 + def visit_interpolated_match_last_line_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedRegularExpressionNode node + # + # source://prism/lib/prism/mutation_compiler.rb#430 + def visit_interpolated_regular_expression_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedStringNode node + # + # source://prism/lib/prism/mutation_compiler.rb#435 + def visit_interpolated_string_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedSymbolNode node + # + # source://prism/lib/prism/mutation_compiler.rb#440 + def visit_interpolated_symbol_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) + # Copy a InterpolatedXStringNode node + # + # source://prism/lib/prism/mutation_compiler.rb#445 + def visit_interpolated_x_string_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + # Copy a ItLocalVariableReadNode node + # + # source://prism/lib/prism/mutation_compiler.rb#450 + def visit_it_local_variable_read_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + # Copy a ItParametersNode node + # + # source://prism/lib/prism/mutation_compiler.rb#455 + def visit_it_parameters_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + # Copy a KeywordHashNode node + # + # source://prism/lib/prism/mutation_compiler.rb#460 + def visit_keyword_hash_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + # Copy a KeywordRestParameterNode node + # + # source://prism/lib/prism/mutation_compiler.rb#465 + def visit_keyword_rest_parameter_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + # Copy a LambdaNode node + # + # source://prism/lib/prism/mutation_compiler.rb#470 + def visit_lambda_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableAndWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#475 + def visit_local_variable_and_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableOperatorWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#480 + def visit_local_variable_operator_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableOrWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#485 + def visit_local_variable_or_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableReadNode node + # + # source://prism/lib/prism/mutation_compiler.rb#490 + def visit_local_variable_read_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableTargetNode node + # + # source://prism/lib/prism/mutation_compiler.rb#495 + def visit_local_variable_target_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + # Copy a LocalVariableWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#500 + def visit_local_variable_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + # Copy a MatchLastLineNode node + # + # source://prism/lib/prism/mutation_compiler.rb#505 + def visit_match_last_line_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + # Copy a MatchPredicateNode node + # + # source://prism/lib/prism/mutation_compiler.rb#510 + def visit_match_predicate_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + # Copy a MatchRequiredNode node + # + # source://prism/lib/prism/mutation_compiler.rb#515 + def visit_match_required_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + # Copy a MatchWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#520 + def visit_match_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + # Copy a MissingNode node + # + # source://prism/lib/prism/mutation_compiler.rb#525 + def visit_missing_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + # Copy a ModuleNode node + # + # source://prism/lib/prism/mutation_compiler.rb#530 + def visit_module_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + # Copy a MultiTargetNode node + # + # source://prism/lib/prism/mutation_compiler.rb#535 + def visit_multi_target_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + # Copy a MultiWriteNode node + # + # source://prism/lib/prism/mutation_compiler.rb#540 + def visit_multi_write_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + # Copy a NextNode node + # + # source://prism/lib/prism/mutation_compiler.rb#545 + def visit_next_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + # Copy a NilNode node + # + # source://prism/lib/prism/mutation_compiler.rb#550 + def visit_nil_node(node); end -# source://prism/lib/prism/pack.rb#55 -Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + # Copy a NoKeywordsParameterNode node + # + # source://prism/lib/prism/mutation_compiler.rb#555 + def visit_no_keywords_parameter_node(node); end -# Flags for parameter nodes. -# -# source://prism/lib/prism/node.rb#19304 -module Prism::ParameterFlags; end + # Copy a NumberedParametersNode node + # + # source://prism/lib/prism/mutation_compiler.rb#560 + def visit_numbered_parameters_node(node); end -# a parameter name that has been repeated in the method signature -# -# source://prism/lib/prism/node.rb#19306 -Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) + # Copy a NumberedReferenceReadNode node + # + # source://prism/lib/prism/mutation_compiler.rb#565 + def visit_numbered_reference_read_node(node); end -# Represents the list of parameters on a method, block, or lambda definition. -# -# def a(b, c, d) -# ^^^^^^^ -# end -# -# source://prism/lib/prism/node.rb#14686 -class Prism::ParametersNode < ::Prism::Node - # def initialize: (Array[Node] requireds, Array[Node] optionals, Node? rest, Array[Node] posts, Array[Node] keywords, Node? keyword_rest, BlockParameterNode? block, Location location) -> void + # Copy a OptionalKeywordParameterNode node # - # @return [ParametersNode] a new instance of ParametersNode + # source://prism/lib/prism/mutation_compiler.rb#570 + def visit_optional_keyword_parameter_node(node); end + + # Copy a OptionalParameterNode node # - # source://prism/lib/prism/node.rb#14688 - def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end + # source://prism/lib/prism/mutation_compiler.rb#575 + def visit_optional_parameter_node(node); end - # def accept: (Visitor visitor) -> void + # Copy a OrNode node # - # source://prism/lib/prism/node.rb#14702 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/mutation_compiler.rb#580 + def visit_or_node(node); end - # attr_reader block: BlockParameterNode? + # Copy a ParametersNode node # - # source://prism/lib/prism/node.rb#14771 - sig { returns(T.nilable(Prism::BlockParameterNode)) } - def block; end + # source://prism/lib/prism/mutation_compiler.rb#585 + def visit_parameters_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Copy a ParenthesesNode node # - # source://prism/lib/prism/node.rb#14707 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#590 + def visit_parentheses_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Copy a PinnedExpressionNode node # - # source://prism/lib/prism/node.rb#14725 - def comment_targets; end + # source://prism/lib/prism/mutation_compiler.rb#595 + def visit_pinned_expression_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Copy a PinnedVariableNode node # - # source://prism/lib/prism/node.rb#14712 - def compact_child_nodes; end + # source://prism/lib/prism/mutation_compiler.rb#600 + def visit_pinned_variable_node(node); end - # def copy: (**params) -> ParametersNode + # Copy a PostExecutionNode node # - # source://prism/lib/prism/node.rb#14730 - sig { params(params: T.untyped).returns(Prism::ParametersNode) } - def copy(**params); end + # source://prism/lib/prism/mutation_compiler.rb#605 + def visit_post_execution_node(node); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Copy a PreExecutionNode node # - # source://prism/lib/prism/node.rb#14707 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/mutation_compiler.rb#610 + def visit_pre_execution_node(node); end - # def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[Node], optionals: Array[Node], rest: Node?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location } + # Copy a ProgramNode node # - # source://prism/lib/prism/node.rb#14748 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/mutation_compiler.rb#615 + def visit_program_node(node); end - # def inspect(NodeInspector inspector) -> String + # Copy a RangeNode node # - # source://prism/lib/prism/node.rb#14775 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/mutation_compiler.rb#620 + def visit_range_node(node); end - # attr_reader keyword_rest: Node? + # Copy a RationalNode node # - # source://prism/lib/prism/node.rb#14768 - sig { returns(T.nilable(Prism::Node)) } - def keyword_rest; end + # source://prism/lib/prism/mutation_compiler.rb#625 + def visit_rational_node(node); end - # attr_reader keywords: Array[Node] + # Copy a RedoNode node # - # source://prism/lib/prism/node.rb#14765 - sig { returns(T::Array[Prism::Node]) } - def keywords; end + # source://prism/lib/prism/mutation_compiler.rb#630 + def visit_redo_node(node); end - # attr_reader optionals: Array[Node] + # Copy a RegularExpressionNode node # - # source://prism/lib/prism/node.rb#14756 - sig { returns(T::Array[Prism::Node]) } - def optionals; end + # source://prism/lib/prism/mutation_compiler.rb#635 + def visit_regular_expression_node(node); end - # attr_reader posts: Array[Node] + # Copy a RequiredKeywordParameterNode node # - # source://prism/lib/prism/node.rb#14762 - sig { returns(T::Array[Prism::Node]) } - def posts; end + # source://prism/lib/prism/mutation_compiler.rb#640 + def visit_required_keyword_parameter_node(node); end - # attr_reader requireds: Array[Node] + # Copy a RequiredParameterNode node # - # source://prism/lib/prism/node.rb#14753 - sig { returns(T::Array[Prism::Node]) } - def requireds; end + # source://prism/lib/prism/mutation_compiler.rb#645 + def visit_required_parameter_node(node); end - # attr_reader rest: Node? + # Copy a RescueModifierNode node # - # source://prism/lib/prism/node.rb#14759 - sig { returns(T.nilable(Prism::Node)) } - def rest; end + # source://prism/lib/prism/mutation_compiler.rb#650 + def visit_rescue_modifier_node(node); end - # Mirrors the Method#parameters method. + # Copy a RescueNode node # - # source://prism/lib/prism/node_ext.rb#172 - def signature; end + # source://prism/lib/prism/mutation_compiler.rb#655 + def visit_rescue_node(node); 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. + # Copy a RestParameterNode node # - # 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/mutation_compiler.rb#660 + def visit_rest_parameter_node(node); end + + # Copy a RetryNode node # - # def type: () -> Symbol + # source://prism/lib/prism/mutation_compiler.rb#665 + def visit_retry_node(node); end + + # Copy a ReturnNode node # - # source://prism/lib/prism/node.rb#14816 - def type; end + # source://prism/lib/prism/mutation_compiler.rb#670 + def visit_return_node(node); 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 - # - # source://prism/lib/prism/node.rb#14826 - def type; end - end + # Copy a SelfNode node + # + # 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#680 + def visit_shareable_constant_node(node); end + + # Copy a SingletonClassNode node + # + # 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#690 + def visit_source_encoding_node(node); end + + # Copy a SourceFileNode node + # + # 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#700 + def visit_source_line_node(node); end + + # Copy a SplatNode node + # + # 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#710 + def visit_statements_node(node); end + + # Copy a StringNode node + # + # 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#720 + def visit_super_node(node); end + + # Copy a SymbolNode node + # + # 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#730 + def visit_true_node(node); end + + # Copy a UndefNode node + # + # 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#740 + def visit_unless_node(node); end + + # Copy a UntilNode node + # + # 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#750 + def visit_when_node(node); end + + # Copy a WhileNode node + # + # 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#760 + def visit_x_string_node(node); end + + # Copy a YieldNode node + # + # source://prism/lib/prism/mutation_compiler.rb#765 + def visit_yield_node(node); end end -# Represents a parenthesized expression +# Represents the use of the `next` keyword. # -# (10 + 34) -# ^^^^^^^^^ +# next 1 +# ^^^^^^ # -# source://prism/lib/prism/node.rb#14835 -class Prism::ParenthesesNode < ::Prism::Node - # def initialize: (Node? body, Location opening_loc, Location closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#13689 +class Prism::NextNode < ::Prism::Node + # def initialize: (ArgumentsNode? arguments, Location keyword_loc, Location location) -> void # - # @return [ParenthesesNode] a new instance of ParenthesesNode + # @return [NextNode] a new instance of NextNode # - # source://prism/lib/prism/node.rb#14837 - def initialize(source, body, opening_loc, closing_loc, location); end + # source://prism/lib/prism/node.rb#13691 + sig do + params( + source: Prism::Source, + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, arguments, keyword_loc, location); 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#13783 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#14847 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#13699 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#14892 - sig { returns(T.nilable(Prism::Node)) } - def body; end + # source://prism/lib/prism/node.rb#13734 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14856 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13704 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#14913 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#14901 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#14868 + # source://prism/lib/prism/node.rb#13716 + 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#14861 + # source://prism/lib/prism/node.rb#13709 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ParenthesesNode + # def copy: (?arguments: ArgumentsNode?, ?keyword_loc: Location, ?location: Location) -> NextNode # - # source://prism/lib/prism/node.rb#14873 - sig { params(params: T.untyped).returns(Prism::ParenthesesNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#13721 + sig do + params( + arguments: T.nilable(Prism::ArgumentsNode), + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NextNode) + end + def copy(arguments: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14856 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#13704 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { body: Node?, opening_loc: Location, closing_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { arguments: ArgumentsNode?, keyword_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#14887 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#13729 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#14918 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#13749 + sig { override.returns(String) } + def inspect; end - # def opening: () -> String + # def keyword: () -> String # - # source://prism/lib/prism/node.rb#14908 + # source://prism/lib/prism/node.rb#13744 sig { returns(String) } - def opening; end + def keyword; end - # attr_reader opening_loc: Location + # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#14895 + # source://prism/lib/prism/node.rb#13737 sig { returns(Prism::Location) } - def opening_loc; end - - # source://prism/lib/prism/node.rb#14851 - def set_newline_flag(newline_marked); end + 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 @@ -21906,7 +24683,8 @@ class Prism::ParenthesesNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#14945 + # source://prism/lib/prism/node.rb#13767 + sig { override.returns(Symbol) } def type; end class << self @@ -21917,589 +24695,519 @@ class Prism::ParenthesesNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#14955 + # source://prism/lib/prism/node.rb#13777 def type; end end end -# This represents an error that was encountered during parsing. +# Represents the use of the `nil` keyword. # -# source://prism/lib/prism/parse_result.rb#338 -class Prism::ParseError - # Create a new error object with the given message and location. +# nil +# ^^^ +# +# source://prism/lib/prism/node.rb#13794 +class Prism::NilNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [ParseError] a new instance of ParseError + # @return [NilNode] a new instance of NilNode # - # source://prism/lib/prism/parse_result.rb#349 - def initialize(message, location, level); end + # source://prism/lib/prism/node.rb#13796 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # Implement the hash pattern matching interface for ParseError. + # 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/parse_result.rb#356 - def deconstruct_keys(keys); end + # source://prism/lib/prism/node.rb#13869 + def ===(other); end - # Returns a string representation of this error. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/parse_result.rb#361 - def inspect; end + # source://prism/lib/prism/node.rb#13802 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # The level of this error. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#346 - def level; end + # source://prism/lib/prism/node.rb#13807 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # A Location object representing the location of this error in the source. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/parse_result.rb#343 - sig { returns(Prism::Location) } - def location; end + # source://prism/lib/prism/node.rb#13817 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # The message associated with this error. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/parse_result.rb#340 - sig { returns(String) } - def message; end -end + # source://prism/lib/prism/node.rb#13812 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end -# This represents the result of a call to ::parse or ::parse_file. It contains -# the AST, any comments that were encounters, and any errors that were -# encountered. -# -# source://prism/lib/prism/parse_result.rb#398 -class Prism::ParseResult - # Create a new parse result object with the given values. - # - # @return [ParseResult] a new instance of ParseResult + # def copy: (?location: Location) -> NilNode # - # source://prism/lib/prism/parse_result.rb#425 - def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end + # source://prism/lib/prism/node.rb#13822 + sig { params(location: Prism::Location).returns(Prism::NilNode) } + def copy(location: T.unsafe(nil)); end - # Attach the list of comments to their respective locations in the tree. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result/comments.rb#173 - def attach_comments!; end + # source://prism/lib/prism/node.rb#13807 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # The list of comments that were encountered during parsing. + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/parse_result.rb#405 - sig { returns(T::Array[Prism::Comment]) } - def comments; end + # source://prism/lib/prism/node.rb#13830 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # An optional location that represents the location of the __END__ marker - # 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#413 - def data_loc; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Implement the hash pattern matching interface for ParseResult. + # def inspect -> String # - # source://prism/lib/prism/parse_result.rb#436 - def deconstruct_keys(keys); end + # source://prism/lib/prism/node.rb#13835 + sig { override.returns(String) } + def inspect; end - # The list of errors that were generated during parsing. + # 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. # - # source://prism/lib/prism/parse_result.rb#416 - sig { returns(T::Array[Prism::ParseError]) } - def errors; end - - # Returns true if there were errors during parsing and false if there were - # not. + # 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/parse_result.rb#448 - def failure?; end + # source://prism/lib/prism/node.rb#13853 + sig { override.returns(Symbol) } + def type; end - # The list of magic comments that were encountered during parsing. - # - # source://prism/lib/prism/parse_result.rb#408 - def magic_comments; 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 + # + # source://prism/lib/prism/node.rb#13863 + def type; end + end +end - # Walk the tree and mark nodes that are on a new line. +# Represents the use of `**nil` inside method arguments. +# +# def a(**nil) +# ^^^^^ +# end +# +# source://prism/lib/prism/node.rb#13879 +class Prism::NoKeywordsParameterNode < ::Prism::Node + # def initialize: (Location operator_loc, Location keyword_loc, Location location) -> void # - # source://prism/lib/prism/parse_result/newlines.rb#60 - def mark_newlines!; end - - # A Source instance that represents the source code that was parsed. + # @return [NoKeywordsParameterNode] a new instance of NoKeywordsParameterNode # - # source://prism/lib/prism/parse_result.rb#422 - sig { returns(Prism::Source) } - def source; end + # source://prism/lib/prism/node.rb#13881 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, operator_loc, keyword_loc, location); end - # Returns true if there were no errors during parsing and false if there - # were. + # Implements case-equality for the node. This is effectively == but without + # comparing the value of locations. Locations are checked only for presence. # - # @return [Boolean] + # source://prism/lib/prism/node.rb#13980 + def ===(other); end + + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/parse_result.rb#442 - def success?; end + # source://prism/lib/prism/node.rb#13889 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # The value that was generated by parsing. Normally this holds the AST, but - # it can sometimes how a list of tokens or other results passed back from - # the parser. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#402 - sig { returns(Prism::ProgramNode) } - def value; end + # source://prism/lib/prism/node.rb#13894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The list of warnings that were generated during parsing. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/parse_result.rb#419 - sig { returns(T::Array[Prism::ParseWarning]) } - def warnings; end -end + # source://prism/lib/prism/node.rb#13904 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end -# When we've parsed the source, we have both the syntax tree and the list of -# comments that we found in the source. This class is responsible for -# walking the tree and finding the nearest location to attach each comment. -# -# It does this by first finding the nearest locations to each comment. -# Locations can either come from nodes directly or from location fields on -# nodes. For example, a `ClassNode` has an overall location encompassing the -# entire class, but it also has a location for the `class` keyword. -# -# Once the nearest locations are found, it determines which one to attach -# to. If it's a trailing comment (a comment on the same line as other source -# code), it will favor attaching to the nearest location that occurs before -# the comment. Otherwise it will favor attaching to the nearest location -# that is after the comment. -# -# source://prism/lib/prism/parse_result/comments.rb#19 -class Prism::ParseResult::Comments - # Create a new Comments object that will attach comments to the given - # parse result. + # def compact_child_nodes: () -> Array[Node] # - # @return [Comments] a new instance of Comments + # source://prism/lib/prism/node.rb#13899 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?operator_loc: Location, ?keyword_loc: Location, ?location: Location) -> NoKeywordsParameterNode # - # source://prism/lib/prism/parse_result/comments.rb#78 - def initialize(parse_result); end + # source://prism/lib/prism/node.rb#13909 + sig do + params( + operator_loc: Prism::Location, + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::NoKeywordsParameterNode) + end + def copy(operator_loc: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end - # Attach the comments to their respective locations in the tree by - # mutating the parse result. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result/comments.rb#84 - def attach!; end + # source://prism/lib/prism/node.rb#13894 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # The parse result that we are attaching comments to. + # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, keyword_loc: Location, location: Location } # - # source://prism/lib/prism/parse_result/comments.rb#74 - def parse_result; end + # source://prism/lib/prism/node.rb#13917 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - private + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Responsible for finding the nearest targets to the given comment within - # the context of the given encapsulating node. + # def inspect -> String # - # source://prism/lib/prism/parse_result/comments.rb#103 - def nearest_targets(node, comment); end -end + # source://prism/lib/prism/node.rb#13946 + sig { override.returns(String) } + def inspect; end -# A target for attaching comments that is based on a location field on a -# node. For example, the `end` token of a ClassNode. -# -# source://prism/lib/prism/parse_result/comments.rb#49 -class Prism::ParseResult::Comments::LocationTarget - # @return [LocationTarget] a new instance of LocationTarget + # def keyword: () -> String # - # source://prism/lib/prism/parse_result/comments.rb#52 - def initialize(location); end + # source://prism/lib/prism/node.rb#13941 + sig { returns(String) } + def keyword; end - # source://prism/lib/prism/parse_result/comments.rb#68 - def <<(comment); end + # attr_reader keyword_loc: Location + # + # source://prism/lib/prism/node.rb#13929 + sig { returns(Prism::Location) } + def keyword_loc; end - # @return [Boolean] + # def operator: () -> String # - # source://prism/lib/prism/parse_result/comments.rb#64 - def encloses?(comment); end + # source://prism/lib/prism/node.rb#13936 + sig { returns(String) } + def operator; end - # source://prism/lib/prism/parse_result/comments.rb#60 - def end_offset; end + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#13922 + sig { returns(Prism::Location) } + def operator_loc; end - # source://prism/lib/prism/parse_result/comments.rb#50 - def location; 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 + # + # source://prism/lib/prism/node.rb#13964 + sig { override.returns(Symbol) } + def type; end - # source://prism/lib/prism/parse_result/comments.rb#56 - def start_offset; 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 + # + # source://prism/lib/prism/node.rb#13974 + def type; end + end end -# A target for attaching comments that is based on a specific node's -# location. +# This represents a node in the tree. It is the parent class of all of the +# various node types. # -# source://prism/lib/prism/parse_result/comments.rb#22 -class Prism::ParseResult::Comments::NodeTarget - # @return [NodeTarget] a new instance of NodeTarget +# source://prism/lib/prism/node.rb#12 +class Prism::Node + abstract! + + # Accepts a visitor and calls back into the specialized visit function. # - # source://prism/lib/prism/parse_result/comments.rb#25 - def initialize(node); end + # @raise [NoMethodError] + # + # source://prism/lib/prism/node.rb#131 + sig { abstract.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # source://prism/lib/prism/parse_result/comments.rb#42 - def <<(comment); 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#137 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # @return [Boolean] + # Returns an array of child nodes and locations that could potentially have + # comments attached to them. # - # source://prism/lib/prism/parse_result/comments.rb#37 - def encloses?(comment); end + # @raise [NoMethodError] + # + # source://prism/lib/prism/node.rb#151 + sig { abstract.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # source://prism/lib/prism/parse_result/comments.rb#33 - def end_offset; end + # Returns an array of child nodes, excluding any `nil`s in the place of + # optional nodes that were not present. + # + # @raise [NoMethodError] + # + # source://prism/lib/prism/node.rb#145 + sig { abstract.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # source://prism/lib/prism/parse_result/comments.rb#23 - def node; end - - # source://prism/lib/prism/parse_result/comments.rb#29 - def start_offset; 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: -# -# * if statements -# * unless statements -# * nodes that are children of statements lists -# -# In order to keep track of the newlines, we have a list of offsets that -# come back from the parser. We assign these offsets to the first nodes that -# we find in the tree that are on those lines. -# -# Note that the logic in this file should be kept in sync with the Java -# MarkNewlinesVisitor, since that visitor is responsible for marking the -# newlines for JRuby/TruffleRuby. -# -# source://prism/lib/prism/parse_result/newlines.rb#20 -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 - - # Permit block/lambda nodes to mark newlines within themselves. - # - # source://prism/lib/prism/parse_result/newlines.rb#27 - def visit_block_node(node); end - - # Mark if/unless nodes as newlines. + # Returns an array of child nodes, including `nil`s in the place of optional + # nodes that were not present. # - # source://prism/lib/prism/parse_result/newlines.rb#41 - def visit_if_node(node); end - - # Permit block/lambda nodes to mark newlines within themselves. + # @raise [NoMethodError] # - # source://prism/lib/prism/parse_result/newlines.rb#27 - def visit_lambda_node(node); end + # source://prism/lib/prism/node.rb#137 + sig { abstract.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Permit statements lists to mark newlines within themselves. - # - # source://prism/lib/prism/parse_result/newlines.rb#49 - def visit_statements_node(node); end + # source://prism/lib/prism/node_ext.rb#7 + def deprecated(*replacements); end - # Mark if/unless nodes as newlines. + # The end offset of the node in the source. This method is effectively a + # delegate method to the location object. # - # source://prism/lib/prism/parse_result/newlines.rb#41 - def visit_unless_node(node); end -end + # source://prism/lib/prism/node.rb#34 + sig { returns(Integer) } + def end_offset; end -# This represents a warning that was encountered during parsing. -# -# source://prism/lib/prism/parse_result.rb#367 -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#378 - def initialize(message, location, level); end + sig { abstract.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # Implement the hash pattern matching interface for ParseWarning. + # Returns a string representation of the node. # - # source://prism/lib/prism/parse_result.rb#385 - def deconstruct_keys(keys); end - - # Returns a string representation of this warning. + # @raise [NoMethodError] # - # source://prism/lib/prism/parse_result.rb#390 + # source://prism/lib/prism/node.rb#162 + sig { abstract.returns(String) } def inspect; end - # The level of this warning. - # - # source://prism/lib/prism/parse_result.rb#375 - def level; end - - # A Location object representing the location of this warning in the source. + # A Location instance that represents the location of this node in the + # source. # - # source://prism/lib/prism/parse_result.rb#372 + # source://prism/lib/prism/node.rb#19 sig { returns(Prism::Location) } def location; end - # The message associated with this warning. - # - # source://prism/lib/prism/parse_result.rb#369 - sig { returns(String) } - def message; end -end - -# A pattern is an object that wraps a Ruby pattern matching expression. The -# expression would normally be passed to an `in` clause within a `case` -# expression or a rightward assignment expression. For example, in the -# following snippet: -# -# case node -# in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] -# end -# -# the pattern is the ConstantPathNode[...] expression. -# -# The pattern gets compiled into an object that responds to #call by running -# the #compile method. This method itself will run back through Prism to -# parse the expression into a tree, then walk the tree to generate the -# necessary callable objects. For example, if you wanted to compile the -# expression above into a callable, you would: -# -# callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile -# callable.call(node) -# -# The callable object returned by #compile is guaranteed to respond to #call -# with a single argument, which is the node to match against. It also is -# guaranteed to respond to #===, which means it itself can be used in a `case` -# expression, as in: -# -# case node -# when callable -# end -# -# If the query given to the initializer cannot be compiled into a valid -# matcher (either because of a syntax error or because it is using syntax we -# do not yet support) then a Prism::Pattern::CompilationError will be -# raised. -# -# source://prism/lib/prism/pattern.rb#37 -class Prism::Pattern - # Create a new pattern with the given query. The query should be a string - # containing a Ruby pattern matching expression. - # - # @return [Pattern] a new instance of Pattern - # - # source://prism/lib/prism/pattern.rb#63 - def initialize(query); end - - # Compile the query into a callable object that can be used to match against - # nodes. - # - # source://prism/lib/prism/pattern.rb#70 - def compile; end + # source://prism/lib/prism/parse_result/newlines.rb#69 + def newline!(lines); end - # The query that this pattern was initialized with. + # @return [Boolean] # - # source://prism/lib/prism/pattern.rb#59 - def query; end + # source://prism/lib/prism/parse_result/newlines.rb#65 + def newline?; end - # Scan the given node and all of its children for nodes that match the - # pattern. If a block is given, it will be called with each node that - # matches the pattern. If no block is given, an enumerator will be returned - # that will yield each node that matches the pattern. + # Similar to inspect, but respects the current level of indentation given by + # the pretty print object. # - # source://prism/lib/prism/pattern.rb#79 - def scan(root); end - - private + # source://prism/lib/prism/node.rb#62 + sig { params(q: T.untyped).void } + def pretty_print(q); end - # Shortcut for combining two procs into one that returns true if both return - # true. + # Returns all of the lines of the source code associated with this node. + # An alias for source_lines, used to mimic the API from + # RubyVM::AbstractSyntaxTree to make it easier to migrate. # - # source://prism/lib/prism/pattern.rb#95 - def combine_and(left, right); end + # source://prism/lib/prism/node.rb#40 + sig { returns(T::Array[String]) } + def script_lines; end - # Shortcut for combining two procs into one that returns true if either - # returns true. + # Slice the location of the node from the source. # - # source://prism/lib/prism/pattern.rb#101 - def combine_or(left, right); end + # source://prism/lib/prism/node.rb#49 + sig { returns(String) } + def slice; end - # in foo | bar + # Slice the location of the node from the source, starting at the beginning + # of the line that the location starts on, ending at the end of the line + # that the location ends on. # - # source://prism/lib/prism/pattern.rb#136 - def compile_alternation_pattern_node(node); end + # source://prism/lib/prism/node.rb#56 + sig { returns(String) } + def slice_lines; end - # in [foo, bar, baz] + # Returns all of the lines of the source code associated with this node. # - # source://prism/lib/prism/pattern.rb#111 - def compile_array_pattern_node(node); end + # source://prism/lib/prism/node.rb#40 + sig { returns(T::Array[String]) } + def source_lines; end - # in Prism::ConstantReadNode + # The start offset of the node in the source. This method is effectively a + # delegate method to the location object. # - # source://prism/lib/prism/pattern.rb#141 - def compile_constant_path_node(node); end + # source://prism/lib/prism/node.rb#27 + sig { returns(Integer) } + def start_offset; end - # in ConstantReadNode - # in String + # Convert this node into a graphviz dot graph string. # - # source://prism/lib/prism/pattern.rb#153 - def compile_constant_read_node(node); end + # source://prism/lib/prism/node.rb#70 + sig { returns(String) } + def to_dot; end - # Raise an error because the given node is not supported. + # Returns a list of nodes that are descendants of this node that contain the + # given line and column. This is useful for locating a node that is selected + # based on the line and column of the source code. # - # @raise [CompilationError] + # 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/pattern.rb#106 - def compile_error(node); end + # source://prism/lib/prism/node.rb#81 + sig { params(line: Integer, column: Integer).returns(T::Array[Prism::Node]) } + def tunnel(line, column); end - # in InstanceVariableReadNode[name: Symbol] - # in { name: Symbol } + # Returns a symbol symbolizing the type of node that this represents. This + # is particularly useful for case statements and array comparisons. # - # source://prism/lib/prism/pattern.rb#171 - def compile_hash_pattern_node(node); end - - # in nil + # @raise [NoMethodError] # - # source://prism/lib/prism/pattern.rb#196 - def compile_nil_node(node); end + # source://prism/lib/prism/node.rb#157 + sig { abstract.returns(Symbol) } + def type; end - # Compile any kind of node. Dispatch out to the individual compilation - # methods based on the type of node. - # - # source://prism/lib/prism/pattern.rb#225 - def compile_node(node); end + private - # in /foo/ + # A pointer to the source that this node was created from. # - # source://prism/lib/prism/pattern.rb#201 - def compile_regular_expression_node(node); end + # source://prism/lib/prism/node.rb#14 + sig { returns(Prism::Source) } + def source; end - # in "" - # in "foo" - # - # source://prism/lib/prism/pattern.rb#209 - def compile_string_node(node); end + class << self + # Returns a list of the fields that exist for this node class. Fields + # describe the structure of the node. This kind of reflection is useful for + # things like recursively visiting each node _and_ field in the tree. + # + # @raise [NoMethodError] + # + # source://prism/lib/prism/node.rb#115 + def fields; end - # in :+ - # in :foo - # - # source://prism/lib/prism/pattern.rb#217 - def compile_symbol_node(node); end + # Returns the type of the node as a symbol. + # + # @raise [NoMethodError] + # + # source://prism/lib/prism/node.rb#167 + def type; end + end end -# Raised when the query given to a pattern is either invalid Ruby syntax or -# is using syntax that we don't yet support. +# Represents an implicit set of parameters through the use of numbered parameters within a block or lambda. # -# source://prism/lib/prism/pattern.rb#40 -class Prism::Pattern::CompilationError < ::StandardError - # Create a new CompilationError with the given representation of the node - # that caused the error. +# -> { _1 + _2 } +# ^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#13991 +class Prism::NumberedParametersNode < ::Prism::Node + # def initialize: (Integer maximum, Location location) -> void # - # @return [CompilationError] a new instance of CompilationError + # @return [NumberedParametersNode] a new instance of NumberedParametersNode # - # source://prism/lib/prism/pattern.rb#43 - def initialize(repr); end -end + # source://prism/lib/prism/node.rb#13993 + sig { params(source: Prism::Source, maximum: Integer, location: Prism::Location).void } + def initialize(source, maximum, location); end -# Represents the use of the `^` operator for pinning an expression in a pattern matching expression. -# -# foo in ^(bar) -# ^^^^^^ -# -# source://prism/lib/prism/node.rb#14964 -class Prism::PinnedExpressionNode < ::Prism::Node - # def initialize: (Node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void - # - # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode + # 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#14966 - def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); end + # source://prism/lib/prism/node.rb#14070 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#14977 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14000 + 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#14982 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14005 + 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#14992 + # source://prism/lib/prism/node.rb#14015 + 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#14987 + # source://prism/lib/prism/node.rb#14010 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> PinnedExpressionNode + # def copy: (?maximum: Integer, ?location: Location) -> NumberedParametersNode # - # source://prism/lib/prism/node.rb#14997 - sig { params(params: T.untyped).returns(Prism::PinnedExpressionNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14020 + sig { params(maximum: Integer, location: Prism::Location).returns(Prism::NumberedParametersNode) } + def copy(maximum: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#14982 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14005 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { maximum: Integer, location: Location } # - # source://prism/lib/prism/node.rb#15012 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14028 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader expression: Node - # - # source://prism/lib/prism/node.rb#15017 - sig { returns(Prism::Node) } - def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#15054 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#14036 + sig { override.returns(String) } + def inspect; end - # def lparen: () -> String + # attr_reader maximum: Integer # - # source://prism/lib/prism/node.rb#15044 - sig { returns(String) } - def lparen; end - - # attr_reader lparen_loc: Location - # - # source://prism/lib/prism/node.rb#15026 - sig { returns(Prism::Location) } - def lparen_loc; end - - # def operator: () -> String - # - # source://prism/lib/prism/node.rb#15039 - sig { returns(String) } - def operator; end - - # attr_reader operator_loc: Location - # - # source://prism/lib/prism/node.rb#15020 - sig { returns(Prism::Location) } - def operator_loc; end - - # def rparen: () -> String - # - # source://prism/lib/prism/node.rb#15049 - sig { returns(String) } - def rparen; end - - # attr_reader rparen_loc: Location - # - # source://prism/lib/prism/node.rb#15032 - sig { returns(Prism::Location) } - def rparen_loc; end + # source://prism/lib/prism/node.rb#14033 + 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 @@ -22516,7 +25224,8 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15078 + # source://prism/lib/prism/node.rb#14054 + sig { override.returns(Symbol) } def type; end class << self @@ -22527,86 +25236,95 @@ class Prism::PinnedExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15088 + # source://prism/lib/prism/node.rb#14064 def type; end end end -# Represents the use of the `^` operator for pinning a variable in a pattern matching expression. +# Represents reading a numbered reference to a capture in the previous match. # -# foo in ^bar -# ^^^^ +# $1 +# ^^ # -# source://prism/lib/prism/node.rb#15097 -class Prism::PinnedVariableNode < ::Prism::Node - # def initialize: (Node variable, Location operator_loc, Location location) -> void +# source://prism/lib/prism/node.rb#14080 +class Prism::NumberedReferenceReadNode < ::Prism::Node + # def initialize: (Integer number, Location location) -> void # - # @return [PinnedVariableNode] a new instance of PinnedVariableNode + # @return [NumberedReferenceReadNode] a new instance of NumberedReferenceReadNode # - # source://prism/lib/prism/node.rb#15099 - def initialize(source, variable, operator_loc, location); end + # source://prism/lib/prism/node.rb#14082 + sig { params(source: Prism::Source, number: Integer, location: Prism::Location).void } + def initialize(source, number, location); 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#14165 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15108 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14089 + 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#15113 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14094 + 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#15123 + # source://prism/lib/prism/node.rb#14104 + 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#15118 + # source://prism/lib/prism/node.rb#14099 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> PinnedVariableNode + # def copy: (?number: Integer, ?location: Location) -> NumberedReferenceReadNode # - # source://prism/lib/prism/node.rb#15128 - sig { params(params: T.untyped).returns(Prism::PinnedVariableNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14109 + sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) } + def copy(number: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15113 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14094 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { variable: Node, operator_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { number: Integer, location: Location } # - # source://prism/lib/prism/node.rb#15141 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14117 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#15161 - def inspect(inspector = T.unsafe(nil)); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def operator: () -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#15156 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node.rb#14131 + sig { override.returns(String) } + def inspect; end - # attr_reader operator_loc: Location + # The (1-indexed, from the left) number of the capture group. Numbered references that are too large result in this value being `0`. # - # source://prism/lib/prism/node.rb#15149 - sig { returns(Prism::Location) } - def operator_loc; end + # $1 # number `1` + # + # $5432 # number `5432` + # + # $4294967296 # number `0` + # + # source://prism/lib/prism/node.rb#14128 + 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 @@ -22623,15 +25341,10 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15183 + # source://prism/lib/prism/node.rb#14149 + sig { override.returns(Symbol) } def type; end - # attr_reader variable: Node - # - # source://prism/lib/prism/node.rb#15146 - sig { returns(Prism::Node) } - 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. @@ -22640,116 +25353,121 @@ class Prism::PinnedVariableNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15193 + # source://prism/lib/prism/node.rb#14159 def type; end end end -# Represents the use of the `END` keyword. +# Represents an optional keyword parameter to a method, block, or lambda definition. # -# END { foo } -# ^^^^^^^^^^^ +# def a(b: 1) +# ^^^^ +# end # -# source://prism/lib/prism/node.rb#15202 -class Prism::PostExecutionNode < ::Prism::Node - # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#14176 +class Prism::OptionalKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Prism::node value, Location location) -> void # - # @return [PostExecutionNode] a new instance of PostExecutionNode + # @return [OptionalKeywordParameterNode] a new instance of OptionalKeywordParameterNode # - # source://prism/lib/prism/node.rb#15204 - def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + # source://prism/lib/prism/node.rb#14178 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, value, location); 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#14277 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15215 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14188 + 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#15220 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14193 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#15289 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#15272 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#15232 + # source://prism/lib/prism/node.rb#14203 + 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#15225 + # source://prism/lib/prism/node.rb#14198 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> PostExecutionNode + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalKeywordParameterNode # - # source://prism/lib/prism/node.rb#15237 - sig { params(params: T.untyped).returns(Prism::PostExecutionNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14208 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15220 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14193 + 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) -> { flags: Integer, name: Symbol, name_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#15252 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14216 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#15294 - def inspect(inspector = T.unsafe(nil)); end - - # def keyword: () -> String - # - # source://prism/lib/prism/node.rb#15279 - sig { returns(String) } - def keyword; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader keyword_loc: Location + # def inspect -> String # - # source://prism/lib/prism/node.rb#15260 - sig { returns(Prism::Location) } - def keyword_loc; end + # source://prism/lib/prism/node.rb#14243 + sig { override.returns(String) } + def inspect; end - # def opening: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#15284 - sig { returns(String) } - def opening; end + # source://prism/lib/prism/node.rb#14225 + sig { returns(Symbol) } + def name; end - # attr_reader opening_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#15266 + # source://prism/lib/prism/node.rb#14228 sig { returns(Prism::Location) } - def opening_loc; end + def name_loc; end - # attr_reader statements: StatementsNode? + # def repeated_parameter?: () -> bool # - # source://prism/lib/prism/node.rb#15257 - sig { returns(T.nilable(Prism::StatementsNode)) } - def statements; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#14238 + 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 @@ -22766,9 +25484,24 @@ class Prism::PostExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15322 + # source://prism/lib/prism/node.rb#14261 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#14235 + sig { returns(Prism::Node) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#14221 + 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. @@ -22777,116 +25510,135 @@ class Prism::PostExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15332 + # source://prism/lib/prism/node.rb#14271 def type; end end end -# Represents the use of the `BEGIN` keyword. +# Represents an optional parameter to a method, block, or lambda definition. # -# BEGIN { foo } -# ^^^^^^^^^^^^^ +# def a(b = 1) +# ^^^^^ +# end # -# source://prism/lib/prism/node.rb#15341 -class Prism::PreExecutionNode < ::Prism::Node - # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void +# source://prism/lib/prism/node.rb#14291 +class Prism::OptionalParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Location location) -> void # - # @return [PreExecutionNode] a new instance of PreExecutionNode + # @return [OptionalParameterNode] a new instance of OptionalParameterNode # - # source://prism/lib/prism/node.rb#15343 - def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end + # source://prism/lib/prism/node.rb#14293 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, value, location); 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#14405 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15354 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14304 + 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#15359 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14309 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String - # - # source://prism/lib/prism/node.rb#15428 - sig { returns(String) } - def closing; end - - # attr_reader closing_loc: Location - # - # source://prism/lib/prism/node.rb#15411 - sig { returns(Prism::Location) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#15371 + # source://prism/lib/prism/node.rb#14319 + 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#15364 + # source://prism/lib/prism/node.rb#14314 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> PreExecutionNode + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> OptionalParameterNode # - # source://prism/lib/prism/node.rb#15376 - sig { params(params: T.untyped).returns(Prism::PreExecutionNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14324 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + operator_loc: Prism::Location, + value: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15359 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14309 + 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) -> { flags: Integer, name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#15391 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14332 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#15433 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#14371 + sig { override.returns(String) } + def inspect; end - # def keyword: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#15418 - sig { returns(String) } - def keyword; end + # source://prism/lib/prism/node.rb#14341 + sig { returns(Symbol) } + def name; end - # attr_reader keyword_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#15399 + # source://prism/lib/prism/node.rb#14344 sig { returns(Prism::Location) } - def keyword_loc; end + def name_loc; end - # def opening: () -> String + # def operator: () -> String # - # source://prism/lib/prism/node.rb#15423 + # source://prism/lib/prism/node.rb#14366 sig { returns(String) } - def opening; end + def operator; end - # attr_reader opening_loc: Location + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#15405 + # source://prism/lib/prism/node.rb#14351 sig { returns(Prism::Location) } - def opening_loc; end + def operator_loc; end - # attr_reader statements: StatementsNode? + # def repeated_parameter?: () -> bool # - # source://prism/lib/prism/node.rb#15396 - sig { returns(T.nilable(Prism::StatementsNode)) } - def statements; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#14361 + 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 @@ -22903,9 +25655,24 @@ class Prism::PreExecutionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15461 + # source://prism/lib/prism/node.rb#14389 + sig { override.returns(Symbol) } def type; end + # attr_reader value: Prism::node + # + # source://prism/lib/prism/node.rb#14358 + sig { returns(Prism::Node) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#14337 + 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. @@ -22914,83 +25681,137 @@ class Prism::PreExecutionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15471 + # source://prism/lib/prism/node.rb#14399 def type; end end end -# The top level node of any parse tree. +# Represents the use of the `||` operator or the `or` keyword. # -# source://prism/lib/prism/node.rb#15477 -class Prism::ProgramNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void +# left or right +# ^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#14419 +class Prism::OrNode < ::Prism::Node + # def initialize: (Prism::node left, Prism::node right, Location operator_loc, Location location) -> void # - # @return [ProgramNode] a new instance of ProgramNode + # @return [OrNode] a new instance of OrNode # - # source://prism/lib/prism/node.rb#15479 - def initialize(source, locals, statements, location); end + # source://prism/lib/prism/node.rb#14421 + sig do + params( + source: Prism::Source, + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, left, right, operator_loc, location); 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#14530 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15488 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14430 + 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#15493 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14435 + 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#15503 + # source://prism/lib/prism/node.rb#14445 + 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#15498 + # source://prism/lib/prism/node.rb#14440 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ProgramNode + # def copy: (?left: Prism::node, ?right: Prism::node, ?operator_loc: Location, ?location: Location) -> OrNode # - # source://prism/lib/prism/node.rb#15508 - sig { params(params: T.untyped).returns(Prism::ProgramNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14450 + sig do + params( + left: Prism::Node, + right: Prism::Node, + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15493 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14435 + 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) -> { left: Prism::node, right: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#15521 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14458 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#15533 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#14496 + sig { override.returns(String) } + def inspect; end - # attr_reader locals: Array[Symbol] + # Represents the left 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). # - # source://prism/lib/prism/node.rb#15526 - sig { returns(T::Array[Symbol]) } - def locals; end + # left or right + # ^^^^ + # + # 1 || 2 + # ^ + # + # source://prism/lib/prism/node.rb#14469 + sig { returns(Prism::Node) } + def left; end - # attr_reader statements: StatementsNode + # def operator: () -> String # - # source://prism/lib/prism/node.rb#15529 - sig { returns(Prism::StatementsNode) } - def statements; end + # source://prism/lib/prism/node.rb#14491 + sig { returns(String) } + def operator; end + + # The location of the `or` keyword or the `||` operator. + # + # left or right + # ^^ + # + # source://prism/lib/prism/node.rb#14484 + 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). + # + # left || right + # ^^^^^ + # + # 1 or 2 + # ^ + # + # source://prism/lib/prism/node.rb#14478 + 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 @@ -23007,7 +25828,8 @@ class Prism::ProgramNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15555 + # source://prism/lib/prism/node.rb#14514 + sig { override.returns(Symbol) } def type; end class << self @@ -23018,341 +25840,411 @@ class Prism::ProgramNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15565 + # source://prism/lib/prism/node.rb#14524 def type; end end end -# Flags for range and flip-flop nodes. -# -# source://prism/lib/prism/node.rb#19310 -module Prism::RangeFlags; end - -# ... operator +# A parser for the pack template language. # -# source://prism/lib/prism/node.rb#19312 -Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) +# source://prism/lib/prism/pack.rb#6 +module Prism::Pack + class << self + def parse(_arg0, _arg1, _arg2); end + end +end -# Represents the use of the `..` or `...` operators. -# -# 1..2 -# ^^^^ -# -# c if a =~ /left/ ... b =~ /right/ -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#15577 -class Prism::RangeNode < ::Prism::Node - # def initialize: (Integer flags, Node? left, Node? right, Location operator_loc, Location location) -> void - # - # @return [RangeNode] a new instance of RangeNode - # - # source://prism/lib/prism/node.rb#15579 - def initialize(source, flags, left, right, operator_loc, location); end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::AGNOSTIC_ENDIAN = T.let(T.unsafe(nil), Symbol) - # def accept: (Visitor visitor) -> void - # - # source://prism/lib/prism/node.rb#15590 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::BACK = T.let(T.unsafe(nil), Symbol) - # def child_nodes: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#15595 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::BER = T.let(T.unsafe(nil), Symbol) - # def comment_targets: () -> Array[Node | Location] - # - # source://prism/lib/prism/node.rb#15608 - def comment_targets; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::BIG_ENDIAN = T.let(T.unsafe(nil), Symbol) - # def compact_child_nodes: () -> Array[Node] - # - # source://prism/lib/prism/node.rb#15600 - def compact_child_nodes; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::COMMENT = T.let(T.unsafe(nil), Symbol) - # def copy: (**params) -> RangeNode +# A directive in the pack template language. +# +# source://prism/lib/prism/pack.rb#60 +class Prism::Pack::Directive + # Initialize a new directive with the given values. # - # source://prism/lib/prism/node.rb#15613 - sig { params(params: T.untyped).returns(Prism::RangeNode) } - def copy(**params); end - - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # @return [Directive] a new instance of Directive # - # source://prism/lib/prism/node.rb#15595 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/pack.rb#89 + def initialize(version, variant, source, type, signed, endian, size, length_type, length); end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location } + # Provide a human-readable description of the directive. # - # source://prism/lib/prism/node.rb#15628 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/pack.rb#131 + def describe; end - # def exclude_end?: () -> bool - # - # @return [Boolean] + # The type of endianness of the directive. # - # source://prism/lib/prism/node.rb#15663 - sig { returns(T::Boolean) } - def exclude_end?; end + # source://prism/lib/prism/pack.rb#77 + def endian; end - # def inspect(NodeInspector inspector) -> String + # The length of this directive (used for integers). # - # source://prism/lib/prism/node.rb#15673 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/pack.rb#86 + def length; end - # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # 1... - # ^ - # - # hello...goodbye - # ^^^^^ + # The length type of this directive (used for integers). # - # source://prism/lib/prism/node.rb#15643 - sig { returns(T.nilable(Prism::Node)) } - def left; end + # source://prism/lib/prism/pack.rb#83 + def length_type; end - # def operator: () -> String + # The type of signedness of the directive. # - # source://prism/lib/prism/node.rb#15668 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/pack.rb#74 + def signed; end - # The location of the `..` or `...` operator. + # The size of the directive. # - # source://prism/lib/prism/node.rb#15656 - sig { returns(Prism::Location) } - def operator_loc; end + # source://prism/lib/prism/pack.rb#80 + def size; end - # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). - # - # ..5 - # ^ - # - # 1...foo - # ^^^ - # If neither right-hand or left-hand side was included, this will be a MissingNode. + # A byteslice of the source string that this directive represents. # - # source://prism/lib/prism/node.rb#15653 - sig { returns(T.nilable(Prism::Node)) } - def right; end + # source://prism/lib/prism/pack.rb#68 + def source; 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 + # The type of the directive. # - # source://prism/lib/prism/node.rb#15707 + # source://prism/lib/prism/pack.rb#71 def type; end - private - - # private attr_reader flags: Integer + # A symbol representing whether or not we are packing or unpacking. # - # source://prism/lib/prism/node.rb#15633 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/pack.rb#65 + def variant; 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 - # - # source://prism/lib/prism/node.rb#15717 - def type; end - end + # A symbol representing the version of Ruby. + # + # source://prism/lib/prism/pack.rb#62 + def version; end end -# Represents a rational number literal. +# The descriptions of the various types of endianness. # -# 1.0r -# ^^^^ +# source://prism/lib/prism/pack.rb#102 +Prism::Pack::Directive::ENDIAN_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of signedness. # -# source://prism/lib/prism/node.rb#15726 -class Prism::RationalNode < ::Prism::Node - # def initialize: (Node numeric, Location location) -> void +# source://prism/lib/prism/pack.rb#111 +Prism::Pack::Directive::SIGNED_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# The descriptions of the various types of sizes. +# +# source://prism/lib/prism/pack.rb#118 +Prism::Pack::Directive::SIZE_DESCRIPTIONS = T.let(T.unsafe(nil), Hash) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::ENDIAN_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::FLOAT = T.let(T.unsafe(nil), Symbol) + +# The result of parsing a pack template. +# +# source://prism/lib/prism/pack.rb#198 +class Prism::Pack::Format + # Create a new Format with the given directives and encoding. # - # @return [RationalNode] a new instance of RationalNode + # @return [Format] a new instance of Format # - # source://prism/lib/prism/node.rb#15728 - def initialize(source, numeric, location); end + # source://prism/lib/prism/pack.rb#206 + def initialize(directives, encoding); end - # def accept: (Visitor visitor) -> void + # Provide a human-readable description of the format. # - # source://prism/lib/prism/node.rb#15736 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/pack.rb#212 + def describe; end - # def child_nodes: () -> Array[nil | Node] + # A list of the directives in the template. # - # source://prism/lib/prism/node.rb#15741 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/pack.rb#200 + def directives; end - # def comment_targets: () -> Array[Node | Location] + # The encoding of the template. # - # source://prism/lib/prism/node.rb#15751 - def comment_targets; end + # source://prism/lib/prism/pack.rb#203 + def encoding; end +end - # def compact_child_nodes: () -> Array[Node] - # - # source://prism/lib/prism/node.rb#15746 - def compact_child_nodes; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::INTEGER = T.let(T.unsafe(nil), Symbol) - # def copy: (**params) -> RationalNode - # - # source://prism/lib/prism/node.rb#15756 - sig { params(params: T.untyped).returns(Prism::RationalNode) } - def copy(**params); end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::LENGTH_FIXED = T.let(T.unsafe(nil), Symbol) - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#15741 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::LENGTH_MAX = T.let(T.unsafe(nil), Symbol) - # def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Node, location: Location } - # - # source://prism/lib/prism/node.rb#15768 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::LENGTH_NA = T.let(T.unsafe(nil), Symbol) - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#15777 - def inspect(inspector = T.unsafe(nil)); end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::LENGTH_RELATIVE = T.let(T.unsafe(nil), Symbol) - # attr_reader numeric: Node - # - # source://prism/lib/prism/node.rb#15773 - sig { returns(Prism::Node) } - def numeric; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::LITTLE_ENDIAN = T.let(T.unsafe(nil), Symbol) - # 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 - # - # source://prism/lib/prism/node.rb#15798 - def type; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::MOVE = T.let(T.unsafe(nil), Symbol) - # Returns the value of the node as a Ruby Rational. - # - # source://prism/lib/prism/node_ext.rb#83 - def value; end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::NATIVE_ENDIAN = T.let(T.unsafe(nil), Symbol) - 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 - # - # source://prism/lib/prism/node.rb#15808 - def type; end - end -end +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::NULL = T.let(T.unsafe(nil), Symbol) -# Represents the use of the `redo` keyword. +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIGNED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIGNED_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_16 = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_32 = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_64 = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_8 = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_INT = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_LONG_LONG = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_NA = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_P = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SIZE_SHORT = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::SPACE = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_BASE64 = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_FIXED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_HEX_HIGH = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_HEX_LOW = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_LSB = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_MIME = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_MSB = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_NULL_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_NULL_TERMINATED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_POINTER = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_SPACE_PADDED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::STRING_UU = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::UNSIGNED = T.let(T.unsafe(nil), Symbol) + +# source://prism/lib/prism/pack.rb#56 +Prism::Pack::UTF8 = T.let(T.unsafe(nil), Symbol) + +# Flags for parameter nodes. # -# redo -# ^^^^ +# source://prism/lib/prism/node.rb#19202 +module Prism::ParameterFlags; end + +# a parameter name that has been repeated in the method signature # -# source://prism/lib/prism/node.rb#15817 -class Prism::RedoNode < ::Prism::Node - # def initialize: (Location location) -> void +# source://prism/lib/prism/node.rb#19204 +Prism::ParameterFlags::REPEATED_PARAMETER = T.let(T.unsafe(nil), Integer) + +# Represents the list of parameters on a method, block, or lambda definition. +# +# def a(b, c, d) +# ^^^^^^^ +# end +# +# source://prism/lib/prism/node.rb#14543 +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 # - # @return [RedoNode] a new instance of RedoNode + # @return [ParametersNode] a new instance of ParametersNode # - # source://prism/lib/prism/node.rb#15819 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#14545 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); 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#14654 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15826 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14558 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # attr_reader block: BlockParameterNode? + # + # source://prism/lib/prism/node.rb#14617 + sig { returns(T.nilable(Prism::BlockParameterNode)) } + def block; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15831 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14563 + 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#15841 + # source://prism/lib/prism/node.rb#14581 + 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#15836 + # source://prism/lib/prism/node.rb#14568 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> RedoNode + # 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 # - # source://prism/lib/prism/node.rb#15846 - sig { params(params: T.untyped).returns(Prism::RedoNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14586 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15831 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14563 + 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) -> { 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 } + # + # source://prism/lib/prism/node.rb#14594 + 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 + # + # source://prism/lib/prism/node.rb#14620 + sig { override.returns(String) } + def inspect; end + + # attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil # - # source://prism/lib/prism/node.rb#15857 + # source://prism/lib/prism/node.rb#14614 sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + returns(T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode))) end - def deconstruct_keys(keys); end + def keyword_rest; end + + # attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] + # + # source://prism/lib/prism/node.rb#14611 + sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) } + def keywords; end + + # attr_reader optionals: Array[OptionalParameterNode] + # + # source://prism/lib/prism/node.rb#14602 + sig { returns(T::Array[Prism::OptionalParameterNode]) } + def optionals; end + + # attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] + # + # source://prism/lib/prism/node.rb#14608 + sig do + returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)]) + end + def posts; end + + # attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode] + # + # source://prism/lib/prism/node.rb#14599 + 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#14605 + sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) } + def rest; end - # def inspect(NodeInspector inspector) -> String + # Mirrors the Method#parameters method. # - # source://prism/lib/prism/node.rb#15863 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node_ext.rb#253 + 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 @@ -23369,7 +26261,8 @@ class Prism::RedoNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#15882 + # source://prism/lib/prism/node.rb#14638 + sig { override.returns(Symbol) } def type; end class << self @@ -23380,242 +26273,129 @@ class Prism::RedoNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#15892 + # source://prism/lib/prism/node.rb#14648 def type; end end end -# Flags for regular expression and match last line nodes. -# -# source://prism/lib/prism/node.rb#19316 -module Prism::RegularExpressionFlags; end - -# n - forces the ASCII-8BIT encoding -# -# source://prism/lib/prism/node.rb#19333 -Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) - -# e - forces the EUC-JP encoding -# -# source://prism/lib/prism/node.rb#19330 -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#19321 -Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) - -# internal bytes forced the encoding to binary -# -# source://prism/lib/prism/node.rb#19345 -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#19348 -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#19342 -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#19318 -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#19324 -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#19327 -Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) - -# u - forces the UTF-8 encoding -# -# source://prism/lib/prism/node.rb#19339 -Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) - -# s - forces the Windows-31J encoding -# -# source://prism/lib/prism/node.rb#19336 -Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) - -# Represents a regular expression literal with no interpolation. +# Represents a parenthesized expression # -# /foo/i -# ^^^^^^ +# (10 + 34) +# ^^^^^^^^^ # -# source://prism/lib/prism/node.rb#15901 -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 +# source://prism/lib/prism/node.rb#14674 +class Prism::ParenthesesNode < ::Prism::Node + # def initialize: (Prism::node? body, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [RegularExpressionNode] a new instance of RegularExpressionNode + # @return [ParenthesesNode] a new instance of ParenthesesNode # - # source://prism/lib/prism/node.rb#15903 - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end + # source://prism/lib/prism/node.rb#14676 + sig do + params( + source: Prism::Source, + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, body, opening_loc, closing_loc, location); 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#14781 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#15915 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14685 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # def ascii_8bit?: () -> bool - # - # @return [Boolean] + # attr_reader body: Prism::node? # - # source://prism/lib/prism/node.rb#16007 - sig { returns(T::Boolean) } - def ascii_8bit?; end + # source://prism/lib/prism/node.rb#14720 + sig { returns(T.nilable(Prism::Node)) } + def body; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15920 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14690 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#16047 + # source://prism/lib/prism/node.rb#14742 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#15972 + # source://prism/lib/prism/node.rb#14730 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#15930 + # source://prism/lib/prism/node.rb#14702 + 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#15925 + # source://prism/lib/prism/node.rb#14695 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def content: () -> String - # - # source://prism/lib/prism/node.rb#16042 - sig { returns(String) } - def content; end - - # attr_reader content_loc: Location - # - # source://prism/lib/prism/node.rb#15966 - sig { returns(Prism::Location) } - def content_loc; end - - # def copy: (**params) -> RegularExpressionNode + # def copy: (?body: Prism::node?, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> ParenthesesNode # - # source://prism/lib/prism/node.rb#15935 - sig { params(params: T.untyped).returns(Prism::RegularExpressionNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14707 + sig do + params( + body: T.nilable(Prism::Node), + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#15920 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14690 + 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) -> { body: Prism::node?, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#15951 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14715 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def euc_jp?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#16002 - sig { returns(T::Boolean) } - def euc_jp?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def extended?: () -> bool - # - # @return [Boolean] + # def inspect -> String # - # source://prism/lib/prism/node.rb#15987 - sig { returns(T::Boolean) } - def extended?; end + # source://prism/lib/prism/node.rb#14747 + sig { override.returns(String) } + def inspect; end - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#16027 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end + # source://prism/lib/prism/parse_result/newlines.rb#85 + def newline!(lines); end - # def forced_us_ascii_encoding?: () -> bool + # def opening: () -> String # - # @return [Boolean] + # source://prism/lib/prism/node.rb#14737 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#16032 - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end - - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#16022 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end - - # def ignore_case?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#15982 - sig { returns(T::Boolean) } - def ignore_case?; end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#16052 - def inspect(inspector = T.unsafe(nil)); end - - # def multi_line?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#15992 - sig { returns(T::Boolean) } - def multi_line?; end - - # def once?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#15997 - sig { returns(T::Boolean) } - def once?; end - - # def opening: () -> String - # - # source://prism/lib/prism/node.rb#16037 - sig { returns(String) } - def opening; end - - # attr_reader opening_loc: Location - # - # source://prism/lib/prism/node.rb#15960 + # source://prism/lib/prism/node.rb#14723 sig { returns(Prism::Location) } def opening_loc; end @@ -23634,39 +26414,10 @@ class Prism::RegularExpressionNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#16077 + # source://prism/lib/prism/node.rb#14765 + sig { override.returns(Symbol) } def type; end - # attr_reader unescaped: String - # - # source://prism/lib/prism/node.rb#15978 - sig { returns(String) } - def unescaped; end - - # def utf_8?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#16017 - sig { returns(T::Boolean) } - def utf_8?; end - - # def windows_31j?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#16012 - sig { returns(T::Boolean) } - def windows_31j?; end - - private - - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#15956 - 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. @@ -23675,628 +26426,648 @@ class Prism::RegularExpressionNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#16087 + # source://prism/lib/prism/node.rb#14775 def type; end end end -# source://prism/lib/prism/node_ext.rb#6 -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#9 - def options; end -end - -# Represents a required keyword parameter to a method, block, or lambda definition. -# -# def a(b: ) -# ^^ -# end +# This represents an error that was encountered during parsing. # -# source://prism/lib/prism/node.rb#16097 -class Prism::RequiredKeywordParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void +# source://prism/lib/prism/parse_result.rb#451 +class Prism::ParseError + # Create a new error object with the given message and location. # - # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode + # @return [ParseError] a new instance of ParseError # - # source://prism/lib/prism/node.rb#16099 - def initialize(source, flags, name, name_loc, location); end + # source://prism/lib/prism/parse_result.rb#466 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } + def initialize(type, message, location, level); end - # def accept: (Visitor visitor) -> void + # Implement the hash pattern matching interface for ParseError. # - # source://prism/lib/prism/node.rb#16109 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/parse_result.rb#474 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # def child_nodes: () -> Array[nil | Node] + # Returns a string representation of this error. # - # source://prism/lib/prism/node.rb#16114 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/parse_result.rb#479 + sig { returns(String) } + def inspect; end - # def comment_targets: () -> Array[Node | Location] + # The level of this error. # - # source://prism/lib/prism/node.rb#16124 - def comment_targets; end + # source://prism/lib/prism/parse_result.rb#463 + sig { returns(Symbol) } + def level; end - # def compact_child_nodes: () -> Array[Node] + # A Location object representing the location of this error in the source. # - # source://prism/lib/prism/node.rb#16119 - def compact_child_nodes; end + # source://prism/lib/prism/parse_result.rb#460 + sig { returns(Prism::Location) } + def location; end - # def copy: (**params) -> RequiredKeywordParameterNode + # The message associated with this error. # - # source://prism/lib/prism/node.rb#16129 - sig { params(params: T.untyped).returns(Prism::RequiredKeywordParameterNode) } - def copy(**params); end + # source://prism/lib/prism/parse_result.rb#457 + sig { returns(String) } + def message; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # 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/node.rb#16114 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/parse_result.rb#454 + sig { returns(Symbol) } + def type; end +end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location } +# This is a result specific to the `parse_lex` and `parse_lex_file` methods. +# +# source://prism/lib/prism/parse_result.rb#627 +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/node.rb#16143 + # source://prism/lib/prism/parse_result.rb#633 sig do params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + value: [Prism::ProgramNode, T::Array[T.untyped]], + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void end - def deconstruct_keys(keys); end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#16167 - def inspect(inspector = T.unsafe(nil)); end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); end - # attr_reader name: Symbol + # Implement the hash pattern matching interface for ParseLexResult. # - # source://prism/lib/prism/node.rb#16152 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/parse_result.rb#639 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # attr_reader name_loc: Location + # A tuple of the syntax tree and the list of tokens that were parsed from + # the source code. # - # source://prism/lib/prism/node.rb#16155 - sig { returns(Prism::Location) } - def name_loc; end + # source://prism/lib/prism/parse_result.rb#630 + sig { returns([Prism::ProgramNode, T::Array[T.untyped]]) } + def value; end +end - # def repeated_parameter?: () -> bool +# This is a result specific to the `parse` and `parse_file` methods. +# +# source://prism/lib/prism/parse_result.rb#576 +class Prism::ParseResult < ::Prism::Result + # Create a new parse result object with the given values. # - # @return [Boolean] + # @return [ParseResult] a new instance of ParseResult # - # source://prism/lib/prism/node.rb#16162 - sig { returns(T::Boolean) } - def repeated_parameter?; end + # source://prism/lib/prism/parse_result.rb#587 + sig do + params( + value: Prism::ProgramNode, + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(value, comments, magic_comments, data_loc, errors, warnings, source); 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 + # Attach the list of comments to their respective locations in the tree. # - # source://prism/lib/prism/node.rb#16190 - def type; end + # source://prism/lib/prism/parse_result.rb#598 + def attach_comments!; end - private + # Implement the hash pattern matching interface for ParseResult. + # + # source://prism/lib/prism/parse_result.rb#593 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # private attr_reader flags: Integer + # 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/node.rb#16148 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/parse_result.rb#604 + def mark_newlines!; 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 - # - # source://prism/lib/prism/node.rb#16200 - def type; end - end + # The syntax tree that was parsed from the source code. + # + # source://prism/lib/prism/parse_result.rb#584 + sig { returns(Prism::ProgramNode) } + def value; end end -# Represents a required parameter to a method, block, or lambda definition. +# When we've parsed the source, we have both the syntax tree and the list of +# comments that we found in the source. This class is responsible for +# walking the tree and finding the nearest location to attach each comment. # -# def a(b) -# ^ -# end +# It does this by first finding the nearest locations to each comment. +# Locations can either come from nodes directly or from location fields on +# nodes. For example, a `ClassNode` has an overall location encompassing the +# entire class, but it also has a location for the `class` keyword. # -# source://prism/lib/prism/node.rb#16210 -class Prism::RequiredParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol name, Location location) -> void +# Once the nearest locations are found, it determines which one to attach +# to. If it's a trailing comment (a comment on the same line as other source +# code), it will favor attaching to the nearest location that occurs before +# the comment. Otherwise it will favor attaching to the nearest location +# that is after the comment. +# +# source://prism/lib/prism/parse_result/comments.rb#19 +class Prism::ParseResult::Comments + # Create a new Comments object that will attach comments to the given + # parse result. # - # @return [RequiredParameterNode] a new instance of RequiredParameterNode + # @return [Comments] a new instance of Comments # - # source://prism/lib/prism/node.rb#16212 - def initialize(source, flags, name, location); end + # source://prism/lib/prism/parse_result/comments.rb#86 + def initialize(parse_result); end - # def accept: (Visitor visitor) -> void + # Attach the comments to their respective locations in the tree by + # mutating the parse result. # - # source://prism/lib/prism/node.rb#16221 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/parse_result/comments.rb#92 + def attach!; end - # def child_nodes: () -> Array[nil | Node] + # The parse result that we are attaching comments to. # - # source://prism/lib/prism/node.rb#16226 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/parse_result/comments.rb#82 + def parse_result; end - # def comment_targets: () -> Array[Node | Location] - # - # source://prism/lib/prism/node.rb#16236 - def comment_targets; end + private - # def compact_child_nodes: () -> Array[Node] + # Responsible for finding the nearest targets to the given comment within + # the context of the given encapsulating node. # - # source://prism/lib/prism/node.rb#16231 - def compact_child_nodes; end + # source://prism/lib/prism/parse_result/comments.rb#119 + def nearest_targets(node, comment); end +end - # def copy: (**params) -> RequiredParameterNode +# A target for attaching comments that is based on a location field on a +# node. For example, the `end` token of a ClassNode. +# +# source://prism/lib/prism/parse_result/comments.rb#53 +class Prism::ParseResult::Comments::LocationTarget + # @return [LocationTarget] a new instance of LocationTarget # - # source://prism/lib/prism/node.rb#16241 - sig { params(params: T.untyped).returns(Prism::RequiredParameterNode) } - def copy(**params); end + # source://prism/lib/prism/parse_result/comments.rb#56 + def initialize(location); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # @return [Boolean] # - # source://prism/lib/prism/node.rb#16226 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/parse_result/comments.rb#68 + def encloses?(comment); end - # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } - # - # source://prism/lib/prism/node.rb#16254 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/parse_result/comments.rb#64 + def end_offset; end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#16272 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/parse_result/comments.rb#72 + def leading_comment(comment); end - # attr_reader name: Symbol - # - # source://prism/lib/prism/node.rb#16263 - sig { returns(Symbol) } - def name; end + # source://prism/lib/prism/parse_result/comments.rb#54 + def location; end - # def repeated_parameter?: () -> bool + # source://prism/lib/prism/parse_result/comments.rb#60 + def start_offset; end + + # source://prism/lib/prism/parse_result/comments.rb#76 + def trailing_comment(comment); end +end + +# A target for attaching comments that is based on a specific node's +# location. +# +# source://prism/lib/prism/parse_result/comments.rb#22 +class Prism::ParseResult::Comments::NodeTarget + # @return [NodeTarget] a new instance of NodeTarget # + # source://prism/lib/prism/parse_result/comments.rb#25 + def initialize(node); end + # @return [Boolean] # - # source://prism/lib/prism/node.rb#16267 - sig { returns(T::Boolean) } - def repeated_parameter?; end + # source://prism/lib/prism/parse_result/comments.rb#37 + def encloses?(comment); 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 - # - # source://prism/lib/prism/node.rb#16294 - def type; end + # source://prism/lib/prism/parse_result/comments.rb#33 + def end_offset; end - private + # source://prism/lib/prism/parse_result/comments.rb#42 + def leading_comment(comment); end - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#16259 - sig { returns(Integer) } - def flags; end + # source://prism/lib/prism/parse_result/comments.rb#23 + def node; 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 - # - # source://prism/lib/prism/node.rb#16304 - def type; end - end + # source://prism/lib/prism/parse_result/comments.rb#29 + def start_offset; end + + # source://prism/lib/prism/parse_result/comments.rb#46 + def trailing_comment(comment); end end -# Represents an expression modified with a rescue. +# 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: # -# foo rescue nil -# ^^^^^^^^^^^^^^ +# * if statements +# * unless statements +# * nodes that are children of statements lists # -# source://prism/lib/prism/node.rb#16313 -class Prism::RescueModifierNode < ::Prism::Node - # def initialize: (Node expression, Location keyword_loc, Node rescue_expression, Location location) -> void +# In order to keep track of the newlines, we have a list of offsets that +# come back from the parser. We assign these offsets to the first nodes that +# we find in the tree that are on those lines. +# +# Note that the logic in this file should be kept in sync with the Java +# MarkNewlinesVisitor, since that visitor is responsible for marking the +# newlines for JRuby/TruffleRuby. +# +# 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 [RescueModifierNode] a new instance of RescueModifierNode + # @return [Newlines] a new instance of Newlines # - # source://prism/lib/prism/node.rb#16315 - def initialize(source, expression, keyword_loc, rescue_expression, location); end + # source://prism/lib/prism/parse_result/newlines.rb#27 + def initialize(lines); end - # def accept: (Visitor visitor) -> void + # Permit block/lambda nodes to mark newlines within themselves. # - # source://prism/lib/prism/node.rb#16325 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/parse_result/newlines.rb#33 + def visit_block_node(node); end - # def child_nodes: () -> Array[nil | Node] + # Mark if/unless nodes as newlines. # - # source://prism/lib/prism/node.rb#16334 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/parse_result/newlines.rb#47 + def visit_if_node(node); end - # def comment_targets: () -> Array[Node | Location] + # Permit block/lambda nodes to mark newlines within themselves. # - # source://prism/lib/prism/node.rb#16344 - def comment_targets; end + # source://prism/lib/prism/parse_result/newlines.rb#33 + def visit_lambda_node(node); end - # def compact_child_nodes: () -> Array[Node] + # Permit statements lists to mark newlines within themselves. # - # source://prism/lib/prism/node.rb#16339 - def compact_child_nodes; end + # source://prism/lib/prism/parse_result/newlines.rb#55 + def visit_statements_node(node); end - # def copy: (**params) -> RescueModifierNode + # Mark if/unless nodes as newlines. # - # source://prism/lib/prism/node.rb#16349 - sig { params(params: T.untyped).returns(Prism::RescueModifierNode) } - def copy(**params); end + # source://prism/lib/prism/parse_result/newlines.rb#47 + def visit_unless_node(node); end +end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] +# This represents a warning that was encountered during parsing. +# +# source://prism/lib/prism/parse_result.rb#485 +class Prism::ParseWarning + # Create a new warning object with the given message and location. # - # source://prism/lib/prism/node.rb#16334 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end - - # def deconstruct_keys: (Array[Symbol] keys) -> { expression: Node, keyword_loc: Location, rescue_expression: Node, location: Location } + # @return [ParseWarning] a new instance of ParseWarning # - # source://prism/lib/prism/node.rb#16363 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/parse_result.rb#500 + sig { params(type: Symbol, message: String, location: Prism::Location, level: Symbol).void } + def initialize(type, message, location, level); end - # attr_reader expression: Node + # Implement the hash pattern matching interface for ParseWarning. # - # source://prism/lib/prism/node.rb#16368 - sig { returns(Prism::Node) } - def expression; end + # source://prism/lib/prism/parse_result.rb#508 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # Returns a string representation of this warning. # - # source://prism/lib/prism/node.rb#16386 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/parse_result.rb#513 + sig { returns(String) } + def inspect; end - # def keyword: () -> String + # The level of this warning. # - # source://prism/lib/prism/node.rb#16381 - sig { returns(String) } - def keyword; end + # source://prism/lib/prism/parse_result.rb#497 + sig { returns(Symbol) } + def level; end - # attr_reader keyword_loc: Location + # A Location object representing the location of this warning in the source. # - # source://prism/lib/prism/node.rb#16371 + # source://prism/lib/prism/parse_result.rb#494 sig { returns(Prism::Location) } - def keyword_loc; end + def location; end - # attr_reader rescue_expression: Node + # The message associated with this warning. # - # source://prism/lib/prism/node.rb#16377 - sig { returns(Prism::Node) } - def rescue_expression; end - - # source://prism/lib/prism/node.rb#16329 - def set_newline_flag(newline_marked); end + # source://prism/lib/prism/parse_result.rb#491 + sig { returns(String) } + def message; 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 + # 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/node.rb#16410 + # source://prism/lib/prism/parse_result.rb#488 + sig { 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 - # - # source://prism/lib/prism/node.rb#16420 - def type; end - end end -# Represents a rescue statement. +# A pattern is an object that wraps a Ruby pattern matching expression. The +# expression would normally be passed to an `in` clause within a `case` +# expression or a rightward assignment expression. For example, in the +# following snippet: # -# begin -# rescue Foo, *splat, Bar => ex -# foo -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# case node +# in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] # end # -# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. +# the pattern is the ConstantPathNode[...] expression. # -# source://prism/lib/prism/node.rb#16434 -class Prism::RescueNode < ::Prism::Node - # def initialize: (Location keyword_loc, Array[Node] exceptions, Location? operator_loc, Node? reference, StatementsNode? statements, RescueNode? consequent, Location location) -> void +# The pattern gets compiled into an object that responds to #call by running +# the #compile method. This method itself will run back through Prism to +# parse the expression into a tree, then walk the tree to generate the +# necessary callable objects. For example, if you wanted to compile the +# expression above into a callable, you would: +# +# callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile +# callable.call(node) +# +# The callable object returned by #compile is guaranteed to respond to #call +# with a single argument, which is the node to match against. It also is +# guaranteed to respond to #===, which means it itself can be used in a `case` +# expression, as in: +# +# case node +# when callable +# end +# +# If the query given to the initializer cannot be compiled into a valid +# matcher (either because of a syntax error or because it is using syntax we +# do not yet support) then a Prism::Pattern::CompilationError will be +# raised. +# +# source://prism/lib/prism/pattern.rb#37 +class Prism::Pattern + # Create a new pattern with the given query. The query should be a string + # containing a Ruby pattern matching expression. # - # @return [RescueNode] a new instance of RescueNode + # @return [Pattern] a new instance of Pattern # - # source://prism/lib/prism/node.rb#16436 - def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end + # source://prism/lib/prism/pattern.rb#63 + def initialize(query); end - # def accept: (Visitor visitor) -> void + # Compile the query into a callable object that can be used to match against + # nodes. # - # source://prism/lib/prism/node.rb#16449 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end - - # def child_nodes: () -> Array[nil | Node] + # @raise [CompilationError] # - # source://prism/lib/prism/node.rb#16454 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end + # source://prism/lib/prism/pattern.rb#70 + def compile; end - # def comment_targets: () -> Array[Node | Location] + # The query that this pattern was initialized with. # - # source://prism/lib/prism/node.rb#16469 - def comment_targets; end + # source://prism/lib/prism/pattern.rb#59 + def query; end - # def compact_child_nodes: () -> Array[Node] + # Scan the given node and all of its children for nodes that match the + # pattern. If a block is given, it will be called with each node that + # matches the pattern. If no block is given, an enumerator will be returned + # that will yield each node that matches the pattern. # - # source://prism/lib/prism/node.rb#16459 - def compact_child_nodes; end + # source://prism/lib/prism/pattern.rb#86 + def scan(root); end - # attr_reader consequent: RescueNode? - # - # source://prism/lib/prism/node.rb#16523 - sig { returns(T.nilable(Prism::RescueNode)) } - def consequent; end + private - # def copy: (**params) -> RescueNode + # Shortcut for combining two procs into one that returns true if both return + # true. # - # source://prism/lib/prism/node.rb#16474 - sig { params(params: T.untyped).returns(Prism::RescueNode) } - def copy(**params); end + # source://prism/lib/prism/pattern.rb#102 + def combine_and(left, right); end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # Shortcut for combining two procs into one that returns true if either + # returns true. # - # source://prism/lib/prism/node.rb#16454 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/pattern.rb#108 + def combine_or(left, right); end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, exceptions: Array[Node], operator_loc: Location?, reference: Node?, statements: StatementsNode?, consequent: RescueNode?, location: Location } + # in foo | bar # - # source://prism/lib/prism/node.rb#16491 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end + # source://prism/lib/prism/pattern.rb#143 + def compile_alternation_pattern_node(node); end - # attr_reader exceptions: Array[Node] + # in [foo, bar, baz] # - # source://prism/lib/prism/node.rb#16502 - sig { returns(T::Array[Prism::Node]) } - def exceptions; end + # source://prism/lib/prism/pattern.rb#118 + def compile_array_pattern_node(node); end - # def inspect(NodeInspector inspector) -> String + # Compile a name associated with a constant. # - # source://prism/lib/prism/node.rb#16537 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/pattern.rb#168 + def compile_constant_name(node, name); end - # def keyword: () -> String + # in Prism::ConstantReadNode # - # source://prism/lib/prism/node.rb#16527 - sig { returns(String) } - def keyword; end + # source://prism/lib/prism/pattern.rb#148 + def compile_constant_path_node(node); end - # attr_reader keyword_loc: Location + # in ConstantReadNode + # in String # - # source://prism/lib/prism/node.rb#16496 - sig { returns(Prism::Location) } - def keyword_loc; end + # source://prism/lib/prism/pattern.rb#163 + def compile_constant_read_node(node); end - # def operator: () -> String? + # Raise an error because the given node is not supported. # - # source://prism/lib/prism/node.rb#16532 - sig { returns(T.nilable(String)) } - def operator; end + # @raise [CompilationError] + # + # source://prism/lib/prism/pattern.rb#113 + def compile_error(node); end - # attr_reader operator_loc: Location? + # in InstanceVariableReadNode[name: Symbol] + # in { name: Symbol } # - # source://prism/lib/prism/node.rb#16505 - sig { returns(T.nilable(Prism::Location)) } - def operator_loc; end + # source://prism/lib/prism/pattern.rb#184 + def compile_hash_pattern_node(node); end - # attr_reader reference: Node? + # in nil # - # source://prism/lib/prism/node.rb#16517 - sig { returns(T.nilable(Prism::Node)) } - def reference; end + # source://prism/lib/prism/pattern.rb#214 + def compile_nil_node(node); end - # attr_reader statements: StatementsNode? + # Compile any kind of node. Dispatch out to the individual compilation + # methods based on the type of node. # - # source://prism/lib/prism/node.rb#16520 - sig { returns(T.nilable(Prism::StatementsNode)) } - def statements; end + # source://prism/lib/prism/pattern.rb#243 + def compile_node(node); 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. + # in /foo/ # - # 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/pattern.rb#219 + def compile_regular_expression_node(node); end + + # in "" + # in "foo" # - # def type: () -> Symbol + # source://prism/lib/prism/pattern.rb#227 + def compile_string_node(node); end + + # in :+ + # in :foo # - # source://prism/lib/prism/node.rb#16577 - def type; end + # source://prism/lib/prism/pattern.rb#235 + def compile_symbol_node(node); end +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 - # - # source://prism/lib/prism/node.rb#16587 - def type; end - end +# Raised when the query given to a pattern is either invalid Ruby syntax or +# is using syntax that we don't yet support. +# +# source://prism/lib/prism/pattern.rb#40 +class Prism::Pattern::CompilationError < ::StandardError + # Create a new CompilationError with the given representation of the node + # that caused the error. + # + # @return [CompilationError] a new instance of CompilationError + # + # source://prism/lib/prism/pattern.rb#43 + def initialize(repr); end end -# Represents a rest parameter to a method, block, or lambda definition. +# Represents the use of the `^` operator for pinning an expression in a pattern matching expression. # -# def a(*b) -# ^^ -# end +# foo in ^(bar) +# ^^^^^^ # -# source://prism/lib/prism/node.rb#16597 -class Prism::RestParameterNode < ::Prism::Node - # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void +# source://prism/lib/prism/node.rb#14793 +class Prism::PinnedExpressionNode < ::Prism::Node + # def initialize: (Prism::node expression, Location operator_loc, Location lparen_loc, Location rparen_loc, Location location) -> void # - # @return [RestParameterNode] a new instance of RestParameterNode + # @return [PinnedExpressionNode] a new instance of PinnedExpressionNode # - # source://prism/lib/prism/node.rb#16599 - def initialize(source, flags, name, name_loc, operator_loc, location); end + # source://prism/lib/prism/node.rb#14795 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, expression, operator_loc, lparen_loc, rparen_loc, location); 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#14911 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#16610 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14805 + 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#16615 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14810 + 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#16625 + # source://prism/lib/prism/node.rb#14820 + 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#16620 + # source://prism/lib/prism/node.rb#14815 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> RestParameterNode + # def copy: (?expression: Prism::node, ?operator_loc: Location, ?lparen_loc: Location, ?rparen_loc: Location, ?location: Location) -> PinnedExpressionNode # - # source://prism/lib/prism/node.rb#16630 - sig { params(params: T.untyped).returns(Prism::RestParameterNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14825 + sig do + params( + expression: Prism::Node, + operator_loc: Prism::Location, + lparen_loc: Prism::Location, + rparen_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#16615 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14810 + 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) -> { expression: Prism::node, operator_loc: Location, lparen_loc: Location, rparen_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#16645 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14833 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # attr_reader expression: Prism::node # - # source://prism/lib/prism/node.rb#16686 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#14838 + sig { returns(Prism::Node) } + def expression; end - # attr_reader name: Symbol? + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#16654 - sig { returns(T.nilable(Symbol)) } - def name; end + # source://prism/lib/prism/node.rb#14877 + sig { override.returns(String) } + def inspect; end - # attr_reader name_loc: Location? + # def lparen: () -> String # - # source://prism/lib/prism/node.rb#16657 - sig { returns(T.nilable(Prism::Location)) } - def name_loc; end + # source://prism/lib/prism/node.rb#14867 + sig { returns(String) } + def lparen; end + + # attr_reader lparen_loc: Location + # + # source://prism/lib/prism/node.rb#14848 + sig { returns(Prism::Location) } + def lparen_loc; end # def operator: () -> String # - # source://prism/lib/prism/node.rb#16681 + # source://prism/lib/prism/node.rb#14862 sig { returns(String) } def operator; end # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#16669 + # source://prism/lib/prism/node.rb#14841 sig { returns(Prism::Location) } def operator_loc; end - # def repeated_parameter?: () -> bool + # def rparen: () -> String # - # @return [Boolean] + # source://prism/lib/prism/node.rb#14872 + sig { returns(String) } + def rparen; end + + # attr_reader rparen_loc: Location # - # source://prism/lib/prism/node.rb#16676 - sig { returns(T::Boolean) } - def repeated_parameter?; end + # source://prism/lib/prism/node.rb#14855 + 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 @@ -24313,17 +27084,10 @@ class Prism::RestParameterNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#16714 + # source://prism/lib/prism/node.rb#14895 + sig { override.returns(Symbol) } def type; end - private - - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#16650 - 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. @@ -24332,74 +27096,108 @@ class Prism::RestParameterNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#16724 + # source://prism/lib/prism/node.rb#14905 def type; end end end -# Represents the use of the `retry` keyword. +# Represents the use of the `^` operator for pinning a variable in a pattern matching expression. # -# retry -# ^^^^^ +# foo in ^bar +# ^^^^ # -# source://prism/lib/prism/node.rb#16733 -class Prism::RetryNode < ::Prism::Node - # def initialize: (Location location) -> void +# source://prism/lib/prism/node.rb#14924 +class Prism::PinnedVariableNode < ::Prism::Node + # def initialize: (Prism::node variable, Location operator_loc, Location location) -> void # - # @return [RetryNode] a new instance of RetryNode + # @return [PinnedVariableNode] a new instance of PinnedVariableNode # - # source://prism/lib/prism/node.rb#16735 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#14926 + sig do + params( + source: Prism::Source, + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, variable, operator_loc, location); 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#15016 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#16742 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#14934 + 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#16747 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14939 + 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#16757 + # source://prism/lib/prism/node.rb#14949 + 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#16752 + # source://prism/lib/prism/node.rb#14944 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> RetryNode + # def copy: (?variable: Prism::node, ?operator_loc: Location, ?location: Location) -> PinnedVariableNode # - # source://prism/lib/prism/node.rb#16762 - sig { params(params: T.untyped).returns(Prism::RetryNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#14954 + sig do + params( + variable: Prism::Node, + operator_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::PinnedVariableNode) + end + def copy(variable: T.unsafe(nil), operator_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#16747 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#14939 + 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) -> { variable: Prism::node, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#16773 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#14962 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#14982 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#14977 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#16779 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#14970 + 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 @@ -24416,9 +27214,16 @@ class Prism::RetryNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#16798 + # source://prism/lib/prism/node.rb#15000 + sig { override.returns(Symbol) } def type; end + # attr_reader variable: Prism::node + # + # source://prism/lib/prism/node.rb#14967 + sig { returns(Prism::Node) } + 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. @@ -24427,109 +27232,160 @@ class Prism::RetryNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#16808 + # source://prism/lib/prism/node.rb#15010 def type; end end end -# Represents the use of the `return` keyword. +# Represents the use of the `END` keyword. # -# return 1 -# ^^^^^^^^ +# END { foo } +# ^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#16817 -class Prism::ReturnNode < ::Prism::Node - # def initialize: (Location keyword_loc, ArgumentsNode? arguments, Location location) -> void +# source://prism/lib/prism/node.rb#15027 +class Prism::PostExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [ReturnNode] a new instance of ReturnNode + # @return [PostExecutionNode] a new instance of PostExecutionNode # - # source://prism/lib/prism/node.rb#16819 - def initialize(source, keyword_loc, arguments, location); end + # source://prism/lib/prism/node.rb#15029 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); end - # def accept: (Visitor visitor) -> void + # 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#16828 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#15147 + def ===(other); end - # attr_reader arguments: ArgumentsNode? + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#16874 - sig { returns(T.nilable(Prism::ArgumentsNode)) } - def arguments; end + # source://prism/lib/prism/node.rb#15039 + 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#16833 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism/lib/prism/node.rb#15108 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism/lib/prism/node.rb#15091 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#16845 + # source://prism/lib/prism/node.rb#15056 + 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#16838 + # source://prism/lib/prism/node.rb#15049 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> ReturnNode + # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PostExecutionNode # - # source://prism/lib/prism/node.rb#16850 - sig { params(params: T.untyped).returns(Prism::ReturnNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#15061 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#16833 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15044 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, arguments: ArgumentsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#16863 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#15069 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#16883 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15113 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#16878 + # source://prism/lib/prism/node.rb#15098 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#16868 + # source://prism/lib/prism/node.rb#15077 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. + # def opening: () -> String # - # 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 + # source://prism/lib/prism/node.rb#15103 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism/lib/prism/node.rb#15084 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism/lib/prism/node.rb#15074 + 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 # - # source://prism/lib/prism/node.rb#16909 + # source://prism/lib/prism/node.rb#15131 + sig { override.returns(Symbol) } def type; end class << self @@ -24540,74 +27396,142 @@ class Prism::ReturnNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#16919 + # source://prism/lib/prism/node.rb#15141 def type; end end end -# Represents the `self` keyword. +# Represents the use of the `BEGIN` keyword. # -# self -# ^^^^ +# BEGIN { foo } +# ^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#16928 -class Prism::SelfNode < ::Prism::Node - # def initialize: (Location location) -> void +# source://prism/lib/prism/node.rb#15160 +class Prism::PreExecutionNode < ::Prism::Node + # def initialize: (StatementsNode? statements, Location keyword_loc, Location opening_loc, Location closing_loc, Location location) -> void # - # @return [SelfNode] a new instance of SelfNode + # @return [PreExecutionNode] a new instance of PreExecutionNode # - # source://prism/lib/prism/node.rb#16930 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#15162 + sig do + params( + source: Prism::Source, + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, statements, keyword_loc, opening_loc, closing_loc, location); 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#15280 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#16937 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#15172 + 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#16942 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15177 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism/lib/prism/node.rb#15241 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism/lib/prism/node.rb#15224 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#16952 + # source://prism/lib/prism/node.rb#15189 + 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#16947 + # source://prism/lib/prism/node.rb#15182 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SelfNode + # def copy: (?statements: StatementsNode?, ?keyword_loc: Location, ?opening_loc: Location, ?closing_loc: Location, ?location: Location) -> PreExecutionNode # - # source://prism/lib/prism/node.rb#16957 - sig { params(params: T.untyped).returns(Prism::SelfNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#15194 + sig do + params( + statements: T.nilable(Prism::StatementsNode), + keyword_loc: Prism::Location, + opening_loc: Prism::Location, + closing_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#16942 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15177 + 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) -> { statements: StatementsNode?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#16968 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#15202 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#16974 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15246 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism/lib/prism/node.rb#15231 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism/lib/prism/node.rb#15210 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def opening: () -> String + # + # source://prism/lib/prism/node.rb#15236 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism/lib/prism/node.rb#15217 + sig { returns(Prism::Location) } + def opening_loc; end + + # attr_reader statements: StatementsNode? + # + # source://prism/lib/prism/node.rb#15207 + 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 @@ -24624,7 +27548,8 @@ class Prism::SelfNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#16993 + # source://prism/lib/prism/node.rb#15264 + sig { override.returns(Symbol) } def type; end class << self @@ -24635,294 +27560,467 @@ class Prism::SelfNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17003 + # source://prism/lib/prism/node.rb#15274 def type; end end end -# A module responsible for deserializing parse results. +# The top level node of any parse tree. # -# source://prism/lib/prism/serialize.rb#23 -module Prism::Serialize - class << self - # Deserialize the AST represented by the given string into a parse result. - # - # source://prism/lib/prism/serialize.rb#37 - def load(input, serialized); end - - # Deserialize the tokens represented by the given string into a parse - # result. - # - # source://prism/lib/prism/serialize.rb#49 - def load_tokens(source, serialized); end +# source://prism/lib/prism/node.rb#15290 +class Prism::ProgramNode < ::Prism::Node + # def initialize: (Array[Symbol] locals, StatementsNode statements, Location location) -> void + # + # @return [ProgramNode] a new instance of ProgramNode + # + # source://prism/lib/prism/node.rb#15292 + sig do + params( + source: Prism::Source, + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).void end -end + def initialize(source, locals, statements, location); end -# source://prism/lib/prism/serialize.rb#53 -class Prism::Serialize::Loader - # @return [Loader] a new instance of Loader + # 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/serialize.rb#58 - def initialize(source, serialized); end + # source://prism/lib/prism/node.rb#15373 + def ===(other); end - # Returns the value of attribute constant_pool. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/serialize.rb#55 - def constant_pool; end + # source://prism/lib/prism/node.rb#15300 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Returns the value of attribute constant_pool_offset. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/serialize.rb#55 - def constant_pool_offset; end + # source://prism/lib/prism/node.rb#15305 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Returns the value of attribute encoding. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/serialize.rb#54 - def encoding; end + # source://prism/lib/prism/node.rb#15315 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Returns the value of attribute input. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/serialize.rb#54 - def input; end + # source://prism/lib/prism/node.rb#15310 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Returns the value of attribute io. + # def copy: (?locals: Array[Symbol], ?statements: StatementsNode, ?location: Location) -> ProgramNode # - # source://prism/lib/prism/serialize.rb#54 - def io; end + # source://prism/lib/prism/node.rb#15320 + sig do + params( + locals: T::Array[Symbol], + statements: Prism::StatementsNode, + location: Prism::Location + ).returns(Prism::ProgramNode) + end + def copy(locals: T.unsafe(nil), statements: T.unsafe(nil), location: T.unsafe(nil)); end - # source://prism/lib/prism/serialize.rb#96 - def load_comments; end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#15305 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism/lib/prism/serialize.rb#82 - def load_encoding; end + # def deconstruct_keys: (Array[Symbol] keys) -> { locals: Array[Symbol], statements: StatementsNode, location: Location } + # + # source://prism/lib/prism/node.rb#15328 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # source://prism/lib/prism/serialize.rb#73 - def load_header; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # source://prism/lib/prism/serialize.rb#92 - def load_line_offsets; end + # def inspect -> String + # + # source://prism/lib/prism/node.rb#15339 + sig { override.returns(String) } + def inspect; end - # source://prism/lib/prism/serialize.rb#106 - def load_metadata; end + # attr_reader locals: Array[Symbol] + # + # source://prism/lib/prism/node.rb#15333 + sig { returns(T::Array[Symbol]) } + def locals; end - # source://prism/lib/prism/serialize.rb#140 - def load_nodes; end + # attr_reader statements: StatementsNode + # + # source://prism/lib/prism/node.rb#15336 + sig { returns(Prism::StatementsNode) } + def statements; end - # source://prism/lib/prism/serialize.rb#154 - def load_result; 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 + # + # source://prism/lib/prism/node.rb#15357 + sig { override.returns(Symbol) } + def type; end - # source://prism/lib/prism/serialize.rb#88 - def load_start_line; 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 + # + # source://prism/lib/prism/node.rb#15367 + def type; end + end +end - # source://prism/lib/prism/serialize.rb#115 - def load_tokens; end +# Flags for range and flip-flop nodes. +# +# source://prism/lib/prism/node.rb#19208 +module Prism::RangeFlags; end - # source://prism/lib/prism/serialize.rb#128 - def load_tokens_result; end +# ... operator +# +# source://prism/lib/prism/node.rb#19210 +Prism::RangeFlags::EXCLUDE_END = T.let(T.unsafe(nil), Integer) - # Returns the value of attribute serialized. +# Represents the use of the `..` or `...` operators. +# +# 1..2 +# ^^^^ +# +# c if a =~ /left/ ... b =~ /right/ +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#15388 +class Prism::RangeNode < ::Prism::Node + # def initialize: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, Location location) -> void # - # source://prism/lib/prism/serialize.rb#54 - def serialized; end + # @return [RangeNode] a new instance of RangeNode + # + # source://prism/lib/prism/node.rb#15390 + sig do + params( + source: Prism::Source, + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, left, right, operator_loc, location); end - # Returns the value of attribute source. + # 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/serialize.rb#55 - def source; end + # source://prism/lib/prism/node.rb#15510 + def ===(other); end - # Returns the value of attribute start_line. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/serialize.rb#56 - def start_line; end + # source://prism/lib/prism/node.rb#15400 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - private + # def child_nodes: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#15405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # source://prism/lib/prism/serialize.rb#217 - def load_constant(index); end + # def comment_targets: () -> Array[Node | Location] + # + # source://prism/lib/prism/node.rb#15418 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # source://prism/lib/prism/serialize.rb#193 - def load_embedded_string; end + # def compact_child_nodes: () -> Array[Node] + # + # source://prism/lib/prism/node.rb#15410 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # source://prism/lib/prism/serialize.rb#247 - def load_error_level; end + # def copy: (?flags: Integer, ?left: Prism::node?, ?right: Prism::node?, ?operator_loc: Location, ?location: Location) -> RangeNode + # + # source://prism/lib/prism/node.rb#15423 + sig do + params( + flags: Integer, + left: T.nilable(Prism::Node), + right: T.nilable(Prism::Node), + operator_loc: Prism::Location, + location: 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 - # source://prism/lib/prism/serialize.rb#209 - def load_location; end + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#15405 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # source://prism/lib/prism/serialize.rb#274 - def load_node; end + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, left: Prism::node?, right: Prism::node?, operator_loc: Location, location: Location } + # + # source://prism/lib/prism/node.rb#15431 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # source://prism/lib/prism/serialize.rb#242 - def load_optional_constant; end + # def exclude_end?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15466 + sig { returns(T::Boolean) } + def exclude_end?; end - # source://prism/lib/prism/serialize.rb#213 - def load_optional_location; end - - # source://prism/lib/prism/serialize.rb#186 - def load_optional_node; end - - # source://prism/lib/prism/serialize.rb#238 - def load_required_constant; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # source://prism/lib/prism/serialize.rb#182 - def load_serialized_length; end + # def inspect -> String + # + # source://prism/lib/prism/node.rb#15476 + sig { override.returns(String) } + def inspect; end - # source://prism/lib/prism/serialize.rb#197 - def load_string; end + # The left-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # 1... + # ^ + # + # hello...goodbye + # ^^^^^ + # + # source://prism/lib/prism/node.rb#15446 + sig { returns(T.nilable(Prism::Node)) } + def left; end - # source://prism/lib/prism/serialize.rb#177 - def load_varsint; end + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#15471 + sig { returns(String) } + def operator; end - # variable-length integer using https://en.wikipedia.org/wiki/LEB128 - # This is also what protobuf uses: https://protobuf.dev/programming-guides/encoding/#varints + # The location of the `..` or `...` operator. # - # source://prism/lib/prism/serialize.rb#163 - def load_varuint; end + # source://prism/lib/prism/node.rb#15459 + sig { returns(Prism::Location) } + def operator_loc; end - # source://prism/lib/prism/serialize.rb#260 - def load_warning_level; end -end + # The right-hand side of the range, if present. It can be either `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + # + # ..5 + # ^ + # + # 1...foo + # ^^^ + # If neither right-hand or left-hand side was included, this will be a MissingNode. + # + # source://prism/lib/prism/node.rb#15456 + sig { returns(T.nilable(Prism::Node)) } + def right; end -# The major version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism/lib/prism/serialize.rb#26 -Prism::Serialize::MAJOR_VERSION = T.let(T.unsafe(nil), Integer) + # 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 + # + # source://prism/lib/prism/node.rb#15494 + sig { override.returns(Symbol) } + def type; end -# The minor version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism/lib/prism/serialize.rb#30 -Prism::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) + protected -# The patch version of prism that we are expecting to find in the serialized -# strings. -# -# source://prism/lib/prism/serialize.rb#34 -Prism::Serialize::PATCH_VERSION = T.let(T.unsafe(nil), Integer) + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#15436 + sig { returns(Integer) } + def flags; end -# The token types that can be indexed by their enum values. -# -# source://prism/lib/prism/serialize.rb#1482 -Prism::Serialize::TOKEN_TYPES = T.let(T.unsafe(nil), Array) + 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 + # + # source://prism/lib/prism/node.rb#15504 + def type; end + end +end -# Represents a singleton class declaration involving the `class` keyword. +# Represents a rational number literal. # -# class << self end -# ^^^^^^^^^^^^^^^^^ +# 1.0r +# ^^^^ # -# source://prism/lib/prism/node.rb#17012 -class Prism::SingletonClassNode < ::Prism::Node - # def initialize: (Array[Symbol] locals, Location class_keyword_loc, Location operator_loc, Node expression, Node? body, Location end_keyword_loc, Location location) -> void +# source://prism/lib/prism/node.rb#15523 +class Prism::RationalNode < ::Prism::Node + # def initialize: (Integer flags, Integer numerator, Integer denominator, Location location) -> void # - # @return [SingletonClassNode] a new instance of SingletonClassNode + # @return [RationalNode] a new instance of RationalNode # - # source://prism/lib/prism/node.rb#17014 - def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end + # source://prism/lib/prism/node.rb#15525 + sig do + params( + source: Prism::Source, + flags: Integer, + numerator: Integer, + denominator: Integer, + location: Prism::Location + ).void + end + def initialize(source, flags, numerator, denominator, location); 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#15635 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17027 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#15534 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end - # attr_reader body: Node? + # def binary?: () -> bool # - # source://prism/lib/prism/node.rb#17090 - sig { returns(T.nilable(Prism::Node)) } - def body; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15581 + sig { returns(T::Boolean) } + def binary?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17032 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15539 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def class_keyword: () -> String - # - # source://prism/lib/prism/node.rb#17100 - sig { returns(String) } - def class_keyword; end - - # attr_reader class_keyword_loc: Location - # - # source://prism/lib/prism/node.rb#17075 - sig { returns(Prism::Location) } - def class_keyword_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#17045 + # source://prism/lib/prism/node.rb#15549 + 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#17037 + # source://prism/lib/prism/node.rb#15544 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SingletonClassNode + # def copy: (?flags: Integer, ?numerator: Integer, ?denominator: Integer, ?location: Location) -> RationalNode + # + # source://prism/lib/prism/node.rb#15554 + sig do + params( + flags: Integer, + numerator: Integer, + denominator: Integer, + location: Prism::Location + ).returns(Prism::RationalNode) + end + def copy(flags: T.unsafe(nil), numerator: T.unsafe(nil), denominator: T.unsafe(nil), location: T.unsafe(nil)); end + + # def decimal?: () -> bool # - # source://prism/lib/prism/node.rb#17050 - sig { params(params: T.untyped).returns(Prism::SingletonClassNode) } - def copy(**params); end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15586 + sig { returns(T::Boolean) } + def decimal?; end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17032 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15539 + 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: Node, body: Node?, end_keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, numerator: Integer, denominator: Integer, location: Location } # - # source://prism/lib/prism/node.rb#17067 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#15562 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def end_keyword: () -> String + # The denominator of the rational number. # - # source://prism/lib/prism/node.rb#17110 - sig { returns(String) } - def end_keyword; end - - # attr_reader end_keyword_loc: Location + # 1.5r # denominator 2 # - # source://prism/lib/prism/node.rb#17093 - sig { returns(Prism::Location) } - def end_keyword_loc; end + # source://prism/lib/prism/node.rb#15578 + sig { returns(Integer) } + def denominator; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # attr_reader expression: Node + # def hexadecimal?: () -> bool # - # source://prism/lib/prism/node.rb#17087 - sig { returns(Prism::Node) } - def expression; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15596 + sig { returns(T::Boolean) } + def hexadecimal?; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#17115 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15601 + sig { override.returns(String) } + def inspect; end - # attr_reader locals: Array[Symbol] + # The numerator of the rational number. # - # source://prism/lib/prism/node.rb#17072 - sig { returns(T::Array[Symbol]) } - def locals; end + # 1.5r # numerator 3 + # + # source://prism/lib/prism/node.rb#15573 + sig { returns(Integer) } + def numerator; end - # def operator: () -> String + # 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.rb#17105 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node_ext.rb#114 + def numeric; end - # attr_reader operator_loc: Location + # def octal?: () -> bool # - # source://prism/lib/prism/node.rb#17081 - sig { returns(Prism::Location) } - def operator_loc; end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15591 + 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 @@ -24939,9 +28037,24 @@ class Prism::SingletonClassNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17146 + # source://prism/lib/prism/node.rb#15619 + sig { override.returns(Symbol) } def type; end + # Returns the value of the node as a Ruby Rational. + # + # source://prism/lib/prism/node_ext.rb#108 + sig { returns(Rational) } + def value; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#15567 + 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. @@ -24950,172 +28063,90 @@ class Prism::SingletonClassNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17156 + # source://prism/lib/prism/node.rb#15629 def type; end end end -# This represents a source of Ruby code that has been parsed. It is used in -# conjunction with locations to allow them to resolve line numbers and source -# ranges. +# Represents the use of the `redo` keyword. # -# source://prism/lib/prism/parse_result.rb#7 -class Prism::Source - # Create a new source object with the given source code. +# redo +# ^^^^ +# +# source://prism/lib/prism/node.rb#15647 +class Prism::RedoNode < ::Prism::Node + # def initialize: (Location location) -> void # - # @return [Source] a new instance of Source + # @return [RedoNode] a new instance of RedoNode # - # source://prism/lib/prism/parse_result.rb#18 - def initialize(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15649 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # Return the column number in characters for the given byte offset. + # 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/parse_result.rb#53 - def character_column(byte_offset); end + # source://prism/lib/prism/node.rb#15722 + def ===(other); end - # Return the character offset for the given byte offset. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/parse_result.rb#48 - def character_offset(byte_offset); end + # source://prism/lib/prism/node.rb#15655 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Returns the column number in code units for the given encoding for the - # given byte offset. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#70 - def code_units_column(byte_offset, encoding); end + # source://prism/lib/prism/node.rb#15660 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Returns the offset from the start of the file for the given byte offset - # counting in code units for the given encoding. - # - # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the - # concept of code units that differs from the number of characters in other - # encodings, it is not captured here. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/parse_result.rb#63 - def code_units_offset(byte_offset, encoding); end + # source://prism/lib/prism/node.rb#15670 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Return the column number for the given byte offset. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/parse_result.rb#43 - def column(byte_offset); end + # source://prism/lib/prism/node.rb#15665 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Binary search through the offsets to find the line number for the given - # byte offset. + # def copy: (?location: Location) -> RedoNode # - # source://prism/lib/prism/parse_result.rb#32 - def line(byte_offset); end + # source://prism/lib/prism/node.rb#15675 + sig { params(location: Prism::Location).returns(Prism::RedoNode) } + def copy(location: T.unsafe(nil)); end - sig { params(value: Integer).returns(Integer) } - def line_offset(value); end - - # Return the byte offset of the start of the line corresponding to the given - # byte offset. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/parse_result.rb#38 - def line_start(byte_offset); end + # source://prism/lib/prism/node.rb#15660 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # The list of newline byte offsets in the source code. + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/parse_result.rb#15 - sig { returns(T::Array[Integer]) } - def offsets; end + # source://prism/lib/prism/node.rb#15683 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Perform a byteslice on the source code using the given byte offset and - # byte length. - # - # source://prism/lib/prism/parse_result.rb#26 - def slice(byte_offset, length); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # The source code that this source object represents. + # def inspect -> String # - # source://prism/lib/prism/parse_result.rb#9 - sig { returns(String) } - def source; end + # source://prism/lib/prism/node.rb#15688 + sig { override.returns(String) } + def inspect; end - # The line number where this source starts. - # - # source://prism/lib/prism/parse_result.rb#12 - def start_line; end - - private - - # Binary search through the offsets to find the line number for the given - # byte offset. - # - # source://prism/lib/prism/parse_result.rb#78 - def find_line(byte_offset); end -end - -# Represents the use of the `__ENCODING__` keyword. -# -# __ENCODING__ -# ^^^^^^^^^^^^ -# -# source://prism/lib/prism/node.rb#17165 -class Prism::SourceEncodingNode < ::Prism::Node - # def initialize: (Location location) -> void - # - # @return [SourceEncodingNode] a new instance of SourceEncodingNode - # - # source://prism/lib/prism/node.rb#17167 - def initialize(source, location); end - - # def accept: (Visitor visitor) -> void - # - # source://prism/lib/prism/node.rb#17174 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end - - # def child_nodes: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#17179 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end - - # def comment_targets: () -> Array[Node | Location] - # - # source://prism/lib/prism/node.rb#17189 - def comment_targets; end - - # def compact_child_nodes: () -> Array[Node] - # - # source://prism/lib/prism/node.rb#17184 - def compact_child_nodes; end - - # def copy: (**params) -> SourceEncodingNode - # - # source://prism/lib/prism/node.rb#17194 - sig { params(params: T.untyped).returns(Prism::SourceEncodingNode) } - def copy(**params); end - - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#17179 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end - - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } - # - # source://prism/lib/prism/node.rb#17205 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end - - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#17211 - def inspect(inspector = T.unsafe(nil)); 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. + # 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 @@ -25125,7 +28156,8 @@ class Prism::SourceEncodingNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17230 + # source://prism/lib/prism/node.rb#15706 + sig { override.returns(Symbol) } def type; end class << self @@ -25136,194 +28168,455 @@ class Prism::SourceEncodingNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17240 + # source://prism/lib/prism/node.rb#15716 def type; end end end -# Represents the use of the `__FILE__` keyword. +# The Reflection module provides the ability to reflect on the structure of +# the syntax tree itself, as opposed to looking at a single syntax tree. This +# is useful in metaprogramming contexts. # -# __FILE__ -# ^^^^^^^^ +# source://prism/lib/prism/reflection.rb#13 +module Prism::Reflection + class << self + # Returns the fields for the given node. + # + # source://prism/lib/prism/reflection.rb#104 + sig { params(node: T.class_of(Prism::Node)).returns(T::Array[Prism::Reflection::Field]) } + def fields_for(node); end + end +end + +# A constant field represents a constant value on a node. Effectively, it +# represents an identifier found within the source. It resolves to a symbol +# in Ruby. # -# source://prism/lib/prism/node.rb#17249 -class Prism::SourceFileNode < ::Prism::Node - # def initialize: (String filepath, Location location) -> void +# source://prism/lib/prism/reflection.rb#45 +class Prism::Reflection::ConstantField < ::Prism::Reflection::Field; end + +# A constant list field represents a list of constant values on a node. It +# resolves to an array of symbols in Ruby. +# +# source://prism/lib/prism/reflection.rb#55 +class Prism::Reflection::ConstantListField < ::Prism::Reflection::Field; end + +# A field represents a single piece of data on a node. It is the base class +# for all other field types. +# +# source://prism/lib/prism/reflection.rb#16 +class Prism::Reflection::Field + # Initializes the field with the given name. # - # @return [SourceFileNode] a new instance of SourceFileNode + # @return [Field] a new instance of Field # - # source://prism/lib/prism/node.rb#17251 - def initialize(source, filepath, location); end + # source://prism/lib/prism/reflection.rb#21 + sig { params(name: Symbol).void } + def initialize(name); end - # def accept: (Visitor visitor) -> void + # The name of the field. # - # source://prism/lib/prism/node.rb#17259 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/reflection.rb#18 + sig { returns(Symbol) } + def name; end +end - # def child_nodes: () -> Array[nil | Node] +# A flags field represents a bitset of flags on a node. It resolves to an +# integer in Ruby. Note that the flags cannot be accessed directly on the +# node because the integer is kept private. Instead, the various flags in +# the bitset should be accessed through their query methods. +# +# source://prism/lib/prism/reflection.rb#92 +class Prism::Reflection::FlagsField < ::Prism::Reflection::Field + # Initializes the flags field with the given name and flags. # - # source://prism/lib/prism/node.rb#17264 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def child_nodes; end - - # def comment_targets: () -> Array[Node | Location] + # @return [FlagsField] a new instance of FlagsField # - # source://prism/lib/prism/node.rb#17274 - def comment_targets; end + # source://prism/lib/prism/reflection.rb#97 + sig { params(name: Symbol, flags: T::Array[Symbol]).void } + def initialize(name, flags); end - # def compact_child_nodes: () -> Array[Node] + # The names of the flags in the bitset. # - # source://prism/lib/prism/node.rb#17269 - def compact_child_nodes; end + # source://prism/lib/prism/reflection.rb#94 + sig { returns(T::Array[Symbol]) } + def flags; end +end - # def copy: (**params) -> SourceFileNode - # - # source://prism/lib/prism/node.rb#17279 - sig { params(params: T.untyped).returns(Prism::SourceFileNode) } - def copy(**params); end +# A float field represents a double-precision floating point value. It is +# used exclusively to represent the value of a floating point literal. It +# resolves to a Float in Ruby. +# +# source://prism/lib/prism/reflection.rb#85 +class Prism::Reflection::FloatField < ::Prism::Reflection::Field; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] - # - # source://prism/lib/prism/node.rb#17264 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end +# An integer field represents an integer value. It is used to represent the +# value of an integer literal, the depth of local variables, and the number +# of a numbered reference. It resolves to an Integer in Ruby. +# +# source://prism/lib/prism/reflection.rb#79 +class Prism::Reflection::IntegerField < ::Prism::Reflection::Field; end - # def deconstruct_keys: (Array[Symbol] keys) -> { filepath: String, location: Location } - # - # source://prism/lib/prism/node.rb#17291 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end - def deconstruct_keys(keys); end +# A location field represents the location of some part of the node in the +# source code. For example, the location of a keyword or an operator. It +# resolves to a Prism::Location in Ruby. +# +# source://prism/lib/prism/reflection.rb#67 +class Prism::Reflection::LocationField < ::Prism::Reflection::Field; end - # attr_reader filepath: String - # - # source://prism/lib/prism/node.rb#17296 - sig { returns(String) } - def filepath; end +# A node field represents a single child node in the syntax tree. It +# resolves to a Prism::Node in Ruby. +# +# source://prism/lib/prism/reflection.rb#28 +class Prism::Reflection::NodeField < ::Prism::Reflection::Field; end - # def inspect(NodeInspector inspector) -> String - # - # source://prism/lib/prism/node.rb#17300 - def inspect(inspector = T.unsafe(nil)); end +# A node list field represents a list of child nodes in the syntax tree. It +# resolves to an array of Prism::Node instances in Ruby. +# +# source://prism/lib/prism/reflection.rb#39 +class Prism::Reflection::NodeListField < ::Prism::Reflection::Field; 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 - # - # source://prism/lib/prism/node.rb#17320 - def type; end +# An optional constant field represents a constant value on a node that may +# or may not be present. It resolves to either a symbol or nil in Ruby. +# +# source://prism/lib/prism/reflection.rb#50 +class Prism::Reflection::OptionalConstantField < ::Prism::Reflection::Field; 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 - # - # source://prism/lib/prism/node.rb#17330 - def type; end - end -end +# An optional location field represents the location of some part of the +# node in the source code that may or may not be present. It resolves to +# either a Prism::Location or nil in Ruby. +# +# source://prism/lib/prism/reflection.rb#73 +class Prism::Reflection::OptionalLocationField < ::Prism::Reflection::Field; end -# Represents the use of the `__LINE__` keyword. +# An optional node field represents a single child node in the syntax tree +# that may or may not be present. It resolves to either a Prism::Node or nil +# in Ruby. # -# __LINE__ -# ^^^^^^^^ +# source://prism/lib/prism/reflection.rb#34 +class Prism::Reflection::OptionalNodeField < ::Prism::Reflection::Field; end + +# A string field represents a string value on a node. It almost always +# represents the unescaped value of a string-like literal. It resolves to a +# string in Ruby. # -# source://prism/lib/prism/node.rb#17339 -class Prism::SourceLineNode < ::Prism::Node - # def initialize: (Location location) -> void +# source://prism/lib/prism/reflection.rb#61 +class Prism::Reflection::StringField < ::Prism::Reflection::Field; end + +# Flags for regular expression and match last line nodes. +# +# source://prism/lib/prism/node.rb#19214 +module Prism::RegularExpressionFlags; end + +# n - forces the ASCII-8BIT encoding +# +# source://prism/lib/prism/node.rb#19231 +Prism::RegularExpressionFlags::ASCII_8BIT = T.let(T.unsafe(nil), Integer) + +# e - forces the EUC-JP encoding +# +# source://prism/lib/prism/node.rb#19228 +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#19219 +Prism::RegularExpressionFlags::EXTENDED = T.let(T.unsafe(nil), Integer) + +# internal bytes forced the encoding to binary +# +# source://prism/lib/prism/node.rb#19243 +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#19246 +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#19240 +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#19216 +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#19222 +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#19225 +Prism::RegularExpressionFlags::ONCE = T.let(T.unsafe(nil), Integer) + +# u - forces the UTF-8 encoding +# +# source://prism/lib/prism/node.rb#19237 +Prism::RegularExpressionFlags::UTF_8 = T.let(T.unsafe(nil), Integer) + +# s - forces the Windows-31J encoding +# +# source://prism/lib/prism/node.rb#19234 +Prism::RegularExpressionFlags::WINDOWS_31J = T.let(T.unsafe(nil), Integer) + +# Represents a regular expression literal with no interpolation. +# +# /foo/i +# ^^^^^^ +# +# source://prism/lib/prism/node.rb#15731 +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 # - # @return [SourceLineNode] a new instance of SourceLineNode + # @return [RegularExpressionNode] a new instance of RegularExpressionNode # - # source://prism/lib/prism/node.rb#17341 - def initialize(source, location); end + # source://prism/lib/prism/node.rb#15733 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); 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#15909 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17348 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#15744 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end + # def ascii_8bit?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15830 + sig { returns(T::Boolean) } + def ascii_8bit?; end + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17353 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15749 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end + # def closing: () -> String + # + # source://prism/lib/prism/node.rb#15870 + sig { returns(String) } + def closing; end + + # attr_reader closing_loc: Location + # + # source://prism/lib/prism/node.rb#15795 + sig { returns(Prism::Location) } + def closing_loc; end + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#17363 + # source://prism/lib/prism/node.rb#15759 + 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#17358 + # source://prism/lib/prism/node.rb#15754 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SourceLineNode + # def content: () -> String # - # source://prism/lib/prism/node.rb#17368 - sig { params(params: T.untyped).returns(Prism::SourceLineNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#15865 + sig { returns(String) } + def content; end - # def child_nodes: () -> Array[nil | Node] - # def deconstruct: () -> Array[nil | Node] + # attr_reader content_loc: Location # - # source://prism/lib/prism/node.rb#17353 - sig { returns(T::Array[T.nilable(Prism::Node)]) } - def deconstruct; end + # source://prism/lib/prism/node.rb#15788 + sig { returns(Prism::Location) } + def content_loc; end - # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> RegularExpressionNode # - # source://prism/lib/prism/node.rb#17379 + # source://prism/lib/prism/node.rb#15764 sig do params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).returns(Prism::RegularExpressionNode) end - def deconstruct_keys(keys); 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 inspect(NodeInspector inspector) -> String + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17385 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15749 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; 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 deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location } # - # 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 + # source://prism/lib/prism/node.rb#15772 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # def euc_jp?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15825 + sig { returns(T::Boolean) } + def euc_jp?; end + + # def extended?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15810 + sig { returns(T::Boolean) } + def extended?; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15850 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15855 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15845 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def ignore_case?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15805 + sig { returns(T::Boolean) } + def ignore_case?; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#15875 + sig { override.returns(String) } + def inspect; end + + # def multi_line?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15815 + sig { returns(T::Boolean) } + def multi_line?; end + + # def once?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15820 + sig { returns(T::Boolean) } + def once?; end + + # def opening: () -> String + # + # source://prism/lib/prism/node.rb#15860 + sig { returns(String) } + def opening; end + + # attr_reader opening_loc: Location + # + # source://prism/lib/prism/node.rb#15781 + 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 # - # source://prism/lib/prism/node.rb#17404 + # source://prism/lib/prism/node.rb#15893 + sig { override.returns(Symbol) } def type; end + # attr_reader unescaped: String + # + # source://prism/lib/prism/node.rb#15802 + sig { returns(String) } + def unescaped; end + + # def utf_8?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15840 + sig { returns(T::Boolean) } + def utf_8?; end + + # def windows_31j?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15835 + sig { returns(T::Boolean) } + def windows_31j?; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#15777 + 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. @@ -25332,92 +28625,128 @@ class Prism::SourceLineNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17414 + # source://prism/lib/prism/node.rb#15903 def type; end end end -# Represents the use of the splat operator. +# 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#23 + def options; end +end + +# Represents a required keyword parameter to a method, block, or lambda definition. # -# [*a] -# ^^ +# def a(b: ) +# ^^ +# end # -# source://prism/lib/prism/node.rb#17423 -class Prism::SplatNode < ::Prism::Node - # def initialize: (Location operator_loc, Node? expression, Location location) -> void +# source://prism/lib/prism/node.rb#15924 +class Prism::RequiredKeywordParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location name_loc, Location location) -> void # - # @return [SplatNode] a new instance of SplatNode + # @return [RequiredKeywordParameterNode] a new instance of RequiredKeywordParameterNode # - # source://prism/lib/prism/node.rb#17425 - def initialize(source, operator_loc, expression, location); end + # source://prism/lib/prism/node.rb#15926 + sig do + params( + source: Prism::Source, + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, location); 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#16021 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17434 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#15935 + 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#17439 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15940 + 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#17451 + # source://prism/lib/prism/node.rb#15950 + 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#17444 + # source://prism/lib/prism/node.rb#15945 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SplatNode + # def copy: (?flags: Integer, ?name: Symbol, ?name_loc: Location, ?location: Location) -> RequiredKeywordParameterNode # - # source://prism/lib/prism/node.rb#17456 - sig { params(params: T.untyped).returns(Prism::SplatNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#15955 + sig do + params( + flags: Integer, + name: Symbol, + name_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17439 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#15940 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { operator_loc: Location, expression: Node?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, name_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#17469 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#15963 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # attr_reader expression: Node? - # - # source://prism/lib/prism/node.rb#17480 - sig { returns(T.nilable(Prism::Node)) } - def expression; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def inspect(NodeInspector inspector) -> String + # def inspect -> String # - # source://prism/lib/prism/node.rb#17489 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#15987 + sig { override.returns(String) } + def inspect; end - # def operator: () -> String + # attr_reader name: Symbol # - # source://prism/lib/prism/node.rb#17484 - sig { returns(String) } - def operator; end + # source://prism/lib/prism/node.rb#15972 + sig { returns(Symbol) } + def name; end - # attr_reader operator_loc: Location + # attr_reader name_loc: Location # - # source://prism/lib/prism/node.rb#17474 + # source://prism/lib/prism/node.rb#15975 sig { returns(Prism::Location) } - def operator_loc; end + def name_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#15982 + 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 @@ -25434,9 +28763,18 @@ class Prism::SplatNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17515 + # source://prism/lib/prism/node.rb#16005 + sig { override.returns(Symbol) } def type; end + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#15968 + 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. @@ -25445,80 +28783,98 @@ class Prism::SplatNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17525 + # source://prism/lib/prism/node.rb#16015 def type; end end end -# Represents a set of statements contained within some scope. +# Represents a required parameter to a method, block, or lambda definition. # -# foo; bar; baz -# ^^^^^^^^^^^^^ +# def a(b) +# ^ +# end # -# source://prism/lib/prism/node.rb#17534 -class Prism::StatementsNode < ::Prism::Node - # def initialize: (Array[Node] body, Location location) -> void +# source://prism/lib/prism/node.rb#16034 +class Prism::RequiredParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol name, Location location) -> void # - # @return [StatementsNode] a new instance of StatementsNode + # @return [RequiredParameterNode] a new instance of RequiredParameterNode # - # source://prism/lib/prism/node.rb#17536 - def initialize(source, body, location); end + # source://prism/lib/prism/node.rb#16036 + sig { params(source: Prism::Source, flags: Integer, name: Symbol, location: Prism::Location).void } + def initialize(source, flags, name, location); end - # def accept: (Visitor visitor) -> void + # 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#17544 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#16123 + def ===(other); end - # attr_reader body: Array[Node] + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17581 - sig { returns(T::Array[Prism::Node]) } - def body; end + # source://prism/lib/prism/node.rb#16044 + 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#17549 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16049 + 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#17559 + # source://prism/lib/prism/node.rb#16059 + 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#17554 + # source://prism/lib/prism/node.rb#16054 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> StatementsNode + # def copy: (?flags: Integer, ?name: Symbol, ?location: Location) -> RequiredParameterNode # - # source://prism/lib/prism/node.rb#17564 - sig { params(params: T.untyped).returns(Prism::StatementsNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#16064 + 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 # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17549 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16049 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Node], location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, name: Symbol, location: Location } # - # source://prism/lib/prism/node.rb#17576 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#16072 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#16089 + sig { override.returns(String) } + def inspect; end + + # attr_reader name: Symbol + # + # source://prism/lib/prism/node.rb#16081 + sig { returns(Symbol) } + def name; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] # - # source://prism/lib/prism/node.rb#17585 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16084 + 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 @@ -25535,9 +28891,18 @@ class Prism::StatementsNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17605 + # source://prism/lib/prism/node.rb#16107 + sig { override.returns(Symbol) } def type; end + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#16077 + 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. @@ -25546,162 +28911,125 @@ class Prism::StatementsNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17615 + # source://prism/lib/prism/node.rb#16117 def type; end end end -# Flags for string nodes. +# Represents an expression modified with a rescue. # -# source://prism/lib/prism/node.rb#19352 -module Prism::StringFlags; end - -# internal bytes forced the encoding to binary +# foo rescue nil +# ^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#19357 -Prism::StringFlags::FORCED_BINARY_ENCODING = T.let(T.unsafe(nil), Integer) +# source://prism/lib/prism/node.rb#16134 +class Prism::RescueModifierNode < ::Prism::Node + # def initialize: (Prism::node expression, Location keyword_loc, Prism::node rescue_expression, Location location) -> void + # + # @return [RescueModifierNode] a new instance of RescueModifierNode + # + # source://prism/lib/prism/node.rb#16136 + sig do + params( + source: Prism::Source, + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).void + end + def initialize(source, expression, keyword_loc, rescue_expression, location); end -# internal bytes forced the encoding to UTF-8 -# -# source://prism/lib/prism/node.rb#19354 -Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + # 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#16230 + def ===(other); end -# frozen by virtue of a `frozen_string_literal` comment -# -# source://prism/lib/prism/node.rb#19360 -Prism::StringFlags::FROZEN = 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. -# -# "foo" -# ^^^^^ -# -# %w[foo] -# ^^^ -# -# "foo #{bar} baz" -# ^^^^ ^^^^ -# -# source://prism/lib/prism/node.rb#17630 -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 - # - # @return [StringNode] a new instance of StringNode - # - # source://prism/lib/prism/node.rb#17632 - def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); end - - # def accept: (Visitor visitor) -> void - # - # source://prism/lib/prism/node.rb#17644 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#16145 + 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#17649 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16150 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism/lib/prism/node.rb#17748 - sig { returns(T.nilable(String)) } - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism/lib/prism/node.rb#17707 - sig { returns(T.nilable(Prism::Location)) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#17659 + # source://prism/lib/prism/node.rb#16160 + 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#17654 + # source://prism/lib/prism/node.rb#16155 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def content: () -> String - # - # source://prism/lib/prism/node.rb#17743 - sig { returns(String) } - def content; end - - # attr_reader content_loc: Location - # - # source://prism/lib/prism/node.rb#17701 - sig { returns(Prism::Location) } - def content_loc; end - - # def copy: (**params) -> StringNode + # def copy: (?expression: Prism::node, ?keyword_loc: Location, ?rescue_expression: Prism::node, ?location: Location) -> RescueModifierNode # - # source://prism/lib/prism/node.rb#17664 - sig { params(params: T.untyped).returns(Prism::StringNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#16165 + sig do + params( + expression: Prism::Node, + keyword_loc: Prism::Location, + rescue_expression: Prism::Node, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17649 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16150 + 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) -> { expression: Prism::node, keyword_loc: Location, rescue_expression: Prism::node, location: Location } # - # source://prism/lib/prism/node.rb#17680 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#16173 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def forced_binary_encoding?: () -> bool + # attr_reader expression: Prism::node # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#17728 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end + # source://prism/lib/prism/node.rb#16178 + sig { returns(Prism::Node) } + def expression; end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#17723 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def frozen?: () -> bool - # - # @return [Boolean] + # def inspect -> String # - # source://prism/lib/prism/node.rb#17733 - sig { returns(T::Boolean) } - def frozen?; end + # source://prism/lib/prism/node.rb#16196 + sig { override.returns(String) } + def inspect; end - # def inspect(NodeInspector inspector) -> String + # def keyword: () -> String # - # source://prism/lib/prism/node.rb#17753 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16191 + sig { returns(String) } + def keyword; end - # def opening: () -> String? + # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#17738 - sig { returns(T.nilable(String)) } - def opening; end + # source://prism/lib/prism/node.rb#16181 + sig { returns(Prism::Location) } + def keyword_loc; end - # attr_reader opening_loc: Location? + # source://prism/lib/prism/parse_result/newlines.rb#115 + def newline!(lines); end + + # attr_reader rescue_expression: Prism::node # - # source://prism/lib/prism/node.rb#17689 - sig { returns(T.nilable(Prism::Location)) } - def opening_loc; end + # source://prism/lib/prism/node.rb#16188 + sig { returns(Prism::Node) } + def rescue_expression; 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 @@ -25718,23 +29046,10 @@ class Prism::StringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17778 + # source://prism/lib/prism/node.rb#16214 + sig { override.returns(Symbol) } def type; end - # attr_reader unescaped: String - # - # source://prism/lib/prism/node.rb#17719 - sig { returns(String) } - def unescaped; end - - private - - # private attr_reader flags: Integer - # - # source://prism/lib/prism/node.rb#17685 - 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. @@ -25743,125 +29058,157 @@ class Prism::StringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17788 + # source://prism/lib/prism/node.rb#16224 def type; end end end -# Represents the use of the `super` keyword with parentheses or arguments. +# Represents a rescue statement. # -# super() -# ^^^^^^^ +# begin +# rescue Foo, *splat, Bar => ex +# foo +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# end # -# super foo, bar -# ^^^^^^^^^^^^^^ +# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field. # -# source://prism/lib/prism/node.rb#17800 -class Prism::SuperNode < ::Prism::Node - # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Node? block, Location location) -> void - # - # @return [SuperNode] a new instance of SuperNode +# source://prism/lib/prism/node.rb#16247 +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 # - # source://prism/lib/prism/node.rb#17802 - def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); end - - # def accept: (Visitor visitor) -> void + # @return [RescueNode] a new instance of RescueNode # - # source://prism/lib/prism/node.rb#17814 - sig { params(visitor: Prism::Visitor).void } - def accept(visitor); end + # source://prism/lib/prism/node.rb#16249 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end - # attr_reader arguments: ArgumentsNode? + # 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#17876 - sig { returns(T.nilable(Prism::ArgumentsNode)) } - def arguments; end + # source://prism/lib/prism/node.rb#16375 + def ===(other); end - # attr_reader block: Node? + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17891 - sig { returns(T.nilable(Prism::Node)) } - def block; end + # source://prism/lib/prism/node.rb#16261 + 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#17819 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16266 + 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#17832 + # source://prism/lib/prism/node.rb#16281 + 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#17824 + # source://prism/lib/prism/node.rb#16271 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SuperNode + # attr_reader consequent: RescueNode? + # + # source://prism/lib/prism/node.rb#16328 + sig { returns(T.nilable(Prism::RescueNode)) } + 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 # - # source://prism/lib/prism/node.rb#17837 - sig { params(params: T.untyped).returns(Prism::SuperNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#16286 + sig do + params( + keyword_loc: Prism::Location, + exceptions: T::Array[Prism::Node], + operator_loc: T.nilable(Prism::Location), + reference: T.nilable(Prism::Node), + statements: T.nilable(Prism::StatementsNode), + consequent: T.nilable(Prism::RescueNode), + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17819 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16266 + 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: Node?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#17853 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#16294 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + # attr_reader exceptions: Array[Prism::node] + # + # source://prism/lib/prism/node.rb#16306 + sig { returns(T::Array[Prism::Node]) } + def exceptions; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#17910 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16341 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#17895 + # source://prism/lib/prism/node.rb#16331 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#17858 + # source://prism/lib/prism/node.rb#16299 sig { returns(Prism::Location) } def keyword_loc; end - # def lparen: () -> String? + # def operator: () -> String? # - # source://prism/lib/prism/node.rb#17900 + # source://prism/lib/prism/node.rb#16336 sig { returns(T.nilable(String)) } - def lparen; end + def operator; end - # attr_reader lparen_loc: Location? + # attr_reader operator_loc: Location? # - # source://prism/lib/prism/node.rb#17864 + # source://prism/lib/prism/node.rb#16309 sig { returns(T.nilable(Prism::Location)) } - def lparen_loc; end + def operator_loc; end - # def rparen: () -> String? + # attr_reader reference: Prism::node? # - # source://prism/lib/prism/node.rb#17905 - sig { returns(T.nilable(String)) } - def rparen; end + # source://prism/lib/prism/node.rb#16322 + sig { returns(T.nilable(Prism::Node)) } + def reference; end - # attr_reader rparen_loc: Location? + # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#17879 - sig { returns(T.nilable(Prism::Location)) } - def rparen_loc; end + # source://prism/lib/prism/node.rb#16325 + 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 @@ -25878,7 +29225,8 @@ class Prism::SuperNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#17944 + # source://prism/lib/prism/node.rb#16359 + sig { override.returns(Symbol) } def type; end class << self @@ -25889,145 +29237,133 @@ class Prism::SuperNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#17954 + # source://prism/lib/prism/node.rb#16369 def type; end end end -# Flags for symbol nodes. -# -# source://prism/lib/prism/node.rb#19364 -module Prism::SymbolFlags; end - -# internal bytes forced the encoding to binary -# -# source://prism/lib/prism/node.rb#19369 -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#19372 -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#19366 -Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) - -# Represents a symbol literal or a symbol contained within a `%i` list. -# -# :foo -# ^^^^ +# Represents a rest parameter to a method, block, or lambda definition. # -# %i[foo] -# ^^^ +# def a(*b) +# ^^ +# end # -# source://prism/lib/prism/node.rb#17966 -class Prism::SymbolNode < ::Prism::Node - # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void +# source://prism/lib/prism/node.rb#16392 +class Prism::RestParameterNode < ::Prism::Node + # def initialize: (Integer flags, Symbol? name, Location? name_loc, Location operator_loc, Location location) -> void # - # @return [SymbolNode] a new instance of SymbolNode + # @return [RestParameterNode] a new instance of RestParameterNode # - # source://prism/lib/prism/node.rb#17968 - def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); end + # source://prism/lib/prism/node.rb#16394 + sig do + params( + source: Prism::Source, + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: Prism::Location + ).void + end + def initialize(source, flags, name, name_loc, operator_loc, location); 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#16508 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#17980 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#16404 + 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#17985 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16409 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end - # def closing: () -> String? - # - # source://prism/lib/prism/node.rb#18090 - sig { returns(T.nilable(String)) } - def closing; end - - # attr_reader closing_loc: Location? - # - # source://prism/lib/prism/node.rb#18049 - sig { returns(T.nilable(Prism::Location)) } - def closing_loc; end - # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#17995 + # source://prism/lib/prism/node.rb#16419 + 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#17990 + # source://prism/lib/prism/node.rb#16414 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> SymbolNode + # def copy: (?flags: Integer, ?name: Symbol?, ?name_loc: Location?, ?operator_loc: Location, ?location: Location) -> RestParameterNode # - # source://prism/lib/prism/node.rb#18000 - sig { params(params: T.untyped).returns(Prism::SymbolNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#16424 + sig do + params( + flags: Integer, + name: T.nilable(Symbol), + name_loc: T.nilable(Prism::Location), + operator_loc: Prism::Location, + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#17985 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#16409 + 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) -> { flags: Integer, name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#18016 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#16432 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def forced_binary_encoding?: () -> bool - # - # @return [Boolean] - # - # source://prism/lib/prism/node.rb#18070 - sig { returns(T::Boolean) } - def forced_binary_encoding?; end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # def forced_us_ascii_encoding?: () -> bool - # - # @return [Boolean] + # def inspect -> String # - # source://prism/lib/prism/node.rb#18075 - sig { returns(T::Boolean) } - def forced_us_ascii_encoding?; end + # source://prism/lib/prism/node.rb#16474 + sig { override.returns(String) } + def inspect; end - # def forced_utf8_encoding?: () -> bool - # - # @return [Boolean] + # attr_reader name: Symbol? # - # source://prism/lib/prism/node.rb#18065 - sig { returns(T::Boolean) } - def forced_utf8_encoding?; end + # source://prism/lib/prism/node.rb#16441 + sig { returns(T.nilable(Symbol)) } + def name; end - # def inspect(NodeInspector inspector) -> String + # attr_reader name_loc: Location? # - # source://prism/lib/prism/node.rb#18095 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16444 + sig { returns(T.nilable(Prism::Location)) } + def name_loc; end - # def opening: () -> String? + # def operator: () -> String # - # source://prism/lib/prism/node.rb#18080 - sig { returns(T.nilable(String)) } - def opening; end - - # attr_reader opening_loc: Location? + # source://prism/lib/prism/node.rb#16469 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location # - # source://prism/lib/prism/node.rb#18025 - sig { returns(T.nilable(Prism::Location)) } - def opening_loc; end + # source://prism/lib/prism/node.rb#16457 + sig { returns(Prism::Location) } + def operator_loc; end + + # def repeated_parameter?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#16464 + 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 @@ -26044,32 +29380,15 @@ class Prism::SymbolNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18120 + # source://prism/lib/prism/node.rb#16492 + sig { override.returns(Symbol) } def type; end - # attr_reader unescaped: String - # - # source://prism/lib/prism/node.rb#18061 - sig { returns(String) } - def unescaped; end - - # def value: () -> String? - # - # source://prism/lib/prism/node.rb#18085 - sig { returns(T.nilable(String)) } - def value; end - - # attr_reader value_loc: Location? - # - # source://prism/lib/prism/node.rb#18037 - sig { returns(T.nilable(Prism::Location)) } - def value_loc; end - - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#18021 + # source://prism/lib/prism/node.rb#16437 sig { returns(Integer) } def flags; end @@ -26081,2959 +29400,7541 @@ class Prism::SymbolNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18130 + # source://prism/lib/prism/node.rb#16502 def type; end end end -# This represents a token from the Ruby source. +# This represents the result of a call to ::parse or ::parse_file. It contains +# the requested structure, any comments that were encounters, and any errors +# that were encountered. # -# source://prism/lib/prism/parse_result.rb#454 -class Prism::Token - # Create a new token object with the given type, value, and location. +# source://prism/lib/prism/parse_result.rb#521 +class Prism::Result + # Create a new result object with the given values. # - # @return [Token] a new instance of Token + # @return [Result] a new instance of Result # - # source://prism/lib/prism/parse_result.rb#466 - def initialize(source, type, value, location); end + # source://prism/lib/prism/parse_result.rb#543 + sig do + params( + comments: T::Array[Prism::Comment], + magic_comments: T::Array[Prism::MagicComment], + data_loc: T.nilable(Prism::Location), + errors: T::Array[Prism::ParseError], + warnings: T::Array[Prism::ParseWarning], + source: Prism::Source + ).void + end + def initialize(comments, magic_comments, data_loc, errors, warnings, source); end - # Returns true if the given other token is equal to this token. + # The list of comments that were encountered during parsing. # - # source://prism/lib/prism/parse_result.rb#500 - sig { params(other: T.untyped).returns(T::Boolean) } - def ==(other); end + # source://prism/lib/prism/parse_result.rb#523 + sig { returns(T::Array[Prism::Comment]) } + def comments; end - # Implement the hash pattern matching interface for Token. + # An optional location that represents the location of the __END__ marker + # 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#474 - sig { params(keys: T.untyped).returns(T.untyped) } - def deconstruct_keys(keys); end + # source://prism/lib/prism/parse_result.rb#531 + sig { returns(T.nilable(Prism::Location)) } + def data_loc; end - # A Location object representing the location of this token in the source. + # Implement the hash pattern matching interface for Result. # - # source://prism/lib/prism/parse_result.rb#479 - sig { returns(Prism::Location) } - def location; end + # source://prism/lib/prism/parse_result.rb#553 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Implement the pretty print interface for Token. + # Returns the encoding of the source code that was parsed. # - # source://prism/lib/prism/parse_result.rb#485 - sig { params(q: T.untyped).returns(T.untyped) } - def pretty_print(q); end + # source://prism/lib/prism/parse_result.rb#558 + sig { returns(Encoding) } + def encoding; end - # The type of token that this token is. + # The list of errors that were generated during parsing. # - # source://prism/lib/prism/parse_result.rb#460 - sig { returns(T.untyped) } - def type; end + # source://prism/lib/prism/parse_result.rb#534 + sig { returns(T::Array[Prism::ParseError]) } + def errors; end - # A byteslice of the source that this token represents. + # Returns true if there were errors during parsing and false if there were + # not. # - # source://prism/lib/prism/parse_result.rb#463 - sig { returns(String) } - def value; end + # @return [Boolean] + # + # source://prism/lib/prism/parse_result.rb#570 + sig { returns(T::Boolean) } + def failure?; end - private + # The list of magic comments that were encountered during parsing. + # + # source://prism/lib/prism/parse_result.rb#526 + sig { returns(T::Array[Prism::MagicComment]) } + def magic_comments; end - # The Source object that represents the source this token came from. + # A Source instance that represents the source code that was parsed. # - # source://prism/lib/prism/parse_result.rb#456 + # source://prism/lib/prism/parse_result.rb#540 + sig { returns(Prism::Source) } def source; end + + # Returns true if there were no errors during parsing and false if there + # were. + # + # @return [Boolean] + # + # source://prism/lib/prism/parse_result.rb#564 + sig { returns(T::Boolean) } + def success?; end + + # The list of warnings that were generated during parsing. + # + # source://prism/lib/prism/parse_result.rb#537 + sig { returns(T::Array[Prism::ParseWarning]) } + def warnings; end end -# This module is responsible for converting the prism syntax tree into other -# syntax trees. +# Represents the use of the `retry` keyword. # -# source://prism/lib/prism/translation.rb#6 -module Prism::Translation; end - -# This class is the entry-point for converting a prism syntax tree into the -# whitequark/parser gem's syntax tree. It inherits from the base parser for -# the parser gem, and overrides the parse* methods to parse with prism and -# then translate. +# retry +# ^^^^^ # -# source://prism/lib/prism/translation/parser.rb#11 -class Prism::Translation::Parser < ::Parser::Base - # The default encoding for Ruby files is UTF-8. +# source://prism/lib/prism/node.rb#16521 +class Prism::RetryNode < ::Prism::Node + # def initialize: (Location location) -> void # - # source://prism/lib/prism/translation/parser.rb#33 - def default_encoding; end - - # Parses a source buffer and returns the AST. + # @return [RetryNode] a new instance of RetryNode # - # source://prism/lib/prism/translation/parser.rb#41 - def parse(source_buffer); end + # source://prism/lib/prism/node.rb#16523 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # Parses a source buffer and returns the AST and the source code comments. + # 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/translation/parser.rb#54 - def parse_with_comments(source_buffer); end + # source://prism/lib/prism/node.rb#16596 + def ===(other); end - # Parses a source buffer and returns the AST, the source code comments, - # and the tokens emitted by the lexer. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser.rb#71 - def tokenize(source_buffer, recover = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16529 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Since prism resolves num params for us, we don't need to support this - # kind of logic here. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser.rb#97 - def try_declare_numparam(node); end - - # source://prism/lib/prism/translation/parser.rb#28 - def version; end - - # source://prism/lib/prism/translation/parser.rb#37 - def yyerror; end - - private + # source://prism/lib/prism/node.rb#16534 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # Build the parser gem AST from the prism AST. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser.rb#146 - def build_ast(program, offset_cache); end + # source://prism/lib/prism/node.rb#16544 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # Build the parser gem comments from the prism comments. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser.rb#151 - def build_comments(comments, offset_cache); end + # source://prism/lib/prism/node.rb#16539 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # Prism deals with offsets in bytes, while the parser gem deals with - # offsets in characters. We need to handle this conversion in order to - # build the parser gem AST. - # - # If the bytesize of the source is the same as the length, then we can - # just use the offset directly. Otherwise, we build an array where the - # index is the byte offset and the value is the character offset. + # def copy: (?location: Location) -> RetryNode # - # source://prism/lib/prism/translation/parser.rb#129 - def build_offset_cache(source); end + # source://prism/lib/prism/node.rb#16549 + sig { params(location: Prism::Location).returns(Prism::RetryNode) } + def copy(location: T.unsafe(nil)); end - # Build a range from a prism location. + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser.rb#163 - def build_range(location, offset_cache); end + # source://prism/lib/prism/node.rb#16534 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # Build the parser gem tokens from the prism tokens. + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/translation/parser.rb#158 - def build_tokens(tokens, offset_cache); end + # source://prism/lib/prism/node.rb#16557 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # Converts the version format handled by Parser to the format handled by Prism. - # - # source://prism/lib/prism/translation/parser.rb#172 - def convert_for_prism(version); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # If there was a error generated during the parse, then raise an - # appropriate syntax error. Otherwise return the result. + # def inspect -> String # - # source://prism/lib/prism/translation/parser.rb#111 - def unwrap(result, offset_cache); end + # source://prism/lib/prism/node.rb#16562 + sig { override.returns(String) } + def inspect; end - # This is a hook to allow consumers to disable some errors if they don't - # want them to block creating the syntax tree. + # 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 [Boolean] + # 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/translation/parser.rb#105 - def valid_error?(error); end + # def type: () -> Symbol + # + # source://prism/lib/prism/node.rb#16580 + 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 + # + # source://prism/lib/prism/node.rb#16590 + def type; end + end end -# A visitor that knows how to convert a prism syntax tree into the -# whitequark/parser gem's syntax tree. +# Represents the use of the `return` keyword. # -# source://prism/lib/prism/translation/parser/compiler.rb#8 -class Prism::Translation::Parser::Compiler < ::Prism::Compiler - # Initialize a new compiler with the given parser, offset cache, and - # options. +# return 1 +# ^^^^^^^^ +# +# source://prism/lib/prism/node.rb#16605 +class Prism::ReturnNode < ::Prism::Node + # def initialize: (Integer flags, Location keyword_loc, ArgumentsNode? arguments, Location location) -> void # - # @return [Compiler] a new instance of Compiler + # @return [ReturnNode] a new instance of ReturnNode # - # source://prism/lib/prism/translation/parser/compiler.rb#39 - def initialize(parser, offset_cache, forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#16607 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).void + end + def initialize(source, flags, keyword_loc, arguments, location); end - # The Parser::Builders::Default instance that is being used to build the - # AST. + # 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/translation/parser/compiler.rb#18 - def builder; end + # source://prism/lib/prism/node.rb#16709 + def ===(other); end - # The types of values that can be forwarded in the current scope. + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#29 - def forwarding; end + # source://prism/lib/prism/node.rb#16616 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # Whether or not the current node is in a destructure. + # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/translation/parser/compiler.rb#32 - def in_destructure; end + # source://prism/lib/prism/node.rb#16662 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end - # Whether or not the current node is in a pattern. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#35 - def in_pattern; end + # source://prism/lib/prism/node.rb#16621 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # The offset cache that is used to map between byte and character - # offsets in the file. + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#26 - def offset_cache; end + # source://prism/lib/prism/node.rb#16633 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # The Parser::Base instance that is being used to build the AST. + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#14 - def parser; end + # source://prism/lib/prism/node.rb#16626 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # The Parser::Source::Buffer instance that is holding a reference to the - # source code. + # def copy: (?flags: Integer, ?keyword_loc: Location, ?arguments: ArgumentsNode?, ?location: Location) -> ReturnNode # - # source://prism/lib/prism/translation/parser/compiler.rb#22 - def source_buffer; end + # source://prism/lib/prism/node.rb#16638 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + arguments: T.nilable(Prism::ArgumentsNode), + location: Prism::Location + ).returns(Prism::ReturnNode) + end + def copy(flags: T.unsafe(nil), keyword_loc: T.unsafe(nil), arguments: T.unsafe(nil), location: T.unsafe(nil)); end - # alias $foo $bar - # ^^^^^^^^^^^^^^^ + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#58 - def visit_alias_global_variable_node(node); end + # source://prism/lib/prism/node.rb#16621 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # alias foo bar - # ^^^^^^^^^^^^^ + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, arguments: ArgumentsNode?, location: Location } # - # source://prism/lib/prism/translation/parser/compiler.rb#52 - def visit_alias_method_node(node); end + # source://prism/lib/prism/node.rb#16646 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # foo => bar | baz - # ^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#64 - def visit_alternation_pattern_node(node); end + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end - # a and b - # ^^^^^^^ + # def inspect -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#70 - def visit_and_node(node); end + # source://prism/lib/prism/node.rb#16675 + sig { override.returns(String) } + def inspect; end - # foo(bar) - # ^^^ + # def keyword: () -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#101 - def visit_arguments_node(node); end + # source://prism/lib/prism/node.rb#16670 + sig { returns(String) } + def keyword; end - # [] - # ^^ + # attr_reader keyword_loc: Location # - # source://prism/lib/prism/translation/parser/compiler.rb#76 - def visit_array_node(node); end + # source://prism/lib/prism/node.rb#16655 + sig { returns(Prism::Location) } + def keyword_loc; end - # foo => [bar] - # ^^^^^ + # def redundant?: () -> bool # - # source://prism/lib/prism/translation/parser/compiler.rb#82 - def visit_array_pattern_node(node); end - - # { a: 1 } - # ^^^^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#107 - def visit_assoc_node(node); end + # source://prism/lib/prism/node.rb#16665 + sig { returns(T::Boolean) } + def redundant?; end - # def foo(**); bar(**); 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. # - # { **foo } - # ^^^^^ + # 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/translation/parser/compiler.rb#141 - def visit_assoc_splat_node(node); end + # def type: () -> Symbol + # + # source://prism/lib/prism/node.rb#16693 + sig { override.returns(Symbol) } + def type; end - # $+ - # ^^ + protected + + # protected attr_reader flags: Integer # - # source://prism/lib/prism/translation/parser/compiler.rb#151 - def visit_back_reference_read_node(node); end + # source://prism/lib/prism/node.rb#16651 + sig { returns(Integer) } + def flags; end - # begin 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 + # + # source://prism/lib/prism/node.rb#16703 + def type; end + end +end + +# Flags for return nodes. +# +# source://prism/lib/prism/node.rb#19250 +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#19252 +Prism::ReturnNodeFlags::REDUNDANT = T.let(T.unsafe(nil), Integer) + +# Represents the `self` keyword. +# +# self +# ^^^^ +# +# source://prism/lib/prism/node.rb#16721 +class Prism::SelfNode < ::Prism::Node + # def initialize: (Location location) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#157 - def visit_begin_node(node); end + # @return [SelfNode] a new instance of SelfNode + # + # source://prism/lib/prism/node.rb#16723 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # foo(&bar) - # ^^^^ + # 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/translation/parser/compiler.rb#195 - def visit_block_argument_node(node); end + # source://prism/lib/prism/node.rb#16796 + def ===(other); end - # foo { |; bar| } - # ^^^ + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#201 - def visit_block_local_variable_node(node); end + # source://prism/lib/prism/node.rb#16729 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # A block on a keyword or method call. + # def child_nodes: () -> Array[nil | Node] # - # @raise [CompilationError] + # source://prism/lib/prism/node.rb#16734 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#206 - def visit_block_node(node); end + # source://prism/lib/prism/node.rb#16744 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # def foo(&bar); end - # ^^^^ + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#212 - def visit_block_parameter_node(node); end + # source://prism/lib/prism/node.rb#16739 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # A block's parameters. + # def copy: (?location: Location) -> SelfNode # - # source://prism/lib/prism/translation/parser/compiler.rb#217 - def visit_block_parameters_node(node); end + # source://prism/lib/prism/node.rb#16749 + sig { params(location: Prism::Location).returns(Prism::SelfNode) } + def copy(location: T.unsafe(nil)); end - # break - # ^^^^^ + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # break foo - # ^^^^^^^^^ + # source://prism/lib/prism/node.rb#16734 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/translation/parser/compiler.rb#226 - def visit_break_node(node); end + # source://prism/lib/prism/node.rb#16757 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # foo.bar += baz - # ^^^^^^^^^^^^^^^ - # foo.bar &&= baz - # ^^^^^^^^^^^^^^^ + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#300 - def visit_call_and_write_node(node); end + # source://prism/lib/prism/node.rb#16762 + sig { override.returns(String) } + def inspect; end - # foo - # ^^^ + # 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. # - # 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. # - # foo.bar() {} - # ^^^^^^^^^^^^ + # def type: () -> Symbol # - # source://prism/lib/prism/translation/parser/compiler.rb#238 - def visit_call_node(node); end + # source://prism/lib/prism/node.rb#16780 + sig { override.returns(Symbol) } + def type; end - # foo.bar += baz - # ^^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#300 - def visit_call_operator_write_node(node); 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 + # + # source://prism/lib/prism/node.rb#16790 + def type; end + end +end - # foo.bar += baz - # ^^^^^^^^^^^^^^^ - # foo.bar ||= baz - # ^^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#300 - def visit_call_or_write_node(node); end +# A module responsible for deserializing parse results. +# +# source://prism/lib/prism/serialize.rb#14 +module Prism::Serialize + class << self + # Deserialize the AST represented by the given string into a parse result. + # + # source://prism/lib/prism/serialize.rb#28 + def load(input, serialized); end - # foo.bar, = 1 - # ^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#327 - def visit_call_target_node(node); end + # Deserialize the tokens represented by the given string into a parse + # result. + # + # source://prism/lib/prism/serialize.rb#40 + def load_tokens(source, serialized); end + end +end - # foo => bar => baz - # ^^^^^^^^^^ +# source://prism/lib/prism/serialize.rb#44 +class Prism::Serialize::Loader + # @return [Loader] a new instance of Loader # - # source://prism/lib/prism/translation/parser/compiler.rb#339 - def visit_capture_pattern_node(node); end + # source://prism/lib/prism/serialize.rb#80 + def initialize(source, serialized); end - # case foo; in bar; end - # ^^^^^^^^^^^^^^^^^^^^^ + # Returns the value of attribute constant_pool. # - # source://prism/lib/prism/translation/parser/compiler.rb#358 - def visit_case_match_node(node); end + # source://prism/lib/prism/serialize.rb#77 + def constant_pool; end - # case foo; when bar; end - # ^^^^^^^^^^^^^^^^^^^^^^^ + # Returns the value of attribute constant_pool_offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#345 - def visit_case_node(node); end + # source://prism/lib/prism/serialize.rb#77 + def constant_pool_offset; end - # class Foo; end - # ^^^^^^^^^^^^^^ + # Returns the value of attribute encoding. # - # source://prism/lib/prism/translation/parser/compiler.rb#371 - def visit_class_node(node); end + # source://prism/lib/prism/serialize.rb#76 + def encoding; end - # @@foo += bar - # ^^^^^^^^^^^^ - # @@foo &&= bar - # ^^^^^^^^^^^^^ + # Returns the value of attribute input. # - # source://prism/lib/prism/translation/parser/compiler.rb#403 - def visit_class_variable_and_write_node(node); end + # source://prism/lib/prism/serialize.rb#76 + def input; end - # @@foo += bar - # ^^^^^^^^^^^^ + # Returns the value of attribute io. # - # source://prism/lib/prism/translation/parser/compiler.rb#403 - def visit_class_variable_operator_write_node(node); end + # source://prism/lib/prism/serialize.rb#76 + def io; end - # @@foo += bar - # ^^^^^^^^^^^^ - # @@foo ||= bar - # ^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#403 - def visit_class_variable_or_write_node(node); end + # source://prism/lib/prism/serialize.rb#118 + def load_comments; end - # @@foo - # ^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#384 - def visit_class_variable_read_node(node); end + # source://prism/lib/prism/serialize.rb#104 + def load_encoding; end - # @@foo, = bar - # ^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#421 - def visit_class_variable_target_node(node); end + # source://prism/lib/prism/serialize.rb#95 + def load_header; end - # @@foo = 1 - # ^^^^^^^^^ - # - # @@foo, @@bar = 1 - # ^^^^^ ^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#393 - def visit_class_variable_write_node(node); end + # source://prism/lib/prism/serialize.rb#114 + def load_line_offsets; end - # Foo += bar - # ^^^^^^^^^^^ - # Foo &&= bar - # ^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#442 - def visit_constant_and_write_node(node); end + # source://prism/lib/prism/serialize.rb#438 + def load_metadata; end - # Foo += bar - # ^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#442 - def visit_constant_operator_write_node(node); end + # source://prism/lib/prism/serialize.rb#472 + def load_nodes; end - # Foo += bar - # ^^^^^^^^^^^ - # Foo ||= bar - # ^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#442 - def visit_constant_or_write_node(node); end + # source://prism/lib/prism/serialize.rb#486 + def load_result; end - # Foo::Bar += baz - # ^^^^^^^^^^^^^^^ - # Foo::Bar &&= baz - # ^^^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#496 - def visit_constant_path_and_write_node(node); end + # source://prism/lib/prism/serialize.rb#110 + def load_start_line; end - # Foo::Bar - # ^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#466 - def visit_constant_path_node(node); end + # source://prism/lib/prism/serialize.rb#447 + def load_tokens; end - # Foo::Bar += baz - # ^^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#496 - def visit_constant_path_operator_write_node(node); end + # source://prism/lib/prism/serialize.rb#460 + def load_tokens_result; end - # Foo::Bar += baz - # ^^^^^^^^^^^^^^^ - # Foo::Bar ||= baz - # ^^^^^^^^^^^^^^^^ + # Returns the value of attribute serialized. # - # source://prism/lib/prism/translation/parser/compiler.rb#496 - def visit_constant_path_or_write_node(node); end + # source://prism/lib/prism/serialize.rb#76 + def serialized; end - # Foo::Bar, = baz - # ^^^^^^^^ + # Returns the value of attribute source. # - # source://prism/lib/prism/translation/parser/compiler.rb#514 - def visit_constant_path_target_node(node); end + # source://prism/lib/prism/serialize.rb#77 + def source; end - # Foo::Bar = 1 - # ^^^^^^^^^^^^ - # - # Foo::Foo, Bar::Bar = 1 - # ^^^^^^^^ ^^^^^^^^ + # Returns the value of attribute start_line. # - # source://prism/lib/prism/translation/parser/compiler.rb#486 - def visit_constant_path_write_node(node); end + # source://prism/lib/prism/serialize.rb#78 + def start_line; end - # Foo - # ^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#427 - def visit_constant_read_node(node); end + private - # Foo, = bar - # ^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#460 - def visit_constant_target_node(node); end + # source://prism/lib/prism/serialize.rb#572 + def load_constant(index); end - # Foo = 1 - # ^^^^^^^ - # - # Foo, Bar = 1 - # ^^^ ^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#436 - def visit_constant_write_node(node); end + # source://prism/lib/prism/serialize.rb#525 + def load_double; end - # def foo; end - # ^^^^^^^^^^^^ - # - # def self.foo; end - # ^^^^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#523 - def visit_def_node(node); end + # source://prism/lib/prism/serialize.rb#540 + def load_embedded_string; end - # defined? a - # ^^^^^^^^^^ - # - # defined?(a) - # ^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#570 - def visit_defined_node(node); end + # source://prism/lib/prism/serialize.rb#602 + def load_error_level; end - # if foo then bar else baz end - # ^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#582 - def visit_else_node(node); end + # source://prism/lib/prism/serialize.rb#514 + def load_integer; end - # "foo #{bar}" - # ^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#588 - def visit_embedded_statements_node(node); end + # source://prism/lib/prism/serialize.rb#556 + def load_location; end - # "foo #@bar" - # ^^^^^ + # source://prism/lib/prism/serialize.rb#560 + def load_location_object; end + + # source://prism/lib/prism/serialize.rb#631 + def load_node; end + + # source://prism/lib/prism/serialize.rb#597 + def load_optional_constant; end + + # source://prism/lib/prism/serialize.rb#564 + def load_optional_location; end + + # source://prism/lib/prism/serialize.rb#568 + def load_optional_location_object; end + + # source://prism/lib/prism/serialize.rb#533 + def load_optional_node; end + + # source://prism/lib/prism/serialize.rb#593 + def load_required_constant; end + + # source://prism/lib/prism/serialize.rb#544 + def load_string; end + + # source://prism/lib/prism/serialize.rb#529 + def load_uint32; end + + # source://prism/lib/prism/serialize.rb#509 + 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/translation/parser/compiler.rb#598 - def visit_embedded_variable_node(node); end + # source://prism/lib/prism/serialize.rb#495 + def load_varuint; end - # begin; foo; ensure; bar; end - # ^^^^^^^^^^^^ + # source://prism/lib/prism/serialize.rb#617 + def load_warning_level; end +end + +# source://prism/lib/prism/serialize.rb#127 +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 +Prism::Serialize::Loader::FastStringIO = StringIO + +# The major version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism/lib/prism/serialize.rb#17 +Prism::Serialize::MAJOR_VERSION = T.let(T.unsafe(nil), Integer) + +# The minor version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism/lib/prism/serialize.rb#21 +Prism::Serialize::MINOR_VERSION = T.let(T.unsafe(nil), Integer) + +# The patch version of prism that we are expecting to find in the serialized +# strings. +# +# source://prism/lib/prism/serialize.rb#25 +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#1863 +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. +# +# C = { a: 1 } +# ^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#16806 +class Prism::ShareableConstantNode < ::Prism::Node + # def initialize: (Integer flags, ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode write, Location location) -> void # - # @raise [CompilationError] + # @return [ShareableConstantNode] a new instance of ShareableConstantNode # - # source://prism/lib/prism/translation/parser/compiler.rb#604 - def visit_ensure_node(node); end + # source://prism/lib/prism/node.rb#16808 + sig do + params( + source: Prism::Source, + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).void + end + def initialize(source, flags, write, location); end - # false - # ^^^^^ + # 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/translation/parser/compiler.rb#610 - def visit_false_node(node); end + # source://prism/lib/prism/node.rb#16905 + def ===(other); end - # foo => [*, bar, *] - # ^^^^^^^^^^^ + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#616 - def visit_find_pattern_node(node); end + # source://prism/lib/prism/node.rb#16816 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # 0..5 - # ^^^^ - # if foo .. bar; end - # ^^^^^^^^^^ + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1302 - def visit_flip_flop_node(node); end + # source://prism/lib/prism/node.rb#16821 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # 1.0 - # ^^^ + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#628 - def visit_float_node(node); end + # source://prism/lib/prism/node.rb#16831 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # for foo in bar do end - # ^^^^^^^^^^^^^^^^^^^^^ + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#634 - def visit_for_node(node); end + # source://prism/lib/prism/node.rb#16826 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # def foo(...); bar(...); end - # ^^^ + # def copy: (?flags: Integer, ?write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, ?location: Location) -> ShareableConstantNode # - # source://prism/lib/prism/translation/parser/compiler.rb#652 - def visit_forwarding_arguments_node(node); end + # source://prism/lib/prism/node.rb#16836 + sig do + params( + flags: Integer, + write: T.any(Prism::ConstantWriteNode, Prism::ConstantAndWriteNode, Prism::ConstantOrWriteNode, Prism::ConstantOperatorWriteNode, Prism::ConstantPathWriteNode, Prism::ConstantPathAndWriteNode, Prism::ConstantPathOrWriteNode, Prism::ConstantPathOperatorWriteNode), + location: Prism::Location + ).returns(Prism::ShareableConstantNode) + end + def copy(flags: T.unsafe(nil), write: T.unsafe(nil), location: T.unsafe(nil)); end - # def foo(...); end - # ^^^ + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#658 - def visit_forwarding_parameter_node(node); end + # source://prism/lib/prism/node.rb#16821 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # super - # ^^^^^ + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode, location: Location } # - # super {} - # ^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#667 - def visit_forwarding_super_node(node); end + # source://prism/lib/prism/node.rb#16844 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # $foo += bar - # ^^^^^^^^^^^ - # $foo &&= bar - # ^^^^^^^^^^^^ + # def experimental_copy?: () -> bool # - # source://prism/lib/prism/translation/parser/compiler.rb#698 - def visit_global_variable_and_write_node(node); end - - # $foo += bar - # ^^^^^^^^^^^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#698 - def visit_global_variable_operator_write_node(node); end + # source://prism/lib/prism/node.rb#16866 + sig { returns(T::Boolean) } + def experimental_copy?; end - # $foo += bar - # ^^^^^^^^^^^ - # $foo ||= bar - # ^^^^^^^^^^^^ + # def experimental_everything?: () -> bool # - # source://prism/lib/prism/translation/parser/compiler.rb#698 - def visit_global_variable_or_write_node(node); end - - # $foo - # ^^^^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#679 - def visit_global_variable_read_node(node); end + # source://prism/lib/prism/node.rb#16861 + sig { returns(T::Boolean) } + def experimental_everything?; end - # $foo, = bar - # ^^^^ + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#716 - def visit_global_variable_target_node(node); end + # source://prism/lib/prism/node.rb#16871 + sig { override.returns(String) } + def inspect; end - # $foo = 1 - # ^^^^^^^^ + # def literal?: () -> bool # - # $foo, $bar = 1 - # ^^^^ ^^^^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#688 - def visit_global_variable_write_node(node); end + # source://prism/lib/prism/node.rb#16856 + 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. # - # source://prism/lib/prism/translation/parser/compiler.rb#722 - def visit_hash_node(node); end + # 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#16889 + sig { override.returns(Symbol) } + def type; end - # foo => {} - # ^^ + # The constant write that should be modified with the shareability state. # - # source://prism/lib/prism/translation/parser/compiler.rb#732 - def visit_hash_pattern_node(node); end + # source://prism/lib/prism/node.rb#16853 + 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 - # if foo then bar end - # ^^^^^^^^^^^^^^^^^^^ + protected + + # protected attr_reader flags: Integer # - # bar if foo - # ^^^^^^^^^^ + # source://prism/lib/prism/node.rb#16849 + 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 + # + # source://prism/lib/prism/node.rb#16899 + def type; end + end +end + +# Flags for shareable constant nodes. +# +# source://prism/lib/prism/node.rb#19256 +module Prism::ShareableConstantNodeFlags; end + +# constant writes that should be modified with shareable constant value experimental copy +# +# source://prism/lib/prism/node.rb#19264 +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#19261 +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#19258 +Prism::ShareableConstantNodeFlags::LITERAL = T.let(T.unsafe(nil), Integer) + +# Represents a singleton class declaration involving the `class` keyword. +# +# class << self end +# ^^^^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#16916 +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 # - # foo ? bar : baz - # ^^^^^^^^^^^^^^^ + # @return [SingletonClassNode] a new instance of SingletonClassNode # - # source://prism/lib/prism/translation/parser/compiler.rb#750 - def visit_if_node(node); end + # source://prism/lib/prism/node.rb#16918 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location); end - # 1i + # 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/translation/parser/compiler.rb#791 - def visit_imaginary_node(node); end + # source://prism/lib/prism/node.rb#17045 + def ===(other); end - # { foo: } - # ^^^^ - # - # @raise [CompilationError] + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#797 - def visit_implicit_node(node); end + # source://prism/lib/prism/node.rb#16930 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # foo { |bar,| } - # ^ + # attr_reader body: Prism::node? # - # @raise [CompilationError] + # source://prism/lib/prism/node.rb#16986 + sig { returns(T.nilable(Prism::Node)) } + def body; end + + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#803 - def visit_implicit_rest_node(node); end + # source://prism/lib/prism/node.rb#16935 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # case foo; in bar; end - # ^^^^^^^^^^^^^^^^^^^^^ + # def class_keyword: () -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#809 - def visit_in_node(node); end + # source://prism/lib/prism/node.rb#16996 + sig { returns(String) } + def class_keyword; end - # foo[bar] += baz - # ^^^^^^^^^^^^^^^ - # foo[bar] &&= baz - # ^^^^^^^^^^^^^^^^ + # attr_reader class_keyword_loc: Location # - # source://prism/lib/prism/translation/parser/compiler.rb#835 - def visit_index_and_write_node(node); end + # source://prism/lib/prism/node.rb#16969 + sig { returns(Prism::Location) } + def class_keyword_loc; end - # foo[bar] += baz - # ^^^^^^^^^^^^^^^ + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#835 - def visit_index_operator_write_node(node); end + # source://prism/lib/prism/node.rb#16948 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # foo[bar] += baz - # ^^^^^^^^^^^^^^^ - # foo[bar] ||= baz - # ^^^^^^^^^^^^^^^^ + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#835 - def visit_index_or_write_node(node); end + # source://prism/lib/prism/node.rb#16940 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # foo[bar], = 1 - # ^^^^^^^^ + # 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 # - # source://prism/lib/prism/translation/parser/compiler.rb#861 - def visit_index_target_node(node); end + # source://prism/lib/prism/node.rb#16953 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#891 - def visit_instance_variable_and_write_node(node); end + # source://prism/lib/prism/node.rb#16935 + 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 } # - # source://prism/lib/prism/translation/parser/compiler.rb#891 - def visit_instance_variable_operator_write_node(node); end + # source://prism/lib/prism/node.rb#16961 + 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/translation/parser/compiler.rb#891 - def visit_instance_variable_or_write_node(node); end + # source://prism/lib/prism/node.rb#17006 + sig { returns(String) } + def end_keyword; end - # ^^^^ + # attr_reader end_keyword_loc: Location # - # source://prism/lib/prism/translation/parser/compiler.rb#872 - def visit_instance_variable_read_node(node); end + # source://prism/lib/prism/node.rb#16989 + sig { returns(Prism::Location) } + def end_keyword_loc; end - # @foo, = bar - # ^^^^ + # attr_reader expression: Prism::node # - # source://prism/lib/prism/translation/parser/compiler.rb#909 - def visit_instance_variable_target_node(node); end + # source://prism/lib/prism/node.rb#16983 + sig { returns(Prism::Node) } + def expression; end - # ^^^^^^^^ + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # @foo, @bar = 1 - # ^^^^ ^^^^ + # source://prism/lib/prism/node.rb#17011 + sig { override.returns(String) } + def inspect; end + + # attr_reader locals: Array[Symbol] # - # source://prism/lib/prism/translation/parser/compiler.rb#881 - def visit_instance_variable_write_node(node); end + # source://prism/lib/prism/node.rb#16966 + sig { returns(T::Array[Symbol]) } + def locals; end - # 1 - # ^ + # def operator: () -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#915 - def visit_integer_node(node); end + # source://prism/lib/prism/node.rb#17001 + sig { returns(String) } + def operator; end - # /foo #{bar}/ - # ^^^^^^^^^^^^ - # if /foo #{bar}/ then end - # ^^^^^^^^^^^^ + # attr_reader operator_loc: Location # - # source://prism/lib/prism/translation/parser/compiler.rb#921 - def visit_interpolated_match_last_line_node(node); end + # source://prism/lib/prism/node.rb#16976 + sig { returns(Prism::Location) } + def operator_loc; end - # /foo #{bar}/ - # ^^^^^^^^^^^^ + # 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. # - # source://prism/lib/prism/translation/parser/compiler.rb#921 - def visit_interpolated_regular_expression_node(node); end + # 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#17029 + sig { override.returns(Symbol) } + def type; end - # "foo #{bar}" - # ^^^^^^^^^^^^ + 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 + # + # source://prism/lib/prism/node.rb#17039 + def type; end + end +end + +# This represents a source of Ruby code that has been parsed. It is used in +# conjunction with locations to allow them to resolve line numbers and source +# ranges. +# +# source://prism/lib/prism/parse_result.rb#7 +class Prism::Source + # Create a new source object with the given source code. # - # source://prism/lib/prism/translation/parser/compiler.rb#936 - def visit_interpolated_string_node(node); end + # @return [Source] a new instance of Source + # + # source://prism/lib/prism/parse_result.rb#26 + 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 - # :"foo #{bar}" - # ^^^^^^^^^^^^^ + # Return the column number in characters for the given byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#951 - def visit_interpolated_symbol_node(node); end + # source://prism/lib/prism/parse_result.rb#78 + sig { params(byte_offset: Integer).returns(Integer) } + def character_column(byte_offset); end - # `foo #{bar}` - # ^^^^^^^^^^^^ + # Return the character offset for the given byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#961 - def visit_interpolated_x_string_node(node); end + # source://prism/lib/prism/parse_result.rb#73 + sig { params(byte_offset: Integer).returns(Integer) } + def character_offset(byte_offset); end - # foo(bar: baz) - # ^^^^^^^^ + # Returns the column number in code units for the given encoding for the + # given byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#976 - def visit_keyword_hash_node(node); end + # source://prism/lib/prism/parse_result.rb#95 + sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) } + def code_units_column(byte_offset, encoding); end - # def foo(**bar); end - # ^^^^^ + # Returns the offset from the start of the file for the given byte offset + # counting in code units for the given encoding. # - # def foo(**); end - # ^^ + # This method is tested with UTF-8, UTF-16, and UTF-32. If there is the + # concept of code units that differs from the number of characters in other + # encodings, it is not captured here. # - # source://prism/lib/prism/translation/parser/compiler.rb#985 - def visit_keyword_rest_parameter_node(node); end + # source://prism/lib/prism/parse_result.rb#88 + 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/translation/parser/compiler.rb#993 - def visit_lambda_node(node); end + # source://prism/lib/prism/parse_result.rb#68 + sig { params(byte_offset: Integer).returns(Integer) } + def column(byte_offset); end - # foo += bar - # ^^^^^^^^^^ - # foo &&= bar - # ^^^^^^^^^^^ + # 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/translation/parser/compiler.rb#1037 - def visit_local_variable_and_write_node(node); end + # source://prism/lib/prism/parse_result.rb#34 + sig { returns(Encoding) } + def encoding; end - # foo += bar - # ^^^^^^^^^^ + # Binary search through the offsets to find the line number for the given + # byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#1037 - def visit_local_variable_operator_write_node(node); end + # source://prism/lib/prism/parse_result.rb#51 + sig { params(byte_offset: Integer).returns(Integer) } + def line(byte_offset); end - # foo += bar - # ^^^^^^^^^^ - # foo ||= bar - # ^^^^^^^^^^^ + # Returns the byte offset of the end of the line corresponding to the given + # byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#1037 - def visit_local_variable_or_write_node(node); end + # source://prism/lib/prism/parse_result.rb#63 + def line_end(byte_offset); end - # foo - # ^^^ + # Return the byte offset of the start of the line corresponding to the given + # byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#1018 - def visit_local_variable_read_node(node); end + # source://prism/lib/prism/parse_result.rb#57 + sig { params(byte_offset: Integer).returns(Integer) } + def line_start(byte_offset); end - # foo, = bar - # ^^^ + # Returns the lines of the source code as an array of strings. # - # source://prism/lib/prism/translation/parser/compiler.rb#1055 - def visit_local_variable_target_node(node); end + # source://prism/lib/prism/parse_result.rb#39 + sig { returns(T::Array[String]) } + def lines; end - # foo = 1 - # ^^^^^^^ - # - # foo, bar = 1 - # ^^^ ^^^ + # The list of newline byte offsets in the source code. # - # source://prism/lib/prism/translation/parser/compiler.rb#1027 - def visit_local_variable_write_node(node); end + # source://prism/lib/prism/parse_result.rb#23 + sig { returns(T::Array[Integer]) } + def offsets; end - # /foo/ - # ^^^^^ - # if /foo/ then end - # ^^^^^ + # Perform a byteslice on the source code using the given byte offset and + # byte length. # - # source://prism/lib/prism/translation/parser/compiler.rb#1336 - def visit_match_last_line_node(node); end - - # source://prism/lib/prism/translation/parser/compiler.rb#1066 - def visit_match_predicate_node(node); end + # source://prism/lib/prism/parse_result.rb#45 + sig { params(byte_offset: Integer, length: Integer).returns(String) } + def slice(byte_offset, length); end - # foo => bar - # ^^^^^^^^^^ + # The source code that this source object represents. # - # source://prism/lib/prism/translation/parser/compiler.rb#1085 - def visit_match_required_node(node); end + # source://prism/lib/prism/parse_result.rb#17 + sig { returns(String) } + def source; end - # /(?foo)/ =~ bar - # ^^^^^^^^^^^^^^^^^^^^ + # The line number where this source starts. # - # source://prism/lib/prism/translation/parser/compiler.rb#1095 - def visit_match_write_node(node); end + # source://prism/lib/prism/parse_result.rb#20 + sig { returns(Integer) } + def start_line; 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#1106 - def visit_missing_node(node); end + private - # module Foo; end - # ^^^^^^^^^^^^^^^ + # Binary search through the offsets to find the line number for the given + # byte offset. # - # source://prism/lib/prism/translation/parser/compiler.rb#1112 - def visit_module_node(node); end + # source://prism/lib/prism/parse_result.rb#103 + def find_line(byte_offset); end - # foo, bar = baz - # ^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1123 - def visit_multi_target_node(node); end + class << self + # Create a new source object with the given source code. This method should + # be used instead of `new` and it will return either a `Source` or a + # specialized and more performant `ASCIISource` if no multibyte characters + # are present in the source code. + # + # source://prism/lib/prism/parse_result.rb#12 + def for(source, start_line = T.unsafe(nil), offsets = T.unsafe(nil)); end + end +end - # foo, bar = baz - # ^^^^^^^^^^^^^^ +# Represents the use of the `__ENCODING__` keyword. +# +# __ENCODING__ +# ^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#17061 +class Prism::SourceEncodingNode < ::Prism::Node + # def initialize: (Location location) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1137 - def visit_multi_write_node(node); end - - # next - # ^^^^ + # @return [SourceEncodingNode] a new instance of SourceEncodingNode # - # next foo - # ^^^^^^^^ + # source://prism/lib/prism/node.rb#17063 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); 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/translation/parser/compiler.rb#1158 - def visit_next_node(node); end + # source://prism/lib/prism/node.rb#17136 + def ===(other); end - # nil - # ^^^ + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1170 - def visit_nil_node(node); end + # source://prism/lib/prism/node.rb#17069 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # def foo(**nil); end - # ^^^^^ + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1176 - def visit_no_keywords_parameter_node(node); end + # source://prism/lib/prism/node.rb#17074 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # -> { _1 + _2 } - # ^^^^^^^^^^^^^^ + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#1186 - def visit_numbered_parameters_node(node); end + # source://prism/lib/prism/node.rb#17084 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # $1 - # ^^ + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1192 - def visit_numbered_reference_read_node(node); end + # source://prism/lib/prism/node.rb#17079 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # def foo(bar: baz); end - # ^^^^^^^^ + # def copy: (?location: Location) -> SourceEncodingNode # - # source://prism/lib/prism/translation/parser/compiler.rb#1198 - def visit_optional_keyword_parameter_node(node); end + # source://prism/lib/prism/node.rb#17089 + sig { params(location: Prism::Location).returns(Prism::SourceEncodingNode) } + def copy(location: T.unsafe(nil)); end - # def foo(bar = 1); end - # ^^^^^^^ + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1204 - def visit_optional_parameter_node(node); end + # source://prism/lib/prism/node.rb#17074 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # a or b - # ^^^^^^ + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/translation/parser/compiler.rb#1210 - def visit_or_node(node); end + # source://prism/lib/prism/node.rb#17097 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # def foo(bar, *baz); end - # ^^^^^^^^^ + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#1216 - def visit_parameters_node(node); end + # source://prism/lib/prism/node.rb#17102 + 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. # - # (1) - # ^^^ + # 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/translation/parser/compiler.rb#1255 - def visit_parentheses_node(node); end - - # foo => ^(bar) - # ^^^^^^ + # def type: () -> Symbol # - # source://prism/lib/prism/translation/parser/compiler.rb#1265 - def visit_pinned_expression_node(node); end + # source://prism/lib/prism/node.rb#17120 + sig { override.returns(Symbol) } + def type; end - # foo = 1 and bar => ^foo - # ^^^^ + 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 + # + # source://prism/lib/prism/node.rb#17130 + def type; end + end +end + +# Represents the use of the `__FILE__` keyword. +# +# __FILE__ +# ^^^^^^^^ +# +# source://prism/lib/prism/node.rb#17145 +class Prism::SourceFileNode < ::Prism::Node + # def initialize: (Integer flags, String filepath, Location location) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1271 - def visit_pinned_variable_node(node); end + # @return [SourceFileNode] a new instance of SourceFileNode + # + # source://prism/lib/prism/node.rb#17147 + sig { params(source: Prism::Source, flags: Integer, filepath: String, location: Prism::Location).void } + def initialize(source, flags, filepath, location); end - # 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/translation/parser/compiler.rb#1276 - def visit_post_execution_node(node); end + # source://prism/lib/prism/node.rb#17249 + def ===(other); end - # BEGIN {} + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1286 - def visit_pre_execution_node(node); end + # source://prism/lib/prism/node.rb#17155 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # The top-level program node. + # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1296 - def visit_program_node(node); end + # source://prism/lib/prism/node.rb#17160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end - # 0..5 - # ^^^^ + # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/translation/parser/compiler.rb#1302 - def visit_range_node(node); end + # source://prism/lib/prism/node.rb#17170 + sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) } + def comment_targets; end - # 1r - # ^^ + # def compact_child_nodes: () -> Array[Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1324 - def visit_rational_node(node); end + # source://prism/lib/prism/node.rb#17165 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # redo - # ^^^^ + # def copy: (?flags: Integer, ?filepath: String, ?location: Location) -> SourceFileNode # - # source://prism/lib/prism/translation/parser/compiler.rb#1330 - def visit_redo_node(node); end + # source://prism/lib/prism/node.rb#17175 + 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 - # /foo/ - # ^^^^^ + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/translation/parser/compiler.rb#1336 - def visit_regular_expression_node(node); end + # source://prism/lib/prism/node.rb#17160 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end - # def foo(bar:); end - # ^^^^ + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, filepath: String, location: Location } # - # source://prism/lib/prism/translation/parser/compiler.rb#1351 - def visit_required_keyword_parameter_node(node); end + # source://prism/lib/prism/node.rb#17183 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end - # def foo(bar); end - # ^^^ + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # Represents the file path being parsed. This corresponds directly to the `filepath` option given to the various `Prism::parse*` APIs. # - # source://prism/lib/prism/translation/parser/compiler.rb#1357 - def visit_required_parameter_node(node); end + # source://prism/lib/prism/node.rb#17192 + sig { returns(String) } + def filepath; end - # foo rescue bar - # ^^^^^^^^^^^^^^ + # def forced_binary_encoding?: () -> bool # - # source://prism/lib/prism/translation/parser/compiler.rb#1363 - def visit_rescue_modifier_node(node); end + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17200 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end - # begin; rescue; end - # ^^^^^^^ + # def forced_utf8_encoding?: () -> bool # - # @raise [CompilationError] + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#1381 - def visit_rescue_node(node); end + # source://prism/lib/prism/node.rb#17195 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end - # def foo(*bar); end - # ^^^^ + # def frozen?: () -> bool # - # def foo(*); end - # ^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#1390 - def visit_rest_parameter_node(node); end + # source://prism/lib/prism/node.rb#17205 + sig { returns(T::Boolean) } + def frozen?; end - # retry - # ^^^^^ + # def inspect -> String # - # source://prism/lib/prism/translation/parser/compiler.rb#1396 - def visit_retry_node(node); end + # source://prism/lib/prism/node.rb#17215 + sig { override.returns(String) } + def inspect; end - # return - # ^^^^^^ + # def mutable?: () -> bool # - # return 1 - # ^^^^^^^^ + # @return [Boolean] # - # source://prism/lib/prism/translation/parser/compiler.rb#1405 - def visit_return_node(node); end + # source://prism/lib/prism/node.rb#17210 + sig { returns(T::Boolean) } + def mutable?; end - # self - # ^^^^ + # 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. # - # source://prism/lib/prism/translation/parser/compiler.rb#1417 - def visit_self_node(node); end + # 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#17233 + sig { override.returns(Symbol) } + def type; end - # class << self; end - # ^^^^^^^^^^^^^^^^^^ + protected + + # protected attr_reader flags: Integer # - # source://prism/lib/prism/translation/parser/compiler.rb#1423 - def visit_singleton_class_node(node); end + # source://prism/lib/prism/node.rb#17188 + sig { returns(Integer) } + def flags; end - # __ENCODING__ - # ^^^^^^^^^^^^ + 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 + # + # source://prism/lib/prism/node.rb#17243 + def type; end + end +end + +# Represents the use of the `__LINE__` keyword. +# +# __LINE__ +# ^^^^^^^^ +# +# source://prism/lib/prism/node.rb#17260 +class Prism::SourceLineNode < ::Prism::Node + # def initialize: (Location location) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1435 - def visit_source_encoding_node(node); end + # @return [SourceLineNode] a new instance of SourceLineNode + # + # source://prism/lib/prism/node.rb#17262 + sig { params(source: Prism::Source, location: Prism::Location).void } + def initialize(source, location); end - # __FILE__ - # ^^^^^^^^ + # 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/translation/parser/compiler.rb#1441 - def visit_source_file_node(node); end + # source://prism/lib/prism/node.rb#17335 + def ===(other); end - # __LINE__ - # ^^^^^^^^ + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/translation/parser/compiler.rb#1447 - def visit_source_line_node(node); end + # source://prism/lib/prism/node.rb#17268 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end - # foo(*bar) - # ^^^^ + # def child_nodes: () -> Array[nil | Node] # - # def foo((bar, *baz)); end - # ^^^^ + # source://prism/lib/prism/node.rb#17273 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def comment_targets: () -> Array[Node | Location] # - # def foo(*); bar(*); end - # ^ + # source://prism/lib/prism/node.rb#17283 + 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/translation/parser/compiler.rb#1459 - def visit_splat_node(node); end + # source://prism/lib/prism/node.rb#17278 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end - # A list of statements. + # def copy: (?location: Location) -> SourceLineNode # - # source://prism/lib/prism/translation/parser/compiler.rb#1472 - def visit_statements_node(node); end + # source://prism/lib/prism/node.rb#17288 + sig { params(location: Prism::Location).returns(Prism::SourceLineNode) } + def copy(location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17273 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } + # + # source://prism/lib/prism/node.rb#17296 + 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 + # + # source://prism/lib/prism/node.rb#17301 + 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 + # + # source://prism/lib/prism/node.rb#17319 + 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 + # + # source://prism/lib/prism/node.rb#17329 + def type; end + end +end + +# Represents the use of the splat operator. +# +# [*a] +# ^^ +# +# source://prism/lib/prism/node.rb#17344 +class Prism::SplatNode < ::Prism::Node + # def initialize: (Location operator_loc, Prism::node? expression, Location location) -> void + # + # @return [SplatNode] a new instance of SplatNode + # + # source://prism/lib/prism/node.rb#17346 + sig do + params( + source: Prism::Source, + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).void + end + def initialize(source, operator_loc, expression, location); 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#17438 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#17354 + 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#17359 + 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#17371 + 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#17364 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?operator_loc: Location, ?expression: Prism::node?, ?location: Location) -> SplatNode + # + # source://prism/lib/prism/node.rb#17376 + sig do + params( + operator_loc: Prism::Location, + expression: T.nilable(Prism::Node), + location: Prism::Location + ).returns(Prism::SplatNode) + end + def copy(operator_loc: T.unsafe(nil), expression: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17359 + 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 } + # + # source://prism/lib/prism/node.rb#17384 + 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#17396 + sig { returns(T.nilable(Prism::Node)) } + def expression; end + + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#17404 + sig { override.returns(String) } + def inspect; end + + # def operator: () -> String + # + # source://prism/lib/prism/node.rb#17399 + sig { returns(String) } + def operator; end + + # attr_reader operator_loc: Location + # + # source://prism/lib/prism/node.rb#17389 + 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 + # + # source://prism/lib/prism/node.rb#17422 + 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 + # + # source://prism/lib/prism/node.rb#17432 + def type; end + end +end + +# Represents a set of statements contained within some scope. +# +# foo; bar; baz +# ^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#17449 +class Prism::StatementsNode < ::Prism::Node + # def initialize: (Array[Prism::node] body, Location location) -> void + # + # @return [StatementsNode] a new instance of StatementsNode + # + # source://prism/lib/prism/node.rb#17451 + sig { params(source: Prism::Source, body: T::Array[Prism::Node], location: Prism::Location).void } + def initialize(source, body, location); 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#17528 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#17458 + 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#17491 + sig { returns(T::Array[Prism::Node]) } + def body; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17463 + 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#17473 + 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#17468 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def copy: (?body: Array[Prism::node], ?location: Location) -> StatementsNode + # + # source://prism/lib/prism/node.rb#17478 + sig { params(body: T::Array[Prism::Node], location: Prism::Location).returns(Prism::StatementsNode) } + def copy(body: T.unsafe(nil), location: T.unsafe(nil)); end + + # def child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17463 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def deconstruct; end + + # def deconstruct_keys: (Array[Symbol] keys) -> { body: Array[Prism::node], location: Location } + # + # source://prism/lib/prism/node.rb#17486 + 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 + # + # source://prism/lib/prism/node.rb#17494 + 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 + # + # source://prism/lib/prism/node.rb#17512 + 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 + # + # source://prism/lib/prism/node.rb#17522 + def type; end + end +end + +# Flags for string nodes. +# +# source://prism/lib/prism/node.rb#19268 +module Prism::StringFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism/lib/prism/node.rb#19273 +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#19270 +Prism::StringFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# source://prism/lib/prism/node.rb#19276 +Prism::StringFlags::FROZEN = T.let(T.unsafe(nil), Integer) + +# source://prism/lib/prism/node.rb#19279 +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. +# +# "foo" +# ^^^^^ +# +# %w[foo] +# ^^^ +# +# "foo #{bar} baz" +# ^^^^ ^^^^ +# +# source://prism/lib/prism/node.rb#17545 +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 + # + # @return [StringNode] a new instance of StringNode + # + # source://prism/lib/prism/node.rb#17547 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).void + end + def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); 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#17700 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#17558 + 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#17563 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism/lib/prism/node.rb#17661 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism/lib/prism/node.rb#17615 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism/lib/prism/node.rb#17573 + 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#17568 + sig { override.returns(T::Array[Prism::Node]) } + def compact_child_nodes; end + + # def content: () -> String + # + # source://prism/lib/prism/node.rb#17656 + sig { returns(String) } + def content; end + + # attr_reader content_loc: Location + # + # source://prism/lib/prism/node.rb#17608 + 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 + # + # source://prism/lib/prism/node.rb#17578 + sig do + params( + flags: Integer, + opening_loc: T.nilable(Prism::Location), + content_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + unescaped: String, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17563 + 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 } + # + # source://prism/lib/prism/node.rb#17586 + 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 forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17636 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17631 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def frozen?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17641 + sig { returns(T::Boolean) } + def frozen?; end + + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#17666 + sig { override.returns(String) } + def inspect; end + + # def mutable?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17646 + sig { returns(T::Boolean) } + def mutable?; end + + # def opening: () -> String? + # + # source://prism/lib/prism/node.rb#17651 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism/lib/prism/node.rb#17595 + 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#69 + 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 + # + # source://prism/lib/prism/node.rb#17684 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism/lib/prism/node.rb#17628 + sig { returns(String) } + def unescaped; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#17591 + 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 + # + # source://prism/lib/prism/node.rb#17694 + def type; end + end +end + +# Represents the use of the `super` keyword with parentheses or arguments. +# +# super() +# ^^^^^^^ +# +# super foo, bar +# ^^^^^^^^^^^^^^ +# +# source://prism/lib/prism/node.rb#17717 +class Prism::SuperNode < ::Prism::Node + # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Prism::node? block, Location location) -> void + # + # @return [SuperNode] a new instance of SuperNode + # + # source://prism/lib/prism/node.rb#17719 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location); 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#17854 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#17730 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } + def accept(visitor); end + + # attr_reader arguments: ArgumentsNode? + # + # source://prism/lib/prism/node.rb#17786 + sig { returns(T.nilable(Prism::ArgumentsNode)) } + def arguments; end + + # attr_reader block: Prism::node? + # + # source://prism/lib/prism/node.rb#17802 + sig { returns(T.nilable(Prism::Node)) } + def block; end + + # def child_nodes: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17735 + 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#17748 + 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#17740 + 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 + # + # source://prism/lib/prism/node.rb#17753 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17735 + 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 } + # + # source://prism/lib/prism/node.rb#17761 + 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 + # + # source://prism/lib/prism/node.rb#17820 + sig { override.returns(String) } + def inspect; end + + # def keyword: () -> String + # + # source://prism/lib/prism/node.rb#17805 + sig { returns(String) } + def keyword; end + + # attr_reader keyword_loc: Location + # + # source://prism/lib/prism/node.rb#17766 + sig { returns(Prism::Location) } + def keyword_loc; end + + # def lparen: () -> String? + # + # source://prism/lib/prism/node.rb#17810 + sig { returns(T.nilable(String)) } + def lparen; end + + # attr_reader lparen_loc: Location? + # + # source://prism/lib/prism/node.rb#17773 + sig { returns(T.nilable(Prism::Location)) } + def lparen_loc; end + + # def rparen: () -> String? + # + # source://prism/lib/prism/node.rb#17815 + sig { returns(T.nilable(String)) } + def rparen; end + + # attr_reader rparen_loc: Location? + # + # source://prism/lib/prism/node.rb#17789 + 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 + # + # source://prism/lib/prism/node.rb#17838 + 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 + # + # source://prism/lib/prism/node.rb#17848 + def type; end + end +end + +# Flags for symbol nodes. +# +# source://prism/lib/prism/node.rb#19283 +module Prism::SymbolFlags; end + +# internal bytes forced the encoding to binary +# +# source://prism/lib/prism/node.rb#19288 +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#19291 +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#19285 +Prism::SymbolFlags::FORCED_UTF8_ENCODING = T.let(T.unsafe(nil), Integer) + +# Represents a symbol literal or a symbol contained within a `%i` list. +# +# :foo +# ^^^^ +# +# %i[foo] +# ^^^ +# +# source://prism/lib/prism/node.rb#17871 +class Prism::SymbolNode < ::Prism::Node + # def initialize: (Integer flags, Location? opening_loc, Location? value_loc, Location? closing_loc, String unescaped, Location location) -> void + # + # @return [SymbolNode] a new instance of SymbolNode + # + # source://prism/lib/prism/node.rb#17873 + sig do + params( + source: Prism::Source, + 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 + ).void + end + def initialize(source, flags, opening_loc, value_loc, closing_loc, unescaped, location); 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#18027 + def ===(other); end + + # def accept: (Visitor visitor) -> void + # + # source://prism/lib/prism/node.rb#17884 + 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#17889 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } + def child_nodes; end + + # def closing: () -> String? + # + # source://prism/lib/prism/node.rb#17988 + sig { returns(T.nilable(String)) } + def closing; end + + # attr_reader closing_loc: Location? + # + # source://prism/lib/prism/node.rb#17947 + sig { returns(T.nilable(Prism::Location)) } + def closing_loc; end + + # def comment_targets: () -> Array[Node | Location] + # + # source://prism/lib/prism/node.rb#17899 + 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#17894 + 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 + # + # source://prism/lib/prism/node.rb#17904 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] + # def deconstruct: () -> Array[nil | Node] + # + # source://prism/lib/prism/node.rb#17889 + 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 } + # + # source://prism/lib/prism/node.rb#17912 + 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 forced_binary_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17968 + sig { returns(T::Boolean) } + def forced_binary_encoding?; end + + # def forced_us_ascii_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17973 + sig { returns(T::Boolean) } + def forced_us_ascii_encoding?; end + + # def forced_utf8_encoding?: () -> bool + # + # @return [Boolean] + # + # source://prism/lib/prism/node.rb#17963 + sig { returns(T::Boolean) } + def forced_utf8_encoding?; end + + # def inspect -> String + # + # source://prism/lib/prism/node.rb#17993 + sig { override.returns(String) } + def inspect; end + + # def opening: () -> String? + # + # source://prism/lib/prism/node.rb#17978 + sig { returns(T.nilable(String)) } + def opening; end + + # attr_reader opening_loc: Location? + # + # source://prism/lib/prism/node.rb#17921 + 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 + # + # source://prism/lib/prism/node.rb#18011 + sig { override.returns(Symbol) } + def type; end + + # attr_reader unescaped: String + # + # source://prism/lib/prism/node.rb#17960 + sig { returns(String) } + def unescaped; end + + # def value: () -> String? + # + # source://prism/lib/prism/node.rb#17983 + sig { returns(T.nilable(String)) } + def value; end + + # attr_reader value_loc: Location? + # + # source://prism/lib/prism/node.rb#17934 + sig { returns(T.nilable(Prism::Location)) } + def value_loc; end + + protected + + # protected attr_reader flags: Integer + # + # source://prism/lib/prism/node.rb#17917 + 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 + # + # source://prism/lib/prism/node.rb#18021 + def type; end + end +end + +# This represents a token from the Ruby source. +# +# source://prism/lib/prism/parse_result.rb#645 +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#657 + 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#692 + 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#665 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } + def deconstruct_keys(keys); end + + # A Location object representing the location of this token in the source. + # + # source://prism/lib/prism/parse_result.rb#670 + sig { returns(Prism::Location) } + def location; end + + # Implement the pretty print interface for Token. + # + # source://prism/lib/prism/parse_result.rb#677 + 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#651 + sig { returns(Symbol) } + def type; end + + # A byteslice of the source that this token represents. + # + # source://prism/lib/prism/parse_result.rb#654 + sig { returns(String) } + def value; end + + private + + # The Source object that represents the source this token came from. + # + # source://prism/lib/prism/parse_result.rb#647 + sig { returns(Prism::Source) } + def source; end +end + +# This module is responsible for converting the prism syntax tree into other +# syntax trees. +# +# source://prism/lib/prism/translation.rb#6 +module Prism::Translation; end + +# This class is the entry-point for converting a prism syntax tree into the +# whitequark/parser gem's syntax tree. It inherits from the base parser for +# the parser gem, and overrides the parse* methods to parse with prism and +# then translate. +# +# 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#41 + def default_encoding; end + + # Parses a source buffer and returns the AST. + # + # 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#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#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#105 + def try_declare_numparam(node); end + + # source://prism/lib/prism/translation/parser.rb#36 + sig { overridable.returns(Integer) } + def version; end + + # 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#263 + def build_ast(program, offset_cache); end + + # Build the parser gem comments from the prism comments. + # + # 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 + # offsets in characters. We need to handle this conversion in order to + # build the parser gem AST. + # + # If the bytesize of the source is the same as the length, then we can + # 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#246 + def build_offset_cache(source); end + + # Build a range from a prism location. + # + # 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#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#289 + def convert_for_prism(version); end + + # Build a diagnostic from the given prism parse error. + # + # 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#224 + def unwrap(result, offset_cache); end + + # This is a hook to allow consumers to disable some errors if they don't + # want them to block creating the syntax tree. + # + # @return [Boolean] + # + # 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 + # want them to block creating the syntax tree. + # + # @return [Boolean] + # + # 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#197 + def warning_diagnostic(warning, offset_cache); end +end + +# This class is the entry-point for Ruby 3.3 of `Prism::Translation::Parser`. +# +# source://prism/lib/prism/translation/parser33.rb#6 +class Prism::Translation::Parser33 < ::Prism::Translation::Parser + # source://prism/lib/prism/translation/parser33.rb#7 + sig { override.returns(Integer) } + def version; end +end + +# This class is the entry-point for Ruby 3.4 of `Prism::Translation::Parser`. +# +# source://prism/lib/prism/translation/parser34.rb#6 +class Prism::Translation::Parser34 < ::Prism::Translation::Parser + # source://prism/lib/prism/translation/parser34.rb#7 + sig { override.returns(Integer) } + def version; end +end + +# A visitor that knows how to convert a prism syntax tree into the +# whitequark/parser gem's syntax tree. +# +# source://prism/lib/prism/translation/parser/compiler.rb#8 +class Prism::Translation::Parser::Compiler < ::Prism::Compiler + # Initialize a new compiler with the given parser, offset cache, and + # options. + # + # @return [Compiler] a new instance of Compiler + # + # source://prism/lib/prism/translation/parser/compiler.rb#39 + def initialize(parser, offset_cache, forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + + # The Parser::Builders::Default instance that is being used to build the + # AST. + # + # source://prism/lib/prism/translation/parser/compiler.rb#18 + def builder; end + + # The types of values that can be forwarded in the current scope. + # + # source://prism/lib/prism/translation/parser/compiler.rb#29 + def forwarding; end + + # Whether or not the current node is in a destructure. + # + # source://prism/lib/prism/translation/parser/compiler.rb#32 + def in_destructure; end + + # Whether or not the current node is in a pattern. + # + # source://prism/lib/prism/translation/parser/compiler.rb#35 + def in_pattern; end + + # The offset cache that is used to map between byte and character + # offsets in the file. + # + # source://prism/lib/prism/translation/parser/compiler.rb#26 + def offset_cache; end + + # The Parser::Base instance that is being used to build the AST. + # + # source://prism/lib/prism/translation/parser/compiler.rb#14 + def parser; end + + # The Parser::Source::Buffer instance that is holding a reference to the + # source code. + # + # source://prism/lib/prism/translation/parser/compiler.rb#22 + def source_buffer; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#58 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#52 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#64 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#70 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#105 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#76 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#82 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#111 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#160 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # 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#178 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # 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#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#227 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # 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#238 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # 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#352 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # 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#333 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # 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#390 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # 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#421 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # 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#434 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # 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#463 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # 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#447 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # 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#453 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # 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#514 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # 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#590 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # 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#580 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # 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#610 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # 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#499 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#544 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#508 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#619 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # 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#678 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # 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#694 + def visit_embedded_variable_node(node); end + + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # + # @raise [CompilationError] + # + # source://prism/lib/prism/translation/parser/compiler.rb#700 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # 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#712 + def visit_find_pattern_node(node); end + + # 0..5 + # ^^^^ + # if foo .. bar; end + # ^^^^^^^^^^ + # + # 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#724 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # 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#748 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#754 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # 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#801 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # 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#811 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # 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#821 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # 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#827 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#837 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#855 + def visit_if_node(node); end + + # 1i + # ^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#897 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # @raise [CompilationError] + # + # source://prism/lib/prism/translation/parser/compiler.rb#903 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # @raise [CompilationError] + # + # 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#915 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # 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#941 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # 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#995 + def visit_index_target_node(node); end + + # ^^^^^^^^^^^^ + # + # 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#1022 + def visit_instance_variable_operator_write_node(node); end + + # ^^^^^^^^^^^^ + # + # 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#1006 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # 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#1012 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1058 + def visit_integer_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # 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#1064 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # 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#1113 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # 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#1143 + def visit_it_parameters_node(node); end + + # foo(bar: baz) + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1149 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # 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#1167 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # 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#1209 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # 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#1193 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # 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#1199 + def visit_local_variable_write_node(node); end + + # /foo/ + # ^^^^^ + # if /foo/ then end + # ^^^^^ + # + # 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#1249 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # 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#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#1280 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # 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#1297 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1307 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1330 + def visit_next_node(node); end + + # nil + # ^^^ + # + # 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#1348 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # 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#1364 + def visit_numbered_reference_read_node(node); end + + # def foo(bar: baz); end + # ^^^^^^^^ + # + # 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#1376 + def visit_optional_parameter_node(node); end + + # a or b + # ^^^^^^ + # + # 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#1388 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # 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#1437 + def visit_pinned_expression_node(node); end + + # foo = 1 and bar => ^foo + # ^^^^ + # + # 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#1449 + def visit_post_execution_node(node); end + + # BEGIN {} + # + # 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#1469 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1475 + def visit_range_node(node); end + + # 1r + # ^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1497 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1503 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # 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#1535 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # 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#1547 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # @raise [CompilationError] + # + # source://prism/lib/prism/translation/parser/compiler.rb#1565 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # 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#1580 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1589 + def visit_return_node(node); end + + # self + # ^^^^ + # + # 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#1606 + def visit_shareable_constant_node(node); end + + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # 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#1624 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # 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#1636 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # 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#1661 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # 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#1709 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1732 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # 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#1770 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1779 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # 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#1831 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1849 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # source://prism/lib/prism/translation/parser/compiler.rb#1871 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # 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#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#1923 + def find_forwarding(node); end + + # Returns the set of targets for a MultiTargetNode or a MultiWriteNode. + # + # 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. + # In normal Ruby, this will always be a method call. The parser gem, + # 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#1948 + def numeric_negate(message_loc, receiver); end + + # Blocks can have a special set of parameters that automatically expand + # when given arrays if they have a single required parameter and no + # other parameters. + # + # @return [Boolean] + # + # source://prism/lib/prism/translation/parser/compiler.rb#1962 + def procarg0?(parameters); end + + # Constructs a new source range from the given start and end offsets. + # + # 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 + # given start offset and end offset. If the needle is not found, it + # returns nil. Importantly it does not search past newlines or comments. + # + # 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#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#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#2004 + def token(location); end + + # Visit a block node on a call. + # + # 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#2051 + def visit_heredoc(node); end + + # Visit a numeric node and account for the optional sign. + # + # 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#2135 + def within_pattern; end +end + +# Raised when the tree is malformed or there is a bug in the compiler. +# +# source://prism/lib/prism/translation/parser/compiler.rb#10 +class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError; end + +# Locations in the parser gem AST are generated using this class. We +# store a reference to its constant to make it slightly faster to look +# up. +# +# source://prism/lib/prism/translation/parser/compiler.rb#1976 +Prism::Translation::Parser::Compiler::Range = Parser::Source::Range + +# 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 +# format for the parser gem. +# +# source://prism/lib/prism/translation/parser/lexer.rb#8 +class Prism::Translation::Parser::Lexer + # Initialize the lexer with the given source buffer, prism tokens, and + # offset cache. + # + # @return [Lexer] a new instance of Lexer + # + # source://prism/lib/prism/translation/parser/lexer.rb#204 + 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 + def lexed; end + + # A hash that maps offsets in bytes to offsets in characters. + # + # source://prism/lib/prism/translation/parser/lexer.rb#200 + def offset_cache; end + + # The Parser::Source::Buffer that the tokens were lexed from. + # + # source://prism/lib/prism/translation/parser/lexer.rb#193 + 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 + def to_a; end + + private + + # Parse a complex from the string representation. + # + # source://prism/lib/prism/translation/parser/lexer.rb#387 + def parse_complex(value); end + + # Parse a float from the string representation. + # + # source://prism/lib/prism/translation/parser/lexer.rb#380 + def parse_float(value); end + + # Parse an integer from the string representation. + # + # source://prism/lib/prism/translation/parser/lexer.rb#373 + def parse_integer(value); end + + # Parse a rational from the string representation. + # + # source://prism/lib/prism/translation/parser/lexer.rb#402 + def parse_rational(value); end +end + +# These constants represent flags in our lex state. We really, really +# don't want to be using them and we really, really don't want to be +# exposing them as part of our public API. Unfortunately, we don't have +# another way of matching the exact tokens that the parser gem expects +# without them. We should find another way to do this, but in the +# meantime we'll hide them from the documentation and mark them as +# private constants. +# +# source://prism/lib/prism/translation/parser/lexer.rb#187 +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 +Prism::Translation::Parser::Lexer::Range = Parser::Source::Range + +# The direct translating of types between the two lexers. +# +# source://prism/lib/prism/translation/parser/lexer.rb#10 +Prism::Translation::Parser::Lexer::TYPES = T.let(T.unsafe(nil), Hash) + +# The parser gem has a list of diagnostics with a hard-coded set of error +# messages. We create our own diagnostic class in order to set our own +# error messages. +# +# 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#28 + def initialize(message, level, reason, location); end + + # This is the cached message coming from prism. + # + # source://prism/lib/prism/translation/parser.rb#25 + def message; end +end + +# 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 +# functions by parsing the entire tree first and then walking it and +# executing each of the Ripper callbacks as it goes. To use this class, you +# treat `Prism::Translation::Ripper` effectively as you would treat the +# `Ripper` class. +# +# Note that this class will serve the most common use cases, but Ripper's +# API is extensive and undocumented. It relies on reporting the state of the +# parser at any given time. We do our best to replicate that here, but +# because it is a different architecture it is not possible to perfectly +# replicate the behavior of Ripper. +# +# The main known difference is that we may omit dispatching some events in +# some cases. This impacts the following events: +# +# - on_assign_error +# - on_comma +# - on_ignored_nl +# - on_ignored_sp +# - on_kw +# - on_label_end +# - on_lbrace +# - on_lbracket +# - on_lparen +# - on_nl +# - on_op +# - on_operator_ambiguous +# - on_rbrace +# - on_rbracket +# - on_rparen +# - on_semicolon +# - on_sp +# - on_symbeg +# - on_tstring_beg +# - on_tstring_end +# +# source://prism/lib/prism/translation/ripper.rb#43 +class Prism::Translation::Ripper < ::Prism::Compiler + # Create a new Translation::Ripper object with the given source. + # + # @return [Ripper] a new instance of Ripper + # + # source://prism/lib/prism/translation/ripper.rb#444 + def initialize(source, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # The current column number of the parser. + # + # source://prism/lib/prism/translation/ripper.rb#441 + def column; end + + # True if the parser encountered an error during parsing. + # + # @return [Boolean] + # + # source://prism/lib/prism/translation/ripper.rb#457 + sig { returns(T::Boolean) } + def error?; end + + # The filename of the source being parsed. + # + # source://prism/lib/prism/translation/ripper.rb#435 + def filename; end + + # The current line number of the parser. + # + # source://prism/lib/prism/translation/ripper.rb#438 + def lineno; end + + # Parse the source and return the result. + # + # source://prism/lib/prism/translation/ripper.rb#462 + sig { returns(T.untyped) } + def parse; end + + # The source that is being parsed. + # + # source://prism/lib/prism/translation/ripper.rb#432 + def source; end + + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#561 + def visit_alias_global_variable_node(node); end + + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#551 + def visit_alias_method_node(node); end + + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#585 + def visit_alternation_pattern_node(node); end + + # a and b + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#605 + def visit_and_node(node); end + + # foo(bar) + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#796 + def visit_arguments_node(node); end + + # [] + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#615 + def visit_array_node(node); end + + # foo => [bar] + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#775 + def visit_array_pattern_node(node); end + + # { a: 1 } + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#803 + def visit_assoc_node(node); end + + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#816 + def visit_assoc_splat_node(node); end + + # $+ + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#825 + def visit_back_reference_read_node(node); end + + # begin end + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#832 + def visit_begin_node(node); end + + # foo(&bar) + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#896 + def visit_block_argument_node(node); end + + # foo { |; bar| } + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#902 + def visit_block_local_variable_node(node); end + + # Visit a BlockNode. + # + # source://prism/lib/prism/translation/ripper.rb#908 + def visit_block_node(node); end + + # def foo(&bar); end + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#944 + def visit_block_parameter_node(node); end + + # A block's parameters. + # + # source://prism/lib/prism/translation/ripper.rb#958 + def visit_block_parameters_node(node); end + + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#982 + def visit_break_node(node); end + + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1194 + def visit_call_and_write_node(node); end + + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1002 + def visit_call_node(node); end + + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1172 + def visit_call_operator_write_node(node); end + + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1216 + def visit_call_or_write_node(node); end + + # foo.bar, = 1 + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1238 + def visit_call_target_node(node); end + + # foo => bar => baz + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1263 + def visit_capture_pattern_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1286 + def visit_case_match_node(node); end + + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1273 + def visit_case_node(node); end + + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1299 + def visit_class_node(node); end + + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1352 + def visit_class_variable_and_write_node(node); end + + # @@foo += bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1338 + def visit_class_variable_operator_write_node(node); end + + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1366 + def visit_class_variable_or_write_node(node); end + + # @@foo + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1317 + def visit_class_variable_read_node(node); end + + # @@foo, = bar + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1380 + def visit_class_variable_target_node(node); end + + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1327 + def visit_class_variable_write_node(node); end + + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1422 + def visit_constant_and_write_node(node); end + + # Foo += bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1408 + def visit_constant_operator_write_node(node); end + + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1436 + def visit_constant_or_write_node(node); end + + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1523 + def visit_constant_path_and_write_node(node); end + + # Foo::Bar + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1457 + def visit_constant_path_node(node); end + + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1509 + def visit_constant_path_operator_write_node(node); end + + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1537 + def visit_constant_path_or_write_node(node); end + + # Foo::Bar, = baz + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1551 + def visit_constant_path_target_node(node); end + + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1480 + def visit_constant_path_write_node(node); end + + # Foo + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1387 + def visit_constant_read_node(node); end + + # Foo, = bar + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1450 + def visit_constant_target_node(node); end + + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1397 + def visit_constant_write_node(node); end + + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1560 + def visit_def_node(node); end + + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1607 + def visit_defined_node(node); end + + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1614 + def visit_else_node(node); end + + # "foo #{bar}" + # ^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1630 + def visit_embedded_statements_node(node); end + + # "foo #@bar" + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1651 + def visit_embedded_variable_node(node); end + + # Visit an EnsureNode node. + # + # source://prism/lib/prism/translation/ripper.rb#1662 + def visit_ensure_node(node); end + + # false + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1680 + def visit_false_node(node); end + + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1687 + def visit_find_pattern_node(node); end + + # if foo .. bar; end + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1712 + def visit_flip_flop_node(node); end + + # 1.0 + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1726 + def visit_float_node(node); end + + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1732 + def visit_for_node(node); end + + # def foo(...); bar(...); end + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1749 + def visit_forwarding_arguments_node(node); end + + # def foo(...); end + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1756 + def visit_forwarding_parameter_node(node); end + + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1766 + def visit_forwarding_super_node(node); end + + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1815 + def visit_global_variable_and_write_node(node); end + + # $foo += bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1801 + def visit_global_variable_operator_write_node(node); end + + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1829 + def visit_global_variable_or_write_node(node); end + + # $foo + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1780 + def visit_global_variable_read_node(node); end + + # $foo, = bar + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1843 + def visit_global_variable_target_node(node); end + + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1790 + def visit_global_variable_write_node(node); end + + # {} + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#1850 + def visit_hash_node(node); end + + # foo => {} + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#1865 + def visit_hash_pattern_node(node); end + + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1907 + def visit_if_node(node); end + + # 1i + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#1943 + def visit_imaginary_node(node); end + + # { foo: } + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1949 + def visit_implicit_node(node); end + + # foo { |bar,| } + # ^ + # + # source://prism/lib/prism/translation/ripper.rb#1954 + def visit_implicit_rest_node(node); end + + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1961 + def visit_in_node(node); end + + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1996 + def visit_index_and_write_node(node); end + + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#1979 + def visit_index_operator_write_node(node); end + + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2013 + def visit_index_or_write_node(node); end + + # foo[bar], = 1 + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2030 + def visit_index_target_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2072 + def visit_instance_variable_and_write_node(node); end + + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2058 + def visit_instance_variable_operator_write_node(node); end + + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2086 + def visit_instance_variable_or_write_node(node); end + + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2040 + def visit_instance_variable_read_node(node); end + + # @foo, = bar + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2100 + def visit_instance_variable_target_node(node); end + + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2047 + def visit_instance_variable_write_node(node); end + + # 1 + # ^ + # + # source://prism/lib/prism/translation/ripper.rb#2107 + def visit_integer_node(node); end + + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2113 + def visit_interpolated_match_last_line_node(node); end + + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2132 + def visit_interpolated_regular_expression_node(node); end + + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2151 + def visit_interpolated_string_node(node); end + + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2179 + def visit_interpolated_symbol_node(node); end + + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2192 + 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#2234 + def visit_keyword_hash_node(node); end + + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#2246 + def visit_keyword_rest_parameter_node(node); end + + # -> {} + # + # source://prism/lib/prism/translation/ripper.rb#2260 + def visit_lambda_node(node); end + + # foo &&= bar + # ^^^^^^^^^^^ + # + # 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#2338 + def visit_local_variable_operator_write_node(node); end + + # foo ||= bar + # ^^^^^^^^^^^ + # + # 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#2320 + def visit_local_variable_read_node(node); end + + # foo, = bar + # ^^^ + # + # 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#2327 + def visit_local_variable_write_node(node); end + + # if /foo/ then end + # ^^^^^ + # + # 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#2402 + def visit_match_predicate_node(node); end + + # foo => bar + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2411 + def visit_match_required_node(node); end + + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # 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#2426 + def visit_missing_node(node); end + + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # 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#2449 + def visit_multi_target_node(node); end + + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2503 + def visit_multi_write_node(node); end + + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2523 + def visit_next_node(node); end + + # nil + # ^^^ + # + # 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#2544 + def visit_no_keywords_parameter_node(node); end + + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2553 + def visit_numbered_parameters_node(node); end + + # $1 + # ^^ + # + # 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#2565 + def visit_optional_keyword_parameter_node(node); end + + # def foo(bar = 1); end + # ^^^^^^^ + # + # 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#2585 + def visit_or_node(node); end + + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2595 + def visit_parameters_node(node); end + + # () + # ^^ + # + # (1) + # ^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2622 + def visit_parentheses_node(node); end + + # foo => ^(bar) + # ^^^^^^ + # + # 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#2645 + def visit_pinned_variable_node(node); end + + # END {} + # ^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2651 + def visit_post_execution_node(node); end + + # BEGIN {} + # ^^^^^^^^ + # + # 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#2680 + def visit_program_node(node); end + + # 0..5 + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2691 + def visit_range_node(node); end + + # 1r + # ^^ + # + # source://prism/lib/prism/translation/ripper.rb#2705 + def visit_rational_node(node); end + + # redo + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2711 + def visit_redo_node(node); end + + # /foo/ + # ^^^^^ + # + # 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#2740 + def visit_required_keyword_parameter_node(node); end + + # def foo(bar); end + # ^^^ + # + # 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#2754 + def visit_rescue_modifier_node(node); end + + # begin; rescue; end + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2764 + def visit_rescue_node(node); end + + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # source://prism/lib/prism/translation/ripper.rb#2822 + def visit_rest_parameter_node(node); end + + # retry + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2834 + def visit_retry_node(node); end + + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2844 + def visit_return_node(node); end + + # self + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2858 + def visit_self_node(node); end + + # A shareable constant. + # + # 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#2870 + def visit_singleton_class_node(node); end + + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2880 + def visit_source_encoding_node(node); end + + # __FILE__ + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2887 + def visit_source_file_node(node); end + + # __LINE__ + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2894 + def visit_source_line_node(node); end + + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # 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#2912 + def visit_statements_node(node); end + + # "foo" + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#2929 + def visit_string_node(node); end + + # super(foo) + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3061 + def visit_super_node(node); end + + # :foo + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3082 + def visit_symbol_node(node); end + + # true + # ^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3106 + def visit_true_node(node); end + + # undef foo + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3113 + def visit_undef_node(node); end + + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3125 + def visit_unless_node(node); end + + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # 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#3177 + def visit_when_node(node); end + + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3198 + def visit_while_node(node); end + + # `foo` + # ^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3222 + def visit_x_string_node(node); end + + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ripper.rb#3245 + def visit_yield_node(node); end + + private + + # :stopdoc: + # + # source://prism/lib/prism/translation/ripper.rb#3389 + def _dispatch_0; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def _dispatch_1(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def _dispatch_2(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def _dispatch_3(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3393 + def _dispatch_4(_, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3394 + def _dispatch_5(_, _, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3395 + def _dispatch_7(_, _, _, _, _, _, _); end + + # This method is responsible for updating lineno and column information + # to reflect the current node. + # + # 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#3379 + def bounds(location); end + + # Returns true if the given node is a command node. + # + # @return [Boolean] + # + # source://prism/lib/prism/translation/ripper.rb#1163 + def command?(node); end + + # This method is called when the parser found syntax error. + # + # source://prism/lib/prism/translation/ripper.rb#3417 + def compile_error(msg); end + + # This method is provided by the Ripper C extension. It is called when a + # string needs to be dedented because of a tilde heredoc. It is expected + # that it will modify the string in place and return the number of bytes + # that were removed. + # + # source://prism/lib/prism/translation/ripper.rb#3432 + def dedent_string(string, width); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_BEGIN(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_CHAR(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_END(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on___end__(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_alias(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_alias_error(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_aref(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_aref_field(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_arg_ambiguous(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_arg_paren(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_args_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_args_add_block(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_args_add_star(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_args_forward; end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_args_new; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_array(_); end + + # source://prism/lib/prism/translation/ripper.rb#3393 + def on_aryptn(_, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_assign(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_assign_error(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_assoc_new(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_assoc_splat(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_assoclist_from_args(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_backref(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_backtick(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_bare_assoc_hash(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_begin(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_binary(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_block_var(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_blockarg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3393 + def on_bodystmt(_, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_brace_block(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_break(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_call(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_case(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_class(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_class_name_error(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_comma(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_command(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3393 + def on_command_call(_, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_comment(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_const(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_const_path_field(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_const_path_ref(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_const_ref(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_cvar(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_def(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_defined(_); end + + # source://prism/lib/prism/translation/ripper.rb#3394 + def on_defs(_, _, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_do_block(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_dot2(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_dot3(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_dyna_symbol(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_else(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_elsif(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embdoc(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embdoc_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embdoc_end(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embexpr_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embexpr_end(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_embvar(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_ensure(_); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_excessed_comma; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_fcall(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_field(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_float(_); end + + # source://prism/lib/prism/translation/ripper.rb#3393 + def on_fndptn(_, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_for(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_gvar(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_hash(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_heredoc_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_heredoc_dedent(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_heredoc_end(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_hshptn(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_ident(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_if(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_if_mod(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_ifop(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_ignored_nl(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_ignored_sp(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_imaginary(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_in(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_int(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_ivar(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_kw(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_kwrest_param(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_label(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_label_end(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_lambda(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_lbrace(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_lbracket(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_lparen(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_magic_comment(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_massign(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_method_add_arg(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_method_add_block(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_mlhs_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_mlhs_add_post(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_mlhs_add_star(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_mlhs_new; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_mlhs_paren(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_module(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_mrhs_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_mrhs_add_star(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_mrhs_new; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_mrhs_new_from_args(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_next(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_nl(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_nokw_param(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_op(_); end + + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_opassign(_, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_operator_ambiguous(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_param_error(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3395 + def on_params(_, _, _, _, _, _, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_paren(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_parse_error(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_period(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_program(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_qsymbols_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_qsymbols_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_qsymbols_new; end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_qwords_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_qwords_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_qwords_new; end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_rational(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_rbrace(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_rbracket(_); end + + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_redo; end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_regexp_add(_, _); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_regexp_beg(_); end + + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_regexp_end(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_regexp_literal(_, _); end - # "foo" - # ^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1478 - def visit_string_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_regexp_new; end - # super(foo) - # ^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1495 - def visit_super_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3393 + def on_rescue(_, _, _, _); end - # :foo - # ^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1518 - def visit_symbol_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_rescue_mod(_, _); end - # true - # ^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1536 - def visit_true_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_rest_param(_); end - # undef foo - # ^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1542 - def visit_undef_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_retry; end - # unless foo; bar end - # ^^^^^^^^^^^^^^^^^^^ - # - # bar unless foo - # ^^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1551 - def visit_unless_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_return(_); end - # until foo; bar end - # ^^^^^^^^^^^^^^^^^ - # - # bar until foo - # ^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1581 - def visit_until_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_return0; end - # case foo; when bar; end - # ^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1603 - def visit_when_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_rparen(_); end - # while foo; bar end - # ^^^^^^^^^^^^^^^^^^ - # - # bar while foo - # ^^^^^^^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1617 - def visit_while_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_sclass(_, _); end - # `foo` - # ^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1639 - def visit_x_string_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_semicolon(_); end - # yield - # ^^^^^ - # - # yield 1 - # ^^^^^^^ - # - # source://prism/lib/prism/translation/parser/compiler.rb#1657 - def visit_yield_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_sp(_); end - private + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_stmts_add(_, _); 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#1671 - def copy_compiler(forwarding: T.unsafe(nil), in_destructure: T.unsafe(nil), in_pattern: T.unsafe(nil)); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_stmts_new; 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#1678 - def find_forwarding(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_string_add(_, _); end - # Blocks can have a special set of parameters that automatically expand - # when given arrays if they have a single required parameter and no - # other parameters. - # - # @return [Boolean] - # - # source://prism/lib/prism/translation/parser/compiler.rb#1693 - def procarg0?(parameters); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_string_concat(_, _); end - # Constructs a new source range from the given start and end offsets. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1710 - def srange(location); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_string_content; end - # Constructs a new source range by finding the given tokens between the - # given start offset and end offset. If the needle is not found, it - # returns nil. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1722 - def srange_find(start_offset, end_offset, tokens); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_string_dvar(_); end - # Constructs a new source range from the given start and end offsets. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1715 - def srange_offsets(start_offset, end_offset); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_string_embexpr(_); end - # Transform a location into a token that the parser gem expects. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1731 - def token(location); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_string_literal(_); end - # Visit a block node on a call. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1736 - def visit_block(call, block); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_super(_); end - # Visit a heredoc that can be either a string or an xstring. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1769 - def visit_heredoc(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_symbeg(_); end - # Visit a numeric node and account for the optional sign. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1815 - def visit_numeric(node, value); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_symbol(_); end - # Within the given block, track that we're within a pattern. - # - # source://prism/lib/prism/translation/parser/compiler.rb#1827 - def within_pattern; end -end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_symbol_literal(_); end -# Raised when the tree is malformed or there is a bug in the compiler. -# -# source://prism/lib/prism/translation/parser/compiler.rb#10 -class Prism::Translation::Parser::Compiler::CompilationError < ::StandardError; end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_symbols_add(_, _); end -# Locations in the parser gem AST are generated using this class. We -# store a reference to its constant to make it slightly faster to look -# up. -# -# source://prism/lib/prism/translation/parser/compiler.rb#1707 -Prism::Translation::Parser::Compiler::Range = Parser::Source::Range + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_symbols_beg(_); end -# The parser gem has a list of diagnostics with a hard-coded set of error -# messages. We create our own diagnostic class in order to set our own -# error messages. -# -# source://prism/lib/prism/translation/parser.rb#15 -class Prism::Translation::Parser::Diagnostic < ::Parser::Diagnostic - # Initialize a new diagnostic with the given message and location. - # - # @return [Diagnostic] a new instance of Diagnostic - # - # source://prism/lib/prism/translation/parser.rb#20 - def initialize(message, location); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_symbols_new; end - # The message generated by prism. - # - # source://prism/lib/prism/translation/parser.rb#17 - def message; end -end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_tlambda(_); end -# Accepts a list of prism tokens and converts them into the expected -# format for the parser gem. -# -# source://prism/lib/prism/translation/parser/lexer.rb#8 -class Prism::Translation::Parser::Lexer - # Initialize the lexer with the given source buffer, prism tokens, and - # offset cache. - # - # @return [Lexer] a new instance of Lexer - # - # source://prism/lib/prism/translation/parser/lexer.rb#193 - def initialize(source_buffer, lexed, offset_cache); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_tlambeg(_); end - # An array of prism tokens that we lexed. - # - # source://prism/lib/prism/translation/parser/lexer.rb#186 - def lexed; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_top_const_field(_); end - # A hash that maps offsets in bytes to offsets in characters. - # - # source://prism/lib/prism/translation/parser/lexer.rb#189 - def offset_cache; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_top_const_ref(_); end - # The Parser::Source::Buffer that the tokens were lexed from. - # - # source://prism/lib/prism/translation/parser/lexer.rb#183 - def source_buffer; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_tstring_beg(_); end - # Convert the prism tokens into the expected format for the parser gem. - # - # source://prism/lib/prism/translation/parser/lexer.rb#203 - def to_a; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_tstring_content(_); end - private + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_tstring_end(_); end - # Parse a complex from the string representation. - # - # source://prism/lib/prism/translation/parser/lexer.rb#310 - def parse_complex(value); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_unary(_, _); end - # Parse a rational from the string representation. - # - # source://prism/lib/prism/translation/parser/lexer.rb#323 - def parse_rational(value); end -end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_undef(_); end -# source://prism/lib/prism/translation/parser/lexer.rb#199 -Prism::Translation::Parser::Lexer::Range = Parser::Source::Range + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_unless(_, _, _); end -# The direct translating of types between the two lexers. -# -# source://prism/lib/prism/translation/parser/lexer.rb#10 -Prism::Translation::Parser::Lexer::TYPES = T.let(T.unsafe(nil), Hash) + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_unless_mod(_, _); end -# source://prism/lib/prism/translation/parser.rb#26 -Prism::Translation::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_until(_, _); end -# Note: This integration is not finished, and therefore still has many -# inconsistencies with Ripper. If you'd like to help out, pull requests would -# be greatly appreciated! -# -# This class is meant to provide a compatibility layer between prism and -# Ripper. It functions by parsing the entire tree first and then walking it -# and executing each of the Ripper callbacks as it goes. -# -# This class is going to necessarily be slower than the native Ripper API. It -# is meant as a stopgap until developers migrate to using prism. It is also -# meant as a test harness for the prism parser. -# -# To use this class, you treat `Prism::Translation::Ripper` effectively as you would -# treat the `Ripper` class. -# -# source://prism/lib/prism/translation/ripper.rb#21 -class Prism::Translation::Ripper < ::Prism::Compiler - # Create a new Translation::Ripper object with the given source. - # - # @return [Ripper] a new instance of Ripper - # - # source://prism/lib/prism/translation/ripper.rb#75 - def initialize(source); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_until_mod(_, _); end - # The current column number of the parser. - # - # source://prism/lib/prism/translation/ripper.rb#72 - def column; end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_var_alias(_, _); end - # True if the parser encountered an error during parsing. - # - # @return [Boolean] - # - # source://prism/lib/prism/translation/ripper.rb#87 - def error?; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_var_field(_); end - # The current line number of the parser. - # - # source://prism/lib/prism/translation/ripper.rb#69 - def lineno; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_var_ref(_); end - # Parse the source and return the result. - # - # source://prism/lib/prism/translation/ripper.rb#92 - def parse; end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_vcall(_); end - # The source that is being parsed. - # - # source://prism/lib/prism/translation/ripper.rb#66 - def source; end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_void_stmt; end - # Visit an AliasGlobalVariableNode. - # - # source://prism/lib/prism/translation/ripper.rb#247 - def visit_alias_global_variable_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3392 + def on_when(_, _, _); end - # Visit an AliasMethodNode. - # - # source://prism/lib/prism/translation/ripper.rb#226 - def visit_alias_method_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_while(_, _); end - # Visit an AndNode. - # - # source://prism/lib/prism/translation/ripper.rb#264 - def visit_and_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_while_mod(_, _); end - # Visit an ArrayNode node. - # - # source://prism/lib/prism/translation/ripper.rb#113 - def visit_array_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_word_add(_, _); end - # Visit a BackReferenceReadNode. - # - # source://prism/lib/prism/translation/ripper.rb#258 - def visit_back_reference_read_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_word_new; end - # Visit a BeginNode node. - # This is not at all bulletproof against different structures of begin/rescue/else/ensure/end. - # - # source://prism/lib/prism/translation/ripper.rb#315 - def visit_begin_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_words_add(_, _); end - # Visit a BlockNode. - # - # source://prism/lib/prism/translation/ripper.rb#191 - def visit_block_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_words_beg(_); end - # Visit a BlockParametersNode. - # - # source://prism/lib/prism/translation/ripper.rb#200 - def visit_block_parameters_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_words_new; end - # Visit a BreakNode. - # - # source://prism/lib/prism/translation/ripper.rb#218 - def visit_break_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_words_sep(_); end + + # source://prism/lib/prism/translation/ripper.rb#3391 + def on_xstring_add(_, _); end - # Visit a CallNode node. - # Ripper distinguishes between many different method-call - # nodes -- unary and binary operators, "command" calls with - # no parentheses, and call/fcall/vcall. - # - # source://prism/lib/prism/translation/ripper.rb#123 - def visit_call_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_xstring_literal(_); end - # Visit an EmbeddedStatementsNode node. - # - # source://prism/lib/prism/translation/ripper.rb#371 - def visit_embedded_statements_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_xstring_new; end - # Visit a FalseNode. - # - # source://prism/lib/prism/translation/ripper.rb#280 - def visit_false_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3390 + def on_yield(_); end - # Visit a FloatNode node. - # - # source://prism/lib/prism/translation/ripper.rb#286 - def visit_float_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_yield0; end - # Visit a GlobalVariableReadNode. - # - # source://prism/lib/prism/translation/ripper.rb#252 - def visit_global_variable_read_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3389 + def on_zsuper; end - # Visit a ImaginaryNode node. + # Lazily initialize the parse result. # - # source://prism/lib/prism/translation/ripper.rb#291 - def visit_imaginary_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3271 + def result; end - # Visit an IntegerNode node. + # Returns true if there is a comma between the two locations. # - # source://prism/lib/prism/translation/ripper.rb#296 - def visit_integer_node(node); end - - # Visit an InterpolatedStringNode node. + # @return [Boolean] # - # source://prism/lib/prism/translation/ripper.rb#366 - def visit_interpolated_string_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3284 + def trailing_comma?(left, right); end - # Visit an InterpolatedSymbolNode node. + # Visit one side of an alias global variable node. # - # source://prism/lib/prism/translation/ripper.rb#381 - def visit_interpolated_symbol_node(node); end + # source://prism/lib/prism/translation/ripper.rb#570 + def visit_alias_global_variable_node_value(node); end - # Visit a LocalVariableAndWriteNode. + # Visit a list of elements, like the elements of an array or arguments. # - # source://prism/lib/prism/translation/ripper.rb#168 - def visit_local_variable_and_write_node(node); end + # source://prism/lib/prism/translation/ripper.rb#756 + def visit_arguments(elements); end - # Visit nodes for +=, *=, -=, etc., called LocalVariableOperatorWriteNodes. + # Visit the clauses of a begin node to form an on_bodystmt call. # - # source://prism/lib/prism/translation/ripper.rb#178 - def visit_local_variable_operator_write_node(node); end + # source://prism/lib/prism/translation/ripper.rb#840 + def visit_begin_node_clauses(location, node, allow_newline); end - # Visit a LocalVariableOrWriteNode. + # Visit the body of a structure that can have either a set of statements + # or statements wrapped in rescue/else/ensure. # - # source://prism/lib/prism/translation/ripper.rb#173 - def visit_local_variable_or_write_node(node); end + # source://prism/lib/prism/translation/ripper.rb#875 + def visit_body_node(location, node, allow_newline = T.unsafe(nil)); end - # Visit a LocalVariableReadNode. + # Visit the arguments and block of a call node and return the arguments + # and block as they should be used. # - # source://prism/lib/prism/translation/ripper.rb#183 - def visit_local_variable_read_node(node); end + # source://prism/lib/prism/translation/ripper.rb#1136 + def visit_call_node_arguments(arguments_node, block_node, trailing_comma); end - # Visit a LocalVariableWriteNode. + # Visit a constant path that is part of a write node. # - # source://prism/lib/prism/translation/ripper.rb#161 - def visit_local_variable_write_node(node); end + # source://prism/lib/prism/translation/ripper.rb#1489 + def visit_constant_path_write_node_target(node); end - # Visit an OrNode. + # Visit a destructured positional parameter node. # - # source://prism/lib/prism/translation/ripper.rb#269 - def visit_or_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2609 + def visit_destructured_parameter_node(node); end - # Visit a ParametersNode. - # This will require expanding as we support more kinds of parameters. + # Visit a string that is expressed using a <<~ heredoc. # - # source://prism/lib/prism/translation/ripper.rb#206 - def visit_parameters_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2980 + def visit_heredoc_node(parts, base); end - # Visit a ParenthesesNode node. + # Ripper gives back the escaped string content but strips out the common + # leading whitespace. Prism gives back the unescaped string content and + # a location for the escaped string content. Unfortunately these don't + # work well together, so here we need to re-derive the common leading + # whitespace. # - # source://prism/lib/prism/translation/ripper.rb#301 - def visit_parentheses_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2955 + def visit_heredoc_node_whitespace(parts); end - # Visit a ProgramNode node. + # Visit a heredoc node that is representing a string. # - # source://prism/lib/prism/translation/ripper.rb#327 - def visit_program_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3026 + def visit_heredoc_string_node(node); end - # Visit a RangeNode node. + # Visit a heredoc node that is representing an xstring. # - # source://prism/lib/prism/translation/ripper.rb#334 - def visit_range_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3043 + def visit_heredoc_x_string_node(node); end - # Visit a RationalNode node. + # Visit the targets of a multi-target node. # - # source://prism/lib/prism/translation/ripper.rb#347 - def visit_rational_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2462 + def visit_multi_target_node_targets(lefts, rest, rights, skippable); end - # Visit a RequiredParameterNode. + # Visit a node that represents a number. We need to explicitly handle the + # unary - operator. # - # source://prism/lib/prism/translation/ripper.rb#212 - def visit_required_parameter_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3323 + def visit_number_node(node); end - # Visit a RescueNode node. + # Visit a pattern within a pattern match. This is used to bypass the + # parenthesis node that can be used to wrap patterns. # - # source://prism/lib/prism/translation/ripper.rb#322 - def visit_rescue_node(node); end + # source://prism/lib/prism/translation/ripper.rb#595 + def visit_pattern_node(node); end - # Visit a StatementsNode node. + # Visit the list of statements of a statements node. We support nil + # statements in the list. This would normally not be allowed by the + # 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#386 - def visit_statements_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2921 + def visit_statements_node_body(body); end - # Visit a StringNode node. + # Visit an individual part of a string-like node. # - # source://prism/lib/prism/translation/ripper.rb#352 - def visit_string_node(node); end + # source://prism/lib/prism/translation/ripper.rb#2211 + def visit_string_content(part); end - # Visit a SymbolNode node. + # 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#376 - def visit_symbol_node(node); end + # source://prism/lib/prism/translation/ripper.rb#3296 + def visit_token(token, allow_keywords = T.unsafe(nil)); end - # Visit a TrueNode. + # Dispatch a words_sep event that contains the space between the elements + # of list literals. # - # source://prism/lib/prism/translation/ripper.rb#274 - def visit_true_node(node); end + # source://prism/lib/prism/translation/ripper.rb#745 + def visit_words_sep(opening_loc, previous, current); end - # Visit an XStringNode node. + # 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#359 - def visit_x_string_node(node); end - - private - - # source://prism/lib/prism/translation/ripper.rb#680 - def _dispatch0; end - - # source://prism/lib/prism/translation/ripper.rb#681 - def _dispatch1(_); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def _dispatch2(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#683 - def _dispatch3(_, _, _); end - - # source://prism/lib/prism/translation/ripper.rb#684 - def _dispatch4(_, _, _, _); end - - # source://prism/lib/prism/translation/ripper.rb#685 - def _dispatch5(_, _, _, _, _); end + # source://prism/lib/prism/translation/ripper.rb#3341 + def visit_write_value(node); end - # source://prism/lib/prism/translation/ripper.rb#686 - def _dispatch7(_, _, _, _, _, _, _); end - - # This method is responsible for updating lineno and column information - # to reflect the current node. + # Returns true if there is a semicolon between the two locations. # - # This method could be drastically improved with some caching on the start - # of every line, but for now it's good enough. + # @return [Boolean] # - # source://prism/lib/prism/translation/ripper.rb#663 - def bounds(location); end + # source://prism/lib/prism/translation/ripper.rb#3289 + def void_stmt?(left, right, allow_newline); end - # If we need to do something unusual, we can directly update the line number - # and column to reflect the current node. + # 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#670 - def bounds_values(lineno, column); end + # source://prism/lib/prism/translation/ripper.rb#3408 + def warn(fmt, *args); end - # For CRuby et al, "no block" in an on_block_var is false + # 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#646 - def no_block_value; end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_BEGIN(_); end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_CHAR(_); end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_END(_); end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on___end__(_); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_alias(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_alias_error(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_aref(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_aref_field(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_arg_ambiguous(_); end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_arg_paren(_); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_args_add(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_args_add_block(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#682 - def on_args_add_star(_, _); end - - # source://prism/lib/prism/translation/ripper.rb#680 - def on_args_forward; end - - # source://prism/lib/prism/translation/ripper.rb#680 - def on_args_new; end - - # source://prism/lib/prism/translation/ripper.rb#681 - def on_array(_); end + # source://prism/lib/prism/translation/ripper.rb#3413 + def warning(fmt, *args); end - # source://prism/lib/prism/translation/ripper.rb#684 - def on_aryptn(_, _, _, _); end + class << self + # Tokenizes the Ruby program and returns an array of an array, + # which is formatted like + # [[lineno, column], type, token, state]. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # use the +raise_errors+ keyword to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.lex("def m(a) nil end") + # #=> [[[1, 0], :on_kw, "def", FNAME ], + # [[1, 3], :on_sp, " ", FNAME ], + # [[1, 4], :on_ident, "m", ENDFN ], + # [[1, 5], :on_lparen, "(", BEG|LABEL], + # [[1, 6], :on_ident, "a", ARG ], + # [[1, 7], :on_rparen, ")", ENDFN ], + # [[1, 8], :on_sp, " ", BEG ], + # [[1, 9], :on_kw, "nil", END ], + # [[1, 12], :on_sp, " ", END ], + # [[1, 13], :on_kw, "end", END ]] + # + # source://prism/lib/prism/translation/ripper.rb#72 + def lex(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + + # Parses the given Ruby program read from +src+. + # +src+ must be a String or an IO or a object with a #gets method. + # + # source://prism/lib/prism/translation/ripper.rb#46 + def parse(src, filename = T.unsafe(nil), lineno = T.unsafe(nil)); end + + # Parses +src+ and create S-exp tree. + # Returns more readable tree rather than Ripper.sexp_raw. + # This method is mainly for developer use. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # returning +nil+ in such cases. Use the +raise_errors+ keyword + # to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.sexp("def m(a) nil end") + # #=> [:program, + # [[:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil, nil, nil]], + # [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]] + # + # source://prism/lib/prism/translation/ripper.rb#381 + def sexp(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + + # Parses +src+ and create S-exp tree. + # This method is mainly for developer use. + # The +filename+ argument is mostly ignored. + # By default, this method does not handle syntax errors in +src+, + # returning +nil+ in such cases. Use the +raise_errors+ keyword + # to raise a SyntaxError for an error in +src+. + # + # require "ripper" + # require "pp" + # + # pp Ripper.sexp_raw("def m(a) nil end") + # #=> [:program, + # [:stmts_add, + # [:stmts_new], + # [:def, + # [:@ident, "m", [1, 4]], + # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]], + # [:bodystmt, + # [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]], + # nil, + # nil, + # nil]]]] + # + # source://prism/lib/prism/translation/ripper.rb#416 + def sexp_raw(src, filename = T.unsafe(nil), lineno = T.unsafe(nil), raise_errors: T.unsafe(nil)); end + end +end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_assign(_, _); end +# A list of all of the Ruby binary operators. +# +# source://prism/lib/prism/translation/ripper.rb#337 +Prism::Translation::Ripper::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) - # source://prism/lib/prism/translation/ripper.rb#682 - def on_assign_error(_, _); end +# This array contains name of all ripper events. +# +# source://prism/lib/prism/translation/ripper.rb#289 +Prism::Translation::Ripper::EVENTS = T.let(T.unsafe(nil), Array) - # source://prism/lib/prism/translation/ripper.rb#682 - def on_assoc_new(_, _); end +# A list of all of the Ruby keywords. +# +# source://prism/lib/prism/translation/ripper.rb#292 +Prism::Translation::Ripper::KEYWORDS = T.let(T.unsafe(nil), Array) - # source://prism/lib/prism/translation/ripper.rb#681 - def on_assoc_splat(_); end +# This array contains name of parser events. +# +# source://prism/lib/prism/translation/ripper.rb#283 +Prism::Translation::Ripper::PARSER_EVENTS = T.let(T.unsafe(nil), Array) - # source://prism/lib/prism/translation/ripper.rb#681 - def on_assoclist_from_args(_); end +# This contains a table of all of the parser events and their +# corresponding arity. +# +# source://prism/lib/prism/translation/ripper.rb#84 +Prism::Translation::Ripper::PARSER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) - # source://prism/lib/prism/translation/ripper.rb#681 - def on_backref(_); end +# This array contains name of scanner events. +# +# source://prism/lib/prism/translation/ripper.rb#286 +Prism::Translation::Ripper::SCANNER_EVENTS = T.let(T.unsafe(nil), Array) - # source://prism/lib/prism/translation/ripper.rb#681 - def on_backtick(_); end +# This contains a table of all of the scanner events and their +# corresponding arity. +# +# source://prism/lib/prism/translation/ripper.rb#227 +Prism::Translation::Ripper::SCANNER_EVENT_TABLE = T.let(T.unsafe(nil), Hash) - # source://prism/lib/prism/translation/ripper.rb#681 - def on_bare_assoc_hash(_); end +# This class mirrors the ::Ripper::SexpBuilder subclass of ::Ripper that +# returns the arrays of [type, *children]. +# +# source://prism/lib/prism/translation/ripper/sexp.rb#10 +class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper + # :stopdoc: + # + # source://prism/lib/prism/translation/ripper/sexp.rb#13 + def error; end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_begin(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_BEGIN(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_binary(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_CHAR(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_block_var(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_END(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_blockarg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on___end__(tok); end - # source://prism/lib/prism/translation/ripper.rb#684 - def on_bodystmt(_, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_alias(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_brace_block(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_alias_error(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_break(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_aref(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_call(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_aref_field(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_case(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_arg_ambiguous(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_class(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_arg_paren(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_class_name_error(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_args_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_comma(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_args_add_block(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_command(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_args_add_star(*args); end - # source://prism/lib/prism/translation/ripper.rb#684 - def on_command_call(_, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_args_forward(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_comment(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_args_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_const(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_array(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_const_path_field(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_aryptn(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_const_path_ref(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_assign(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_const_ref(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_assign_error(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_cvar(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_assoc_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_def(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_assoc_splat(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_defined(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_assoclist_from_args(*args); end - # source://prism/lib/prism/translation/ripper.rb#685 - def on_defs(_, _, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_backref(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_do_block(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_backtick(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_dot2(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_bare_assoc_hash(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_dot3(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_begin(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_dyna_symbol(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_binary(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_else(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_block_var(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_elsif(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_blockarg(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embdoc(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_bodystmt(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embdoc_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_brace_block(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embdoc_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_break(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embexpr_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_call(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embexpr_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_case(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_embvar(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_class(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_ensure(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_class_name_error(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_excessed_comma; end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_comma(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_fcall(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_command(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_field(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_command_call(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_float(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_comment(tok); end - # source://prism/lib/prism/translation/ripper.rb#684 - def on_fndptn(_, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_const(tok); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_for(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_const_path_field(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_gvar(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_const_path_ref(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_hash(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_const_ref(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_heredoc_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_cvar(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_heredoc_dedent(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_def(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_heredoc_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_defined(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_hshptn(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_defs(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_ident(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_do_block(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_if(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_dot2(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_if_mod(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_dot3(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_ifop(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_dyna_symbol(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_ignored_nl(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_else(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_ignored_sp(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_elsif(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_imaginary(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc(tok); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_in(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_int(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embdoc_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_ivar(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embexpr_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_kw(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embexpr_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_kwrest_param(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_embvar(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_label(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_ensure(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_label_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_excessed_comma(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_lambda(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_fcall(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_lbrace(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_field(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_lbracket(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_float(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_lparen(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_fndptn(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_magic_comment(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_for(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_massign(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_gvar(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_method_add_arg(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_hash(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_method_add_block(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_heredoc_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_mlhs_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_heredoc_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_mlhs_add_post(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_hshptn(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_mlhs_add_star(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_ident(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_mlhs_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_if(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_mlhs_paren(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_if_mod(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_module(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_ifop(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_mrhs_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_ignored_nl(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_mrhs_add_star(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_ignored_sp(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_mrhs_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_imaginary(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_mrhs_new_from_args(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_in(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_next(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_int(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_nl(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_ivar(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_nokw_param(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_kw(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_op(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_kwrest_param(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_opassign(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_label(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_operator_ambiguous(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_label_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_param_error(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_lambda(*args); end - # source://prism/lib/prism/translation/ripper.rb#686 - def on_params(_, _, _, _, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_lbrace(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_paren(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_lbracket(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_parse_error(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_lparen(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_period(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_magic_comment(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_program(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_massign(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_qsymbols_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_method_add_arg(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_qsymbols_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_method_add_block(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_qsymbols_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_qwords_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add_post(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_qwords_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_add_star(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_qwords_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_rational(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mlhs_paren(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_rbrace(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_module(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_rbracket(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_redo; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_add_star(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_regexp_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_regexp_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_mrhs_new_from_args(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_regexp_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_next(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_regexp_literal(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_nl(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_regexp_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_nokw_param(*args); end - # source://prism/lib/prism/translation/ripper.rb#684 - def on_rescue(_, _, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_op(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_rescue_mod(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_opassign(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_rest_param(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_operator_ambiguous(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_retry; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_param_error(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_return(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_params(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_return0; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_paren(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_rparen(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_period(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_sclass(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_program(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_semicolon(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_qsymbols_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_sp(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_qsymbols_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_stmts_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_qsymbols_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_stmts_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_qwords_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_string_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_qwords_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_string_concat(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_qwords_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_string_content; end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_rational(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_string_dvar(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_rbrace(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_string_embexpr(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_rbracket(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_string_literal(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_redo(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_super(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_symbeg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_regexp_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_symbol(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_regexp_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_symbol_literal(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_literal(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_symbols_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_regexp_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_symbols_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_rescue(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_symbols_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_rescue_mod(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_tlambda(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_rest_param(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_tlambeg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_retry(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_top_const_field(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_return(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_top_const_ref(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_return0(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_tstring_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_rparen(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_tstring_content(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_sclass(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_tstring_end(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_semicolon(tok); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_unary(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_sp(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_undef(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_stmts_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_unless(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_stmts_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_unless_mod(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_until(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_concat(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_until_mod(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_content(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_var_alias(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_dvar(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_var_field(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_embexpr(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_var_ref(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_string_literal(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_vcall(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_super(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_void_stmt; end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_symbeg(tok); end - # source://prism/lib/prism/translation/ripper.rb#683 - def on_when(_, _, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_symbol(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_while(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_symbol_literal(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_while_mod(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_symbols_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_word_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_symbols_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_word_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_symbols_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_words_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_tlambda(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_words_beg(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_tlambeg(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_words_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_top_const_field(*args); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_words_sep(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_top_const_ref(*args); end - # source://prism/lib/prism/translation/ripper.rb#682 - def on_xstring_add(_, _); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_xstring_literal(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_content(tok); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_xstring_new; end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_tstring_end(tok); end - # source://prism/lib/prism/translation/ripper.rb#681 - def on_yield(_); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_unary(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_yield0; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_undef(*args); end - # source://prism/lib/prism/translation/ripper.rb#680 - def on_zsuper; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_unless(*args); end - # Lazily initialize the parse result. - # - # source://prism/lib/prism/translation/ripper.rb#676 - def result; end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_unless_mod(*args); end - # In Prism this is a CallNode with :[]= as the operator. - # In Ripper it's an :aref_field. - # - # source://prism/lib/prism/translation/ripper.rb#521 - def visit_aref_field_node(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_until(*args); end - # In Prism this is a CallNode with :[] as the operator. - # In Ripper it's an :aref. - # - # source://prism/lib/prism/translation/ripper.rb#513 - def visit_aref_node(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_until_mod(*args); end - # Visit an operation-and-assign node, such as +=. - # - # source://prism/lib/prism/translation/ripper.rb#501 - def visit_binary_op_assign(node, operator: T.unsafe(nil)); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_var_alias(*args); end - # Visit a binary operator node like an AndNode or OrNode - # - # source://prism/lib/prism/translation/ripper.rb#652 - def visit_binary_operator(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_var_field(*args); end - # Visit a list of elements, like the elements of an array or arguments. - # - # source://prism/lib/prism/translation/ripper.rb#474 - def visit_elements(elements); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_var_ref(*args); end - # Visit an InterpolatedStringNode or an InterpolatedSymbolNode node. - # - # source://prism/lib/prism/translation/ripper.rb#482 - def visit_enumerated_node(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_vcall(*args); end - # Generate Ripper events for a CallNode with no opening_loc - # - # source://prism/lib/prism/translation/ripper.rb#410 - def visit_no_paren_call(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_void_stmt(*args); end - # Visit a node that represents a number. We need to explicitly handle the - # unary - operator. - # - # source://prism/lib/prism/translation/ripper.rb#611 - def visit_number(node); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_when(*args); end - # Ripper has several methods of emitting a symbol literal. Inside an alias - # sometimes it suppresses the [:symbol] wrapper around ident. If the symbol - # is also the name of a keyword (e.g. :if) it will emit a :@kw wrapper, not - # an :@ident wrapper, with similar treatment for constants and operators. - # - # source://prism/lib/prism/translation/ripper.rb#580 - def visit_symbol_literal_node(node, no_symbol_wrapper: T.unsafe(nil)); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_while(*args); end - # For most Rubies and JRuby after 9.4.6.0 this is a no-op. - # - # source://prism/lib/prism/translation/ripper.rb#634 - def visit_unary_operator(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_while_mod(*args); end - class << self - # This is a convenience method that runs the SexpBuilderPP subclass parser. - # - # source://prism/lib/prism/translation/ripper.rb#403 - def sexp(source); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_word_add(*args); end - # This is a convenience method that runs the SexpBuilder subclass parser. - # - # source://prism/lib/prism/translation/ripper.rb#398 - def sexp_raw(source); end - end -end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_word_new(*args); end -# In an alias statement Ripper will emit @kw instead of @ident if the object -# being aliased is a Ruby keyword. For instance, in the line "alias :foo :if", -# the :if is treated as a lexer keyword. So we need to know what symbols are -# also keywords. -# -# source://prism/lib/prism/translation/ripper.rb#532 -Prism::Translation::Ripper::RUBY_KEYWORDS = T.let(T.unsafe(nil), Array) + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_words_add(*args); end -# This class mirrors the ::Ripper::SexpBuilder subclass of ::Ripper that -# returns the arrays of [type, *children]. -# -# source://prism/lib/prism/translation/ripper.rb#24 -class Prism::Translation::Ripper::SexpBuilder < ::Prism::Translation::Ripper - private + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_words_beg(tok); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_BEGIN(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_words_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_CHAR(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#55 + def on_words_sep(tok); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_END(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_add(*args); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on___end__(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_literal(*args); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_alias(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_xstring_new(*args); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_alias_error(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_yield(*args); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_aref(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_yield0(*args); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_aref_field(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#47 + def on_zsuper(*args); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_arg_ambiguous(*args); end + private - # source://prism/lib/prism/translation/ripper.rb#28 - def on_arg_paren(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#61 + def compile_error(mesg); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_args_add(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#17 + def dedent_element(e, width); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_args_add_block(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#61 + def on_error(mesg); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_args_add_star(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#24 + def on_heredoc_dedent(val, width); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_args_forward(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#61 + def on_parse_error(mesg); end +end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_args_new(*args); end +# This class mirrors the ::Ripper::SexpBuilderPP subclass of ::Ripper that +# returns the same values as ::Ripper::SexpBuilder except with a couple of +# niceties that flatten linked lists into arrays. +# +# source://prism/lib/prism/translation/ripper/sexp.rb#74 +class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder + private - # source://prism/lib/prism/translation/ripper.rb#28 - def on_array(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def _dispatch_event_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_aryptn(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def _dispatch_event_push(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_assign(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_args_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_assign_error(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_args_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_assoc_new(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#79 + def on_heredoc_dedent(val, width); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_assoc_splat(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_mlhs_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_assoclist_from_args(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#109 + def on_mlhs_add_post(list, post); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_backref(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#105 + def on_mlhs_add_star(list, star); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_backtick(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_mlhs_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_bare_assoc_hash(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#101 + def on_mlhs_paren(list); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_begin(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_mrhs_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_binary(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_mrhs_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_block_var(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_qsymbols_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_blockarg(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_qsymbols_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_bodystmt(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_qwords_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_brace_block(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_qwords_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_break(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_regexp_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_call(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_regexp_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_case(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_stmts_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_class(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_stmts_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_class_name_error(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_string_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_comma(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_symbols_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_command(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_symbols_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_command_call(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_word_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_comment(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_word_new; end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_const(value); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_words_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_const_path_field(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_words_new; end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_const_path_ref(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#96 + def on_xstring_add(list, item); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_const_ref(*args); end + # source://prism/lib/prism/translation/ripper/sexp.rb#92 + def on_xstring_new; end +end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_cvar(value); 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#1556 + def parse(source, filepath = T.unsafe(nil)); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_def(*args); 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#1562 + def parse_file(filepath); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_defined(*args); end + private - # source://prism/lib/prism/translation/ripper.rb#28 - def on_defs(*args); end + # Translate the given parse result and filepath into the + # seattlerb/ruby_parser gem's Sexp format. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1584 + def translate(result, filepath); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_do_block(*args); 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#1569 + def parse(source, filepath = T.unsafe(nil)); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_dot2(*args); 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#1575 + def parse_file(filepath); end + end +end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_dot3(*args); 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 - # source://prism/lib/prism/translation/ripper.rb#28 - def on_dyna_symbol(*args); 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 - # source://prism/lib/prism/translation/ripper.rb#28 - def on_else(*args); 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 - # source://prism/lib/prism/translation/ripper.rb#28 - def on_elsif(*args); 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 - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embdoc(value); end + # alias $foo $bar + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#45 + def visit_alias_global_variable_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embdoc_beg(value); end + # alias foo bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#39 + def visit_alias_method_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embdoc_end(value); end + # foo => bar | baz + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#51 + def visit_alternation_pattern_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embexpr_beg(value); end + # a and b + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#57 + def visit_and_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embexpr_end(value); end + # foo(bar) + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#96 + def visit_arguments_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_embvar(value); end + # [] + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#63 + def visit_array_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_ensure(*args); end + # foo => [bar] + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#73 + def visit_array_pattern_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_excessed_comma(*args); end + # { a: 1 } + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#102 + def visit_assoc_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_fcall(*args); end + # def foo(**); bar(**); end + # ^^ + # + # { **foo } + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#111 + def visit_assoc_splat_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_field(*args); end + # $+ + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#121 + def visit_back_reference_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_float(value); end + # begin end + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#127 + def visit_begin_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_fndptn(*args); end + # foo(&bar) + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#160 + def visit_block_argument_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_for(*args); end + # foo { |; bar| } + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#168 + def visit_block_local_variable_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_gvar(value); end + # A block on a keyword or method call. + # + # source://prism/lib/prism/translation/ruby_parser.rb#173 + def visit_block_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_hash(*args); end + # def foo(&bar); end + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#179 + def visit_block_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_heredoc_beg(value); end + # A block's parameters. + # + # source://prism/lib/prism/translation/ruby_parser.rb#184 + def visit_block_parameters_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_heredoc_dedent(*args); end + # break + # ^^^^^ + # + # break foo + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#224 + def visit_break_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_heredoc_end(value); end + # foo.bar &&= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#287 + def visit_call_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_hshptn(*args); end + # foo + # ^^^ + # + # foo.bar + # ^^^^^^^ + # + # foo.bar() {} + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#242 + def visit_call_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_ident(value); end + # foo.bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#277 + def visit_call_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_if(*args); end + # foo.bar ||= baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#297 + def visit_call_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_if_mod(*args); end + # foo.bar, = 1 + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#320 + def visit_call_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_ifop(*args); end + # foo => bar => baz + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#326 + def visit_capture_pattern_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_ignored_nl(value); end + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#338 + def visit_case_match_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_ignored_sp(value); end + # case foo; when bar; end + # ^^^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#332 + def visit_case_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_imaginary(value); end + # class Foo; end + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#344 + def visit_class_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_in(*args); end + # @@foo &&= bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#385 + def visit_class_variable_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_int(value); end + # @@foo += bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#379 + def visit_class_variable_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_ivar(value); end + # @@foo ||= bar + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#391 + def visit_class_variable_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_kw(value); end + # @@foo + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#364 + def visit_class_variable_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_kwrest_param(*args); end + # @@foo, = bar + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#397 + def visit_class_variable_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_label(value); end + # @@foo = 1 + # ^^^^^^^^^ + # + # @@foo, @@bar = 1 + # ^^^^^ ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#373 + def visit_class_variable_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_label_end(value); end + # Foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#430 + def visit_constant_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_lambda(*args); end + # Foo += bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#424 + def visit_constant_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_lbrace(value); end + # Foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#436 + def visit_constant_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_lbracket(value); end + # Foo::Bar &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#473 + def visit_constant_path_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_lparen(value); end + # Foo::Bar + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#448 + def visit_constant_path_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_magic_comment(*args); end + # Foo::Bar += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#467 + def visit_constant_path_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_massign(*args); end + # Foo::Bar ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#479 + def visit_constant_path_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_method_add_arg(*args); end + # Foo::Bar, = baz + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#485 + def visit_constant_path_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_method_add_block(*args); end + # Foo::Bar = 1 + # ^^^^^^^^^^^^ + # + # Foo::Foo, Bar::Bar = 1 + # ^^^^^^^^ ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#461 + def visit_constant_path_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mlhs_add(*args); end + # Foo + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#409 + def visit_constant_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mlhs_add_post(*args); end + # Foo, = bar + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#442 + def visit_constant_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mlhs_add_star(*args); end + # Foo = 1 + # ^^^^^^^ + # + # Foo, Bar = 1 + # ^^^ ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#418 + def visit_constant_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mlhs_new(*args); end + # def foo; end + # ^^^^^^^^^^^^ + # + # def self.foo; end + # ^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#501 + def visit_def_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mlhs_paren(*args); end + # defined? a + # ^^^^^^^^^^ + # + # defined?(a) + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#532 + def visit_defined_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_module(*args); end + # if foo then bar else baz end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#538 + def visit_else_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mrhs_add(*args); end + # "foo #{bar}" + # ^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#544 + def visit_embedded_statements_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mrhs_add_star(*args); end + # "foo #@bar" + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#552 + def visit_embedded_variable_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mrhs_new(*args); end + # begin; foo; ensure; bar; end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#558 + def visit_ensure_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_mrhs_new_from_args(*args); end + # false + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#564 + def visit_false_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_next(*args); end + # foo => [*, bar, *] + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#570 + def visit_find_pattern_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_nl(value); end + # if foo .. bar; end + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#576 + def visit_flip_flop_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_nokw_param(*args); end + # 1.0 + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#586 + def visit_float_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_op(value); end + # for foo in bar do end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#592 + def visit_for_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_opassign(*args); end + # def foo(...); bar(...); end + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#598 + def visit_forwarding_arguments_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_operator_ambiguous(*args); end + # def foo(...); end + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#604 + def visit_forwarding_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_param_error(*args); end + # super + # ^^^^^ + # + # super {} + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#613 + def visit_forwarding_super_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_params(*args); end + # $foo &&= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#640 + def visit_global_variable_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_paren(*args); end + # $foo += bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#634 + def visit_global_variable_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_parse_error(*args); end + # $foo ||= bar + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#646 + def visit_global_variable_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_period(value); end + # $foo + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#619 + def visit_global_variable_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_program(*args); end + # $foo, = bar + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#652 + def visit_global_variable_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_qsymbols_add(*args); end + # $foo = 1 + # ^^^^^^^^ + # + # $foo, $bar = 1 + # ^^^^ ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#628 + def visit_global_variable_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_qsymbols_beg(value); end + # {} + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#658 + def visit_hash_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_qsymbols_new(*args); end + # foo => {} + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#664 + def visit_hash_pattern_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_qwords_add(*args); end + # if foo then bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar if foo + # ^^^^^^^^^^ + # + # foo ? bar : baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#685 + def visit_if_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_qwords_beg(value); end + # 1i + # + # source://prism/lib/prism/translation/ruby_parser.rb#690 + def visit_imaginary_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_qwords_new(*args); end + # { foo: } + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#696 + def visit_implicit_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_rational(value); end + # foo { |bar,| } + # ^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#701 + def visit_implicit_rest_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_rbrace(value); end + # case foo; in bar; end + # ^^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#706 + def visit_in_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_rbracket(value); end + # foo[bar] &&= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#732 + def visit_index_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_redo(*args); end + # foo[bar] += baz + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#719 + def visit_index_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_regexp_add(*args); end + # foo[bar] ||= baz + # ^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#745 + def visit_index_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_regexp_beg(value); end + # foo[bar], = 1 + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#758 + def visit_index_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_regexp_end(value); end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#788 + def visit_instance_variable_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_regexp_literal(*args); end + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#782 + def visit_instance_variable_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_regexp_new(*args); end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#794 + def visit_instance_variable_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_rescue(*args); end + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#767 + def visit_instance_variable_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_rescue_mod(*args); end + # @foo, = bar + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#800 + def visit_instance_variable_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_rest_param(*args); end + # ^^^^^^^^ + # + # @foo, @bar = 1 + # ^^^^ ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#776 + def visit_instance_variable_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_retry(*args); end + # 1 + # ^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#806 + def visit_integer_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_return(*args); end + # if /foo #{bar}/ then end + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#812 + def visit_interpolated_match_last_line_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_return0(*args); end + # /foo #{bar}/ + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#829 + def visit_interpolated_regular_expression_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_rparen(value); end + # "foo #{bar}" + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#844 + def visit_interpolated_string_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_sclass(*args); end + # :"foo #{bar}" + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#851 + def visit_interpolated_symbol_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_semicolon(value); end + # `foo #{bar}` + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#858 + def visit_interpolated_x_string_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_sp(value); end + # -> { it } + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#923 + def visit_it_local_variable_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_stmts_add(*args); end + # foo(bar: baz) + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#929 + def visit_keyword_hash_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_stmts_new(*args); end + # def foo(**bar); end + # ^^^^^ + # + # def foo(**); end + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#938 + def visit_keyword_rest_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_add(*args); end + # -> {} + # + # source://prism/lib/prism/translation/ruby_parser.rb#943 + def visit_lambda_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_concat(*args); end + # foo &&= bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#986 + def visit_local_variable_and_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_content(*args); end + # foo += bar + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#980 + def visit_local_variable_operator_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_dvar(*args); end + # foo ||= bar + # ^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#992 + def visit_local_variable_or_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_embexpr(*args); end + # foo + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#961 + def visit_local_variable_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_string_literal(*args); end + # foo, = bar + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#998 + def visit_local_variable_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_super(*args); end + # foo = 1 + # ^^^^^^^ + # + # foo, bar = 1 + # ^^^ ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#974 + def visit_local_variable_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_symbeg(value); end + # if /foo/ then end + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1004 + def visit_match_last_line_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_symbol(*args); end + # foo in bar + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1010 + def visit_match_predicate_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_symbol_literal(*args); end + # foo => bar + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1016 + def visit_match_required_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_symbols_add(*args); end + # /(?foo)/ =~ bar + # ^^^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1022 + def visit_match_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_symbols_beg(value); 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#1029 + def visit_missing_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_symbols_new(*args); end + # module Foo; end + # ^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1035 + def visit_module_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_tlambda(value); end + # foo, bar = baz + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1055 + def visit_multi_target_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_tlambeg(value); end + # foo, bar = baz + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1065 + def visit_multi_write_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_top_const_field(*args); end + # next + # ^^^^ + # + # next foo + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1089 + def visit_next_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_top_const_ref(*args); end + # nil + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1102 + def visit_nil_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_tstring_beg(value); end + # def foo(**nil); end + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1108 + def visit_no_keywords_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_tstring_content(value); end + # -> { _1 + _2 } + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1114 + def visit_numbered_parameters_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_tstring_end(value); end + # $1 + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1120 + def visit_numbered_reference_read_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_unary(*args); end + # def foo(bar: baz); end + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1126 + def visit_optional_keyword_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_undef(*args); end + # def foo(bar = 1); end + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1132 + def visit_optional_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_unless(*args); end + # a or b + # ^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1138 + def visit_or_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_unless_mod(*args); end + # def foo(bar, *baz); end + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1144 + def visit_parameters_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_until(*args); end + # () + # ^^ + # + # (1) + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1182 + def visit_parentheses_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_until_mod(*args); end + # foo => ^(bar) + # ^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1192 + def visit_pinned_expression_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_var_alias(*args); end + # foo = 1 and bar => ^foo + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1198 + def visit_pinned_variable_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_var_field(*args); end + # END {} + # + # source://prism/lib/prism/translation/ruby_parser.rb#1207 + def visit_post_execution_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_var_ref(*args); end + # BEGIN {} + # + # source://prism/lib/prism/translation/ruby_parser.rb#1212 + def visit_pre_execution_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_vcall(*args); end + # The top-level program node. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1217 + def visit_program_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_void_stmt(*args); end + # 0..5 + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1223 + def visit_range_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_when(*args); end + # 1r + # ^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1245 + def visit_rational_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_while(*args); end + # redo + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1251 + def visit_redo_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_while_mod(*args); end + # /foo/ + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1257 + def visit_regular_expression_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_word_add(*args); end + # def foo(bar:); end + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1263 + def visit_required_keyword_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_word_new(*args); end + # def foo(bar); end + # ^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1269 + def visit_required_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_words_add(*args); end + # foo rescue bar + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1275 + def visit_rescue_modifier_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_words_beg(value); end + # begin; rescue; end + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1281 + def visit_rescue_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_words_new(*args); end + # def foo(*bar); end + # ^^^^ + # + # def foo(*); end + # ^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1301 + def visit_rest_parameter_node(node); end - # source://prism/lib/prism/translation/ripper.rb#34 - def on_words_sep(value); end + # retry + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1307 + def visit_retry_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_xstring_add(*args); end + # return + # ^^^^^^ + # + # return 1 + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1316 + def visit_return_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_xstring_literal(*args); end + # self + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1329 + def visit_self_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_xstring_new(*args); end + # A shareable constant. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1334 + def visit_shareable_constant_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_yield(*args); end + # class << self; end + # ^^^^^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1340 + def visit_singleton_class_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_yield0(*args); end + # __ENCODING__ + # ^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1348 + def visit_source_encoding_node(node); end - # source://prism/lib/prism/translation/ripper.rb#28 - def on_zsuper(*args); end -end + # __FILE__ + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1355 + def visit_source_file_node(node); end -# This class mirrors the ::Ripper::SexpBuilderPP subclass of ::Ripper that -# returns the same values as ::Ripper::SexpBuilder except with a couple of -# niceties that flatten linked lists into arrays. -# -# source://prism/lib/prism/translation/ripper.rb#43 -class Prism::Translation::Ripper::SexpBuilderPP < ::Prism::Translation::Ripper::SexpBuilder - private + # __LINE__ + # ^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1361 + def visit_source_line_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def _dispatch_event_new; end + # foo(*bar) + # ^^^^ + # + # def foo((bar, *baz)); end + # ^^^^ + # + # def foo(*); bar(*); end + # ^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1373 + def visit_splat_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def _dispatch_event_push(list, item); end + # A list of statements. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1382 + def visit_statements_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_args_add(list, item); end + # "foo" + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1394 + def visit_string_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_args_new; end + # super(foo) + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1400 + def visit_super_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_mlhs_add(list, item); end + # :foo + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1414 + def visit_symbol_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_mlhs_new; end + # true + # ^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1420 + def visit_true_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_mrhs_add(list, item); end + # undef foo + # ^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1426 + def visit_undef_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_mrhs_new; end + # unless foo; bar end + # ^^^^^^^^^^^^^^^^^^^ + # + # bar unless foo + # ^^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1436 + def visit_unless_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_qsymbols_add(list, item); end + # until foo; bar end + # ^^^^^^^^^^^^^^^^^ + # + # bar until foo + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1445 + def visit_until_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_qsymbols_new; end + # case foo; when bar; end + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1451 + def visit_when_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_qwords_add(list, item); end + # while foo; bar end + # ^^^^^^^^^^^^^^^^^^ + # + # bar while foo + # ^^^^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1460 + def visit_while_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_qwords_new; end + # `foo` + # ^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1466 + def visit_x_string_node(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_regexp_add(list, item); end + # yield + # ^^^^^ + # + # yield 1 + # ^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1482 + def visit_yield_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_regexp_new; end + private - # source://prism/lib/prism/translation/ripper.rb#50 - def on_stmts_add(list, item); end + # 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#403 + def class_variable_write_type; end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_stmts_new; end + # Create a new compiler with the given options. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1489 + def copy_compiler(in_def: T.unsafe(nil), in_pattern: T.unsafe(nil)); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_string_add(list, item); 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#308 + def op_asgn?(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - 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#314 + def op_asgn_type(node, type); end - # source://prism/lib/prism/translation/ripper.rb#46 - 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#1494 + def s(node, *arguments); end - # source://prism/lib/prism/translation/ripper.rb#50 - 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#1504 + def visit_block(node, sexp, block); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_word_new; end + # def foo((bar, baz)); end + # ^^^^^^^^^^ + # + # source://prism/lib/prism/translation/ruby_parser.rb#1159 + def visit_destructured_parameter(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - def on_words_add(list, item); end + # Visit the interpolated content of the string-like node. + # + # source://prism/lib/prism/translation/ruby_parser.rb#865 + def visit_interpolated_parts(parts); end - # source://prism/lib/prism/translation/ripper.rb#46 - def on_words_new; end + # Pattern constants get wrapped in another layer of :const. + # + # source://prism/lib/prism/translation/ruby_parser.rb#1525 + def visit_pattern_constant(node); end - # source://prism/lib/prism/translation/ripper.rb#50 - 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#1235 + def visit_range_bounds_node(node); end - # source://prism/lib/prism/translation/ripper.rb#46 - 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#1539 + def visit_write_value(node); end end # Represents the use of the literal `true` keyword. @@ -29041,64 +36942,73 @@ end # true # ^^^^ # -# source://prism/lib/prism/node.rb#18139 +# source://prism/lib/prism/node.rb#18041 class Prism::TrueNode < ::Prism::Node # def initialize: (Location location) -> void # # @return [TrueNode] a new instance of TrueNode # - # source://prism/lib/prism/node.rb#18141 + # source://prism/lib/prism/node.rb#18043 + sig { params(source: Prism::Source, location: Prism::Location).void } def initialize(source, location); 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#18116 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18148 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18049 + 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#18153 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18054 + 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#18163 + # source://prism/lib/prism/node.rb#18064 + 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#18158 + # source://prism/lib/prism/node.rb#18059 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> TrueNode + # def copy: (?location: Location) -> TrueNode # - # source://prism/lib/prism/node.rb#18168 - sig { params(params: T.untyped).returns(Prism::TrueNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18069 + sig { params(location: Prism::Location).returns(Prism::TrueNode) } + def copy(location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18153 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18054 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end # def deconstruct_keys: (Array[Symbol] keys) -> { location: Location } # - # source://prism/lib/prism/node.rb#18179 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18077 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18185 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18082 + 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 @@ -29115,7 +37025,8 @@ class Prism::TrueNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18204 + # source://prism/lib/prism/node.rb#18100 + sig { override.returns(Symbol) } def type; end class << self @@ -29126,7 +37037,7 @@ class Prism::TrueNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18214 + # source://prism/lib/prism/node.rb#18110 def type; end end end @@ -29136,81 +37047,103 @@ end # undef :foo, :bar, :baz # ^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#18223 +# source://prism/lib/prism/node.rb#18125 class Prism::UndefNode < ::Prism::Node - # def initialize: (Array[Node] names, Location keyword_loc, Location location) -> void + # def initialize: (Array[SymbolNode | InterpolatedSymbolNode] names, Location keyword_loc, Location location) -> void # # @return [UndefNode] a new instance of UndefNode # - # source://prism/lib/prism/node.rb#18225 + # source://prism/lib/prism/node.rb#18127 + sig do + params( + source: Prism::Source, + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).void + end def initialize(source, names, keyword_loc, location); 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#18217 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18234 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18135 + 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#18239 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18140 + 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#18249 + # source://prism/lib/prism/node.rb#18150 + 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#18244 + # source://prism/lib/prism/node.rb#18145 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> UndefNode + # def copy: (?names: Array[SymbolNode | InterpolatedSymbolNode], ?keyword_loc: Location, ?location: Location) -> UndefNode # - # source://prism/lib/prism/node.rb#18254 - sig { params(params: T.untyped).returns(Prism::UndefNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18155 + sig do + params( + names: T::Array[T.any(Prism::SymbolNode, Prism::InterpolatedSymbolNode)], + keyword_loc: Prism::Location, + location: Prism::Location + ).returns(Prism::UndefNode) + end + def copy(names: T.unsafe(nil), keyword_loc: T.unsafe(nil), location: T.unsafe(nil)); end # def child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18239 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18140 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[Node], keyword_loc: Location, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { names: Array[SymbolNode | InterpolatedSymbolNode], keyword_loc: Location, location: Location } # - # source://prism/lib/prism/node.rb#18267 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18163 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18287 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18183 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#18282 + # source://prism/lib/prism/node.rb#18178 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#18275 + # source://prism/lib/prism/node.rb#18171 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader names: Array[Node] + # attr_reader names: Array[SymbolNode | InterpolatedSymbolNode] # - # source://prism/lib/prism/node.rb#18272 - sig { returns(T::Array[Prism::Node]) } + # source://prism/lib/prism/node.rb#18168 + 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 @@ -29228,7 +37161,8 @@ class Prism::UndefNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18308 + # source://prism/lib/prism/node.rb#18201 + sig { override.returns(Symbol) } def type; end class << self @@ -29239,7 +37173,7 @@ class Prism::UndefNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18318 + # source://prism/lib/prism/node.rb#18211 def type; end end end @@ -29252,119 +37186,174 @@ end # unless foo then bar end # ^^^^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#18330 +# source://prism/lib/prism/node.rb#18232 class Prism::UnlessNode < ::Prism::Node - # def initialize: (Location keyword_loc, Node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void + # def initialize: (Location keyword_loc, Prism::node predicate, Location? then_keyword_loc, StatementsNode? statements, ElseNode? consequent, Location? end_keyword_loc, Location location) -> void # # @return [UnlessNode] a new instance of UnlessNode # - # source://prism/lib/prism/node.rb#18332 + # source://prism/lib/prism/node.rb#18234 + sig do + params( + source: Prism::Source, + 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 + ).void + end def initialize(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location); 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#18399 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18345 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18246 + 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#18354 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18251 + 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#18368 + # source://prism/lib/prism/node.rb#18265 + 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#18359 + # source://prism/lib/prism/node.rb#18256 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader consequent: ElseNode? + # The else clause of the unless expression, if present. # - # source://prism/lib/prism/node.rb#18419 + # unless cond then bar else baz end + # ^^^^^^^^ + # + # source://prism/lib/prism/node.rb#18331 sig { returns(T.nilable(Prism::ElseNode)) } def consequent; end - # def copy: (**params) -> UnlessNode + # def copy: (?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?consequent: ElseNode?, ?end_keyword_loc: Location?, ?location: Location) -> UnlessNode # - # source://prism/lib/prism/node.rb#18373 - sig { params(params: T.untyped).returns(Prism::UnlessNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18270 + sig do + params( + 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 + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18354 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18251 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location } + # 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 } # - # source://prism/lib/prism/node.rb#18390 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18278 + 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#18445 + # source://prism/lib/prism/node.rb#18360 sig { returns(T.nilable(String)) } def end_keyword; end - # attr_reader end_keyword_loc: Location? + # The location of the `end` keyword, if present. # - # source://prism/lib/prism/node.rb#18422 + # unless cond then bar end + # ^^^ + # + # source://prism/lib/prism/node.rb#18337 sig { returns(T.nilable(Prism::Location)) } def end_keyword_loc; end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18450 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18365 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#18435 + # source://prism/lib/prism/node.rb#18350 sig { returns(String) } def keyword; end - # attr_reader keyword_loc: Location + # The location of the `unless` keyword. + # + # unless cond then bar end + # ^^^^^^ + # + # bar unless cond + # ^^^^^^ # - # source://prism/lib/prism/node.rb#18395 + # source://prism/lib/prism/node.rb#18289 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader predicate: Node + # source://prism/lib/prism/parse_result/newlines.rb#97 + def newline!(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 + # ^^^^ # - # source://prism/lib/prism/node.rb#18401 + # bar unless cond + # ^^^^ + # + # source://prism/lib/prism/node.rb#18302 sig { returns(Prism::Node) } def predicate; end - # source://prism/lib/prism/node.rb#18349 - def set_newline_flag(newline_marked); end - - # attr_reader statements: StatementsNode? + # 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#18416 + # source://prism/lib/prism/node.rb#18325 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end # def then_keyword: () -> String? # - # source://prism/lib/prism/node.rb#18440 + # source://prism/lib/prism/node.rb#18355 sig { returns(T.nilable(String)) } def then_keyword; end - # attr_reader then_keyword_loc: Location? + # The location of the `then` keyword, if present. # - # source://prism/lib/prism/node.rb#18404 + # unless cond then bar end + # ^^^^ + # + # source://prism/lib/prism/node.rb#18308 sig { returns(T.nilable(Prism::Location)) } def then_keyword_loc; end @@ -29383,7 +37372,8 @@ class Prism::UnlessNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18486 + # source://prism/lib/prism/node.rb#18383 + sig { override.returns(Symbol) } def type; end class << self @@ -29394,7 +37384,7 @@ class Prism::UnlessNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18496 + # source://prism/lib/prism/node.rb#18393 def type; end end end @@ -29407,109 +37397,137 @@ end # until foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#18508 +# source://prism/lib/prism/node.rb#18417 class Prism::UntilNode < ::Prism::Node - # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Node predicate, StatementsNode? statements, Location location) -> void + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void # # @return [UntilNode] a new instance of UntilNode # - # source://prism/lib/prism/node.rb#18510 + # source://prism/lib/prism/node.rb#18419 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); 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#18545 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18522 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18430 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#18599 + # source://prism/lib/prism/node.rb#18496 sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18531 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18435 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#18609 + # source://prism/lib/prism/node.rb#18506 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#18580 + # source://prism/lib/prism/node.rb#18477 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#18544 + # source://prism/lib/prism/node.rb#18448 + 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#18536 + # source://prism/lib/prism/node.rb#18440 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> UntilNode + # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> UntilNode # - # source://prism/lib/prism/node.rb#18549 - sig { params(params: T.untyped).returns(Prism::UntilNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18453 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18531 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18435 + 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: Node, statements: StatementsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } # - # source://prism/lib/prism/node.rb#18565 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18461 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18614 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18511 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#18604 + # source://prism/lib/prism/node.rb#18501 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#18574 + # source://prism/lib/prism/node.rb#18470 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader predicate: Node + # source://prism/lib/prism/parse_result/newlines.rb#103 + def newline!(lines); end + + # attr_reader predicate: Prism::node # - # source://prism/lib/prism/node.rb#18592 + # source://prism/lib/prism/node.rb#18490 sig { returns(Prism::Node) } def predicate; end - # source://prism/lib/prism/node.rb#18526 - def set_newline_flag(newline_marked); end - # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#18595 + # source://prism/lib/prism/node.rb#18493 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -29528,14 +37546,15 @@ class Prism::UntilNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18645 + # source://prism/lib/prism/node.rb#18529 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#18570 + # source://prism/lib/prism/node.rb#18466 sig { returns(Integer) } def flags; end @@ -29547,7 +37566,7 @@ class Prism::UntilNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18655 + # source://prism/lib/prism/node.rb#18539 def type; end end end @@ -29574,893 +37593,911 @@ Prism::VERSION = T.let(T.unsafe(nil), String) # end # end # -# source://prism/lib/prism/visitor.rb#50 +# source://prism/lib/prism/visitor.rb#54 class Prism::Visitor < ::Prism::BasicVisitor # Visit a AliasGlobalVariableNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AliasGlobalVariableNode).void } def visit_alias_global_variable_node(node); end # Visit a AliasMethodNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AliasMethodNode).void } def visit_alias_method_node(node); end # Visit a AlternationPatternNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AlternationPatternNode).void } def visit_alternation_pattern_node(node); end # Visit a AndNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AndNode).void } def visit_and_node(node); end # Visit a ArgumentsNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ArgumentsNode).void } def visit_arguments_node(node); end # Visit a ArrayNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ArrayNode).void } def visit_array_node(node); end # Visit a ArrayPatternNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ArrayPatternNode).void } def visit_array_pattern_node(node); end # Visit a AssocNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AssocNode).void } def visit_assoc_node(node); end # Visit a AssocSplatNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::AssocSplatNode).void } def visit_assoc_splat_node(node); end # Visit a BackReferenceReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BackReferenceReadNode).void } def visit_back_reference_read_node(node); end # Visit a BeginNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BeginNode).void } def visit_begin_node(node); end # Visit a BlockArgumentNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BlockArgumentNode).void } def visit_block_argument_node(node); end # Visit a BlockLocalVariableNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BlockLocalVariableNode).void } def visit_block_local_variable_node(node); end # Visit a BlockNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BlockNode).void } def visit_block_node(node); end # Visit a BlockParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BlockParameterNode).void } def visit_block_parameter_node(node); end # Visit a BlockParametersNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BlockParametersNode).void } def visit_block_parameters_node(node); end # Visit a BreakNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::BreakNode).void } def visit_break_node(node); end # Visit a CallAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CallAndWriteNode).void } def visit_call_and_write_node(node); end # Visit a CallNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CallNode).void } def visit_call_node(node); end # Visit a CallOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CallOperatorWriteNode).void } def visit_call_operator_write_node(node); end # Visit a CallOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CallOrWriteNode).void } def visit_call_or_write_node(node); end # Visit a CallTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CallTargetNode).void } def visit_call_target_node(node); end # Visit a CapturePatternNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CapturePatternNode).void } def visit_capture_pattern_node(node); end # Visit a CaseMatchNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CaseMatchNode).void } def visit_case_match_node(node); end # Visit a CaseNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::CaseNode).void } def visit_case_node(node); end # Visit a ClassNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassNode).void } def visit_class_node(node); end # Visit a ClassVariableAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableAndWriteNode).void } def visit_class_variable_and_write_node(node); end # Visit a ClassVariableOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableOperatorWriteNode).void } def visit_class_variable_operator_write_node(node); end # Visit a ClassVariableOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableOrWriteNode).void } def visit_class_variable_or_write_node(node); end # Visit a ClassVariableReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableReadNode).void } def visit_class_variable_read_node(node); end # Visit a ClassVariableTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableTargetNode).void } def visit_class_variable_target_node(node); end # Visit a ClassVariableWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ClassVariableWriteNode).void } def visit_class_variable_write_node(node); end # Visit a ConstantAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantAndWriteNode).void } def visit_constant_and_write_node(node); end # Visit a ConstantOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantOperatorWriteNode).void } def visit_constant_operator_write_node(node); end # Visit a ConstantOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantOrWriteNode).void } def visit_constant_or_write_node(node); end # Visit a ConstantPathAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathAndWriteNode).void } def visit_constant_path_and_write_node(node); end # Visit a ConstantPathNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathNode).void } def visit_constant_path_node(node); end # Visit a ConstantPathOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathOperatorWriteNode).void } def visit_constant_path_operator_write_node(node); end # Visit a ConstantPathOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathOrWriteNode).void } def visit_constant_path_or_write_node(node); end # Visit a ConstantPathTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathTargetNode).void } def visit_constant_path_target_node(node); end # Visit a ConstantPathWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end # Visit a ConstantReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantReadNode).void } def visit_constant_read_node(node); end # Visit a ConstantTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantTargetNode).void } def visit_constant_target_node(node); end # Visit a ConstantWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end # Visit a DefNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::DefNode).void } def visit_def_node(node); end # Visit a DefinedNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::DefinedNode).void } def visit_defined_node(node); end # Visit a ElseNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ElseNode).void } def visit_else_node(node); end # Visit a EmbeddedStatementsNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::EmbeddedStatementsNode).void } def visit_embedded_statements_node(node); end # Visit a EmbeddedVariableNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::EmbeddedVariableNode).void } def visit_embedded_variable_node(node); end # Visit a EnsureNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::EnsureNode).void } def visit_ensure_node(node); end # Visit a FalseNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::FalseNode).void } def visit_false_node(node); end # Visit a FindPatternNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::FindPatternNode).void } def visit_find_pattern_node(node); end # Visit a FlipFlopNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::FlipFlopNode).void } def visit_flip_flop_node(node); end # Visit a FloatNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::FloatNode).void } def visit_float_node(node); end # Visit a ForNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ForNode).void } def visit_for_node(node); end # Visit a ForwardingArgumentsNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ForwardingArgumentsNode).void } def visit_forwarding_arguments_node(node); end # Visit a ForwardingParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ForwardingParameterNode).void } def visit_forwarding_parameter_node(node); end # Visit a ForwardingSuperNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ForwardingSuperNode).void } def visit_forwarding_super_node(node); end # Visit a GlobalVariableAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableAndWriteNode).void } def visit_global_variable_and_write_node(node); end # Visit a GlobalVariableOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableOperatorWriteNode).void } def visit_global_variable_operator_write_node(node); end # Visit a GlobalVariableOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableOrWriteNode).void } def visit_global_variable_or_write_node(node); end # Visit a GlobalVariableReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableReadNode).void } def visit_global_variable_read_node(node); end # Visit a GlobalVariableTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableTargetNode).void } def visit_global_variable_target_node(node); end # Visit a GlobalVariableWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::GlobalVariableWriteNode).void } def visit_global_variable_write_node(node); end # Visit a HashNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::HashNode).void } def visit_hash_node(node); end # Visit a HashPatternNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::HashPatternNode).void } def visit_hash_pattern_node(node); end # Visit a IfNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IfNode).void } def visit_if_node(node); end # Visit a ImaginaryNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ImaginaryNode).void } def visit_imaginary_node(node); end # Visit a ImplicitNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ImplicitNode).void } def visit_implicit_node(node); end # Visit a ImplicitRestNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ImplicitRestNode).void } def visit_implicit_rest_node(node); end # Visit a InNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InNode).void } def visit_in_node(node); end # Visit a IndexAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IndexAndWriteNode).void } def visit_index_and_write_node(node); end # Visit a IndexOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IndexOperatorWriteNode).void } def visit_index_operator_write_node(node); end # Visit a IndexOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IndexOrWriteNode).void } def visit_index_or_write_node(node); end # Visit a IndexTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IndexTargetNode).void } def visit_index_target_node(node); end # Visit a InstanceVariableAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableAndWriteNode).void } def visit_instance_variable_and_write_node(node); end # Visit a InstanceVariableOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableOperatorWriteNode).void } def visit_instance_variable_operator_write_node(node); end # Visit a InstanceVariableOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableOrWriteNode).void } def visit_instance_variable_or_write_node(node); end # Visit a InstanceVariableReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableReadNode).void } def visit_instance_variable_read_node(node); end # Visit a InstanceVariableTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableTargetNode).void } def visit_instance_variable_target_node(node); end # Visit a InstanceVariableWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InstanceVariableWriteNode).void } def visit_instance_variable_write_node(node); end # Visit a IntegerNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::IntegerNode).void } def visit_integer_node(node); end # Visit a InterpolatedMatchLastLineNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InterpolatedMatchLastLineNode).void } def visit_interpolated_match_last_line_node(node); end # Visit a InterpolatedRegularExpressionNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InterpolatedRegularExpressionNode).void } def visit_interpolated_regular_expression_node(node); end # Visit a InterpolatedStringNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end # Visit a InterpolatedSymbolNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::InterpolatedSymbolNode).void } def visit_interpolated_symbol_node(node); end # Visit a InterpolatedXStringNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 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 + sig { params(node: Prism::ItParametersNode).void } + def visit_it_parameters_node(node); end + # Visit a KeywordHashNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::KeywordHashNode).void } def visit_keyword_hash_node(node); end # Visit a KeywordRestParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::KeywordRestParameterNode).void } def visit_keyword_rest_parameter_node(node); end # Visit a LambdaNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LambdaNode).void } def visit_lambda_node(node); end # Visit a LocalVariableAndWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end # Visit a LocalVariableOperatorWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end # Visit a LocalVariableOrWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end # Visit a LocalVariableReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableReadNode).void } def visit_local_variable_read_node(node); end # Visit a LocalVariableTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableTargetNode).void } def visit_local_variable_target_node(node); end # Visit a LocalVariableWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end # Visit a MatchLastLineNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MatchLastLineNode).void } def visit_match_last_line_node(node); end # Visit a MatchPredicateNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MatchPredicateNode).void } def visit_match_predicate_node(node); end # Visit a MatchRequiredNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MatchRequiredNode).void } def visit_match_required_node(node); end # Visit a MatchWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MatchWriteNode).void } def visit_match_write_node(node); end # Visit a MissingNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MissingNode).void } def visit_missing_node(node); end # Visit a ModuleNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ModuleNode).void } def visit_module_node(node); end # Visit a MultiTargetNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MultiTargetNode).void } def visit_multi_target_node(node); end # Visit a MultiWriteNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::MultiWriteNode).void } def visit_multi_write_node(node); end # Visit a NextNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::NextNode).void } def visit_next_node(node); end # Visit a NilNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::NilNode).void } def visit_nil_node(node); end # Visit a NoKeywordsParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::NoKeywordsParameterNode).void } def visit_no_keywords_parameter_node(node); end # Visit a NumberedParametersNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::NumberedParametersNode).void } def visit_numbered_parameters_node(node); end # Visit a NumberedReferenceReadNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::NumberedReferenceReadNode).void } def visit_numbered_reference_read_node(node); end # Visit a OptionalKeywordParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::OptionalKeywordParameterNode).void } def visit_optional_keyword_parameter_node(node); end # Visit a OptionalParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::OptionalParameterNode).void } def visit_optional_parameter_node(node); end # Visit a OrNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::OrNode).void } def visit_or_node(node); end # Visit a ParametersNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ParametersNode).void } def visit_parameters_node(node); end # Visit a ParenthesesNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ParenthesesNode).void } def visit_parentheses_node(node); end # Visit a PinnedExpressionNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::PinnedExpressionNode).void } def visit_pinned_expression_node(node); end # Visit a PinnedVariableNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::PinnedVariableNode).void } def visit_pinned_variable_node(node); end # Visit a PostExecutionNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::PostExecutionNode).void } def visit_post_execution_node(node); end # Visit a PreExecutionNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::PreExecutionNode).void } def visit_pre_execution_node(node); end # Visit a ProgramNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ProgramNode).void } def visit_program_node(node); end # Visit a RangeNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RangeNode).void } def visit_range_node(node); end # Visit a RationalNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RationalNode).void } def visit_rational_node(node); end # Visit a RedoNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RedoNode).void } def visit_redo_node(node); end # Visit a RegularExpressionNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RegularExpressionNode).void } def visit_regular_expression_node(node); end # Visit a RequiredKeywordParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RequiredKeywordParameterNode).void } def visit_required_keyword_parameter_node(node); end # Visit a RequiredParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RequiredParameterNode).void } def visit_required_parameter_node(node); end # Visit a RescueModifierNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RescueModifierNode).void } def visit_rescue_modifier_node(node); end # Visit a RescueNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RescueNode).void } def visit_rescue_node(node); end # Visit a RestParameterNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RestParameterNode).void } def visit_rest_parameter_node(node); end # Visit a RetryNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::RetryNode).void } def visit_retry_node(node); end # Visit a ReturnNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::ReturnNode).void } def visit_return_node(node); end # Visit a SelfNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SelfNode).void } def visit_self_node(node); end + # Visit a ShareableConstantNode node + # + # source://prism/lib/prism/visitor.rb#29 + sig { params(node: Prism::ShareableConstantNode).void } + def visit_shareable_constant_node(node); end + # Visit a SingletonClassNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end # Visit a SourceEncodingNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SourceEncodingNode).void } def visit_source_encoding_node(node); end # Visit a SourceFileNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SourceFileNode).void } def visit_source_file_node(node); end # Visit a SourceLineNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SourceLineNode).void } def visit_source_line_node(node); end # Visit a SplatNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SplatNode).void } def visit_splat_node(node); end # Visit a StatementsNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::StatementsNode).void } def visit_statements_node(node); end # Visit a StringNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::StringNode).void } def visit_string_node(node); end # Visit a SuperNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SuperNode).void } def visit_super_node(node); end # Visit a SymbolNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::SymbolNode).void } def visit_symbol_node(node); end # Visit a TrueNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::TrueNode).void } def visit_true_node(node); end # Visit a UndefNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::UndefNode).void } def visit_undef_node(node); end # Visit a UnlessNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::UnlessNode).void } def visit_unless_node(node); end # Visit a UntilNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::UntilNode).void } def visit_until_node(node); end # Visit a WhenNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::WhenNode).void } def visit_when_node(node); end # Visit a WhileNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::WhileNode).void } def visit_while_node(node); end # Visit a XStringNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::XStringNode).void } def visit_x_string_node(node); end # Visit a YieldNode node # - # source://prism/lib/prism/visitor.rb#26 + # source://prism/lib/prism/visitor.rb#29 sig { params(node: Prism::YieldNode).void } def visit_yield_node(node); end end @@ -30472,89 +38509,127 @@ end # ^^^^^^^^^ # end # -# source://prism/lib/prism/node.rb#18666 +# source://prism/lib/prism/node.rb#18561 class Prism::WhenNode < ::Prism::Node - # def initialize: (Location keyword_loc, Array[Node] conditions, StatementsNode? statements, Location location) -> void + # def initialize: (Location keyword_loc, Array[Prism::node] conditions, Location? then_keyword_loc, StatementsNode? statements, Location location) -> void # # @return [WhenNode] a new instance of WhenNode # - # source://prism/lib/prism/node.rb#18668 - def initialize(source, keyword_loc, conditions, statements, location); end + # source://prism/lib/prism/node.rb#18563 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end + def initialize(source, keyword_loc, conditions, then_keyword_loc, statements, location); 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#18679 + def ===(other); end # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18678 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18573 + 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#18683 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18578 + 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#18696 + # source://prism/lib/prism/node.rb#18591 + 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#18688 + # source://prism/lib/prism/node.rb#18583 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # attr_reader conditions: Array[Node] + # attr_reader conditions: Array[Prism::node] # - # source://prism/lib/prism/node.rb#18726 + # source://prism/lib/prism/node.rb#18616 sig { returns(T::Array[Prism::Node]) } def conditions; end - # def copy: (**params) -> WhenNode + # def copy: (?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?location: Location) -> WhenNode # - # source://prism/lib/prism/node.rb#18701 - sig { params(params: T.untyped).returns(Prism::WhenNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18596 + sig do + params( + keyword_loc: Prism::Location, + conditions: T::Array[Prism::Node], + then_keyword_loc: T.nilable(Prism::Location), + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18683 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18578 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def deconstruct; end - # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Node], statements: StatementsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { keyword_loc: Location, conditions: Array[Prism::node], then_keyword_loc: Location?, statements: StatementsNode?, location: Location } # - # source://prism/lib/prism/node.rb#18715 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18604 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18738 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18645 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#18733 + # source://prism/lib/prism/node.rb#18635 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#18720 + # source://prism/lib/prism/node.rb#18609 sig { returns(Prism::Location) } def keyword_loc; end # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#18729 + # source://prism/lib/prism/node.rb#18632 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end + # def then_keyword: () -> String? + # + # source://prism/lib/prism/node.rb#18640 + sig { returns(T.nilable(String)) } + def then_keyword; end + + # attr_reader then_keyword_loc: Location? + # + # source://prism/lib/prism/node.rb#18619 + 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 @@ -30570,7 +38645,8 @@ class Prism::WhenNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18765 + # source://prism/lib/prism/node.rb#18663 + sig { override.returns(Symbol) } def type; end class << self @@ -30581,7 +38657,7 @@ class Prism::WhenNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18775 + # source://prism/lib/prism/node.rb#18673 def type; end end end @@ -30594,109 +38670,137 @@ end # while foo do bar end # ^^^^^^^^^^^^^^^^^^^^ # -# source://prism/lib/prism/node.rb#18787 +# source://prism/lib/prism/node.rb#18696 class Prism::WhileNode < ::Prism::Node - # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Node predicate, StatementsNode? statements, Location location) -> void + # def initialize: (Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements, Location location) -> void # # @return [WhileNode] a new instance of WhileNode # - # source://prism/lib/prism/node.rb#18789 + # source://prism/lib/prism/node.rb#18698 + sig do + params( + source: Prism::Source, + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).void + end def initialize(source, flags, keyword_loc, closing_loc, predicate, statements, location); 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#18824 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18801 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18709 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # def begin_modifier?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#18878 + # source://prism/lib/prism/node.rb#18775 sig { returns(T::Boolean) } def begin_modifier?; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18810 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18714 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String? # - # source://prism/lib/prism/node.rb#18888 + # source://prism/lib/prism/node.rb#18785 sig { returns(T.nilable(String)) } def closing; end # attr_reader closing_loc: Location? # - # source://prism/lib/prism/node.rb#18859 + # source://prism/lib/prism/node.rb#18756 sig { returns(T.nilable(Prism::Location)) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#18823 + # source://prism/lib/prism/node.rb#18727 + 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#18815 + # source://prism/lib/prism/node.rb#18719 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> WhileNode + # def copy: (?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?, ?location: Location) -> WhileNode # - # source://prism/lib/prism/node.rb#18828 - sig { params(params: T.untyped).returns(Prism::WhileNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18732 + sig do + params( + flags: Integer, + keyword_loc: Prism::Location, + closing_loc: T.nilable(Prism::Location), + predicate: Prism::Node, + statements: T.nilable(Prism::StatementsNode), + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18810 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18714 + 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: Node, statements: StatementsNode?, location: Location } + # def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode?, location: Location } # - # source://prism/lib/prism/node.rb#18844 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18740 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#18893 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18790 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#18883 + # source://prism/lib/prism/node.rb#18780 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#18853 + # source://prism/lib/prism/node.rb#18749 sig { returns(Prism::Location) } def keyword_loc; end - # attr_reader predicate: Node + # source://prism/lib/prism/parse_result/newlines.rb#109 + def newline!(lines); end + + # attr_reader predicate: Prism::node # - # source://prism/lib/prism/node.rb#18871 + # source://prism/lib/prism/node.rb#18769 sig { returns(Prism::Node) } def predicate; end - # source://prism/lib/prism/node.rb#18805 - def set_newline_flag(newline_marked); end - # attr_reader statements: StatementsNode? # - # source://prism/lib/prism/node.rb#18874 + # source://prism/lib/prism/node.rb#18772 sig { returns(T.nilable(Prism::StatementsNode)) } def statements; end @@ -30715,14 +38819,15 @@ class Prism::WhileNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#18924 + # source://prism/lib/prism/node.rb#18808 + sig { override.returns(Symbol) } def type; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#18849 + # source://prism/lib/prism/node.rb#18745 sig { returns(Integer) } def flags; end @@ -30734,7 +38839,7 @@ class Prism::WhileNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#18934 + # source://prism/lib/prism/node.rb#18818 def type; end end end @@ -30744,7 +38849,7 @@ end # `foo` # ^^^^^ # -# source://prism/lib/prism/node.rb#18943 +# source://prism/lib/prism/node.rb#18838 class Prism::XStringNode < ::Prism::Node include ::Prism::HeredocQuery @@ -30752,83 +38857,110 @@ class Prism::XStringNode < ::Prism::Node # # @return [XStringNode] a new instance of XStringNode # - # source://prism/lib/prism/node.rb#18945 + # source://prism/lib/prism/node.rb#18840 + sig do + params( + source: Prism::Source, + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).void + end def initialize(source, flags, opening_loc, content_loc, closing_loc, unescaped, location); 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#18971 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#18957 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18851 + 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#18962 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18856 + sig { override.returns(T::Array[T.nilable(Prism::Node)]) } def child_nodes; end # def closing: () -> String # - # source://prism/lib/prism/node.rb#19044 + # source://prism/lib/prism/node.rb#18932 sig { returns(String) } def closing; end # attr_reader closing_loc: Location # - # source://prism/lib/prism/node.rb#19014 + # source://prism/lib/prism/node.rb#18902 sig { returns(Prism::Location) } def closing_loc; end # def comment_targets: () -> Array[Node | Location] # - # source://prism/lib/prism/node.rb#18972 + # source://prism/lib/prism/node.rb#18866 + 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#18967 + # source://prism/lib/prism/node.rb#18861 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end # def content: () -> String # - # source://prism/lib/prism/node.rb#19039 + # source://prism/lib/prism/node.rb#18927 sig { returns(String) } def content; end # attr_reader content_loc: Location # - # source://prism/lib/prism/node.rb#19008 + # source://prism/lib/prism/node.rb#18895 sig { returns(Prism::Location) } def content_loc; end - # def copy: (**params) -> XStringNode + # def copy: (?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String, ?location: Location) -> XStringNode # - # source://prism/lib/prism/node.rb#18977 - sig { params(params: T.untyped).returns(Prism::XStringNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#18871 + sig do + params( + flags: Integer, + opening_loc: Prism::Location, + content_loc: Prism::Location, + closing_loc: Prism::Location, + unescaped: String, + location: Prism::Location + ).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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#18962 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#18856 + 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 } # - # source://prism/lib/prism/node.rb#18993 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#18879 + 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 forced_binary_encoding?: () -> bool # # @return [Boolean] # - # source://prism/lib/prism/node.rb#19029 + # source://prism/lib/prism/node.rb#18917 sig { returns(T::Boolean) } def forced_binary_encoding?; end @@ -30836,27 +38968,38 @@ class Prism::XStringNode < ::Prism::Node # # @return [Boolean] # - # source://prism/lib/prism/node.rb#19024 + # source://prism/lib/prism/node.rb#18912 sig { returns(T::Boolean) } def forced_utf8_encoding?; end - # def inspect(NodeInspector inspector) -> String + sig { returns(T::Boolean) } + def heredoc?; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#19049 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#18937 + sig { override.returns(String) } + def inspect; end # def opening: () -> String # - # source://prism/lib/prism/node.rb#19034 + # source://prism/lib/prism/node.rb#18922 sig { returns(String) } def opening; end # attr_reader opening_loc: Location # - # source://prism/lib/prism/node.rb#19002 + # source://prism/lib/prism/node.rb#18888 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#86 + 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 @@ -30872,20 +39015,21 @@ class Prism::XStringNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#19074 + # source://prism/lib/prism/node.rb#18955 + sig { override.returns(Symbol) } def type; end # attr_reader unescaped: String # - # source://prism/lib/prism/node.rb#19020 + # source://prism/lib/prism/node.rb#18909 sig { returns(String) } def unescaped; end - private + protected - # private attr_reader flags: Integer + # protected attr_reader flags: Integer # - # source://prism/lib/prism/node.rb#18998 + # source://prism/lib/prism/node.rb#18884 sig { returns(Integer) } def flags; end @@ -30897,7 +39041,7 @@ class Prism::XStringNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#19084 + # source://prism/lib/prism/node.rb#18965 def type; end end end @@ -30907,104 +39051,130 @@ end # yield 1 # ^^^^^^^ # -# source://prism/lib/prism/node.rb#19093 +# source://prism/lib/prism/node.rb#18985 class Prism::YieldNode < ::Prism::Node # def initialize: (Location keyword_loc, Location? lparen_loc, ArgumentsNode? arguments, Location? rparen_loc, Location location) -> void # # @return [YieldNode] a new instance of YieldNode # - # source://prism/lib/prism/node.rb#19095 + # source://prism/lib/prism/node.rb#18987 + sig do + params( + source: Prism::Source, + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: Prism::Location + ).void + end def initialize(source, keyword_loc, lparen_loc, arguments, rparen_loc, location); 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#19117 + def ===(other); end + # def accept: (Visitor visitor) -> void # - # source://prism/lib/prism/node.rb#19106 - sig { params(visitor: Prism::Visitor).void } + # source://prism/lib/prism/node.rb#18997 + sig { override.params(visitor: Prism::Visitor).returns(T.untyped) } def accept(visitor); end # attr_reader arguments: ArgumentsNode? # - # source://prism/lib/prism/node.rb#19166 + # source://prism/lib/prism/node.rb#19052 sig { returns(T.nilable(Prism::ArgumentsNode)) } def arguments; end # def child_nodes: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#19111 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#19002 + 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#19123 + # source://prism/lib/prism/node.rb#19014 + 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#19116 + # source://prism/lib/prism/node.rb#19007 + sig { override.returns(T::Array[Prism::Node]) } def compact_child_nodes; end - # def copy: (**params) -> YieldNode + # def copy: (?keyword_loc: Location, ?lparen_loc: Location?, ?arguments: ArgumentsNode?, ?rparen_loc: Location?, ?location: Location) -> YieldNode # - # source://prism/lib/prism/node.rb#19128 - sig { params(params: T.untyped).returns(Prism::YieldNode) } - def copy(**params); end + # source://prism/lib/prism/node.rb#19019 + sig do + params( + keyword_loc: Prism::Location, + lparen_loc: T.nilable(Prism::Location), + arguments: T.nilable(Prism::ArgumentsNode), + rparen_loc: T.nilable(Prism::Location), + location: 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 child_nodes: () -> Array[nil | Node] # def deconstruct: () -> Array[nil | Node] # - # source://prism/lib/prism/node.rb#19111 - sig { returns(T::Array[T.nilable(Prism::Node)]) } + # source://prism/lib/prism/node.rb#19002 + 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 } # - # source://prism/lib/prism/node.rb#19143 - sig do - params( - keys: T::Array[Symbol] - ).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) - end + # source://prism/lib/prism/node.rb#19027 + sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) } def deconstruct_keys(keys); end - # def inspect(NodeInspector inspector) -> String + sig { override.returns(T::Array[Prism::Reflection::Field]) } + def fields; end + + # def inspect -> String # - # source://prism/lib/prism/node.rb#19197 - def inspect(inspector = T.unsafe(nil)); end + # source://prism/lib/prism/node.rb#19083 + sig { override.returns(String) } + def inspect; end # def keyword: () -> String # - # source://prism/lib/prism/node.rb#19182 + # source://prism/lib/prism/node.rb#19068 sig { returns(String) } def keyword; end # attr_reader keyword_loc: Location # - # source://prism/lib/prism/node.rb#19148 + # source://prism/lib/prism/node.rb#19032 sig { returns(Prism::Location) } def keyword_loc; end # def lparen: () -> String? # - # source://prism/lib/prism/node.rb#19187 + # source://prism/lib/prism/node.rb#19073 sig { returns(T.nilable(String)) } def lparen; end # attr_reader lparen_loc: Location? # - # source://prism/lib/prism/node.rb#19154 + # source://prism/lib/prism/node.rb#19039 sig { returns(T.nilable(Prism::Location)) } def lparen_loc; end # def rparen: () -> String? # - # source://prism/lib/prism/node.rb#19192 + # source://prism/lib/prism/node.rb#19078 sig { returns(T.nilable(String)) } def rparen; end # attr_reader rparen_loc: Location? # - # source://prism/lib/prism/node.rb#19169 + # source://prism/lib/prism/node.rb#19055 sig { returns(T.nilable(Prism::Location)) } def rparen_loc; end @@ -31023,7 +39193,8 @@ class Prism::YieldNode < ::Prism::Node # # def type: () -> Symbol # - # source://prism/lib/prism/node.rb#19225 + # source://prism/lib/prism/node.rb#19101 + sig { override.returns(Symbol) } def type; end class << self @@ -31034,7 +39205,7 @@ class Prism::YieldNode < ::Prism::Node # # def self.type: () -> Symbol # - # source://prism/lib/prism/node.rb#19235 + # source://prism/lib/prism/node.rb#19111 def type; end end end diff --git a/sorbet/rbi/gems/rbs@3.5.1.rbi b/sorbet/rbi/gems/rbs@3.5.1.rbi new file mode 100644 index 00000000..99a46329 --- /dev/null +++ b/sorbet/rbi/gems/rbs@3.5.1.rbi @@ -0,0 +1,6700 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rbs` gem. +# Please instead update this file by running `bin/tapioca gem rbs`. + +# source://rbs/lib/rbs/namespace.rb#120 +module Kernel + # source://rbs/lib/rbs/namespace.rb#121 + def Namespace(name); end + + # source://rbs/lib/rbs/type_name.rb#93 + def TypeName(string); end +end + +# source://rbs/lib/rbs/version.rb#3 +module RBS + class << self + # source://rbs/lib/rbs.rb#67 + def logger; end + + # Returns the value of attribute logger_level. + # + # source://rbs/lib/rbs.rb#64 + def logger_level; end + + # source://rbs/lib/rbs.rb#76 + def logger_level=(level); end + + # Returns the value of attribute logger_output. + # + # source://rbs/lib/rbs.rb#65 + def logger_output; end + + # source://rbs/lib/rbs.rb#71 + def logger_output=(val); end + + # source://rbs/lib/rbs.rb#81 + def print_warning; end + end +end + +# source://rbs/lib/rbs/ast/type_param.rb#4 +module RBS::AST; end + +# source://rbs/lib/rbs/ast/annotation.rb#5 +class RBS::AST::Annotation + # @return [Annotation] a new instance of Annotation + # + # source://rbs/lib/rbs/ast/annotation.rb#9 + def initialize(string:, location:); end + + # source://rbs/lib/rbs/ast/annotation.rb#14 + def ==(other); end + + # source://rbs/lib/rbs/ast/annotation.rb#14 + def eql?(other); end + + # source://rbs/lib/rbs/ast/annotation.rb#20 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/annotation.rb#7 + def location; end + + # Returns the value of attribute string. + # + # source://rbs/lib/rbs/ast/annotation.rb#6 + def string; end + + # source://rbs/lib/rbs/ast/annotation.rb#24 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/comment.rb#5 +class RBS::AST::Comment + # @return [Comment] a new instance of Comment + # + # source://rbs/lib/rbs/ast/comment.rb#9 + def initialize(string:, location:); end + + # source://rbs/lib/rbs/ast/comment.rb#14 + def ==(other); end + + # source://rbs/lib/rbs/ast/comment.rb#14 + def eql?(other); end + + # source://rbs/lib/rbs/ast/comment.rb#20 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/comment.rb#7 + def location; end + + # Returns the value of attribute string. + # + # source://rbs/lib/rbs/ast/comment.rb#6 + def string; end + + # source://rbs/lib/rbs/ast/comment.rb#24 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/declarations.rb#5 +module RBS::AST::Declarations; end + +# source://rbs/lib/rbs/ast/declarations.rb#383 +class RBS::AST::Declarations::AliasDecl < ::RBS::AST::Declarations::Base + # @return [AliasDecl] a new instance of AliasDecl + # + # source://rbs/lib/rbs/ast/declarations.rb#386 + def initialize(new_name:, old_name:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#393 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#384 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#393 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#401 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#384 + def location; end + + # Returns the value of attribute new_name. + # + # source://rbs/lib/rbs/ast/declarations.rb#384 + def new_name; end + + # Returns the value of attribute old_name. + # + # source://rbs/lib/rbs/ast/declarations.rb#384 + def old_name; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#6 +class RBS::AST::Declarations::Base; end + +# source://rbs/lib/rbs/ast/declarations.rb#55 +class RBS::AST::Declarations::Class < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::NestedDeclarationHelper + include ::RBS::AST::Declarations::MixinHelper + + # @return [Class] a new instance of Class + # + # source://rbs/lib/rbs/ast/declarations.rb#97 + def initialize(name:, type_params:, super_class:, members:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#107 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/declarations.rb#93 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#95 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#107 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#117 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#94 + def location; end + + # Returns the value of attribute members. + # + # source://rbs/lib/rbs/ast/declarations.rb#91 + def members; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#89 + def name; end + + # Returns the value of attribute super_class. + # + # source://rbs/lib/rbs/ast/declarations.rb#92 + def super_class; end + + # source://rbs/lib/rbs/ast/declarations.rb#121 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type_params. + # + # source://rbs/lib/rbs/ast/declarations.rb#90 + def type_params; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#56 +class RBS::AST::Declarations::Class::Super + # @return [Super] a new instance of Super + # + # source://rbs/lib/rbs/ast/declarations.rb#61 + def initialize(name:, args:, location:); end + + # source://rbs/lib/rbs/ast/declarations.rb#67 + def ==(other); end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/ast/declarations.rb#58 + def args; end + + # source://rbs/lib/rbs/ast/declarations.rb#67 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#73 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#59 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#57 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#77 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/declarations.rb#406 +class RBS::AST::Declarations::ClassAlias < ::RBS::AST::Declarations::AliasDecl + # source://rbs/lib/rbs/ast/declarations.rb#407 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/declarations.rb#311 +class RBS::AST::Declarations::Constant < ::RBS::AST::Declarations::Base + # @return [Constant] a new instance of Constant + # + # source://rbs/lib/rbs/ast/declarations.rb#317 + def initialize(name:, type:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#324 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#315 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#324 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#332 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#314 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#312 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#336 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/ast/declarations.rb#313 + def type; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#347 +class RBS::AST::Declarations::Global < ::RBS::AST::Declarations::Base + # @return [Global] a new instance of Global + # + # source://rbs/lib/rbs/ast/declarations.rb#353 + def initialize(name:, type:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#360 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#351 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#360 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#368 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#350 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#348 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#372 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/ast/declarations.rb#349 + def type; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#223 +class RBS::AST::Declarations::Interface < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::MixinHelper + + # @return [Interface] a new instance of Interface + # + # source://rbs/lib/rbs/ast/declarations.rb#233 + def initialize(name:, type_params:, members:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#242 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/declarations.rb#227 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#229 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#242 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#251 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#228 + def location; end + + # Returns the value of attribute members. + # + # source://rbs/lib/rbs/ast/declarations.rb#226 + def members; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#224 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#255 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type_params. + # + # source://rbs/lib/rbs/ast/declarations.rb#225 + def type_params; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#35 +module RBS::AST::Declarations::MixinHelper + # source://rbs/lib/rbs/ast/declarations.rb#36 + def each_mixin(&block); end +end + +# source://rbs/lib/rbs/ast/declarations.rb#135 +class RBS::AST::Declarations::Module < ::RBS::AST::Declarations::Base + include ::RBS::AST::Declarations::NestedDeclarationHelper + include ::RBS::AST::Declarations::MixinHelper + + # @return [Module] a new instance of Module + # + # source://rbs/lib/rbs/ast/declarations.rb#185 + def initialize(name:, type_params:, members:, self_types:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#195 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/declarations.rb#181 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#183 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#195 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#205 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#180 + def location; end + + # Returns the value of attribute members. + # + # source://rbs/lib/rbs/ast/declarations.rb#179 + def members; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#177 + def name; end + + # Returns the value of attribute self_types. + # + # source://rbs/lib/rbs/ast/declarations.rb#182 + def self_types; end + + # source://rbs/lib/rbs/ast/declarations.rb#209 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type_params. + # + # source://rbs/lib/rbs/ast/declarations.rb#178 + def type_params; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#136 +class RBS::AST::Declarations::Module::Self + # @return [Self] a new instance of Self + # + # source://rbs/lib/rbs/ast/declarations.rb#141 + def initialize(name:, args:, location:); end + + # source://rbs/lib/rbs/ast/declarations.rb#147 + def ==(other); end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/ast/declarations.rb#138 + def args; end + + # source://rbs/lib/rbs/ast/declarations.rb#147 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#153 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#139 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#137 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#157 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/ast/declarations.rb#165 + def to_s; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#418 +class RBS::AST::Declarations::ModuleAlias < ::RBS::AST::Declarations::AliasDecl + # source://rbs/lib/rbs/ast/declarations.rb#419 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/declarations.rb#9 +module RBS::AST::Declarations::NestedDeclarationHelper + # source://rbs/lib/rbs/ast/declarations.rb#22 + def each_decl; end + + # source://rbs/lib/rbs/ast/declarations.rb#10 + def each_member; end +end + +# source://rbs/lib/rbs/ast/declarations.rb#268 +class RBS::AST::Declarations::TypeAlias < ::RBS::AST::Declarations::Base + # @return [TypeAlias] a new instance of TypeAlias + # + # source://rbs/lib/rbs/ast/declarations.rb#276 + def initialize(name:, type_params:, type:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/declarations.rb#285 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/declarations.rb#272 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/declarations.rb#274 + def comment; end + + # source://rbs/lib/rbs/ast/declarations.rb#285 + def eql?(other); end + + # source://rbs/lib/rbs/ast/declarations.rb#294 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/declarations.rb#273 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/declarations.rb#269 + def name; end + + # source://rbs/lib/rbs/ast/declarations.rb#298 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/ast/declarations.rb#271 + def type; end + + # Returns the value of attribute type_params. + # + # source://rbs/lib/rbs/ast/declarations.rb#270 + def type_params; end +end + +# source://rbs/lib/rbs/ast/directives.rb#5 +module RBS::AST::Directives; end + +# source://rbs/lib/rbs/ast/directives.rb#6 +class RBS::AST::Directives::Base; end + +# source://rbs/lib/rbs/ast/directives.rb#9 +class RBS::AST::Directives::Use < ::RBS::AST::Directives::Base + # @return [Use] a new instance of Use + # + # source://rbs/lib/rbs/ast/directives.rb#31 + def initialize(clauses:, location:); end + + # Returns the value of attribute clauses. + # + # source://rbs/lib/rbs/ast/directives.rb#29 + def clauses; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/directives.rb#29 + def location; end +end + +# source://rbs/lib/rbs/ast/directives.rb#10 +class RBS::AST::Directives::Use::SingleClause + # @return [SingleClause] a new instance of SingleClause + # + # source://rbs/lib/rbs/ast/directives.rb#13 + def initialize(type_name:, new_name:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/directives.rb#11 + def location; end + + # Returns the value of attribute new_name. + # + # source://rbs/lib/rbs/ast/directives.rb#11 + def new_name; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/ast/directives.rb#11 + def type_name; end +end + +# source://rbs/lib/rbs/ast/directives.rb#20 +class RBS::AST::Directives::Use::WildcardClause + # @return [WildcardClause] a new instance of WildcardClause + # + # source://rbs/lib/rbs/ast/directives.rb#23 + def initialize(namespace:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/directives.rb#21 + def location; end + + # Returns the value of attribute namespace. + # + # source://rbs/lib/rbs/ast/directives.rb#21 + def namespace; end +end + +# source://rbs/lib/rbs/ast/members.rb#5 +module RBS::AST::Members; end + +# source://rbs/lib/rbs/ast/members.rb#397 +class RBS::AST::Members::Alias < ::RBS::AST::Members::Base + # @return [Alias] a new instance of Alias + # + # source://rbs/lib/rbs/ast/members.rb#405 + def initialize(new_name:, old_name:, kind:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/members.rb#414 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/members.rb#401 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/members.rb#403 + def comment; end + + # source://rbs/lib/rbs/ast/members.rb#414 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#423 + def hash; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#439 + def instance?; end + + # Returns the value of attribute kind. + # + # source://rbs/lib/rbs/ast/members.rb#400 + def kind; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#402 + def location; end + + # Returns the value of attribute new_name. + # + # source://rbs/lib/rbs/ast/members.rb#398 + def new_name; end + + # Returns the value of attribute old_name. + # + # source://rbs/lib/rbs/ast/members.rb#399 + def old_name; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#443 + def singleton?; end + + # source://rbs/lib/rbs/ast/members.rb#427 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#327 +class RBS::AST::Members::AttrAccessor < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # source://rbs/lib/rbs/ast/members.rb#330 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#309 +class RBS::AST::Members::AttrReader < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # source://rbs/lib/rbs/ast/members.rb#312 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#345 +class RBS::AST::Members::AttrWriter < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Attribute + + # source://rbs/lib/rbs/ast/members.rb#348 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#258 +module RBS::AST::Members::Attribute + # source://rbs/lib/rbs/ast/members.rb#268 + def initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: T.unsafe(nil)); end + + # source://rbs/lib/rbs/ast/members.rb#279 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/members.rb#263 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/members.rb#265 + def comment; end + + # source://rbs/lib/rbs/ast/members.rb#279 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#290 + def hash; end + + # Returns the value of attribute ivar_name. + # + # source://rbs/lib/rbs/ast/members.rb#262 + def ivar_name; end + + # Returns the value of attribute kind. + # + # source://rbs/lib/rbs/ast/members.rb#261 + def kind; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#264 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/members.rb#259 + def name; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/ast/members.rb#260 + def type; end + + # source://rbs/lib/rbs/ast/members.rb#294 + def update(name: T.unsafe(nil), type: T.unsafe(nil), ivar_name: T.unsafe(nil), kind: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil), visibility: T.unsafe(nil)); end + + # Returns the value of attribute visibility. + # + # source://rbs/lib/rbs/ast/members.rb#266 + def visibility; end +end + +# source://rbs/lib/rbs/ast/members.rb#6 +class RBS::AST::Members::Base; end + +# source://rbs/lib/rbs/ast/members.rb#157 +class RBS::AST::Members::ClassInstanceVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # source://rbs/lib/rbs/ast/members.rb#160 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#171 +class RBS::AST::Members::ClassVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # source://rbs/lib/rbs/ast/members.rb#174 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#228 +class RBS::AST::Members::Extend < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # source://rbs/lib/rbs/ast/members.rb#231 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#213 +class RBS::AST::Members::Include < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # source://rbs/lib/rbs/ast/members.rb#216 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#143 +class RBS::AST::Members::InstanceVariable < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Var + + # source://rbs/lib/rbs/ast/members.rb#146 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#363 +module RBS::AST::Members::LocationOnly + # source://rbs/lib/rbs/ast/members.rb#366 + def initialize(location:); end + + # source://rbs/lib/rbs/ast/members.rb#370 + def ==(other); end + + # source://rbs/lib/rbs/ast/members.rb#370 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#376 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#364 + def location; end +end + +# source://rbs/lib/rbs/ast/members.rb#9 +class RBS::AST::Members::MethodDefinition < ::RBS::AST::Members::Base + # @return [MethodDefinition] a new instance of MethodDefinition + # + # source://rbs/lib/rbs/ast/members.rb#53 + def initialize(name:, kind:, overloads:, annotations:, location:, comment:, overloading:, visibility:); end + + # source://rbs/lib/rbs/ast/members.rb#64 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/members.rb#47 + def annotations; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/members.rb#49 + def comment; end + + # source://rbs/lib/rbs/ast/members.rb#64 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#75 + def hash; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#79 + def instance?; end + + # Returns the value of attribute kind. + # + # source://rbs/lib/rbs/ast/members.rb#45 + def kind; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#48 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/members.rb#44 + def name; end + + # Returns the value of attribute overloading. + # + # source://rbs/lib/rbs/ast/members.rb#50 + def overloading; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#87 + def overloading?; end + + # Returns the value of attribute overloads. + # + # source://rbs/lib/rbs/ast/members.rb#46 + def overloads; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#83 + def singleton?; end + + # source://rbs/lib/rbs/ast/members.rb#104 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/ast/members.rb#91 + def update(name: T.unsafe(nil), kind: T.unsafe(nil), overloads: T.unsafe(nil), annotations: T.unsafe(nil), location: T.unsafe(nil), comment: T.unsafe(nil), overloading: T.unsafe(nil), visibility: T.unsafe(nil)); end + + # Returns the value of attribute visibility. + # + # source://rbs/lib/rbs/ast/members.rb#51 + def visibility; end +end + +# source://rbs/lib/rbs/ast/members.rb#10 +class RBS::AST::Members::MethodDefinition::Overload + # @return [Overload] a new instance of Overload + # + # source://rbs/lib/rbs/ast/members.rb#13 + def initialize(method_type:, annotations:); end + + # source://rbs/lib/rbs/ast/members.rb#18 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/members.rb#11 + def annotations; end + + # source://rbs/lib/rbs/ast/members.rb#18 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#22 + def hash; end + + # Returns the value of attribute method_type. + # + # source://rbs/lib/rbs/ast/members.rb#11 + def method_type; end + + # source://rbs/lib/rbs/ast/members.rb#32 + def sub(subst); end + + # source://rbs/lib/rbs/ast/members.rb#36 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/ast/members.rb#28 + def update(annotations: T.unsafe(nil), method_type: T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#185 +module RBS::AST::Members::Mixin + # source://rbs/lib/rbs/ast/members.rb#192 + def initialize(name:, args:, annotations:, location:, comment:); end + + # source://rbs/lib/rbs/ast/members.rb#200 + def ==(other); end + + # Returns the value of attribute annotations. + # + # source://rbs/lib/rbs/ast/members.rb#188 + def annotations; end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/ast/members.rb#187 + def args; end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/members.rb#190 + def comment; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/members.rb#204 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#208 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#189 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/members.rb#186 + def name; end +end + +# source://rbs/lib/rbs/ast/members.rb#243 +class RBS::AST::Members::Prepend < ::RBS::AST::Members::Base + include ::RBS::AST::Members::Mixin + + # source://rbs/lib/rbs/ast/members.rb#246 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#389 +class RBS::AST::Members::Private < ::RBS::AST::Members::Base + include ::RBS::AST::Members::LocationOnly + + # source://rbs/lib/rbs/ast/members.rb#392 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#381 +class RBS::AST::Members::Public < ::RBS::AST::Members::Base + include ::RBS::AST::Members::LocationOnly + + # source://rbs/lib/rbs/ast/members.rb#384 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/ast/members.rb#119 +module RBS::AST::Members::Var + # source://rbs/lib/rbs/ast/members.rb#125 + def initialize(name:, type:, location:, comment:); end + + # source://rbs/lib/rbs/ast/members.rb#132 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://rbs/lib/rbs/ast/members.rb#123 + def comment; end + + # source://rbs/lib/rbs/ast/members.rb#132 + def eql?(other); end + + # source://rbs/lib/rbs/ast/members.rb#138 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/members.rb#122 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/members.rb#120 + def name; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/ast/members.rb#121 + def type; end +end + +# source://rbs/lib/rbs/ast/type_param.rb#5 +class RBS::AST::TypeParam + # @return [TypeParam] a new instance of TypeParam + # + # source://rbs/lib/rbs/ast/type_param.rb#8 + def initialize(name:, variance:, upper_bound:, location:); end + + # source://rbs/lib/rbs/ast/type_param.rb#25 + def ==(other); end + + # source://rbs/lib/rbs/ast/type_param.rb#25 + def eql?(other); end + + # source://rbs/lib/rbs/ast/type_param.rb#35 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/ast/type_param.rb#6 + def location; end + + # source://rbs/lib/rbs/ast/type_param.rb#58 + def map_type(&block); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/ast/type_param.rb#6 + def name; end + + # source://rbs/lib/rbs/ast/type_param.rb#49 + def rename(name); end + + # source://rbs/lib/rbs/ast/type_param.rb#39 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/ast/type_param.rb#110 + def to_s; end + + # source://rbs/lib/rbs/ast/type_param.rb#16 + def unchecked!(value = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/ast/type_param.rb#21 + def unchecked?; end + + # Returns the value of attribute upper_bound. + # + # source://rbs/lib/rbs/ast/type_param.rb#6 + def upper_bound; end + + # Returns the value of attribute variance. + # + # source://rbs/lib/rbs/ast/type_param.rb#6 + def variance; end + + class << self + # source://rbs/lib/rbs/ast/type_param.rb#93 + def rename(params, new_names:); end + + # source://rbs/lib/rbs/ast/type_param.rb#71 + def resolve_variables(params); end + + # source://rbs/lib/rbs/ast/type_param.rb#81 + def subst_var(vars, type); end + end +end + +# source://rbs/lib/rbs/ancestor_graph.rb#4 +class RBS::AncestorGraph + # @return [AncestorGraph] a new instance of AncestorGraph + # + # source://rbs/lib/rbs/ancestor_graph.rb#13 + def initialize(env:, ancestor_builder: T.unsafe(nil)); end + + # Returns the value of attribute ancestor_builder. + # + # source://rbs/lib/rbs/ancestor_graph.rb#9 + def ancestor_builder; end + + # source://rbs/lib/rbs/ancestor_graph.rb#19 + def build; end + + # source://rbs/lib/rbs/ancestor_graph.rb#32 + def build_ancestors(node, ancestors); end + + # Returns the value of attribute children. + # + # source://rbs/lib/rbs/ancestor_graph.rb#11 + def children; end + + # source://rbs/lib/rbs/ancestor_graph.rb#64 + def each_ancestor(node, yielded: T.unsafe(nil), &block); end + + # source://rbs/lib/rbs/ancestor_graph.rb#56 + def each_child(node, &block); end + + # source://rbs/lib/rbs/ancestor_graph.rb#78 + def each_descendant(node, yielded: T.unsafe(nil), &block); end + + # source://rbs/lib/rbs/ancestor_graph.rb#48 + def each_parent(node, &block); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/ancestor_graph.rb#8 + def env; end + + # Returns the value of attribute parents. + # + # source://rbs/lib/rbs/ancestor_graph.rb#10 + def parents; end + + # source://rbs/lib/rbs/ancestor_graph.rb#43 + def register(parent:, child:); end +end + +# source://rbs/lib/rbs/ancestor_graph.rb#5 +class RBS::AncestorGraph::InstanceNode < ::Struct + def type_name; end + def type_name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/ancestor_graph.rb#6 +class RBS::AncestorGraph::SingletonNode < ::Struct + def type_name; end + def type_name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/errors.rb#19 +class RBS::BaseError < ::StandardError; end + +# source://rbs/lib/rbs/buffer.rb#4 +class RBS::Buffer + # @return [Buffer] a new instance of Buffer + # + # source://rbs/lib/rbs/buffer.rb#8 + def initialize(name:, content:); end + + # Returns the value of attribute content. + # + # source://rbs/lib/rbs/buffer.rb#6 + def content; end + + # source://rbs/lib/rbs/buffer.rb#58 + def inspect; end + + # source://rbs/lib/rbs/buffer.rb#54 + def last_position; end + + # source://rbs/lib/rbs/buffer.rb#13 + def lines; end + + # source://rbs/lib/rbs/buffer.rb#44 + def loc_to_pos(loc); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/buffer.rb#5 + def name; end + + # source://rbs/lib/rbs/buffer.rb#32 + def pos_to_loc(pos); end + + # source://rbs/lib/rbs/buffer.rb#17 + def ranges; end +end + +# source://rbs/lib/rbs/builtin_names.rb#4 +module RBS::BuiltinNames; end + +# source://rbs/lib/rbs/builtin_names.rb#45 +RBS::BuiltinNames::Array = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#37 +RBS::BuiltinNames::BasicObject = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#43 +RBS::BuiltinNames::Class = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#41 +RBS::BuiltinNames::Comparable = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#42 +RBS::BuiltinNames::Enumerable = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#48 +RBS::BuiltinNames::Enumerator = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#55 +RBS::BuiltinNames::FalseClass = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#52 +RBS::BuiltinNames::Float = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#46 +RBS::BuiltinNames::Hash = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#51 +RBS::BuiltinNames::Integer = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#39 +RBS::BuiltinNames::Kernel = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#44 +RBS::BuiltinNames::Module = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#5 +class RBS::BuiltinNames::Name + # @return [Name] a new instance of Name + # + # source://rbs/lib/rbs/builtin_names.rb#8 + def initialize(name:); end + + # source://rbs/lib/rbs/builtin_names.rb#16 + def instance_type(*args); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/builtin_names.rb#20 + def instance_type?(type); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/builtin_names.rb#6 + def name; end + + # source://rbs/lib/rbs/builtin_names.rb#24 + def singleton_type; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/builtin_names.rb#28 + def singleton_type?(type); end + + # source://rbs/lib/rbs/builtin_names.rb#12 + def to_s; end + + class << self + # source://rbs/lib/rbs/builtin_names.rb#32 + def define(name, namespace: T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/builtin_names.rb#56 +RBS::BuiltinNames::Numeric = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#38 +RBS::BuiltinNames::Object = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#47 +RBS::BuiltinNames::Range = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#53 +RBS::BuiltinNames::Regexp = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#49 +RBS::BuiltinNames::Set = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#40 +RBS::BuiltinNames::String = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#50 +RBS::BuiltinNames::Symbol = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/builtin_names.rb#54 +RBS::BuiltinNames::TrueClass = T.let(T.unsafe(nil), RBS::BuiltinNames::Name) + +# source://rbs/lib/rbs/cli/colored_io.rb#4 +class RBS::CLI; end + +# source://rbs/lib/rbs/cli/colored_io.rb#5 +class RBS::CLI::ColoredIO + # @return [ColoredIO] a new instance of ColoredIO + # + # source://rbs/lib/rbs/cli/colored_io.rb#8 + def initialize(stdout:); end + + # source://rbs/lib/rbs/cli/colored_io.rb#28 + def puts(*_arg0, **_arg1, &_arg2); end + + # source://rbs/lib/rbs/cli/colored_io.rb#20 + def puts_green(string); end + + # source://rbs/lib/rbs/cli/colored_io.rb#12 + def puts_red(string); end + + # Returns the value of attribute stdout. + # + # source://rbs/lib/rbs/cli/colored_io.rb#6 + def stdout; end + + private + + # @return [Boolean] + # + # source://rbs/lib/rbs/cli/colored_io.rb#43 + def are_colors_disabled?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/cli/colored_io.rb#39 + def are_colors_supported?; end + + # https://github.com/rubygems/rubygems/blob/ed65279100234a17d65d71fe26de5083984ac5b8/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb#L99-L109 + # + # @return [Boolean] + # + # source://rbs/lib/rbs/cli/colored_io.rb#35 + def can_display_colors?; end +end + +# source://rbs/lib/rbs/collection/sources/base.rb#4 +module RBS::Collection; end + +# source://rbs/lib/rbs/collection/cleaner.rb#5 +class RBS::Collection::Cleaner + # @return [Cleaner] a new instance of Cleaner + # + # source://rbs/lib/rbs/collection/cleaner.rb#8 + def initialize(lockfile_path:); end + + # source://rbs/lib/rbs/collection/cleaner.rb#12 + def clean; end + + # Returns the value of attribute lock. + # + # source://rbs/lib/rbs/collection/cleaner.rb#6 + def lock; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/cleaner.rb#30 + def needed?(gem_name, version); end +end + +# This class represent the configuration file. +# +# source://rbs/lib/rbs/collection/config.rb#7 +class RBS::Collection::Config + # @return [Config] a new instance of Config + # + # source://rbs/lib/rbs/collection/config.rb#49 + def initialize(data, config_path:); end + + # Returns the value of attribute config_path. + # + # source://rbs/lib/rbs/collection/config.rb#19 + def config_path; end + + # Returns the value of attribute data. + # + # source://rbs/lib/rbs/collection/config.rb#19 + def data; end + + # source://rbs/lib/rbs/collection/config.rb#54 + def gem(gem_name); end + + # source://rbs/lib/rbs/collection/config.rb#74 + def gems; end + + # source://rbs/lib/rbs/collection/config.rb#58 + def repo_path; end + + # source://rbs/lib/rbs/collection/config.rb#62 + def repo_path_data; end + + # source://rbs/lib/rbs/collection/config.rb#66 + def sources; end + + class << self + # source://rbs/lib/rbs/collection/config.rb#21 + def find_config_path; end + + # source://rbs/lib/rbs/collection/config.rb#41 + def from_path(path); end + + # Generate a rbs lockfile from Gemfile.lock to `config_path`. + # If `with_lockfile` is true, it respects existing rbs lockfile. + # + # source://rbs/lib/rbs/collection/config.rb#34 + def generate_lockfile(config_path:, definition:, with_lockfile: T.unsafe(nil)); end + + # source://rbs/lib/rbs/collection/config.rb#45 + def to_lockfile_path(config_path); end + end +end + +# source://rbs/lib/rbs/collection/config.rb#8 +class RBS::Collection::Config::CollectionNotAvailable < ::StandardError + # @return [CollectionNotAvailable] a new instance of CollectionNotAvailable + # + # source://rbs/lib/rbs/collection/config.rb#9 + def initialize; end +end + +# source://rbs/lib/rbs/collection/config/lockfile.rb#6 +class RBS::Collection::Config::Lockfile + # @return [Lockfile] a new instance of Lockfile + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#9 + def initialize(lockfile_path:, path:, gemfile_lock_path:); end + + # @raise [CollectionNotAvailable] + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#73 + def check_rbs_availability!; end + + # source://rbs/lib/rbs/collection/config/lockfile.rb#18 + def fullpath; end + + # source://rbs/lib/rbs/collection/config/lockfile.rb#22 + def gemfile_lock_fullpath; end + + # Returns the value of attribute gemfile_lock_path. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def gemfile_lock_path; end + + # Returns the value of attribute gems. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def gems; end + + # source://rbs/lib/rbs/collection/config/lockfile.rb#65 + def library_data(lib); end + + # Returns the value of attribute lockfile_dir. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def lockfile_dir; end + + # Returns the value of attribute lockfile_path. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def lockfile_path; end + + # Returns the value of attribute path. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def path; end + + # Returns the value of attribute sources. + # + # source://rbs/lib/rbs/collection/config/lockfile.rb#7 + def sources; end + + # source://rbs/lib/rbs/collection/config/lockfile.rb#28 + def to_lockfile; end + + class << self + # source://rbs/lib/rbs/collection/config/lockfile.rb#42 + def from_lockfile(lockfile_path:, data:); end + end +end + +# source://rbs/lib/rbs/collection/config/lockfile_generator.rb#6 +class RBS::Collection::Config::LockfileGenerator + # @return [LockfileGenerator] a new instance of LockfileGenerator + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#31 + def initialize(config:, definition:, with_lockfile:); end + + # Returns the value of attribute config. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def config; end + + # Returns the value of attribute definition. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def definition; end + + # Returns the value of attribute existing_lockfile. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def existing_lockfile; end + + # Returns the value of attribute gem_entries. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def gem_entries; end + + # Returns the value of attribute gem_hash. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def gem_hash; end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#59 + def generate; end + + # Returns the value of attribute lockfile. + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#23 + def lockfile; end + + private + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#91 + def assign_gem(name:, version:, skip: T.unsafe(nil)); end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#152 + def assign_stdlib(name:, from_gem:); end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#184 + def find_best_version(version:, versions:); end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#178 + def find_source(name:); end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#83 + def validate_gemfile_lock_path!(lock:, gemfile_lock_path:); end + + class << self + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#25 + def generate(config:, definition:, with_lockfile: T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/collection/config/lockfile_generator.rb#7 +class RBS::Collection::Config::LockfileGenerator::GemfileLockMismatchError < ::StandardError + # @return [GemfileLockMismatchError] a new instance of GemfileLockMismatchError + # + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#8 + def initialize(expected:, actual:); end + + # source://rbs/lib/rbs/collection/config/lockfile_generator.rb#13 + def message; end +end + +# source://rbs/lib/rbs/collection/config.rb#17 +RBS::Collection::Config::PATH = T.let(T.unsafe(nil), Pathname) + +# source://rbs/lib/rbs/collection/installer.rb#5 +class RBS::Collection::Installer + # @return [Installer] a new instance of Installer + # + # source://rbs/lib/rbs/collection/installer.rb#9 + def initialize(lockfile_path:, stdout: T.unsafe(nil)); end + + # source://rbs/lib/rbs/collection/installer.rb#14 + def install_from_lockfile; end + + # Returns the value of attribute lockfile. + # + # source://rbs/lib/rbs/collection/installer.rb#6 + def lockfile; end + + # Returns the value of attribute stdout. + # + # source://rbs/lib/rbs/collection/installer.rb#7 + def stdout; end +end + +# source://rbs/lib/rbs/collection/sources/base.rb#5 +module RBS::Collection::Sources + class << self + # source://rbs/lib/rbs/collection/sources.rb#12 + def from_config_entry(source_entry, base_directory:); end + end +end + +# source://rbs/lib/rbs/collection/sources/base.rb#6 +module RBS::Collection::Sources::Base + # source://rbs/lib/rbs/collection/sources/base.rb#7 + def dependencies_of(name, version); end +end + +# source://rbs/lib/rbs/collection/sources/git.rb#10 +class RBS::Collection::Sources::Git + include ::RBS::Collection::Sources::Base + + # @return [Git] a new instance of Git + # + # source://rbs/lib/rbs/collection/sources/git.rb#18 + def initialize(name:, revision:, remote:, repo_dir:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/git.rb#26 + def has?(name, version); end + + # source://rbs/lib/rbs/collection/sources/git.rb#43 + def install(dest:, name:, version:, stdout:); end + + # source://rbs/lib/rbs/collection/sources/git.rb#223 + def load_metadata(dir:); end + + # source://rbs/lib/rbs/collection/sources/git.rb#73 + def manifest_of(name, version); end + + # source://rbs/lib/rbs/collection/sources/git.rb#207 + def metadata_content(name:, version:); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/collection/sources/git.rb#16 + def name; end + + # Returns the value of attribute remote. + # + # source://rbs/lib/rbs/collection/sources/git.rb#16 + def remote; end + + # Returns the value of attribute repo_dir. + # + # source://rbs/lib/rbs/collection/sources/git.rb#16 + def repo_dir; end + + # source://rbs/lib/rbs/collection/sources/git.rb#172 + def resolved_revision; end + + # Returns the value of attribute revision. + # + # source://rbs/lib/rbs/collection/sources/git.rb#16 + def revision; end + + # source://rbs/lib/rbs/collection/sources/git.rb#113 + def to_lockfile; end + + # source://rbs/lib/rbs/collection/sources/git.rb#36 + def versions(name); end + + # source://rbs/lib/rbs/collection/sources/git.rb#215 + def write_metadata(dir:, name:, version:); end + + private + + # source://rbs/lib/rbs/collection/sources/git.rb#87 + def _install(dest:, name:, version:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/git.rb#183 + def commit_hash?; end + + # source://rbs/lib/rbs/collection/sources/git.rb#99 + def cp_r(src, dest); end + + # source://rbs/lib/rbs/collection/sources/git.rb#123 + def format_config_entry(name, version); end + + # source://rbs/lib/rbs/collection/sources/git.rb#168 + def gem_repo_dir; end + + # source://rbs/lib/rbs/collection/sources/git.rb#229 + def gems_versions; end + + # source://rbs/lib/rbs/collection/sources/git.rb#187 + def git(*cmd, **opt); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/git.rb#191 + def git?(*cmd, **opt); end + + # source://rbs/lib/rbs/collection/sources/git.rb#158 + def git_dir; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/git.rb#152 + def need_to_fetch?(revision); end + + # source://rbs/lib/rbs/collection/sources/git.rb#130 + def setup!; end + + # source://rbs/lib/rbs/collection/sources/git.rb#197 + def sh!(*cmd, **opt); end +end + +# source://rbs/lib/rbs/collection/sources/git.rb#14 +class RBS::Collection::Sources::Git::CommandError < ::StandardError; end + +# source://rbs/lib/rbs/collection/sources/git.rb#12 +RBS::Collection::Sources::Git::METADATA_FILENAME = T.let(T.unsafe(nil), String) + +# source://rbs/lib/rbs/collection/sources/local.rb#6 +class RBS::Collection::Sources::Local + include ::RBS::Collection::Sources::Base + + # @return [Local] a new instance of Local + # + # source://rbs/lib/rbs/collection/sources/local.rb#11 + def initialize(path:, base_directory:); end + + # Returns the value of attribute full_path. + # + # source://rbs/lib/rbs/collection/sources/local.rb#9 + def full_path; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/local.rb#17 + def has?(name, version); end + + # Create a symlink instead of copying file to refer files in @path. + # By avoiding copying RBS files, the users do not need re-run `rbs collection install` + # when the RBS files are updated. + # + # source://rbs/lib/rbs/collection/sources/local.rb#32 + def install(dest:, name:, version:, stdout:); end + + # source://rbs/lib/rbs/collection/sources/local.rb#64 + def manifest_of(name, version); end + + # Returns the value of attribute path. + # + # source://rbs/lib/rbs/collection/sources/local.rb#9 + def path; end + + # source://rbs/lib/rbs/collection/sources/local.rb#72 + def to_lockfile; end + + # source://rbs/lib/rbs/collection/sources/local.rb#25 + def versions(name); end + + private + + # source://rbs/lib/rbs/collection/sources/local.rb#59 + def _install(src, dst); end +end + +# Signatures that are inclduded in gem package as sig/ directory. +# +# source://rbs/lib/rbs/collection/sources/rubygems.rb#9 +class RBS::Collection::Sources::Rubygems + include ::RBS::Collection::Sources::Base + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/rubygems.rb#13 + def has?(name, version); end + + # source://rbs/lib/rbs/collection/sources/rubygems.rb#23 + def install(dest:, name:, version:, stdout:); end + + # source://rbs/lib/rbs/collection/sources/rubygems.rb#29 + def manifest_of(name, version); end + + # source://rbs/lib/rbs/collection/sources/rubygems.rb#36 + def to_lockfile; end + + # source://rbs/lib/rbs/collection/sources/rubygems.rb#17 + def versions(name); end + + private + + # source://rbs/lib/rbs/collection/sources/rubygems.rb#42 + def gem_sig_path(name, version); end + + class << self + private + + def allocate; end + def new(*_arg0); end + end +end + +# signatures that are bundled in rbs gem under the stdlib/ directory +# +# source://rbs/lib/rbs/collection/sources/stdlib.rb#9 +class RBS::Collection::Sources::Stdlib + include ::RBS::Collection::Sources::Base + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Boolean] + # + # source://rbs/lib/rbs/collection/sources/stdlib.rb#15 + def has?(name, version); end + + # source://rbs/lib/rbs/collection/sources/stdlib.rb#23 + def install(dest:, name:, version:, stdout:); end + + # source://rbs/lib/rbs/collection/sources/stdlib.rb#29 + def manifest_of(name, version); end + + # source://rbs/lib/rbs/collection/sources/stdlib.rb#38 + def to_lockfile; end + + # source://rbs/lib/rbs/collection/sources/stdlib.rb#19 + def versions(name); end + + private + + # source://rbs/lib/rbs/collection/sources/stdlib.rb#44 + def lookup(name, version); end + + class << self + private + + def allocate; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/collection/sources/stdlib.rb#13 +RBS::Collection::Sources::Stdlib::REPO = T.let(T.unsafe(nil), RBS::Repository) + +# source://rbs/lib/rbs/constant.rb#4 +class RBS::Constant + # @return [Constant] a new instance of Constant + # + # source://rbs/lib/rbs/constant.rb#9 + def initialize(name:, type:, entry:); end + + # source://rbs/lib/rbs/constant.rb#15 + def ==(other); end + + # Returns the value of attribute entry. + # + # source://rbs/lib/rbs/constant.rb#7 + def entry; end + + # source://rbs/lib/rbs/constant.rb#15 + def eql?(other); end + + # source://rbs/lib/rbs/constant.rb#24 + def hash; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/constant.rb#5 + def name; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/constant.rb#6 + def type; end +end + +# source://rbs/lib/rbs/errors.rb#531 +class RBS::CyclicClassAliasDefinitionError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [CyclicClassAliasDefinitionError] a new instance of CyclicClassAliasDefinitionError + # + # source://rbs/lib/rbs/errors.rb#536 + def initialize(entry); end + + # Returns the value of attribute alias_entry. + # + # source://rbs/lib/rbs/errors.rb#534 + def alias_entry; end + + # source://rbs/lib/rbs/errors.rb#542 + def location; end +end + +# source://rbs/lib/rbs/errors.rb#492 +class RBS::CyclicTypeParameterBound < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [CyclicTypeParameterBound] a new instance of CyclicTypeParameterBound + # + # source://rbs/lib/rbs/errors.rb#497 + def initialize(type_name:, method_name:, params:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#495 + def location; end + + # Returns the value of attribute method_name. + # + # source://rbs/lib/rbs/errors.rb#495 + def method_name; end + + # Returns the value of attribute params. + # + # source://rbs/lib/rbs/errors.rb#495 + def params; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#495 + def type_name; end +end + +# source://rbs/lib/rbs/definition.rb#4 +class RBS::Definition + # @return [Definition] a new instance of Definition + # + # source://rbs/lib/rbs/definition.rb#287 + def initialize(type_name:, entry:, self_type:, ancestors:); end + + # Returns the value of attribute ancestors. + # + # source://rbs/lib/rbs/definition.rb#281 + def ancestors; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#310 + def class?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#327 + def class_type?; end + + # Returns the value of attribute class_variables. + # + # source://rbs/lib/rbs/definition.rb#285 + def class_variables; end + + # source://rbs/lib/rbs/definition.rb#372 + def each_type(&block); end + + # Returns the value of attribute entry. + # + # source://rbs/lib/rbs/definition.rb#280 + def entry; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#331 + def instance_type?; end + + # Returns the value of attribute instance_variables. + # + # source://rbs/lib/rbs/definition.rb#284 + def instance_variables; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#318 + def interface?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#335 + def interface_type?; end + + # source://rbs/lib/rbs/definition.rb#362 + def map_method_type(&block); end + + # Returns the value of attribute methods. + # + # source://rbs/lib/rbs/definition.rb#283 + def methods; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#314 + def module?; end + + # Returns the value of attribute self_type. + # + # source://rbs/lib/rbs/definition.rb#282 + def self_type; end + + # source://rbs/lib/rbs/definition.rb#352 + def sub(s); end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/definition.rb#279 + def type_name; end + + # source://rbs/lib/rbs/definition.rb#339 + def type_params; end + + # source://rbs/lib/rbs/definition.rb#343 + def type_params_decl; end +end + +# source://rbs/lib/rbs/definition.rb#189 +module RBS::Definition::Ancestor; end + +# source://rbs/lib/rbs/definition.rb#190 +class RBS::Definition::Ancestor::Instance + # @return [Instance] a new instance of Instance + # + # source://rbs/lib/rbs/definition.rb#193 + def initialize(name:, args:, source:); end + + # source://rbs/lib/rbs/definition.rb#199 + def ==(other); end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/definition.rb#191 + def args; end + + # source://rbs/lib/rbs/definition.rb#199 + def eql?(other); end + + # source://rbs/lib/rbs/definition.rb#205 + def hash; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/definition.rb#191 + def name; end + + # Returns the value of attribute source. + # + # source://rbs/lib/rbs/definition.rb#191 + def source; end +end + +# source://rbs/lib/rbs/definition.rb#210 +class RBS::Definition::Ancestor::Singleton + # @return [Singleton] a new instance of Singleton + # + # source://rbs/lib/rbs/definition.rb#213 + def initialize(name:); end + + # source://rbs/lib/rbs/definition.rb#217 + def ==(other); end + + # source://rbs/lib/rbs/definition.rb#217 + def eql?(other); end + + # source://rbs/lib/rbs/definition.rb#223 + def hash; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/definition.rb#211 + def name; end +end + +# source://rbs/lib/rbs/definition.rb#229 +class RBS::Definition::InstanceAncestors + # @return [InstanceAncestors] a new instance of InstanceAncestors + # + # source://rbs/lib/rbs/definition.rb#234 + def initialize(type_name:, params:, ancestors:); end + + # Returns the value of attribute ancestors. + # + # source://rbs/lib/rbs/definition.rb#232 + def ancestors; end + + # source://rbs/lib/rbs/definition.rb#240 + def apply(args, location:); end + + # Returns the value of attribute params. + # + # source://rbs/lib/rbs/definition.rb#231 + def params; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/definition.rb#230 + def type_name; end +end + +# source://rbs/lib/rbs/definition.rb#25 +class RBS::Definition::Method + # @return [Method] a new instance of Method + # + # source://rbs/lib/rbs/definition.rb#81 + def initialize(super_method:, defs:, accessibility:, alias_of:, annotations: T.unsafe(nil)); end + + # source://rbs/lib/rbs/definition.rb#89 + def ==(other); end + + # Returns the value of attribute accessibility. + # + # source://rbs/lib/rbs/definition.rb#77 + def accessibility; end + + # Returns the value of attribute alias_of. + # + # source://rbs/lib/rbs/definition.rb#79 + def alias_of; end + + # source://rbs/lib/rbs/definition.rb#126 + def annotations; end + + # source://rbs/lib/rbs/definition.rb#122 + def comments; end + + # source://rbs/lib/rbs/definition.rb#104 + def defined_in; end + + # Returns the value of attribute defs. + # + # source://rbs/lib/rbs/definition.rb#76 + def defs; end + + # source://rbs/lib/rbs/definition.rb#89 + def eql?(other); end + + # Returns the value of attribute extra_annotations. + # + # source://rbs/lib/rbs/definition.rb#78 + def extra_annotations; end + + # source://rbs/lib/rbs/definition.rb#100 + def hash; end + + # source://rbs/lib/rbs/definition.rb#111 + def implemented_in; end + + # source://rbs/lib/rbs/definition.rb#169 + def map_method_type(&block); end + + # source://rbs/lib/rbs/definition.rb#151 + def map_type(&block); end + + # source://rbs/lib/rbs/definition.rb#160 + def map_type_bound(&block); end + + # source://rbs/lib/rbs/definition.rb#130 + def members; end + + # source://rbs/lib/rbs/definition.rb#118 + def method_types; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#138 + def private?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#134 + def public?; end + + # source://rbs/lib/rbs/definition.rb#142 + def sub(s); end + + # Returns the value of attribute super_method. + # + # source://rbs/lib/rbs/definition.rb#75 + def super_method; end + + # source://rbs/lib/rbs/definition.rb#178 + def update(super_method: T.unsafe(nil), defs: T.unsafe(nil), accessibility: T.unsafe(nil), alias_of: T.unsafe(nil), annotations: T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/definition.rb#26 +class RBS::Definition::Method::TypeDef + # @return [TypeDef] a new instance of TypeDef + # + # source://rbs/lib/rbs/definition.rb#32 + def initialize(type:, member:, defined_in:, implemented_in:); end + + # source://rbs/lib/rbs/definition.rb#39 + def ==(other); end + + # source://rbs/lib/rbs/definition.rb#57 + def annotations; end + + # source://rbs/lib/rbs/definition.rb#53 + def comment; end + + # Returns the value of attribute defined_in. + # + # source://rbs/lib/rbs/definition.rb#29 + def defined_in; end + + # source://rbs/lib/rbs/definition.rb#39 + def eql?(other); end + + # source://rbs/lib/rbs/definition.rb#49 + def hash; end + + # Returns the value of attribute implemented_in. + # + # source://rbs/lib/rbs/definition.rb#30 + def implemented_in; end + + # Returns the value of attribute member. + # + # source://rbs/lib/rbs/definition.rb#28 + def member; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/definition.rb#65 + def overload?; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/definition.rb#27 + def type; end + + # source://rbs/lib/rbs/definition.rb#61 + def update(type: T.unsafe(nil), member: T.unsafe(nil), defined_in: T.unsafe(nil), implemented_in: T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/definition.rb#269 +class RBS::Definition::SingletonAncestors + # @return [SingletonAncestors] a new instance of SingletonAncestors + # + # source://rbs/lib/rbs/definition.rb#273 + def initialize(type_name:, ancestors:); end + + # Returns the value of attribute ancestors. + # + # source://rbs/lib/rbs/definition.rb#271 + def ancestors; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/definition.rb#270 + def type_name; end +end + +# source://rbs/lib/rbs/definition.rb#5 +class RBS::Definition::Variable + # @return [Variable] a new instance of Variable + # + # source://rbs/lib/rbs/definition.rb#10 + def initialize(parent_variable:, type:, declared_in:); end + + # Returns the value of attribute declared_in. + # + # source://rbs/lib/rbs/definition.rb#8 + def declared_in; end + + # Returns the value of attribute parent_variable. + # + # source://rbs/lib/rbs/definition.rb#6 + def parent_variable; end + + # source://rbs/lib/rbs/definition.rb#16 + def sub(s); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/definition.rb#7 + def type; end +end + +# source://rbs/lib/rbs/definition_builder.rb#4 +class RBS::DefinitionBuilder + # @return [DefinitionBuilder] a new instance of DefinitionBuilder + # + # source://rbs/lib/rbs/definition_builder.rb#14 + def initialize(env:, ancestor_builder: T.unsafe(nil), method_builder: T.unsafe(nil)); end + + # Returns the value of attribute ancestor_builder. + # + # source://rbs/lib/rbs/definition_builder.rb#6 + def ancestor_builder; end + + # source://rbs/lib/rbs/definition_builder.rb#155 + def build_instance(type_name); end + + # source://rbs/lib/rbs/definition_builder.rb#43 + def build_interface(type_name); end + + # source://rbs/lib/rbs/definition_builder.rb#288 + def build_singleton(type_name); end + + # Builds a definition for singleton without .new method. + # + # source://rbs/lib/rbs/definition_builder.rb#217 + def build_singleton0(type_name); end + + # source://rbs/lib/rbs/definition_builder.rb#85 + def define_instance(definition, type_name, subst); end + + # source://rbs/lib/rbs/definition_builder.rb#33 + def define_interface(definition, type_name, subst); end + + # source://rbs/lib/rbs/definition_builder.rb#590 + def define_method(methods, definition, method, subst, defined_in:, implemented_in: T.unsafe(nil)); end + + # source://rbs/lib/rbs/definition_builder.rb#25 + def ensure_namespace!(namespace, location:); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/definition_builder.rb#5 + def env; end + + # source://rbs/lib/rbs/definition_builder.rb#751 + def expand_alias(type_name); end + + # source://rbs/lib/rbs/definition_builder.rb#755 + def expand_alias1(type_name); end + + # source://rbs/lib/rbs/definition_builder.rb#762 + def expand_alias2(type_name, args); end + + # source://rbs/lib/rbs/definition_builder.rb#532 + def import_methods(definition, module_name, module_methods, interfaces_methods, subst); end + + # source://rbs/lib/rbs/definition_builder.rb#524 + def insert_variable(type_name, variables, name:, type:); end + + # Returns the value of attribute instance_cache. + # + # source://rbs/lib/rbs/definition_builder.rb#9 + def instance_cache; end + + # Returns the value of attribute interface_cache. + # + # source://rbs/lib/rbs/definition_builder.rb#12 + def interface_cache; end + + # source://rbs/lib/rbs/definition_builder.rb#398 + def interface_methods(interface_ancestors); end + + # Returns the value of attribute method_builder. + # + # source://rbs/lib/rbs/definition_builder.rb#7 + def method_builder; end + + # Returns the value of attribute singleton0_cache. + # + # source://rbs/lib/rbs/definition_builder.rb#11 + def singleton0_cache; end + + # Returns the value of attribute singleton_cache. + # + # source://rbs/lib/rbs/definition_builder.rb#10 + def singleton_cache; end + + # source://rbs/lib/rbs/definition_builder.rb#428 + def source_location(source, decl); end + + # source://rbs/lib/rbs/definition_builder.rb#66 + def tapp_subst(name, args); end + + # source://rbs/lib/rbs/definition_builder.rb#747 + def try_cache(type_name, cache:); end + + # source://rbs/lib/rbs/definition_builder.rb#786 + def update(env:, except:, ancestor_builder:); end + + # source://rbs/lib/rbs/definition_builder.rb#418 + def validate_params_with(type_params, result:); end + + # @raise [NoTypeFoundError] + # + # source://rbs/lib/rbs/definition_builder.rb#815 + def validate_type_name(name, location); end + + # source://rbs/lib/rbs/definition_builder.rb#442 + def validate_type_params(definition, ancestors:, methods:); end + + # source://rbs/lib/rbs/definition_builder.rb#804 + def validate_type_presence(type); end +end + +# source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#5 +class RBS::DefinitionBuilder::AncestorBuilder + # @return [AncestorBuilder] a new instance of AncestorBuilder + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#162 + def initialize(env:); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#151 + def env; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#564 + def fill_ancestor_source(ancestor, name:, source:, &block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#408 + def instance_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # Returns the value of attribute instance_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#154 + def instance_ancestors_cache; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#531 + def interface_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # Returns the value of attribute interface_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#160 + def interface_ancestors_cache; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#388 + def mixin_ancestors(entry, type_name, included_modules:, included_interfaces:, extended_modules:, prepended_modules:, extended_interfaces:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#337 + def mixin_ancestors0(decl, type_name, align_params:, included_modules:, included_interfaces:, extended_modules:, prepended_modules:, extended_interfaces:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#192 + def one_instance_ancestors(type_name); end + + # Returns the value of attribute one_instance_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#153 + def one_instance_ancestors_cache; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#318 + def one_interface_ancestors(type_name); end + + # Returns the value of attribute one_interface_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#159 + def one_interface_ancestors_cache; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#264 + def one_singleton_ancestors(type_name); end + + # Returns the value of attribute one_singleton_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#156 + def one_singleton_ancestors_cache; end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#481 + def singleton_ancestors(type_name, building_ancestors: T.unsafe(nil)); end + + # Returns the value of attribute singleton_ancestors_cache. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#157 + def singleton_ancestors_cache; end + + # @raise [SuperclassMismatchError] + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#175 + def validate_super_class!(type_name, entry); end +end + +# source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#6 +class RBS::DefinitionBuilder::AncestorBuilder::OneAncestors + # @return [OneAncestors] a new instance of OneAncestors + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#17 + def initialize(type_name:, params:, super_class:, self_types:, included_modules:, included_interfaces:, prepended_modules:, extended_modules:, extended_interfaces:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#29 + def each_ancestor(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#86 + def each_extended_interface(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#78 + def each_extended_module(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#62 + def each_included_interface(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#54 + def each_included_module(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#70 + def each_prepended_module(&block); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#46 + def each_self_type(&block); end + + # Returns the value of attribute extended_interfaces. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#15 + def extended_interfaces; end + + # Returns the value of attribute extended_modules. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#14 + def extended_modules; end + + # Returns the value of attribute included_interfaces. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#12 + def included_interfaces; end + + # Returns the value of attribute included_modules. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#11 + def included_modules; end + + # Returns the value of attribute params. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#8 + def params; end + + # Returns the value of attribute prepended_modules. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#13 + def prepended_modules; end + + # Returns the value of attribute self_types. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#10 + def self_types; end + + # Returns the value of attribute super_class. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#9 + def super_class; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#7 + def type_name; end + + class << self + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#94 + def class_instance(type_name:, params:, super_class:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#136 + def interface(type_name:, params:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#122 + def module_instance(type_name:, params:); end + + # source://rbs/lib/rbs/definition_builder/ancestor_builder.rb#108 + def singleton(type_name:, super_class:); end + end +end + +# source://rbs/lib/rbs/definition_builder/method_builder.rb#5 +class RBS::DefinitionBuilder::MethodBuilder + # @return [MethodBuilder] a new instance of MethodBuilder + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#91 + def initialize(env:); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#194 + def build_alias(methods, type, member:); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#199 + def build_attribute(methods, type, member:, accessibility:); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#99 + def build_instance(type_name); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#174 + def build_interface(type_name); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#215 + def build_method(methods, type, member:, accessibility:); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#145 + def build_singleton(type_name); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#226 + def each_member_with_accessibility(members, accessibility: T.unsafe(nil)); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#86 + def env; end + + # Returns the value of attribute instance_methods. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#87 + def instance_methods; end + + # Returns the value of attribute interface_methods. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#89 + def interface_methods; end + + # Returns the value of attribute singleton_methods. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#88 + def singleton_methods; end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#239 + def update(env:, except:); end +end + +# source://rbs/lib/rbs/definition_builder/method_builder.rb#6 +class RBS::DefinitionBuilder::MethodBuilder::Methods + # @return [Methods] a new instance of Methods + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#30 + def initialize(type:); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#49 + def each; end + + # Returns the value of attribute methods. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#28 + def methods; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#27 + def type; end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#35 + def validate!; end +end + +# source://rbs/lib/rbs/definition_builder/method_builder.rb#7 +class RBS::DefinitionBuilder::MethodBuilder::Methods::Definition < ::Struct + # source://rbs/lib/rbs/definition_builder/method_builder.rb#14 + def accessibility; end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#10 + def original; end + + class << self + # source://rbs/lib/rbs/definition_builder/method_builder.rb#22 + def empty(name:, type:); end + end +end + +# source://rbs/lib/rbs/definition_builder/method_builder.rb#63 +class RBS::DefinitionBuilder::MethodBuilder::Methods::Sorter + include ::TSort + + # @return [Sorter] a new instance of Sorter + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#68 + def initialize(methods); end + + # Returns the value of attribute methods. + # + # source://rbs/lib/rbs/definition_builder/method_builder.rb#66 + def methods; end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#76 + def tsort_each_child(defn); end + + # source://rbs/lib/rbs/definition_builder/method_builder.rb#72 + def tsort_each_node(&block); end +end + +# source://rbs/lib/rbs/errors.rb#21 +class RBS::DefinitionError < ::RBS::BaseError; end + +# source://rbs/lib/rbs/errors.rb#23 +module RBS::DetailedMessageable + # source://rbs/lib/rbs/errors.rb#24 + def detailed_message(highlight: T.unsafe(nil), **_arg1); end +end + +# source://rbs/lib/rbs/diff.rb#4 +class RBS::Diff + # @return [Diff] a new instance of Diff + # + # source://rbs/lib/rbs/diff.rb#5 + def initialize(type_name:, library_options:, after_path: T.unsafe(nil), before_path: T.unsafe(nil), detail: T.unsafe(nil)); end + + # source://rbs/lib/rbs/diff.rb#13 + def each_diff(&block); end + + private + + # source://rbs/lib/rbs/diff.rb#96 + def build_builder(env); end + + # source://rbs/lib/rbs/diff.rb#77 + def build_env(path); end + + # source://rbs/lib/rbs/diff.rb#49 + def build_methods(path); end + + # source://rbs/lib/rbs/diff.rb#116 + def constant_to_s(constant); end + + # source://rbs/lib/rbs/diff.rb#100 + def definition_method_to_s(key, kind, definition_method); end + + # source://rbs/lib/rbs/diff.rb#38 + def each_diff_constants(before_constant_children, after_constant_children); end + + # source://rbs/lib/rbs/diff.rb#27 + def each_diff_methods(kind, before_methods, after_methods); end +end + +# source://rbs/lib/rbs/errors.rb#372 +class RBS::DuplicatedDeclarationError < ::RBS::LoadingError + # @return [DuplicatedDeclarationError] a new instance of DuplicatedDeclarationError + # + # source://rbs/lib/rbs/errors.rb#376 + def initialize(name, *decls); end + + # Returns the value of attribute decls. + # + # source://rbs/lib/rbs/errors.rb#374 + def decls; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/errors.rb#373 + def name; end +end + +# source://rbs/lib/rbs/errors.rb#270 +class RBS::DuplicatedInterfaceMethodDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [DuplicatedInterfaceMethodDefinitionError] a new instance of DuplicatedInterfaceMethodDefinitionError + # + # source://rbs/lib/rbs/errors.rb#277 + def initialize(type:, method_name:, member:); end + + # source://rbs/lib/rbs/errors.rb#285 + def location; end + + # Returns the value of attribute member. + # + # source://rbs/lib/rbs/errors.rb#275 + def member; end + + # Returns the value of attribute method_name. + # + # source://rbs/lib/rbs/errors.rb#274 + def method_name; end + + # source://rbs/lib/rbs/errors.rb#289 + def qualified_method_name; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/errors.rb#273 + def type; end + + # source://rbs/lib/rbs/errors.rb#298 + def type_name; end +end + +# source://rbs/lib/rbs/errors.rb#229 +class RBS::DuplicatedMethodDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [DuplicatedMethodDefinitionError] a new instance of DuplicatedMethodDefinitionError + # + # source://rbs/lib/rbs/errors.rb#236 + def initialize(type:, method_name:, members:); end + + # source://rbs/lib/rbs/errors.rb#261 + def location; end + + # Returns the value of attribute members. + # + # source://rbs/lib/rbs/errors.rb#234 + def members; end + + # Returns the value of attribute method_name. + # + # source://rbs/lib/rbs/errors.rb#233 + def method_name; end + + # source://rbs/lib/rbs/errors.rb#265 + def other_locations; end + + # source://rbs/lib/rbs/errors.rb#248 + def qualified_method_name; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/errors.rb#232 + def type; end + + # source://rbs/lib/rbs/errors.rb#257 + def type_name; end +end + +# source://rbs/lib/rbs/environment.rb#4 +class RBS::Environment + # @return [Environment] a new instance of Environment + # + # source://rbs/lib/rbs/environment.rb#145 + def initialize; end + + # source://rbs/lib/rbs/environment.rb#470 + def <<(decl); end + + # source://rbs/lib/rbs/environment.rb#792 + def absolute_type(resolver, map, type, context:); end + + # source://rbs/lib/rbs/environment.rb#787 + def absolute_type_name(resolver, map, type_name, context:); end + + # source://rbs/lib/rbs/environment.rb#476 + def add_signature(buffer:, directives:, decls:); end + + # source://rbs/lib/rbs/environment.rb#528 + def append_context(context, decl); end + + # source://rbs/lib/rbs/environment.rb#803 + def buffers; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#218 + def class_alias?(name); end + + # Returns the value of attribute class_alias_decls. + # + # source://rbs/lib/rbs/environment.rb#12 + def class_alias_decls; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#202 + def class_decl?(name); end + + # Returns the value of attribute class_decls. + # + # source://rbs/lib/rbs/environment.rb#7 + def class_decls; end + + # source://rbs/lib/rbs/environment.rb#226 + def class_entry(type_name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#198 + def constant_decl?(name); end + + # Returns the value of attribute constant_decls. + # + # source://rbs/lib/rbs/environment.rb#10 + def constant_decls; end + + # source://rbs/lib/rbs/environment.rb#274 + def constant_entry(type_name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#194 + def constant_name?(name); end + + # Returns the value of attribute declarations. + # + # source://rbs/lib/rbs/environment.rb#5 + def declarations; end + + # Returns the value of attribute global_decls. + # + # source://rbs/lib/rbs/environment.rb#11 + def global_decls; end + + # source://rbs/lib/rbs/environment.rb#373 + def insert_decl(decl, outer:, namespace:); end + + # source://rbs/lib/rbs/environment.rb#798 + def inspect; end + + # Returns the value of attribute interface_decls. + # + # source://rbs/lib/rbs/environment.rb#8 + def interface_decls; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#176 + def interface_name?(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#210 + def module_alias?(name); end + + # source://rbs/lib/rbs/environment.rb#266 + def module_class_entry(type_name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#206 + def module_decl?(name); end + + # source://rbs/lib/rbs/environment.rb#235 + def module_entry(type_name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#184 + def module_name?(name); end + + # source://rbs/lib/rbs/environment.rb#332 + def normalize_module_name(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#336 + def normalize_module_name?(name); end + + # source://rbs/lib/rbs/environment.rb#328 + def normalize_type_name(name); end + + # source://rbs/lib/rbs/environment.rb#297 + def normalize_type_name!(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#278 + def normalize_type_name?(name); end + + # source://rbs/lib/rbs/environment.rb#244 + def normalized_class_entry(type_name); end + + # source://rbs/lib/rbs/environment.rb#270 + def normalized_module_class_entry(type_name); end + + # source://rbs/lib/rbs/environment.rb#255 + def normalized_module_entry(type_name); end + + # source://rbs/lib/rbs/environment.rb#323 + def normalized_type_name!(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#310 + def normalized_type_name?(type_name); end + + # source://rbs/lib/rbs/environment.rb#537 + def resolve_declaration(resolver, map, decl, outer:, prefix:); end + + # source://rbs/lib/rbs/environment.rb#673 + def resolve_member(resolver, map, member, context:); end + + # source://rbs/lib/rbs/environment.rb#773 + def resolve_method_type(resolver, map, type, context:); end + + # source://rbs/lib/rbs/environment.rb#489 + def resolve_type_names(only: T.unsafe(nil)); end + + # source://rbs/lib/rbs/environment.rb#781 + def resolve_type_params(resolver, map, params, context:); end + + # source://rbs/lib/rbs/environment.rb#522 + def resolver_context(*nesting); end + + # Returns the value of attribute signatures. + # + # source://rbs/lib/rbs/environment.rb#14 + def signatures; end + + # Returns the value of attribute type_alias_decls. + # + # source://rbs/lib/rbs/environment.rb#9 + def type_alias_decls; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#180 + def type_alias_name?(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#188 + def type_name?(name); end + + # source://rbs/lib/rbs/environment.rb#807 + def unload(buffers); end + + # source://rbs/lib/rbs/environment.rb#483 + def validate_type_params; end + + private + + # source://rbs/lib/rbs/environment.rb#158 + def initialize_copy(other); end + + class << self + # source://rbs/lib/rbs/environment.rb#170 + def from_loader(loader); end + end +end + +# source://rbs/lib/rbs/environment.rb#130 +class RBS::Environment::ClassAliasEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment.rb#100 +class RBS::Environment::ClassEntry < ::RBS::Environment::MultiEntry + # source://rbs/lib/rbs/environment.rb#101 + def primary; end +end + +# source://rbs/lib/rbs/environment.rb#139 +class RBS::Environment::ConstantEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment.rb#16 +module RBS::Environment::ContextUtil + # source://rbs/lib/rbs/environment.rb#17 + def calculate_context(decls); end +end + +# source://rbs/lib/rbs/environment.rb#142 +class RBS::Environment::GlobalEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment.rb#133 +class RBS::Environment::InterfaceEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment.rb#127 +class RBS::Environment::ModuleAliasEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment.rb#85 +class RBS::Environment::ModuleEntry < ::RBS::Environment::MultiEntry + # source://rbs/lib/rbs/environment.rb#92 + def primary; end + + # source://rbs/lib/rbs/environment.rb#86 + def self_types; end +end + +# source://rbs/lib/rbs/environment.rb#29 +class RBS::Environment::MultiEntry + # @return [MultiEntry] a new instance of MultiEntry + # + # source://rbs/lib/rbs/environment.rb#43 + def initialize(name:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment.rb#70 + def compatible_params?(ps1, ps2); end + + # Returns the value of attribute decls. + # + # source://rbs/lib/rbs/environment.rb#41 + def decls; end + + # source://rbs/lib/rbs/environment.rb#48 + def insert(decl:, outer:); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/environment.rb#40 + def name; end + + # source://rbs/lib/rbs/environment.rb#80 + def primary; end + + # source://rbs/lib/rbs/environment.rb#76 + def type_params; end + + # source://rbs/lib/rbs/environment.rb#53 + def validate_type_params; end +end + +# source://rbs/lib/rbs/environment.rb#30 +class RBS::Environment::MultiEntry::D < ::Struct + include ::RBS::Environment::ContextUtil + + # source://rbs/lib/rbs/environment.rb#35 + def context; end + + def decl; end + def decl=(_); end + def outer; end + def outer=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/environment.rb#109 +class RBS::Environment::SingleEntry + include ::RBS::Environment::ContextUtil + + # @return [SingleEntry] a new instance of SingleEntry + # + # source://rbs/lib/rbs/environment.rb#114 + def initialize(name:, decl:, outer:); end + + # source://rbs/lib/rbs/environment.rb#122 + def context; end + + # Returns the value of attribute decl. + # + # source://rbs/lib/rbs/environment.rb#112 + def decl; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/environment.rb#110 + def name; end + + # Returns the value of attribute outer. + # + # source://rbs/lib/rbs/environment.rb#111 + def outer; end +end + +# source://rbs/lib/rbs/environment.rb#136 +class RBS::Environment::TypeAliasEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs/lib/rbs/environment/use_map.rb#5 +class RBS::Environment::UseMap + # @return [UseMap] a new instance of UseMap + # + # source://rbs/lib/rbs/environment/use_map.rb#30 + def initialize(table:); end + + # source://rbs/lib/rbs/environment/use_map.rb#36 + def build_map(clause); end + + # source://rbs/lib/rbs/environment/use_map.rb#72 + def resolve(type_name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment/use_map.rb#53 + def resolve?(type_name); end + + # Returns the value of attribute use_dirs. + # + # source://rbs/lib/rbs/environment/use_map.rb#28 + def use_dirs; end +end + +# source://rbs/lib/rbs/environment/use_map.rb#6 +class RBS::Environment::UseMap::Table + # @return [Table] a new instance of Table + # + # source://rbs/lib/rbs/environment/use_map.rb#9 + def initialize; end + + # Returns the value of attribute children. + # + # source://rbs/lib/rbs/environment/use_map.rb#7 + def children; end + + # source://rbs/lib/rbs/environment/use_map.rb#14 + def compute_children; end + + # Returns the value of attribute known_types. + # + # source://rbs/lib/rbs/environment/use_map.rb#7 + def known_types; end +end + +# source://rbs/lib/rbs/environment_loader.rb#4 +class RBS::EnvironmentLoader + include ::RBS::FileFinder + + # @return [EnvironmentLoader] a new instance of EnvironmentLoader + # + # source://rbs/lib/rbs/environment_loader.rb#40 + def initialize(core_root: T.unsafe(nil), repository: T.unsafe(nil)); end + + # source://rbs/lib/rbs/environment_loader.rb#48 + def add(path: T.unsafe(nil), library: T.unsafe(nil), version: T.unsafe(nil), resolve_dependencies: T.unsafe(nil)); end + + # source://rbs/lib/rbs/environment_loader.rb#80 + def add_collection(lockfile); end + + # Returns the value of attribute core_root. + # + # source://rbs/lib/rbs/environment_loader.rb#20 + def core_root; end + + # Returns the value of attribute dirs. + # + # source://rbs/lib/rbs/environment_loader.rb#24 + def dirs; end + + # source://rbs/lib/rbs/environment_loader.rb#126 + def each_dir; end + + # source://rbs/lib/rbs/environment_loader.rb#149 + def each_signature; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment_loader.rb#104 + def has_library?(library:, version:); end + + # Returns the value of attribute libs. + # + # source://rbs/lib/rbs/environment_loader.rb#23 + def libs; end + + # source://rbs/lib/rbs/environment_loader.rb#112 + def load(env:); end + + # Returns the value of attribute repository. + # + # source://rbs/lib/rbs/environment_loader.rb#21 + def repository; end + + # source://rbs/lib/rbs/environment_loader.rb#65 + def resolve_dependencies(library:, version:); end + + class << self + # source://rbs/lib/rbs/environment_loader.rb#28 + def gem_sig_path(name, version); end + end +end + +# source://rbs/lib/rbs/environment_loader.rb#26 +RBS::EnvironmentLoader::DEFAULT_CORE_ROOT = T.let(T.unsafe(nil), Pathname) + +# source://rbs/lib/rbs/environment_loader.rb#17 +class RBS::EnvironmentLoader::Library < ::Struct; end + +# source://rbs/lib/rbs/environment_loader.rb#5 +class RBS::EnvironmentLoader::UnknownLibraryError < ::StandardError + # @return [UnknownLibraryError] a new instance of UnknownLibraryError + # + # source://rbs/lib/rbs/environment_loader.rb#8 + def initialize(lib:); end + + # Returns the value of attribute library. + # + # source://rbs/lib/rbs/environment_loader.rb#6 + def library; end +end + +# source://rbs/lib/rbs/environment_walker.rb#4 +class RBS::EnvironmentWalker + include ::TSort + + # @return [EnvironmentWalker] a new instance of EnvironmentWalker + # + # source://rbs/lib/rbs/environment_walker.rb#11 + def initialize(env:); end + + # source://rbs/lib/rbs/environment_walker.rb#16 + def builder; end + + # source://rbs/lib/rbs/environment_walker.rb#99 + def each_type_name(type, &block); end + + # source://rbs/lib/rbs/environment_walker.rb#105 + def each_type_node(type, &block); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/environment_walker.rb#9 + def env; end + + # source://rbs/lib/rbs/environment_walker.rb#20 + def only_ancestors!(only = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/environment_walker.rb#25 + def only_ancestors?; end + + # source://rbs/lib/rbs/environment_walker.rb#44 + def tsort_each_child(node, &block); end + + # source://rbs/lib/rbs/environment_walker.rb#31 + def tsort_each_node(&block); end +end + +# source://rbs/lib/rbs/environment_walker.rb#5 +class RBS::EnvironmentWalker::InstanceNode < ::Struct + def type_name; end + def type_name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/environment_walker.rb#6 +class RBS::EnvironmentWalker::SingletonNode < ::Struct + def type_name; end + def type_name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/environment_walker.rb#7 +class RBS::EnvironmentWalker::TypeNameNode < ::Struct + def type_name; end + def type_name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/factory.rb#4 +class RBS::Factory + # source://rbs/lib/rbs/factory.rb#5 + def type_name(string); end +end + +# source://rbs/lib/rbs/file_finder.rb#4 +module RBS::FileFinder + class << self + # source://rbs/lib/rbs/file_finder.rb#7 + def each_file(path, immediate:, skip_hidden:, &block); end + end +end + +# source://rbs/lib/rbs/errors.rb#361 +class RBS::GenericParameterMismatchError < ::RBS::LoadingError + # @return [GenericParameterMismatchError] a new instance of GenericParameterMismatchError + # + # source://rbs/lib/rbs/errors.rb#365 + def initialize(name:, decl:); end + + # Returns the value of attribute decl. + # + # source://rbs/lib/rbs/errors.rb#363 + def decl; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/errors.rb#362 + def name; end +end + +# source://rbs/lib/rbs/errors.rb#507 +class RBS::InconsistentClassModuleAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [InconsistentClassModuleAliasError] a new instance of InconsistentClassModuleAliasError + # + # source://rbs/lib/rbs/errors.rb#512 + def initialize(entry); end + + # Returns the value of attribute alias_entry. + # + # source://rbs/lib/rbs/errors.rb#510 + def alias_entry; end + + # source://rbs/lib/rbs/errors.rb#526 + def location; end +end + +# source://rbs/lib/rbs/errors.rb#165 +class RBS::InheritModuleError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [InheritModuleError] a new instance of InheritModuleError + # + # source://rbs/lib/rbs/errors.rb#170 + def initialize(super_decl); end + + # source://rbs/lib/rbs/errors.rb#176 + def location; end + + # Returns the value of attribute super_decl. + # + # source://rbs/lib/rbs/errors.rb#168 + def super_decl; end + + class << self + # source://rbs/lib/rbs/errors.rb#180 + def check!(super_decl, env:); end + end +end + +# source://rbs/lib/rbs/errors.rb#332 +class RBS::InvalidOverloadMethodError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [InvalidOverloadMethodError] a new instance of InvalidOverloadMethodError + # + # source://rbs/lib/rbs/errors.rb#340 + def initialize(type_name:, method_name:, kind:, members:); end + + # Returns the value of attribute kind. + # + # source://rbs/lib/rbs/errors.rb#337 + def kind; end + + # source://rbs/lib/rbs/errors.rb#356 + def location; end + + # Returns the value of attribute members. + # + # source://rbs/lib/rbs/errors.rb#338 + def members; end + + # Returns the value of attribute method_name. + # + # source://rbs/lib/rbs/errors.rb#336 + def method_name; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#335 + def type_name; end +end + +# source://rbs/lib/rbs/errors.rb#67 +class RBS::InvalidTypeApplicationError < ::RBS::DefinitionError + # @return [InvalidTypeApplicationError] a new instance of InvalidTypeApplicationError + # + # source://rbs/lib/rbs/errors.rb#73 + def initialize(type_name:, args:, params:, location:); end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/errors.rb#69 + def args; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#71 + def location; end + + # Returns the value of attribute params. + # + # source://rbs/lib/rbs/errors.rb#70 + def params; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#68 + def type_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#81 + def check!(type_name:, args:, params:, location:); end + end +end + +# source://rbs/lib/rbs/errors.rb#385 +class RBS::InvalidVarianceAnnotationError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [InvalidVarianceAnnotationError] a new instance of InvalidVarianceAnnotationError + # + # source://rbs/lib/rbs/errors.rb#392 + def initialize(type_name:, param:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#390 + def location; end + + # Returns the value of attribute param. + # + # source://rbs/lib/rbs/errors.rb#389 + def param; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#388 + def type_name; end +end + +# source://rbs/lib/rbs/errors.rb#20 +class RBS::LoadingError < ::RBS::BaseError; end + +# source://rbs/lib/rbs/location_aux.rb#4 +class RBS::Location + def initialize(_arg0, _arg1, _arg2); end + + # source://rbs/lib/rbs/location_aux.rb#75 + def ==(other); end + + def [](_arg0); end + def _add_optional_child(_arg0, _arg1, _arg2); end + def _add_optional_no_child(_arg0); end + def _add_required_child(_arg0, _arg1, _arg2); end + def _optional_keys; end + def _required_keys; end + + # source://rbs/lib/rbs/location_aux.rb#106 + def add_optional_child(name, range); end + + # source://rbs/lib/rbs/location_aux.rb#102 + def add_required_child(name, range); end + + def aref(_arg0); end + def buffer; end + + # source://rbs/lib/rbs/location_aux.rb#114 + def each_optional_key(&block); end + + # source://rbs/lib/rbs/location_aux.rb#122 + def each_required_key(&block); end + + # source://rbs/lib/rbs/location_aux.rb#47 + def end_column; end + + # source://rbs/lib/rbs/location_aux.rb#43 + def end_line; end + + # source://rbs/lib/rbs/location_aux.rb#57 + def end_loc; end + + def end_pos; end + + # source://rbs/lib/rbs/location_aux.rb#5 + def inspect; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/location_aux.rb#130 + def key?(name); end + + # source://rbs/lib/rbs/location_aux.rb#31 + def name; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/location_aux.rb#134 + def optional_key?(name); end + + # source://rbs/lib/rbs/location_aux.rb#63 + def range; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/location_aux.rb#138 + def required_key?(name); end + + # source://rbs/lib/rbs/location_aux.rb#67 + def source; end + + # source://rbs/lib/rbs/location_aux.rb#39 + def start_column; end + + # source://rbs/lib/rbs/location_aux.rb#35 + def start_line; end + + # source://rbs/lib/rbs/location_aux.rb#51 + def start_loc; end + + def start_pos; end + + # source://rbs/lib/rbs/location_aux.rb#82 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/location_aux.rb#71 + def to_s; end + + private + + def _end_loc; end + def _start_loc; end + def initialize_copy(_arg0); end + + class << self + # source://rbs/lib/rbs/location_aux.rb#16 + def new(buffer_ = T.unsafe(nil), start_pos_ = T.unsafe(nil), end_pos_ = T.unsafe(nil), buffer: T.unsafe(nil), start_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end + + # source://rbs/lib/rbs/location_aux.rb#98 + def to_string(location, default: T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/location_aux.rb#29 +RBS::Location::WithChildren = RBS::Location + +# source://rbs/lib/rbs/locator.rb#4 +class RBS::Locator + # @return [Locator] a new instance of Locator + # + # source://rbs/lib/rbs/locator.rb#7 + def initialize(buffer:, dirs:, decls:); end + + # Returns the value of attribute buffer. + # + # source://rbs/lib/rbs/locator.rb#5 + def buffer; end + + # Returns the value of attribute decls. + # + # source://rbs/lib/rbs/locator.rb#5 + def decls; end + + # Returns the value of attribute dirs. + # + # source://rbs/lib/rbs/locator.rb#5 + def dirs; end + + # source://rbs/lib/rbs/locator.rb#13 + def find(line:, column:); end + + # source://rbs/lib/rbs/locator.rb#29 + def find2(line:, column:); end + + # source://rbs/lib/rbs/locator.rb#58 + def find_in_decl(pos, decl:, array:); end + + # source://rbs/lib/rbs/locator.rb#42 + def find_in_directive(pos, dir, array); end + + # source://rbs/lib/rbs/locator.rb#203 + def find_in_loc(pos, location:, array:); end + + # source://rbs/lib/rbs/locator.rb#129 + def find_in_member(pos, member:, array:); end + + # source://rbs/lib/rbs/locator.rb#152 + def find_in_method_type(pos, method_type:, array:); end + + # source://rbs/lib/rbs/locator.rb#187 + def find_in_type(pos, type:, array:); end + + # source://rbs/lib/rbs/locator.rb#170 + def find_in_type_param(pos, type_param:, array:); end + + # source://rbs/lib/rbs/locator.rb#230 + def test_loc(pos, location:); end +end + +# source://rbs/lib/rbs/errors.rb#4 +module RBS::MethodNameHelper + # source://rbs/lib/rbs/errors.rb#5 + def method_name_string; end +end + +# source://rbs/lib/rbs/method_type.rb#4 +class RBS::MethodType + # @return [MethodType] a new instance of MethodType + # + # source://rbs/lib/rbs/method_type.rb#10 + def initialize(type_params:, type:, block:, location:); end + + # source://rbs/lib/rbs/method_type.rb#17 + def ==(other); end + + # Returns the value of attribute block. + # + # source://rbs/lib/rbs/method_type.rb#7 + def block; end + + # source://rbs/lib/rbs/method_type.rb#84 + def each_type(&block); end + + # source://rbs/lib/rbs/method_type.rb#57 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/method_type.rb#125 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/method_type.rb#121 + def has_self_type?; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/method_type.rb#8 + def location; end + + # source://rbs/lib/rbs/method_type.rb#63 + def map_type(&block); end + + # source://rbs/lib/rbs/method_type.rb#72 + def map_type_bound(&block); end + + # source://rbs/lib/rbs/method_type.rb#33 + def sub(s); end + + # source://rbs/lib/rbs/method_type.rb#24 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/method_type.rb#98 + def to_s; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/method_type.rb#6 + def type; end + + # source://rbs/lib/rbs/method_type.rb#117 + def type_param_names; end + + # Returns the value of attribute type_params. + # + # source://rbs/lib/rbs/method_type.rb#5 + def type_params; end + + # source://rbs/lib/rbs/method_type.rb#48 + def update(type_params: T.unsafe(nil), type: T.unsafe(nil), block: T.unsafe(nil), location: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/method_type.rb#129 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/errors.rb#421 +class RBS::MixinClassError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [MixinClassError] a new instance of MixinClassError + # + # source://rbs/lib/rbs/errors.rb#427 + def initialize(type_name:, member:); end + + # source://rbs/lib/rbs/errors.rb#434 + def location; end + + # Returns the value of attribute member. + # + # source://rbs/lib/rbs/errors.rb#425 + def member; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#424 + def type_name; end + + private + + # source://rbs/lib/rbs/errors.rb#446 + def mixin_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#438 + def check!(type_name:, env:, member:); end + end +end + +# source://rbs/lib/rbs/namespace.rb#4 +class RBS::Namespace + # @return [Namespace] a new instance of Namespace + # + # source://rbs/lib/rbs/namespace.rb#7 + def initialize(path:, absolute:); end + + # source://rbs/lib/rbs/namespace.rb#20 + def +(other); end + + # source://rbs/lib/rbs/namespace.rb#59 + def ==(other); end + + # source://rbs/lib/rbs/namespace.rb#47 + def absolute!; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/namespace.rb#39 + def absolute?; end + + # source://rbs/lib/rbs/namespace.rb#28 + def append(component); end + + # source://rbs/lib/rbs/namespace.rb#101 + def ascend; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/namespace.rb#55 + def empty?; end + + # source://rbs/lib/rbs/namespace.rb#59 + def eql?(other); end + + # source://rbs/lib/rbs/namespace.rb#65 + def hash; end + + # source://rbs/lib/rbs/namespace.rb#32 + def parent; end + + # Returns the value of attribute path. + # + # source://rbs/lib/rbs/namespace.rb#5 + def path; end + + # source://rbs/lib/rbs/namespace.rb#51 + def relative!; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/namespace.rb#43 + def relative?; end + + # source://rbs/lib/rbs/namespace.rb#69 + def split; end + + # source://rbs/lib/rbs/namespace.rb#75 + def to_s; end + + # source://rbs/lib/rbs/namespace.rb#84 + def to_type_name; end + + class << self + # source://rbs/lib/rbs/namespace.rb#12 + def empty; end + + # source://rbs/lib/rbs/namespace.rb#93 + def parse(string); end + + # source://rbs/lib/rbs/namespace.rb#16 + def root; end + end +end + +# source://rbs/lib/rbs/errors.rb#207 +class RBS::NoMixinFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [NoMixinFoundError] a new instance of NoMixinFoundError + # + # source://rbs/lib/rbs/errors.rb#213 + def initialize(type_name:, member:); end + + # source://rbs/lib/rbs/errors.rb#220 + def location; end + + # Returns the value of attribute member. + # + # source://rbs/lib/rbs/errors.rb#211 + def member; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#210 + def type_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#224 + def check!(type_name, env:, member:); end + end +end + +# source://rbs/lib/rbs/errors.rb#188 +class RBS::NoSelfTypeFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [NoSelfTypeFoundError] a new instance of NoSelfTypeFoundError + # + # source://rbs/lib/rbs/errors.rb#194 + def initialize(type_name:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#192 + def location; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#191 + def type_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#201 + def check!(self_type, env:); end + end +end + +# source://rbs/lib/rbs/errors.rb#145 +class RBS::NoSuperclassFoundError < ::RBS::DefinitionError + # @return [NoSuperclassFoundError] a new instance of NoSuperclassFoundError + # + # source://rbs/lib/rbs/errors.rb#149 + def initialize(type_name:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#147 + def location; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#146 + def type_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#156 + def check!(type_name, env:, location:); end + end +end + +# source://rbs/lib/rbs/errors.rb#126 +class RBS::NoTypeFoundError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [NoTypeFoundError] a new instance of NoTypeFoundError + # + # source://rbs/lib/rbs/errors.rb#132 + def initialize(type_name:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#130 + def location; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#129 + def type_name; end + + class << self + # source://rbs/lib/rbs/errors.rb#139 + def check!(type_name, env:, location:); end + end +end + +# source://rbs/lib/rbs/errors.rb#478 +class RBS::NonregularTypeAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [NonregularTypeAliasError] a new instance of NonregularTypeAliasError + # + # source://rbs/lib/rbs/errors.rb#484 + def initialize(diagnostic:, location:); end + + # Returns the value of attribute diagnostic. + # + # source://rbs/lib/rbs/errors.rb#481 + def diagnostic; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#482 + def location; end +end + +# source://rbs/lib/rbs/parser/lex_result.rb#4 +class RBS::Parser + class << self + def _lex(_arg0, _arg1); end + def _parse_method_type(_arg0, _arg1, _arg2, _arg3, _arg4); end + def _parse_signature(_arg0, _arg1); end + def _parse_type(_arg0, _arg1, _arg2, _arg3, _arg4); end + + # source://rbs/lib/rbs/parser_aux.rb#34 + def buffer(source); end + + # source://rbs/lib/rbs/parser_aux.rb#25 + def lex(source); end + + # source://rbs/lib/rbs/parser_aux.rb#13 + def parse_method_type(source, range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil)); end + + # source://rbs/lib/rbs/parser_aux.rb#18 + def parse_signature(source); end + + # source://rbs/lib/rbs/parser_aux.rb#8 + def parse_type(source, range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/parser_aux.rb#43 +RBS::Parser::KEYWORDS = T.let(T.unsafe(nil), Hash) + +# source://rbs/lib/rbs/parser/lex_result.rb#5 +class RBS::Parser::LexResult + # @return [LexResult] a new instance of LexResult + # + # source://rbs/lib/rbs/parser/lex_result.rb#9 + def initialize(buffer:, value:); end + + # Returns the value of attribute buffer. + # + # source://rbs/lib/rbs/parser/lex_result.rb#6 + def buffer; end + + # Returns the value of attribute value. + # + # source://rbs/lib/rbs/parser/lex_result.rb#7 + def value; end +end + +# source://rbs/lib/rbs/parser/token.rb#5 +class RBS::Parser::Token + # @return [Token] a new instance of Token + # + # source://rbs/lib/rbs/parser/token.rb#9 + def initialize(type:, location:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/parser/token.rb#18 + def comment?; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/parser/token.rb#7 + def location; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/parser/token.rb#6 + def type; end + + # source://rbs/lib/rbs/parser/token.rb#14 + def value; end +end + +# source://rbs/lib/rbs/errors.rb#51 +class RBS::ParsingError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [ParsingError] a new instance of ParsingError + # + # source://rbs/lib/rbs/errors.rb#58 + def initialize(location, error_message, token_type); end + + # Returns the value of attribute error_message. + # + # source://rbs/lib/rbs/errors.rb#55 + def error_message; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#54 + def location; end + + # Returns the value of attribute token_type. + # + # source://rbs/lib/rbs/errors.rb#56 + def token_type; end +end + +# source://rbs/lib/rbs/prototype/helpers.rb#4 +module RBS::Prototype; end + +# source://rbs/lib/rbs/prototype/helpers.rb#5 +module RBS::Prototype::Helpers + private + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/helpers.rb#96 + def any_node?(node, nodes: T.unsafe(nil), &block); end + + # NOTE: args_node may be a nil by a bug + # https://bugs.ruby-lang.org/issues/17495 + # + # source://rbs/lib/rbs/prototype/helpers.rb#120 + def args_from_node(args_node); end + + # source://rbs/lib/rbs/prototype/helpers.rb#8 + def block_from_body(node); end + + # source://rbs/lib/rbs/prototype/helpers.rb#84 + def each_child(node, &block); end + + # source://rbs/lib/rbs/prototype/helpers.rb#88 + def each_node(nodes); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/helpers.rb#108 + def keyword_hash?(node); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/helpers.rb#124 + def symbol_literal_node?(node); end + + # source://rbs/lib/rbs/prototype/helpers.rb#135 + def untyped; end +end + +# source://rbs/lib/rbs/prototype/node_usage.rb#5 +class RBS::Prototype::NodeUsage + include ::RBS::Prototype::Helpers + + # @return [NodeUsage] a new instance of NodeUsage + # + # source://rbs/lib/rbs/prototype/node_usage.rb#10 + def initialize(node); end + + # source://rbs/lib/rbs/prototype/node_usage.rb#25 + def calculate(node, conditional:); end + + # Returns the value of attribute conditional_nodes. + # + # source://rbs/lib/rbs/prototype/node_usage.rb#8 + def conditional_nodes; end + + # source://rbs/lib/rbs/prototype/node_usage.rb#17 + def each_conditional_node(&block); end +end + +# source://rbs/lib/rbs/prototype/rb.rb#5 +class RBS::Prototype::RB + include ::RBS::Prototype::Helpers + + # @return [RB] a new instance of RB + # + # source://rbs/lib/rbs/prototype/rb.rb#45 + def initialize; end + + # source://rbs/lib/rbs/prototype/rb.rb#556 + def block_type(node); end + + # source://rbs/lib/rbs/prototype/rb.rb#536 + def body_type(node); end + + # source://rbs/lib/rbs/prototype/rb.rb#451 + def const_to_name(node, context:); end + + # source://rbs/lib/rbs/prototype/rb.rb#432 + def const_to_name!(node); end + + # source://rbs/lib/rbs/prototype/rb.rb#764 + def current_accessibility(decls, index = T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/rb.rb#49 + def decls; end + + # source://rbs/lib/rbs/prototype/rb.rb#804 + def find_def_index_by_name(decls, name); end + + # source://rbs/lib/rbs/prototype/rb.rb#531 + def function_return_type_from_body(node); end + + # source://rbs/lib/rbs/prototype/rb.rb#473 + def function_type_from_body(node, def_name); end + + # source://rbs/lib/rbs/prototype/rb.rb#549 + def if_unless_type(node); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/rb.rb#800 + def is_accessibility?(decl); end + + # source://rbs/lib/rbs/prototype/rb.rb#462 + def literal_to_symbol(node); end + + # source://rbs/lib/rbs/prototype/rb.rb#570 + def literal_to_type(node); end + + # backward compatible + # + # source://rbs/lib/rbs/prototype/rb.rb#711 + def node_type(node, default: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/rb.rb#711 + def param_type(node, default: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/rb.rb#75 + def parse(string); end + + # source://rbs/lib/rbs/prototype/rb.rb#756 + def private; end + + # source://rbs/lib/rbs/prototype/rb.rb#107 + def process(node, decls:, comments:, context:); end + + # source://rbs/lib/rbs/prototype/rb.rb#426 + def process_children(node, decls:, comments:, context:); end + + # source://rbs/lib/rbs/prototype/rb.rb#760 + def public; end + + # source://rbs/lib/rbs/prototype/rb.rb#691 + def range_element_type(types); end + + # source://rbs/lib/rbs/prototype/rb.rb#774 + def remove_unnecessary_accessibility_methods!(decls); end + + # source://rbs/lib/rbs/prototype/rb.rb#822 + def sort_members!(decls); end + + # Returns the value of attribute source_decls. + # + # source://rbs/lib/rbs/prototype/rb.rb#42 + def source_decls; end + + # Returns the value of attribute toplevel_members. + # + # source://rbs/lib/rbs/prototype/rb.rb#43 + def toplevel_members; end + + # source://rbs/lib/rbs/prototype/rb.rb#680 + def types_to_union_type(types); end +end + +# source://rbs/lib/rbs/prototype/rb.rb#8 +class RBS::Prototype::RB::Context < ::Struct + # source://rbs/lib/rbs/prototype/rb.rb#25 + def attribute_kind; end + + # source://rbs/lib/rbs/prototype/rb.rb#33 + def enter_namespace(namespace); end + + # source://rbs/lib/rbs/prototype/rb.rb#15 + def method_kind; end + + # source://rbs/lib/rbs/prototype/rb.rb#37 + def update(module_function: T.unsafe(nil), singleton: T.unsafe(nil), in_def: T.unsafe(nil)); end + + class << self + # source://rbs/lib/rbs/prototype/rb.rb#11 + def initial(namespace: T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/prototype/rbi.rb#5 +class RBS::Prototype::RBI + include ::RBS::Prototype::Helpers + + # @return [RBI] a new instance of RBI + # + # source://rbs/lib/rbs/prototype/rbi.rb#12 + def initialize; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/rbi.rb#556 + def call_node?(node, name:, receiver: T.unsafe(nil), args: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/rbi.rb#560 + def const_to_name(node); end + + # source://rbs/lib/rbs/prototype/rbi.rb#92 + def current_module; end + + # source://rbs/lib/rbs/prototype/rbi.rb#96 + def current_module!; end + + # source://rbs/lib/rbs/prototype/rbi.rb#48 + def current_namespace; end + + # Returns the value of attribute decls. + # + # source://rbs/lib/rbs/prototype/rbi.rb#8 + def decls; end + + # source://rbs/lib/rbs/prototype/rbi.rb#596 + def each_arg(array, &block); end + + # source://rbs/lib/rbs/prototype/rbi.rb#610 + def each_child(node); end + + # source://rbs/lib/rbs/prototype/rbi.rb#114 + def join_comments(nodes, comments); end + + # Returns the value of attribute last_sig. + # + # source://rbs/lib/rbs/prototype/rbi.rb#10 + def last_sig; end + + # source://rbs/lib/rbs/prototype/rbi.rb#280 + def method_type(args_node, type_node, variables:, overloads:); end + + # Returns the value of attribute modules. + # + # source://rbs/lib/rbs/prototype/rbi.rb#9 + def modules; end + + # source://rbs/lib/rbs/prototype/rbi.rb#44 + def nested_name(name); end + + # source://rbs/lib/rbs/prototype/rbi.rb#618 + def node_to_hash(node); end + + # source://rbs/lib/rbs/prototype/rbi.rb#18 + def parse(string); end + + # source://rbs/lib/rbs/prototype/rbi.rb#346 + def parse_params(args_node, args, method_type, variables:, overloads:); end + + # source://rbs/lib/rbs/prototype/rbi.rb#108 + def pop_sig; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/rbi.rb#548 + def proc_type?(type_node); end + + # source://rbs/lib/rbs/prototype/rbi.rb#119 + def process(node, comments:, outer: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/rbi.rb#54 + def push_class(name, super_class, comment:); end + + # source://rbs/lib/rbs/prototype/rbi.rb#73 + def push_module(name, comment:); end + + # source://rbs/lib/rbs/prototype/rbi.rb#100 + def push_sig(node); end + + # source://rbs/lib/rbs/prototype/rbi.rb#471 + def type_of(type_node, variables:); end + + # source://rbs/lib/rbs/prototype/rbi.rb#484 + def type_of0(type_node, variables:); end +end + +# source://rbs/lib/rbs/prototype/runtime/helpers.rb#5 +class RBS::Prototype::Runtime + include ::RBS::Prototype::Helpers + include ::RBS::Prototype::Runtime::Helpers + + # @return [Runtime] a new instance of Runtime + # + # source://rbs/lib/rbs/prototype/runtime.rb#70 + def initialize(patterns:, env:, merge:, todo: T.unsafe(nil), owners_included: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/runtime.rb#652 + def block_from_ast_of(method); end + + # source://rbs/lib/rbs/prototype/runtime.rb#100 + def builder; end + + # source://rbs/lib/rbs/prototype/runtime.rb#108 + def decls; end + + # Generate/find outer module declarations + # This is broken down into another method to comply with `DRY` + # This generates/finds declarations in nested form & returns the last array of declarations + # + # source://rbs/lib/rbs/prototype/runtime.rb#581 + def ensure_outer_module_declarations(mod); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/prototype/runtime.rb#64 + def env; end + + # source://rbs/lib/rbs/prototype/runtime.rb#486 + def generate_class(mod); end + + # source://rbs/lib/rbs/prototype/runtime.rb#424 + def generate_constants(mod, decls); end + + # source://rbs/lib/rbs/prototype/runtime.rb#298 + def generate_methods(mod, module_name, members); end + + # source://rbs/lib/rbs/prototype/runtime.rb#563 + def generate_mixin(mod, decl, type_name, type_name_absolute); end + + # source://rbs/lib/rbs/prototype/runtime.rb#525 + def generate_module(mod); end + + # source://rbs/lib/rbs/prototype/runtime.rb#471 + def generate_super_class(mod); end + + # Returns the value of attribute merge. + # + # source://rbs/lib/rbs/prototype/runtime.rb#65 + def merge; end + + # source://rbs/lib/rbs/prototype/runtime.rb#239 + def merge_rbs(module_name, members, instance: T.unsafe(nil), singleton: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/runtime.rb#170 + def method_type(method); end + + # Returns the value of attribute outline. + # + # source://rbs/lib/rbs/prototype/runtime.rb#68 + def outline; end + + # Sets the attribute outline + # + # @param value the value to set the attribute outline to. + # + # source://rbs/lib/rbs/prototype/runtime.rb#68 + def outline=(_arg0); end + + # Returns the value of attribute owners_included. + # + # source://rbs/lib/rbs/prototype/runtime.rb#67 + def owners_included; end + + # source://rbs/lib/rbs/prototype/runtime.rb#104 + def parse(file); end + + # Returns the value of attribute patterns. + # + # source://rbs/lib/rbs/prototype/runtime.rb#63 + def patterns; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#83 + def target?(const); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#285 + def target_method?(mod, instance: T.unsafe(nil), singleton: T.unsafe(nil)); end + + # Returns the value of attribute todo. + # + # source://rbs/lib/rbs/prototype/runtime.rb#66 + def todo; end + + # source://rbs/lib/rbs/prototype/runtime.rb#96 + def todo_object; end + + # source://rbs/lib/rbs/prototype/runtime.rb#635 + def type_args(type_name); end + + # source://rbs/lib/rbs/prototype/runtime.rb#643 + def type_params(mod); end + + private + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#414 + def can_alias?(mod, method); end + + # source://rbs/lib/rbs/prototype/runtime.rb#128 + def each_mixined_module(type_name, mod); end + + # source://rbs/lib/rbs/prototype/runtime.rb#137 + def each_mixined_module_one(type_name, mod); end +end + +# source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#211 +class RBS::Prototype::Runtime::DataGenerator < ::RBS::Prototype::Runtime::ValueObjectBase + private + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#227 + def add_decl_members(decl); end + + # def self.new: (untyped foo, untyped bar) -> instance + # | (foo: untyped, bar: untyped) -> instance + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#235 + def build_s_new; end + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#223 + def build_super_class; end + + class << self + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#212 + def generatable?(target); end + end +end + +# source://rbs/lib/rbs/prototype/runtime/helpers.rb#6 +module RBS::Prototype::Runtime::Helpers + private + + # source://rbs/lib/rbs/prototype/runtime/helpers.rb#19 + def const_name(const); end + + # source://rbs/lib/rbs/prototype/runtime/helpers.rb#15 + def const_name!(const); end + + # Returns the exact name & not compactly declared name + # + # source://rbs/lib/rbs/prototype/runtime/helpers.rb#10 + def only_name(mod); end + + # source://rbs/lib/rbs/prototype/runtime/helpers.rb#37 + def to_type_name(name, full_name: T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/runtime/helpers.rb#53 + def untyped; end +end + +# source://rbs/lib/rbs/prototype/runtime/reflection.rb#6 +module RBS::Prototype::Runtime::Reflection + class << self + # source://rbs/lib/rbs/prototype/runtime/reflection.rb#12 + def constants_of(mod, inherit = T.unsafe(nil)); end + + # source://rbs/lib/rbs/prototype/runtime/reflection.rb#7 + def object_class(value); end + end +end + +# source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#89 +class RBS::Prototype::Runtime::StructGenerator < ::RBS::Prototype::Runtime::ValueObjectBase + private + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#106 + def add_decl_members(decl); end + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#163 + def build_overload_for_keyword_arguments; end + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#149 + def build_overload_for_positional_arguments; end + + # def self.keyword_init?: () -> bool? + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#178 + def build_s_keyword_init_p; end + + # def self.new: (?untyped foo, ?untyped bar) -> instance + # | (?foo: untyped, ?bar: untyped) -> instance + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#115 + def build_s_new; end + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#102 + def build_super_class; end + + class << self + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#90 + def generatable?(target); end + end +end + +# source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#100 +RBS::Prototype::Runtime::StructGenerator::CAN_CALL_KEYWORD_INIT_P = T.let(T.unsafe(nil), TrueClass) + +# source://rbs/lib/rbs/prototype/runtime.rb#10 +class RBS::Prototype::Runtime::Todo + # @return [Todo] a new instance of Todo + # + # source://rbs/lib/rbs/prototype/runtime.rb#11 + def initialize(builder:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#42 + def skip_constant?(module_name:, name:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#33 + def skip_instance_method?(module_name:, method:, accessibility:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#15 + def skip_mixin?(type_name:, module_name:, mixin_class:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/prototype/runtime.rb#24 + def skip_singleton_method?(module_name:, method:, accessibility:); end + + private + + # source://rbs/lib/rbs/prototype/runtime.rb#49 + def mixin_decls(type_name); end +end + +# source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#8 +class RBS::Prototype::Runtime::ValueObjectBase + include ::RBS::Prototype::Runtime::Helpers + + # @return [ValueObjectBase] a new instance of ValueObjectBase + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#11 + def initialize(target_class); end + + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#15 + def build_decl; end + + private + + # attr_accessor foo: untyped + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#74 + def build_member_accessors(ast_members_class); end + + # def self.members: () -> [ :foo, :bar ] + # def members: () -> [ :foo, :bar ] + # + # source://rbs/lib/rbs/prototype/runtime/value_object_generator.rb#35 + def build_s_members; end +end + +# source://rbs/lib/rdoc_plugin/parser.rb#6 +module RBS::RDocPlugin; end + +# source://rbs/lib/rdoc_plugin/parser.rb#7 +class RBS::RDocPlugin::Parser + # @return [Parser] a new instance of Parser + # + # source://rbs/lib/rdoc_plugin/parser.rb#11 + def initialize(top_level, content); end + + # Returns the value of attribute content. + # + # source://rbs/lib/rdoc_plugin/parser.rb#9 + def content; end + + # Sets the attribute content + # + # @param value the value to set the attribute content to. + # + # source://rbs/lib/rdoc_plugin/parser.rb#9 + def content=(_arg0); end + + # source://rbs/lib/rdoc_plugin/parser.rb#94 + def parse_attr_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#53 + def parse_class_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#67 + def parse_constant_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#125 + def parse_extend_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#109 + def parse_include_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#24 + def parse_member(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#88 + def parse_method_alias_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#73 + def parse_method_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#60 + def parse_module_decl(decl:, context:, outer_name: T.unsafe(nil)); end + + # source://rbs/lib/rdoc_plugin/parser.rb#16 + def scan; end + + # Returns the value of attribute top_level. + # + # source://rbs/lib/rdoc_plugin/parser.rb#9 + def top_level; end + + # Sets the attribute top_level + # + # @param value the value to set the attribute top_level to. + # + # source://rbs/lib/rdoc_plugin/parser.rb#9 + def top_level=(_arg0); end + + private + + # source://rbs/lib/rdoc_plugin/parser.rb#149 + def comment_string(with_comment); end + + # source://rbs/lib/rdoc_plugin/parser.rb#143 + def construct_comment(context:, comment:); end + + # source://rbs/lib/rdoc_plugin/parser.rb#154 + def fully_qualified_name(outer_name:, decl:); end +end + +# source://rbs/lib/rbs/errors.rb#401 +class RBS::RecursiveAliasDefinitionError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [RecursiveAliasDefinitionError] a new instance of RecursiveAliasDefinitionError + # + # source://rbs/lib/rbs/errors.rb#407 + def initialize(type:, defs:); end + + # Returns the value of attribute defs. + # + # source://rbs/lib/rbs/errors.rb#405 + def defs; end + + # source://rbs/lib/rbs/errors.rb#414 + def location; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/errors.rb#404 + def type; end +end + +# source://rbs/lib/rbs/errors.rb#88 +class RBS::RecursiveAncestorError < ::RBS::DefinitionError + # @return [RecursiveAncestorError] a new instance of RecursiveAncestorError + # + # source://rbs/lib/rbs/errors.rb#92 + def initialize(ancestors:, location:); end + + # Returns the value of attribute ancestors. + # + # source://rbs/lib/rbs/errors.rb#89 + def ancestors; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#90 + def location; end + + class << self + # source://rbs/lib/rbs/errors.rb#112 + def check!(self_ancestor, ancestors:, location:); end + end +end + +# source://rbs/lib/rbs/errors.rb#460 +class RBS::RecursiveTypeAliasError < ::RBS::BaseError + include ::RBS::DetailedMessageable + + # @return [RecursiveTypeAliasError] a new instance of RecursiveTypeAliasError + # + # source://rbs/lib/rbs/errors.rb#466 + def initialize(alias_names:, location:); end + + # Returns the value of attribute alias_names. + # + # source://rbs/lib/rbs/errors.rb#463 + def alias_names; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#464 + def location; end + + # source://rbs/lib/rbs/errors.rb#473 + def name; end +end + +# source://rbs/lib/rbs/repository.rb#4 +class RBS::Repository + # @return [Repository] a new instance of Repository + # + # source://rbs/lib/rbs/repository.rb#74 + def initialize(no_stdlib: T.unsafe(nil)); end + + # source://rbs/lib/rbs/repository.rb#98 + def add(dir); end + + # Returns the value of attribute dirs. + # + # source://rbs/lib/rbs/repository.rb#71 + def dirs; end + + # Returns the value of attribute gems. + # + # source://rbs/lib/rbs/repository.rb#72 + def gems; end + + # source://rbs/lib/rbs/repository.rb#108 + def lookup(gem, version); end + + # source://rbs/lib/rbs/repository.rb#113 + def lookup_path(gem, version); end + + class << self + # source://rbs/lib/rbs/repository.rb#83 + def default; end + + # source://rbs/lib/rbs/repository.rb#87 + def find_best_version(version, candidates); end + end +end + +# source://rbs/lib/rbs/repository.rb#5 +RBS::Repository::DEFAULT_STDLIB_ROOT = T.let(T.unsafe(nil), Pathname) + +# source://rbs/lib/rbs/repository.rb#7 +class RBS::Repository::GemRBS + # @return [GemRBS] a new instance of GemRBS + # + # source://rbs/lib/rbs/repository.rb#11 + def initialize(name:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/repository.rb#64 + def empty?; end + + # source://rbs/lib/rbs/repository.rb#59 + def find_best_version(version); end + + # source://rbs/lib/rbs/repository.rb#54 + def latest_version; end + + # source://rbs/lib/rbs/repository.rb#22 + def load!; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/repository.rb#8 + def name; end + + # source://rbs/lib/rbs/repository.rb#49 + def oldest_version; end + + # Returns the value of attribute paths. + # + # source://rbs/lib/rbs/repository.rb#9 + def paths; end + + # source://rbs/lib/rbs/repository.rb#45 + def version_names; end + + # source://rbs/lib/rbs/repository.rb#17 + def versions; end +end + +# source://rbs/lib/rbs/repository.rb#69 +class RBS::Repository::VersionPath < ::Struct + def gem; end + def gem=(_); end + def path; end + def path=(_); end + def version; end + def version=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rbs/lib/rbs/resolver/constant_resolver.rb#4 +module RBS::Resolver; end + +# source://rbs/lib/rbs/resolver/constant_resolver.rb#5 +class RBS::Resolver::ConstantResolver + # @return [ConstantResolver] a new instance of ConstantResolver + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#88 + def initialize(builder:); end + + # Returns the value of attribute builder. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#85 + def builder; end + + # Returns the value of attribute child_constants_cache. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#86 + def child_constants_cache; end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#112 + def children(module_name); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#100 + def constants(context); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#178 + def constants_from_ancestors(module_name, constants:); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#163 + def constants_from_context(context, constants:); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#201 + def constants_itself(context, constants:); end + + # Returns the value of attribute context_constants_cache. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#86 + def context_constants_cache; end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#138 + def load_child_constants(name); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#122 + def load_context_constants(context); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#95 + def resolve(name, context:); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#108 + def resolve_child(module_name, name); end + + # Returns the value of attribute table. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#85 + def table; end +end + +# source://rbs/lib/rbs/resolver/constant_resolver.rb#6 +class RBS::Resolver::ConstantResolver::Table + # @return [Table] a new instance of Table + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#10 + def initialize(environment); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#63 + def children(name); end + + # Returns the value of attribute children_table. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#7 + def children_table; end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#67 + def constant(name); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#80 + def constant_of_constant(name, entry); end + + # source://rbs/lib/rbs/resolver/constant_resolver.rb#71 + def constant_of_module(name, entry); end + + # Returns the value of attribute constants_table. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#8 + def constants_table; end + + # Returns the value of attribute toplevel. + # + # source://rbs/lib/rbs/resolver/constant_resolver.rb#7 + def toplevel; end +end + +# source://rbs/lib/rbs/resolver/type_name_resolver.rb#5 +class RBS::Resolver::TypeNameResolver + # @return [TypeNameResolver] a new instance of TypeNameResolver + # + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#10 + def initialize(env); end + + # Returns the value of attribute all_names. + # + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#6 + def all_names; end + + # Returns the value of attribute cache. + # + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#7 + def cache; end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#8 + def env; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#84 + def has_name?(full_name); end + + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#51 + def partition(type_name); end + + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#28 + def resolve(type_name, context:); end + + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#69 + def resolve_in(head, context); end + + # source://rbs/lib/rbs/resolver/type_name_resolver.rb#21 + def try_cache(query); end +end + +# source://rbs/lib/rbs/substitution.rb#4 +class RBS::Substitution + # @return [Substitution] a new instance of Substitution + # + # source://rbs/lib/rbs/substitution.rb#12 + def initialize; end + + # source://rbs/lib/rbs/substitution.rb#66 + def +(other); end + + # source://rbs/lib/rbs/substitution.rb#37 + def [](ty); end + + # source://rbs/lib/rbs/substitution.rb#16 + def add(from:, to:); end + + # source://rbs/lib/rbs/substitution.rb#37 + def apply(ty); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/substitution.rb#8 + def empty?; end + + # Returns the value of attribute instance_type. + # + # source://rbs/lib/rbs/substitution.rb#6 + def instance_type; end + + # Sets the attribute instance_type + # + # @param value the value to set the attribute instance_type to. + # + # source://rbs/lib/rbs/substitution.rb#6 + def instance_type=(_arg0); end + + # Returns the value of attribute mapping. + # + # source://rbs/lib/rbs/substitution.rb#5 + def mapping; end + + # source://rbs/lib/rbs/substitution.rb#55 + def without(*vars); end + + class << self + # source://rbs/lib/rbs/substitution.rb#20 + def build(variables, types, instance_type: T.unsafe(nil), &block); end + end +end + +# source://rbs/lib/rbs/subtractor.rb#4 +class RBS::Subtractor + # @return [Subtractor] a new instance of Subtractor + # + # source://rbs/lib/rbs/subtractor.rb#5 + def initialize(minuend, subtrahend); end + + # source://rbs/lib/rbs/subtractor.rb#10 + def call(minuend = T.unsafe(nil), context: T.unsafe(nil)); end + + private + + # source://rbs/lib/rbs/subtractor.rb#177 + def absolute_typename(name, context:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#160 + def access_modifier?(decl); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#118 + def cvar_exist?(owner, name); end + + # source://rbs/lib/rbs/subtractor.rb#127 + def each_member(owner, &block); end + + # source://rbs/lib/rbs/subtractor.rb#48 + def filter_members(decl, context:); end + + # source://rbs/lib/rbs/subtractor.rb#148 + def filter_redundunt_access_modifiers(decls); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#106 + def ivar_exist?(owner, name, kind); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#60 + def member_exist?(owner, member, context:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#89 + def method_exist?(owner, method_name, kind); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/subtractor.rb#137 + def mixin_exist?(owner, mixin, context:); end + + # source://rbs/lib/rbs/subtractor.rb#186 + def typename_candidates(name, context:); end + + # source://rbs/lib/rbs/subtractor.rb#164 + def update_decl(decl, members:); end +end + +# source://rbs/lib/rbs/errors.rb#321 +class RBS::SuperclassMismatchError < ::RBS::DefinitionError + # @return [SuperclassMismatchError] a new instance of SuperclassMismatchError + # + # source://rbs/lib/rbs/errors.rb#325 + def initialize(name:, entry:); end + + # Returns the value of attribute entry. + # + # source://rbs/lib/rbs/errors.rb#323 + def entry; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/errors.rb#322 + def name; end +end + +# source://rbs/lib/rbs/type_alias_dependency.rb#4 +class RBS::TypeAliasDependency + # @return [TypeAliasDependency] a new instance of TypeAliasDependency + # + # source://rbs/lib/rbs/type_alias_dependency.rb#14 + def initialize(env:); end + + # source://rbs/lib/rbs/type_alias_dependency.rb#27 + def build_dependencies; end + + # Check if an alias type definition is circular & prohibited + # + # @return [Boolean] + # + # source://rbs/lib/rbs/type_alias_dependency.rb#19 + def circular_definition?(alias_name); end + + # A hash which stores the transitive closure + # of the directed graph + # + # source://rbs/lib/rbs/type_alias_dependency.rb#12 + def dependencies; end + + # source://rbs/lib/rbs/type_alias_dependency.rb#57 + def dependencies_of(name); end + + # Direct dependencies corresponds to a directed graph + # with vertices as types and directions based on assignment of types + # + # source://rbs/lib/rbs/type_alias_dependency.rb#9 + def direct_dependencies; end + + # source://rbs/lib/rbs/type_alias_dependency.rb#52 + def direct_dependencies_of(name); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/type_alias_dependency.rb#5 + def env; end + + # source://rbs/lib/rbs/type_alias_dependency.rb#43 + def transitive_closure; end + + private + + # Recursive function to construct transitive closure + # + # source://rbs/lib/rbs/type_alias_dependency.rb#81 + def dependency(start, vertex, nested = T.unsafe(nil)); end + + # Constructs directed graph recursively + # + # source://rbs/lib/rbs/type_alias_dependency.rb#65 + def direct_dependency(type, result = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/type_alias_regularity.rb#4 +class RBS::TypeAliasRegularity + # @return [TypeAliasRegularity] a new instance of TypeAliasRegularity + # + # source://rbs/lib/rbs/type_alias_regularity.rb#16 + def initialize(env:); end + + # source://rbs/lib/rbs/type_alias_regularity.rb#61 + def build_alias_type(name); end + + # Returns the value of attribute builder. + # + # source://rbs/lib/rbs/type_alias_regularity.rb#14 + def builder; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_alias_regularity.rb#69 + def compatible_args?(args1, args2); end + + # Returns the value of attribute diagnostics. + # + # source://rbs/lib/rbs/type_alias_regularity.rb#14 + def diagnostics; end + + # source://rbs/lib/rbs/type_alias_regularity.rb#110 + def each_alias_type(type, &block); end + + # source://rbs/lib/rbs/type_alias_regularity.rb#83 + def each_mutual_alias_defs(&block); end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/type_alias_regularity.rb#14 + def env; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_alias_regularity.rb#79 + def nonregular?(type_name); end + + # source://rbs/lib/rbs/type_alias_regularity.rb#22 + def validate; end + + # source://rbs/lib/rbs/type_alias_regularity.rb#39 + def validate_alias_type(alias_type, names, types); end + + class << self + # source://rbs/lib/rbs/type_alias_regularity.rb#120 + def validate(env:); end + end +end + +# source://rbs/lib/rbs/type_alias_regularity.rb#5 +class RBS::TypeAliasRegularity::Diagnostic + # @return [Diagnostic] a new instance of Diagnostic + # + # source://rbs/lib/rbs/type_alias_regularity.rb#8 + def initialize(type_name:, nonregular_type:); end + + # Returns the value of attribute nonregular_type. + # + # source://rbs/lib/rbs/type_alias_regularity.rb#6 + def nonregular_type; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/type_alias_regularity.rb#6 + def type_name; end +end + +# source://rbs/lib/rbs/type_name.rb#4 +class RBS::TypeName + # @return [TypeName] a new instance of TypeName + # + # source://rbs/lib/rbs/type_name.rb#9 + def initialize(namespace:, name:); end + + # source://rbs/lib/rbs/type_name.rb#79 + def +(other); end + + # source://rbs/lib/rbs/type_name.rb#25 + def ==(other); end + + # source://rbs/lib/rbs/type_name.rb#55 + def absolute!; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_name.rb#59 + def absolute?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_name.rb#51 + def alias?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_name.rb#47 + def class?; end + + # source://rbs/lib/rbs/type_name.rb#25 + def eql?(other); end + + # source://rbs/lib/rbs/type_name.rb#31 + def hash; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/type_name.rb#67 + def interface?; end + + # Returns the value of attribute kind. + # + # source://rbs/lib/rbs/type_name.rb#7 + def kind; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/type_name.rb#6 + def name; end + + # Returns the value of attribute namespace. + # + # source://rbs/lib/rbs/type_name.rb#5 + def namespace; end + + # source://rbs/lib/rbs/type_name.rb#63 + def relative!; end + + # source://rbs/lib/rbs/type_name.rb#75 + def split; end + + # source://rbs/lib/rbs/type_name.rb#39 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/type_name.rb#43 + def to_namespace; end + + # source://rbs/lib/rbs/type_name.rb#35 + def to_s; end + + # source://rbs/lib/rbs/type_name.rb#71 + def with_prefix(namespace); end +end + +# source://rbs/lib/rbs/types.rb#4 +module RBS::Types; end + +# source://rbs/lib/rbs/types.rb#394 +class RBS::Types::Alias + include ::RBS::Types::Application + + # @return [Alias] a new instance of Alias + # + # source://rbs/lib/rbs/types.rb#399 + def initialize(name:, args:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#395 + def location; end + + # source://rbs/lib/rbs/types.rb#421 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#413 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#409 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#405 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/types.rb#252 +module RBS::Types::Application + # source://rbs/lib/rbs/types.rb#256 + def ==(other); end + + # Returns the value of attribute args. + # + # source://rbs/lib/rbs/types.rb#254 + def args; end + + # source://rbs/lib/rbs/types.rb#282 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#256 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#266 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#294 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#290 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#262 + def hash; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/types.rb#253 + def name; end + + # source://rbs/lib/rbs/types.rb#274 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#298 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#41 +module RBS::Types::Bases; end + +# source://rbs/lib/rbs/types.rb#109 +class RBS::Types::Bases::Any < ::RBS::Types::Bases::Base + # source://rbs/lib/rbs/types.rb#110 + def to_s(level = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#114 + def todo!; end +end + +# source://rbs/lib/rbs/types.rb#42 +class RBS::Types::Bases::Base + include ::RBS::Types::NoFreeVariables + include ::RBS::Types::NoSubst + include ::RBS::Types::EmptyEachType + include ::RBS::Types::NoTypeName + + # @return [Base] a new instance of Base + # + # source://rbs/lib/rbs/types.rb#45 + def initialize(location:); end + + # source://rbs/lib/rbs/types.rb#49 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#49 + def eql?(other); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#98 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#94 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#53 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#43 + def location; end + + # source://rbs/lib/rbs/types.rb#64 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#69 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#102 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#107 +class RBS::Types::Bases::Bool < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#121 +class RBS::Types::Bases::Bottom < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#128 +class RBS::Types::Bases::Class < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#123 +class RBS::Types::Bases::Instance < ::RBS::Types::Bases::Base + # source://rbs/lib/rbs/types.rb#124 + def sub(s); end +end + +# source://rbs/lib/rbs/types.rb#119 +class RBS::Types::Bases::Nil < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#122 +class RBS::Types::Bases::Self < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#120 +class RBS::Types::Bases::Top < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#108 +class RBS::Types::Bases::Void < ::RBS::Types::Bases::Base; end + +# source://rbs/lib/rbs/types.rb#1283 +class RBS::Types::Block + # @return [Block] a new instance of Block + # + # source://rbs/lib/rbs/types.rb#1288 + def initialize(type:, required:, self_type: T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1294 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#1317 + def map_type(&block); end + + # Returns the value of attribute required. + # + # source://rbs/lib/rbs/types.rb#1285 + def required; end + + # Returns the value of attribute self_type. + # + # source://rbs/lib/rbs/types.rb#1286 + def self_type; end + + # source://rbs/lib/rbs/types.rb#1309 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#1301 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/types.rb#1284 + def type; end +end + +# source://rbs/lib/rbs/types.rb#352 +class RBS::Types::ClassInstance + include ::RBS::Types::Application + + # @return [ClassInstance] a new instance of ClassInstance + # + # source://rbs/lib/rbs/types.rb#357 + def initialize(name:, args:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#353 + def location; end + + # source://rbs/lib/rbs/types.rb#381 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#373 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#367 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#363 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/types.rb#200 +class RBS::Types::ClassSingleton + include ::RBS::Types::NoFreeVariables + include ::RBS::Types::NoSubst + include ::RBS::Types::EmptyEachType + + # @return [ClassSingleton] a new instance of ClassSingleton + # + # source://rbs/lib/rbs/types.rb#204 + def initialize(name:, location:); end + + # source://rbs/lib/rbs/types.rb#209 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#209 + def eql?(other); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#243 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#239 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#215 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#202 + def location; end + + # source://rbs/lib/rbs/types.rb#232 + def map_type_name; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/types.rb#201 + def name; end + + # source://rbs/lib/rbs/types.rb#222 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#226 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#247 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#23 +module RBS::Types::EmptyEachType + # source://rbs/lib/rbs/types.rb#24 + def each_type; end + + # source://rbs/lib/rbs/types.rb#32 + def map_type(&block); end +end + +# source://rbs/lib/rbs/types.rb#871 +class RBS::Types::Function + # @return [Function] a new instance of Function + # + # source://rbs/lib/rbs/types.rb#927 + def initialize(required_positionals:, optional_positionals:, rest_positionals:, trailing_positionals:, required_keywords:, optional_keywords:, rest_keywords:, return_type:); end + + # source://rbs/lib/rbs/types.rb#938 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#1009 + def amap(array, &block); end + + # source://rbs/lib/rbs/types.rb#1146 + def drop_head; end + + # source://rbs/lib/rbs/types.rb#1163 + def drop_tail; end + + # source://rbs/lib/rbs/types.rb#1046 + def each_param(&block); end + + # source://rbs/lib/rbs/types.rb#1031 + def each_type; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1117 + def empty?; end + + # source://rbs/lib/rbs/types.rb#938 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#964 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1188 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1176 + def has_keyword?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1184 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#952 + def hash; end + + # source://rbs/lib/rbs/types.rb#1017 + def hmapv(hash, &block); end + + # source://rbs/lib/rbs/types.rb#992 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#1025 + def map_type_name(&block); end + + # Returns the value of attribute optional_keywords. + # + # source://rbs/lib/rbs/types.rb#923 + def optional_keywords; end + + # Returns the value of attribute optional_positionals. + # + # source://rbs/lib/rbs/types.rb#919 + def optional_positionals; end + + # source://rbs/lib/rbs/types.rb#1127 + def param_to_s; end + + # Returns the value of attribute required_keywords. + # + # source://rbs/lib/rbs/types.rb#922 + def required_keywords; end + + # Returns the value of attribute required_positionals. + # + # source://rbs/lib/rbs/types.rb#918 + def required_positionals; end + + # Returns the value of attribute rest_keywords. + # + # source://rbs/lib/rbs/types.rb#924 + def rest_keywords; end + + # Returns the value of attribute rest_positionals. + # + # source://rbs/lib/rbs/types.rb#920 + def rest_positionals; end + + # source://rbs/lib/rbs/types.rb#1142 + def return_to_s; end + + # Returns the value of attribute return_type. + # + # source://rbs/lib/rbs/types.rb#925 + def return_type; end + + # source://rbs/lib/rbs/types.rb#1073 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#1060 + def to_json(state = T.unsafe(nil)); end + + # Returns the value of attribute trailing_positionals. + # + # source://rbs/lib/rbs/types.rb#921 + def trailing_positionals; end + + # source://rbs/lib/rbs/types.rb#1103 + def update(required_positionals: T.unsafe(nil), optional_positionals: T.unsafe(nil), rest_positionals: T.unsafe(nil), trailing_positionals: T.unsafe(nil), required_keywords: T.unsafe(nil), optional_keywords: T.unsafe(nil), rest_keywords: T.unsafe(nil), return_type: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1192 + def with_nonreturn_void?; end + + # source://rbs/lib/rbs/types.rb#1090 + def with_return_type(type); end + + class << self + # source://rbs/lib/rbs/types.rb#1077 + def empty(return_type); end + end +end + +# source://rbs/lib/rbs/types.rb#872 +class RBS::Types::Function::Param + # @return [Param] a new instance of Param + # + # source://rbs/lib/rbs/types.rb#877 + def initialize(type:, name:, location: T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#883 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#883 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#889 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#875 + def location; end + + # source://rbs/lib/rbs/types.rb#893 + def map_type(&block); end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/types.rb#874 + def name; end + + # source://rbs/lib/rbs/types.rb#901 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#905 + def to_s; end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/types.rb#873 + def type; end +end + +# source://rbs/lib/rbs/types.rb#310 +class RBS::Types::Interface + include ::RBS::Types::Application + + # @return [Interface] a new instance of Interface + # + # source://rbs/lib/rbs/types.rb#315 + def initialize(name:, args:, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#311 + def location; end + + # source://rbs/lib/rbs/types.rb#339 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#331 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#325 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#321 + def to_json(state = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/types.rb#790 +class RBS::Types::Intersection + # @return [Intersection] a new instance of Intersection + # + # source://rbs/lib/rbs/types.rb#794 + def initialize(types:, location:); end + + # source://rbs/lib/rbs/types.rb#799 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#835 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#799 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#809 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#862 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#858 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#805 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#792 + def location; end + + # source://rbs/lib/rbs/types.rb#843 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#851 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#821 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#817 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#826 + def to_s(level = T.unsafe(nil)); end + + # Returns the value of attribute types. + # + # source://rbs/lib/rbs/types.rb#791 + def types; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#866 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#1458 +class RBS::Types::Literal + include ::RBS::Types::NoFreeVariables + include ::RBS::Types::NoSubst + include ::RBS::Types::EmptyEachType + include ::RBS::Types::NoTypeName + + # @return [Literal] a new instance of Literal + # + # source://rbs/lib/rbs/types.rb#1462 + def initialize(literal:, location:); end + + # source://rbs/lib/rbs/types.rb#1467 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#1467 + def eql?(other); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1494 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1490 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#1473 + def hash; end + + # Returns the value of attribute literal. + # + # source://rbs/lib/rbs/types.rb#1459 + def literal; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#1460 + def location; end + + # source://rbs/lib/rbs/types.rb#1482 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1486 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1498 + def with_nonreturn_void?; end + + class << self + # source://rbs/lib/rbs/types.rb#1518 + def unescape_string(string, is_double_quote); end + end +end + +# source://rbs/lib/rbs/types.rb#1502 +RBS::Types::Literal::TABLE = T.let(T.unsafe(nil), Hash) + +# source://rbs/lib/rbs/types.rb#5 +module RBS::Types::NoFreeVariables + # source://rbs/lib/rbs/types.rb#6 + def free_variables(set = T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/types.rb#11 +module RBS::Types::NoSubst + # source://rbs/lib/rbs/types.rb#12 + def sub(s); end +end + +# source://rbs/lib/rbs/types.rb#17 +module RBS::Types::NoTypeName + # source://rbs/lib/rbs/types.rb#18 + def map_type_name; end +end + +# source://rbs/lib/rbs/types.rb#626 +class RBS::Types::Optional + # @return [Optional] a new instance of Optional + # + # source://rbs/lib/rbs/types.rb#630 + def initialize(type:, location:); end + + # source://rbs/lib/rbs/types.rb#635 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#671 + def each_type; end + + # source://rbs/lib/rbs/types.rb#635 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#645 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#701 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#697 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#641 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#628 + def location; end + + # source://rbs/lib/rbs/types.rb#686 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#679 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#653 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#649 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#657 + def to_s(level = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/types.rb#627 + def type; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#705 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#1338 +class RBS::Types::Proc + # @return [Proc] a new instance of Proc + # + # source://rbs/lib/rbs/types.rb#1344 + def initialize(location:, type:, block:, self_type: T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1351 + def ==(other); end + + # Returns the value of attribute block. + # + # source://rbs/lib/rbs/types.rb#1340 + def block; end + + # source://rbs/lib/rbs/types.rb#1403 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#1351 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#1361 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1441 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1437 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#1357 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#1342 + def location; end + + # source://rbs/lib/rbs/types.rb#1424 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#1415 + def map_type_name(&block); end + + # Returns the value of attribute self_type. + # + # source://rbs/lib/rbs/types.rb#1341 + def self_type; end + + # source://rbs/lib/rbs/types.rb#1378 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#1368 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1387 + def to_s(level = T.unsafe(nil)); end + + # Returns the value of attribute type. + # + # source://rbs/lib/rbs/types.rb#1339 + def type; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1445 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#517 +class RBS::Types::Record + # @return [Record] a new instance of Record + # + # source://rbs/lib/rbs/types.rb#521 + def initialize(location:, all_fields: T.unsafe(nil), fields: T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#538 + def ==(other); end + + # Returns the value of attribute all_fields. + # + # source://rbs/lib/rbs/types.rb#518 + def all_fields; end + + # source://rbs/lib/rbs/types.rb#586 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#538 + def eql?(other); end + + # Returns the value of attribute fields. + # + # source://rbs/lib/rbs/types.rb#518 + def fields; end + + # source://rbs/lib/rbs/types.rb#548 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#617 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#613 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#544 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#519 + def location; end + + # source://rbs/lib/rbs/types.rb#602 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#595 + def map_type_name(&block); end + + # Returns the value of attribute optional_fields. + # + # source://rbs/lib/rbs/types.rb#518 + def optional_fields; end + + # source://rbs/lib/rbs/types.rb#563 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#559 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#570 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#621 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#1326 +module RBS::Types::SelfTypeBindingHelper + private + + # source://rbs/lib/rbs/types.rb#1329 + def self_type_binding_to_s(t); end + + class << self + # source://rbs/lib/rbs/types.rb#1329 + def self_type_binding_to_s(t); end + end +end + +# source://rbs/lib/rbs/types.rb#434 +class RBS::Types::Tuple + # @return [Tuple] a new instance of Tuple + # + # source://rbs/lib/rbs/types.rb#438 + def initialize(types:, location:); end + + # source://rbs/lib/rbs/types.rb#443 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#478 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#443 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#453 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#508 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#504 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#449 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#436 + def location; end + + # source://rbs/lib/rbs/types.rb#493 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#486 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#465 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#461 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#470 + def to_s(level = T.unsafe(nil)); end + + # Returns the value of attribute types. + # + # source://rbs/lib/rbs/types.rb#435 + def types; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#512 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#710 +class RBS::Types::Union + # @return [Union] a new instance of Union + # + # source://rbs/lib/rbs/types.rb#714 + def initialize(types:, location:); end + + # source://rbs/lib/rbs/types.rb#719 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#754 + def each_type(&block); end + + # source://rbs/lib/rbs/types.rb#719 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#729 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#781 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#777 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#725 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#712 + def location; end + + # source://rbs/lib/rbs/types.rb#762 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#770 + def map_type_name(&block); end + + # source://rbs/lib/rbs/types.rb#741 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#737 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#746 + def to_s(level = T.unsafe(nil)); end + + # Returns the value of attribute types. + # + # source://rbs/lib/rbs/types.rb#711 + def types; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#785 + def with_nonreturn_void?; end +end + +# source://rbs/lib/rbs/types.rb#1205 +class RBS::Types::UntypedFunction + # @return [UntypedFunction] a new instance of UntypedFunction + # + # source://rbs/lib/rbs/types.rb#1208 + def initialize(return_type:); end + + # source://rbs/lib/rbs/types.rb#1232 + def each_param(&block); end + + # source://rbs/lib/rbs/types.rb#1224 + def each_type(&block); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1258 + def empty?; end + + # source://rbs/lib/rbs/types.rb#1212 + def free_variables(acc = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1266 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#1262 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#1216 + def map_type(&block); end + + # source://rbs/lib/rbs/types.rb#1274 + def param_to_s; end + + # source://rbs/lib/rbs/types.rb#1278 + def return_to_s; end + + # Returns the value of attribute return_type. + # + # source://rbs/lib/rbs/types.rb#1206 + def return_type; end + + # source://rbs/lib/rbs/types.rb#1246 + def sub(subst); end + + # source://rbs/lib/rbs/types.rb#1240 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1254 + def update(return_type: T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#1270 + def with_nonreturn_void; end + + # source://rbs/lib/rbs/types.rb#1250 + def with_return_type(ty); end +end + +# source://rbs/lib/rbs/types.rb#131 +class RBS::Types::Variable + include ::RBS::Types::NoTypeName + include ::RBS::Types::EmptyEachType + + # @return [Variable] a new instance of Variable + # + # source://rbs/lib/rbs/types.rb#137 + def initialize(name:, location:); end + + # source://rbs/lib/rbs/types.rb#142 + def ==(other); end + + # source://rbs/lib/rbs/types.rb#142 + def eql?(other); end + + # source://rbs/lib/rbs/types.rb#152 + def free_variables(set = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#191 + def has_classish_type?; end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#187 + def has_self_type?; end + + # source://rbs/lib/rbs/types.rb#148 + def hash; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/types.rb#133 + def location; end + + # Returns the value of attribute name. + # + # source://rbs/lib/rbs/types.rb#132 + def name; end + + # source://rbs/lib/rbs/types.rb#162 + def sub(s); end + + # source://rbs/lib/rbs/types.rb#158 + def to_json(state = T.unsafe(nil)); end + + # source://rbs/lib/rbs/types.rb#181 + def to_s(level = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/types.rb#195 + def with_nonreturn_void?; end + + class << self + # source://rbs/lib/rbs/types.rb#166 + def build(v); end + + # source://rbs/lib/rbs/types.rb#176 + def fresh(v = T.unsafe(nil)); end + end +end + +# source://rbs/lib/rbs/errors.rb#303 +class RBS::UnknownMethodAliasError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [UnknownMethodAliasError] a new instance of UnknownMethodAliasError + # + # source://rbs/lib/rbs/errors.rb#311 + def initialize(type_name:, original_name:, aliased_name:, location:); end + + # Returns the value of attribute aliased_name. + # + # source://rbs/lib/rbs/errors.rb#308 + def aliased_name; end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#309 + def location; end + + # Returns the value of attribute original_name. + # + # source://rbs/lib/rbs/errors.rb#307 + def original_name; end + + # Returns the value of attribute type_name. + # + # source://rbs/lib/rbs/errors.rb#306 + def type_name; end +end + +# source://rbs/lib/rbs/version.rb#4 +RBS::VERSION = T.let(T.unsafe(nil), String) + +# source://rbs/lib/rbs/validator.rb#4 +class RBS::Validator + # @return [Validator] a new instance of Validator + # + # source://rbs/lib/rbs/validator.rb#9 + def initialize(env:, resolver:); end + + # source://rbs/lib/rbs/validator.rb#15 + def absolute_type(type, context:, &block); end + + # Returns the value of attribute definition_builder. + # + # source://rbs/lib/rbs/validator.rb#7 + def definition_builder; end + + # Returns the value of attribute env. + # + # source://rbs/lib/rbs/validator.rb#5 + def env; end + + # Returns the value of attribute resolver. + # + # source://rbs/lib/rbs/validator.rb#6 + def resolver; end + + # source://rbs/lib/rbs/validator.rb#172 + def type_alias_dependency; end + + # source://rbs/lib/rbs/validator.rb#176 + def type_alias_regularity; end + + # source://rbs/lib/rbs/validator.rb#152 + def validate_class_alias(entry:); end + + # source://rbs/lib/rbs/validator.rb#102 + def validate_method_definition(method_def, type_name:); end + + # Validates presence of the relative type, and application arity match. + # + # source://rbs/lib/rbs/validator.rb#22 + def validate_type(type, context:); end + + # source://rbs/lib/rbs/validator.rb#61 + def validate_type_alias(entry:); end + + # source://rbs/lib/rbs/validator.rb#118 + def validate_type_params(params, type_name:, location:, method_name: T.unsafe(nil)); end +end + +# source://rbs/lib/rbs/variance_calculator.rb#4 +class RBS::VarianceCalculator + # @return [VarianceCalculator] a new instance of VarianceCalculator + # + # source://rbs/lib/rbs/variance_calculator.rb#78 + def initialize(builder:); end + + # Returns the value of attribute builder. + # + # source://rbs/lib/rbs/variance_calculator.rb#76 + def builder; end + + # source://rbs/lib/rbs/variance_calculator.rb#82 + def env; end + + # source://rbs/lib/rbs/variance_calculator.rb#169 + def function(type, result:, context:); end + + # source://rbs/lib/rbs/variance_calculator.rb#98 + def in_inherit(name:, args:, variables:); end + + # source://rbs/lib/rbs/variance_calculator.rb#86 + def in_method_type(method_type:, variables:); end + + # source://rbs/lib/rbs/variance_calculator.rb#110 + def in_type_alias(name:); end + + # source://rbs/lib/rbs/variance_calculator.rb#176 + def negate(variance); end + + # source://rbs/lib/rbs/variance_calculator.rb#121 + def type(type, result:, context:); end +end + +# source://rbs/lib/rbs/variance_calculator.rb#5 +class RBS::VarianceCalculator::Result + # @return [Result] a new instance of Result + # + # source://rbs/lib/rbs/variance_calculator.rb#8 + def initialize(variables:); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/variance_calculator.rb#45 + def compatible?(var, with_annotation:); end + + # source://rbs/lib/rbs/variance_calculator.rb#24 + def contravariant(x); end + + # source://rbs/lib/rbs/variance_calculator.rb#15 + def covariant(x); end + + # source://rbs/lib/rbs/variance_calculator.rb#37 + def each(&block); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/variance_calculator.rb#41 + def include?(name); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/variance_calculator.rb#60 + def incompatible?(params); end + + # source://rbs/lib/rbs/variance_calculator.rb#33 + def invariant(x); end + + # Returns the value of attribute result. + # + # source://rbs/lib/rbs/variance_calculator.rb#6 + def result; end +end + +# source://rbs/lib/rbs/vendorer.rb#4 +class RBS::Vendorer + # @return [Vendorer] a new instance of Vendorer + # + # source://rbs/lib/rbs/vendorer.rb#8 + def initialize(vendor_dir:, loader:); end + + # source://rbs/lib/rbs/vendorer.rb#21 + def clean!; end + + # source://rbs/lib/rbs/vendorer.rb#28 + def copy!; end + + # source://rbs/lib/rbs/vendorer.rb#13 + def ensure_dir; end + + # Returns the value of attribute loader. + # + # source://rbs/lib/rbs/vendorer.rb#6 + def loader; end + + # Returns the value of attribute vendor_dir. + # + # source://rbs/lib/rbs/vendorer.rb#5 + def vendor_dir; end +end + +# source://rbs/lib/rbs/errors.rb#547 +class RBS::WillSyntaxError < ::RBS::DefinitionError + include ::RBS::DetailedMessageable + + # @return [WillSyntaxError] a new instance of WillSyntaxError + # + # source://rbs/lib/rbs/errors.rb#552 + def initialize(message, location:); end + + # Returns the value of attribute location. + # + # source://rbs/lib/rbs/errors.rb#550 + def location; end +end + +# source://rbs/lib/rbs/writer.rb#4 +class RBS::Writer + # @return [Writer] a new instance of Writer + # + # source://rbs/lib/rbs/writer.rb#8 + def initialize(out:); end + + # source://rbs/lib/rbs/writer.rb#361 + def attribute(kind, attr); end + + # source://rbs/lib/rbs/writer.rb#42 + def format_annotation(annotation); end + + # source://rbs/lib/rbs/writer.rb#23 + def indent(size = T.unsafe(nil)); end + + # Returns the value of attribute indentation. + # + # source://rbs/lib/rbs/writer.rb#6 + def indentation; end + + # source://rbs/lib/rbs/writer.rb#288 + def method_name(name); end + + # source://rbs/lib/rbs/writer.rb#214 + def name_and_args(name, args); end + + # source://rbs/lib/rbs/writer.rb#202 + def name_and_params(name, params); end + + # Returns the value of attribute out. + # + # source://rbs/lib/rbs/writer.rb#5 + def out; end + + # source://rbs/lib/rbs/writer.rb#30 + def prefix; end + + # source://rbs/lib/rbs/writer.rb#18 + def preserve!(preserve: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rbs/lib/rbs/writer.rb#14 + def preserve?; end + + # source://rbs/lib/rbs/writer.rb#391 + def preserve_empty_line(prev, decl); end + + # source://rbs/lib/rbs/writer.rb#224 + def put_lines(lines, leading_spaces:); end + + # source://rbs/lib/rbs/writer.rb#34 + def puts(string = T.unsafe(nil)); end + + # source://rbs/lib/rbs/writer.rb#79 + def write(contents); end + + # source://rbs/lib/rbs/writer.rb#60 + def write_annotation(annotations); end + + # source://rbs/lib/rbs/writer.rb#66 + def write_comment(comment); end + + # source://rbs/lib/rbs/writer.rb#114 + def write_decl(decl); end + + # source://rbs/lib/rbs/writer.rb#309 + def write_def(member); end + + # source://rbs/lib/rbs/writer.rb#97 + def write_directive(dir); end + + # source://rbs/lib/rbs/writer.rb#301 + def write_loc_source(located); end + + # source://rbs/lib/rbs/writer.rb#234 + def write_member(member); end +end + +# source://rbs/lib/rdoc/discover.rb#8 +class RDoc::Parser::RBS < ::RDoc::Parser + # source://rbs/lib/rdoc/discover.rb#10 + def scan; end +end diff --git a/sorbet/rbi/gems/ruby-lsp@0.17.2.rbi b/sorbet/rbi/gems/ruby-lsp@0.17.4.rbi similarity index 87% rename from sorbet/rbi/gems/ruby-lsp@0.17.2.rbi rename to sorbet/rbi/gems/ruby-lsp@0.17.4.rbi index 50a3f6ab..4a79d937 100644 --- a/sorbet/rbi/gems/ruby-lsp@0.17.2.rbi +++ b/sorbet/rbi/gems/ruby-lsp@0.17.4.rbi @@ -7,7 +7,7 @@ # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/indexable_path.rb#4 module RubyIndexer class << self - # source://ruby-lsp/lib/ruby_indexer/ruby_indexer.rb#22 + # source://ruby-lsp/lib/ruby_indexer/ruby_indexer.rb#23 sig { returns(::RubyIndexer::Configuration) } def configuration; end end @@ -49,7 +49,7 @@ RubyIndexer::Configuration::CONFIGURATION_SCHEMA = T.let(T.unsafe(nil), Hash) # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#5 class RubyIndexer::DeclarationListener - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#11 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#14 sig do params( index: ::RubyIndexer::Index, @@ -60,97 +60,109 @@ class RubyIndexer::DeclarationListener end def initialize(index, dispatcher, parse_result, file_path); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#200 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#361 + sig { params(node: ::Prism::AliasMethodNode).void } + def on_alias_method_node_enter(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#250 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#224 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#276 sig { params(node: ::Prism::CallNode).void } def on_call_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#59 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#65 sig { params(node: ::Prism::ClassNode).void } def on_class_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#87 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#106 sig { params(node: ::Prism::ClassNode).void } def on_class_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#188 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#238 sig { params(node: ::Prism::ConstantAndWriteNode).void } def on_constant_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#194 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#244 sig { params(node: ::Prism::ConstantOperatorWriteNode).void } def on_constant_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#182 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#232 sig { params(node: ::Prism::ConstantOrWriteNode).void } def on_constant_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#166 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#216 sig { params(node: ::Prism::ConstantPathAndWriteNode).void } def on_constant_path_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#156 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#206 sig { params(node: ::Prism::ConstantPathOperatorWriteNode).void } def on_constant_path_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#146 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#196 sig { params(node: ::Prism::ConstantPathOrWriteNode).void } def on_constant_path_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#136 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#186 sig { params(node: ::Prism::ConstantPathWriteNode).void } def on_constant_path_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#176 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#226 sig { params(node: ::Prism::ConstantWriteNode).void } def on_constant_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#237 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#289 sig { params(node: ::Prism::DefNode).void } def on_def_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#267 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#326 sig { params(node: ::Prism::DefNode).void } def on_def_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#286 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#341 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#300 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#346 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#314 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#351 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#328 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#356 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#272 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#336 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#94 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#113 sig { params(node: ::Prism::ModuleNode).void } def on_module_node_enter(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#109 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#128 sig { params(node: ::Prism::ModuleNode).void } def on_module_node_leave(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#116 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#166 sig { params(node: ::Prism::MultiWriteNode).void } def on_multi_write_node_enter(node); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#135 + sig { params(node: ::Prism::SingletonClassNode).void } + def on_singleton_class_node_enter(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#159 + sig { params(node: ::Prism::SingletonClassNode).void } + def on_singleton_class_node_leave(node); end + private - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#386 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#482 sig do params( node: T.any(::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathTargetNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantTargetNode, ::Prism::ConstantWriteNode), @@ -160,31 +172,66 @@ class RubyIndexer::DeclarationListener end def add_constant(node, name, value = T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#409 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#507 sig { params(node: ::Prism::Node).returns(T::Array[::String]) } def collect_comments(node); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#502 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#605 sig { returns(::RubyIndexer::Entry::Visibility) } def current_visibility; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#435 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#533 sig { params(name: ::String).returns(::String) } def fully_qualify_name(name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#444 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#426 + sig { params(node: ::Prism::CallNode).void } + def handle_alias_method(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#542 sig { params(node: ::Prism::CallNode, reader: T::Boolean, writer: T::Boolean).void } def handle_attribute(node, reader:, writer:); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#475 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#390 + sig do + params( + node: T.any(::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableTargetNode, ::Prism::InstanceVariableWriteNode), + loc: ::Prism::Location + ).void + end + def handle_instance_variable(node, loc); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#578 sig { params(node: ::Prism::CallNode, operation: ::Symbol).void } def handle_module_operation(node, operation); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#344 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#401 sig { params(node: ::Prism::CallNode).void } def handle_private_constant(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#610 + sig do + params( + parameters_node: T.nilable(::Prism::ParametersNode) + ).returns(T::Array[::RubyIndexer::Entry::Parameter]) + end + def list_params(parameters_node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#669 + sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::Symbol)) } + def parameter_name(node); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#694 + sig { returns(T.nilable(::RubyIndexer::Entry::Class)) } + def singleton_klass; end end +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#9 +RubyIndexer::DeclarationListener::BASIC_OBJECT_NESTING = T.let(T.unsafe(nil), Array) + +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/declaration_listener.rb#8 +RubyIndexer::DeclarationListener::OBJECT_NESTING = T.let(T.unsafe(nil), Array) + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#5 class RubyIndexer::Entry # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#39 @@ -232,36 +279,36 @@ class RubyIndexer::Entry def visibility=(_arg0); end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#270 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#295 class RubyIndexer::Entry::Accessor < ::RubyIndexer::Entry::Member - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#274 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#299 sig { override.returns(T::Array[::RubyIndexer::Entry::Parameter]) } def parameters; end end # Alias represents a resolved alias, which points to an existing constant target # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#438 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#367 class RubyIndexer::Entry::Alias < ::RubyIndexer::Entry - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#445 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#374 sig { params(target: ::String, unresolved_alias: ::RubyIndexer::Entry::UnresolvedAlias).void } def initialize(target, unresolved_alias); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#442 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#371 sig { returns(::String) } def target; end end # A block method parameter, e.g. `def foo(&block)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#232 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#251 class RubyIndexer::Entry::BlockParameter < ::RubyIndexer::Entry::Parameter - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#236 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#255 sig { override.returns(::Symbol) } def decorated_name; end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#233 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#252 RubyIndexer::Entry::BlockParameter::DEFAULT_NAME = T.let(T.unsafe(nil), Symbol) # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#136 @@ -278,7 +325,7 @@ class RubyIndexer::Entry::Class < ::RubyIndexer::Entry::Namespace end def initialize(nesting, file_path, location, comments, parent_class); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#160 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#159 sig { override.returns(::Integer) } def ancestor_hash; end @@ -290,7 +337,7 @@ class RubyIndexer::Entry::Class < ::RubyIndexer::Entry::Namespace def parent_class; end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#165 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#180 class RubyIndexer::Entry::Constant < ::RubyIndexer::Entry; end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#87 @@ -299,14 +346,11 @@ class RubyIndexer::Entry::Extend < ::RubyIndexer::Entry::ModuleOperation; end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#85 class RubyIndexer::Entry::Include < ::RubyIndexer::Entry::ModuleOperation; end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#397 -class RubyIndexer::Entry::InstanceMethod < ::RubyIndexer::Entry::Method; end - # Represents an instance variable e.g.: @a = 1 # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#454 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#383 class RubyIndexer::Entry::InstanceVariable < ::RubyIndexer::Entry - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#467 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#396 sig do params( name: ::String, @@ -318,39 +362,39 @@ class RubyIndexer::Entry::InstanceVariable < ::RubyIndexer::Entry end def initialize(name, file_path, location, comments, owner); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#456 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#385 sig { returns(T.nilable(::RubyIndexer::Entry::Namespace)) } def owner; end end # An required keyword method parameter, e.g. `def foo(a:)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#196 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#215 class RubyIndexer::Entry::KeywordParameter < ::RubyIndexer::Entry::Parameter - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#198 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#217 sig { override.returns(::Symbol) } def decorated_name; end end # A keyword rest method parameter, e.g. `def foo(**a)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#222 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#241 class RubyIndexer::Entry::KeywordRestParameter < ::RubyIndexer::Entry::Parameter - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#226 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#245 sig { override.returns(::Symbol) } def decorated_name; end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#223 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#242 RubyIndexer::Entry::KeywordRestParameter::DEFAULT_NAME = T.let(T.unsafe(nil), Symbol) # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#241 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#260 class RubyIndexer::Entry::Member < ::RubyIndexer::Entry abstract! - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#260 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#279 sig do params( name: ::String, @@ -363,54 +407,72 @@ class RubyIndexer::Entry::Member < ::RubyIndexer::Entry end def initialize(name, file_path, location, comments, visibility, owner); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#248 + # Returns a string with the decorated names of the parameters of this member. E.g.: `(a, b = 1, c: 2)` + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#290 + sig { returns(::String) } + def decorated_parameters; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#267 sig { returns(T.nilable(::RubyIndexer::Entry::Namespace)) } def owner; end # @abstract # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#267 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#286 sig { abstract.returns(T::Array[::RubyIndexer::Entry::Parameter]) } def parameters; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#281 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#306 class RubyIndexer::Entry::Method < ::RubyIndexer::Entry::Member - abstract! - - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#301 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#323 sig do params( name: ::String, file_path: ::String, location: T.any(::Prism::Location, ::RubyIndexer::Location), comments: T::Array[::String], - parameters_node: T.nilable(::Prism::ParametersNode), + parameters: T::Array[::RubyIndexer::Entry::Parameter], visibility: ::RubyIndexer::Entry::Visibility, owner: T.nilable(::RubyIndexer::Entry::Namespace) ).void end - def initialize(name, file_path, location, comments, parameters_node, visibility, owner); end + def initialize(name, file_path, location, comments, parameters, visibility, owner); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#288 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#310 sig { override.returns(T::Array[::RubyIndexer::Entry::Parameter]) } def parameters; end +end - private - - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#310 +# A method alias is a resolved alias entry that points to the exact method target it refers to +# +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#434 +class RubyIndexer::Entry::MethodAlias < ::RubyIndexer::Entry + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#441 sig do params( - parameters_node: T.nilable(::Prism::ParametersNode) - ).returns(T::Array[::RubyIndexer::Entry::Parameter]) + target: T.any(::RubyIndexer::Entry::Member, ::RubyIndexer::Entry::MethodAlias), + unresolved_alias: ::RubyIndexer::Entry::UnresolvedMethodAlias + ).void end - def list_params(parameters_node); end + def initialize(target, unresolved_alias); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#369 - sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::Symbol)) } - def parameter_name(node); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#468 + sig { returns(::String) } + def decorated_parameters; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#458 + sig { returns(T.nilable(::RubyIndexer::Entry::Namespace)) } + def owner; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#463 + sig { returns(T::Array[::RubyIndexer::Entry::Parameter]) } + def parameters; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#438 + sig { returns(T.any(::RubyIndexer::Entry::Member, ::RubyIndexer::Entry::MethodAlias)) } + def target; end end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#133 @@ -471,25 +533,29 @@ end # An optional keyword method parameter, e.g. `def foo(a: 123)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#204 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#223 class RubyIndexer::Entry::OptionalKeywordParameter < ::RubyIndexer::Entry::Parameter - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#206 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#225 sig { override.returns(::Symbol) } def decorated_name; end end # An optional method parameter, e.g. `def foo(a = 123)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#192 -class RubyIndexer::Entry::OptionalParameter < ::RubyIndexer::Entry::Parameter; end +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#207 +class RubyIndexer::Entry::OptionalParameter < ::RubyIndexer::Entry::Parameter + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#209 + sig { override.returns(::Symbol) } + def decorated_name; end +end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#168 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#183 class RubyIndexer::Entry::Parameter abstract! - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#182 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#197 sig { params(name: ::Symbol).void } def initialize(name:); end @@ -503,7 +569,7 @@ class RubyIndexer::Entry::Parameter # Name includes just the name of the parameter, excluding symbols like splats # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#176 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#191 sig { returns(::Symbol) } def name; end end @@ -513,23 +579,27 @@ class RubyIndexer::Entry::Prepend < ::RubyIndexer::Entry::ModuleOperation; end # A required method parameter, e.g. `def foo(a)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#188 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#203 class RubyIndexer::Entry::RequiredParameter < ::RubyIndexer::Entry::Parameter; end # A rest method parameter, e.g. `def foo(*a)` # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#212 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#231 class RubyIndexer::Entry::RestParameter < ::RubyIndexer::Entry::Parameter - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#216 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#235 sig { override.returns(::Symbol) } def decorated_name; end end -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#213 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#232 RubyIndexer::Entry::RestParameter::DEFAULT_NAME = T.let(T.unsafe(nil), Symbol) -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#394 -class RubyIndexer::Entry::SingletonMethod < ::RubyIndexer::Entry::Method; end +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#164 +class RubyIndexer::Entry::SingletonClass < ::RubyIndexer::Entry::Class + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#168 + sig { params(location: ::Prism::Location, comments: T::Array[::String]).void } + def update_singleton_information(location, comments); end +end # An UnresolvedAlias points to a constant alias with a right hand side that has not yet been resolved. For # example, if we find @@ -542,9 +612,9 @@ class RubyIndexer::Entry::SingletonMethod < ::RubyIndexer::Entry::Method; end # target in [rdoc-ref:Index#resolve]. If the right hand side contains a constant that doesn't exist, then it's not # possible to resolve the alias and it will remain an UnresolvedAlias until the right hand side constant exists # -# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#410 +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#339 class RubyIndexer::Entry::UnresolvedAlias < ::RubyIndexer::Entry - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#429 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#358 sig do params( target: ::String, @@ -557,15 +627,48 @@ class RubyIndexer::Entry::UnresolvedAlias < ::RubyIndexer::Entry end def initialize(target, nesting, name, file_path, location, comments); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#417 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#346 sig { returns(T::Array[::String]) } def nesting; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#414 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#343 sig { returns(::String) } def target; end end +# An unresolved method alias is an alias entry for which we aren't sure what the right hand side points to yet. For +# example, if we have `alias a b`, we create an unresolved alias for `a` because we aren't sure immediate what `b` +# is referring to +# +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#405 +class RubyIndexer::Entry::UnresolvedMethodAlias < ::RubyIndexer::Entry + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#424 + sig do + params( + new_name: ::String, + old_name: ::String, + owner: T.nilable(::RubyIndexer::Entry::Namespace), + file_path: ::String, + location: ::Prism::Location, + comments: T::Array[::String] + ).void + end + def initialize(new_name, old_name, owner, file_path, location, comments); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#409 + sig { returns(::String) } + def new_name; end + + # @return [String] + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#409 + def old_name; end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#412 + sig { returns(T.nilable(::RubyIndexer::Entry::Namespace)) } + def owner; end +end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#6 class RubyIndexer::Entry::Visibility < ::T::Enum enums do @@ -581,14 +684,14 @@ class RubyIndexer::Index sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#69 - sig { params(entry: ::RubyIndexer::Entry).void } - def <<(entry); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#78 sig { params(fully_qualified_name: ::String).returns(T.nilable(T::Array[::RubyIndexer::Entry])) } def [](fully_qualified_name); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#69 + sig { params(entry: ::RubyIndexer::Entry, skip_prefix_tree: T::Boolean).void } + def add(entry, skip_prefix_tree: T.unsafe(nil)); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#41 sig { params(indexable: ::RubyIndexer::IndexablePath).void } def delete(indexable); end @@ -604,9 +707,9 @@ class RubyIndexer::Index # `Something::Else`, then we first discover `Something::Else::Baz`. But `Something::Else::Baz` might contain other # aliases, so we have to invoke `follow_aliased_namespace` again to check until we only return a real name # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#226 - sig { params(name: ::String).returns(::String) } - def follow_aliased_namespace(name); end + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#268 + sig { params(name: ::String, seen_names: T::Array[::String]).returns(::String) } + def follow_aliased_namespace(name, seen_names = T.unsafe(nil)); end # Fuzzy searches index entries based on Jaro-Winkler similarity. If no query is provided, all entries are returned # @@ -617,7 +720,7 @@ class RubyIndexer::Index # Synchronizes a change made to the given indexable path. This method will ensure that new declarations are indexed, # removed declarations removed and that the ancestor linearization cache is cleared if necessary # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#406 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#460 sig { params(indexable: ::RubyIndexer::IndexablePath).void } def handle_change(indexable); end @@ -625,7 +728,7 @@ class RubyIndexer::Index # and control indexing progress. That block is invoked with the current progress percentage and should return `true` # to continue indexing or `false` to stop indexing. # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#185 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#221 sig do params( indexable_paths: T::Array[::RubyIndexer::IndexablePath], @@ -634,14 +737,14 @@ class RubyIndexer::Index end def index_all(indexable_paths: T.unsafe(nil), &block); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#200 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#236 sig { params(indexable_path: ::RubyIndexer::IndexablePath, source: T.nilable(::String)).void } def index_single(indexable_path, source = T.unsafe(nil)); end # Returns a list of possible candidates for completion of instance variables for a given owner name. The name must # include the `@` prefix # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#394 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#448 sig { params(name: ::String, owner_name: ::String).returns(T::Array[::RubyIndexer::Entry::InstanceVariable]) } def instance_variable_completion_candidates(name, owner_name); end @@ -656,12 +759,17 @@ class RubyIndexer::Index # # @raise [NonExistingNamespaceError] # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#289 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#343 sig { params(fully_qualified_name: ::String).returns(T::Array[::String]) } def linearized_ancestors_of(fully_qualified_name); end - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#134 - sig { params(name: ::String, receiver_name: ::String).returns(T::Array[::RubyIndexer::Entry]) } + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#149 + sig do + params( + name: T.nilable(::String), + receiver_name: ::String + ).returns(T::Array[T.any(::RubyIndexer::Entry::Member, ::RubyIndexer::Entry::MethodAlias)]) + end def method_completion_candidates(name, receiver_name); end # Searches entries in the index based on an exact prefix, intended for providing autocomplete. All possible matches @@ -687,20 +795,28 @@ class RubyIndexer::Index end def prefix_search(query, nesting = T.unsafe(nil)); end - # Try to find the entry based on the nesting from the most specific to the least specific. For example, if we have - # the nesting as ["Foo", "Bar"] and the name as "Baz", we will try to find it in this order: - # 1. Foo::Bar::Baz - # 2. Foo::Baz - # 3. Baz + # Resolve a constant to its declaration based on its name and the nesting where the reference was found. Parameter + # documentation: # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#149 - sig { params(name: ::String, nesting: T::Array[::String]).returns(T.nilable(T::Array[::RubyIndexer::Entry])) } - def resolve(name, nesting); end + # name: the name of the reference how it was found in the source code (qualified or not) + # nesting: the nesting structure where the reference was found (e.g.: ["Foo", "Bar"]) + # seen_names: this parameter should not be used by consumers of the api. It is used to avoid infinite recursion when + # resolving circular references + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#180 + sig do + params( + name: ::String, + nesting: T::Array[::String], + seen_names: T::Array[::String] + ).returns(T.nilable(T::Array[::RubyIndexer::Entry])) + end + def resolve(name, nesting, seen_names = T.unsafe(nil)); end # Resolves an instance variable name for a given owner name. This method will linearize the ancestors of the owner # and find inherited instance variables as well # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#381 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#435 sig do params( variable_name: ::String, @@ -712,12 +828,12 @@ class RubyIndexer::Index # Attempts to find methods for a resolved fully qualified receiver name. # Returns `nil` if the method does not exist on that receiver # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#260 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#307 sig do params( method_name: ::String, receiver_name: ::String - ).returns(T.nilable(T::Array[::RubyIndexer::Entry::Member])) + ).returns(T.nilable(T::Array[T.any(::RubyIndexer::Entry::Member, ::RubyIndexer::Entry::MethodAlias)])) end def resolve_method(method_name, receiver_name); end @@ -727,16 +843,71 @@ class RubyIndexer::Index private + # Removes redudancy from a constant reference's full name. For example, if we find a reference to `A::B::Foo` inside + # of the ["A", "B"] nesting, then we should not concatenate the nesting with the name or else we'll end up with + # `A::B::A::B::Foo`. This method will remove any redundant parts from the final name based on the reference and the + # nesting + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#575 + sig { params(name: ::String, nesting: T::Array[::String]).returns(::String) } + def build_non_redundant_full_name(name, nesting); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#602 + sig do + params( + full_name: ::String, + seen_names: T::Array[::String] + ).returns(T.nilable(T::Array[::RubyIndexer::Entry])) + end + def direct_or_aliased_constant(full_name, seen_names); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#551 + sig do + params( + name: ::String, + nesting: T::Array[::String], + seen_names: T::Array[::String] + ).returns(T.nilable(T::Array[::RubyIndexer::Entry])) + end + def lookup_ancestor_chain(name, nesting, seen_names); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#526 + sig do + params( + name: ::String, + nesting: T::Array[::String], + seen_names: T::Array[::String] + ).returns(T.nilable(T::Array[::RubyIndexer::Entry])) + end + def lookup_enclosing_scopes(name, nesting, seen_names); end + # Attempts to resolve an UnresolvedAlias into a resolved Alias. If the unresolved alias is pointing to a constant # that doesn't exist, then we return the same UnresolvedAlias # - # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#438 + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#497 sig do params( - entry: ::RubyIndexer::Entry::UnresolvedAlias + entry: ::RubyIndexer::Entry::UnresolvedAlias, + seen_names: T::Array[::String] ).returns(T.any(::RubyIndexer::Entry::Alias, ::RubyIndexer::Entry::UnresolvedAlias)) end - def resolve_alias(entry); end + def resolve_alias(entry, seen_names); end + + # Attempt to resolve a given unresolved method alias. This method returns the resolved alias if we managed to + # identify the target or the same unresolved alias entry if we couldn't + # + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#620 + sig do + params( + entry: ::RubyIndexer::Entry::UnresolvedMethodAlias, + receiver_name: ::String + ).returns(T.any(::RubyIndexer::Entry::MethodAlias, ::RubyIndexer::Entry::UnresolvedMethodAlias)) + end + def resolve_method_alias(entry, receiver_name); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/index.rb#608 + sig { params(name: ::String, seen_names: T::Array[::String]).returns(T.nilable(T::Array[::RubyIndexer::Entry])) } + def search_top_level(name, seen_names); end end # The minimum Jaro-Winkler similarity score for an entry to be considered a match for a given fuzzy search query @@ -915,6 +1086,56 @@ class RubyIndexer::PrefixTree::Node def value=(_arg0); end end +# source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#5 +class RubyIndexer::RBSIndexer + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#9 + sig { params(index: ::RubyIndexer::Index).void } + def initialize(index); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#14 + sig { void } + def index_ruby_core; end + + private + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#93 + sig do + params( + declaration: T.any(::RBS::AST::Declarations::Class, ::RBS::AST::Declarations::Module), + entry: ::RubyIndexer::Entry::Namespace + ).void + end + def add_declaration_mixins_to_entry(declaration, entry); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#130 + sig { params(owner: ::RubyIndexer::Entry::Namespace).returns(T.nilable(::RubyIndexer::Entry::Class)) } + def existing_or_new_singleton_klass(owner); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#45 + sig { params(declaration: ::RBS::AST::Declarations::Class, pathname: ::Pathname).void } + def handle_class_declaration(declaration, pathname); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#110 + sig { params(member: ::RBS::AST::Members::MethodDefinition, owner: ::RubyIndexer::Entry::Namespace).void } + def handle_method(member, owner); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#62 + sig { params(declaration: ::RBS::AST::Declarations::Module, pathname: ::Pathname).void } + def handle_module_declaration(declaration, pathname); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#33 + sig { params(declaration: ::RBS::AST::Declarations::Base, pathname: ::Pathname).void } + def process_declaration(declaration, pathname); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#26 + sig { params(source: T.untyped, pathname: ::Pathname, declarations: T::Array[::RBS::AST::Declarations::Base]).void } + def process_signature(source, pathname, declarations); end + + # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/rbs_indexer.rb#78 + sig { params(rbs_location: ::RBS::Location).returns(::RubyIndexer::Location) } + def to_ruby_indexer_location(rbs_location); end +end + # source://ruby-lsp/lib/ruby-lsp.rb#4 module RubyLsp; end @@ -1242,7 +1463,7 @@ class RubyLsp::Document sig { params(edits: T::Array[T::Hash[::Symbol, T.untyped]], version: ::Integer).void } def push_edits(edits, version:); end - # source://ruby-lsp/lib/ruby_lsp/document.rb#200 + # source://ruby-lsp/lib/ruby_lsp/document.rb#229 sig { returns(T::Boolean) } def sorbet_sigil_is_true_or_higher; end @@ -1267,32 +1488,32 @@ class RubyLsp::Document def version; end end -# source://ruby-lsp/lib/ruby_lsp/document.rb#206 +# source://ruby-lsp/lib/ruby_lsp/document.rb#235 class RubyLsp::Document::Scanner - # source://ruby-lsp/lib/ruby_lsp/document.rb#214 + # source://ruby-lsp/lib/ruby_lsp/document.rb#243 sig { params(source: ::String, encoding: ::Encoding).void } def initialize(source, encoding); end # Finds the character index inside the source string for a given line and column # - # source://ruby-lsp/lib/ruby_lsp/document.rb#223 + # source://ruby-lsp/lib/ruby_lsp/document.rb#252 sig { params(position: T::Hash[::Symbol, T.untyped]).returns(::Integer) } def find_char_position(position); end # Subtract 1 for each character after 0xFFFF in the current line from the column position, so that we hit the # right character in the UTF-8 representation # - # source://ruby-lsp/lib/ruby_lsp/document.rb#245 + # source://ruby-lsp/lib/ruby_lsp/document.rb#274 sig { params(current_position: ::Integer, requested_position: ::Integer).returns(::Integer) } def utf_16_character_position_correction(current_position, requested_position); end end -# source://ruby-lsp/lib/ruby_lsp/document.rb#209 +# source://ruby-lsp/lib/ruby_lsp/document.rb#238 RubyLsp::Document::Scanner::LINE_BREAK = T.let(T.unsafe(nil), Integer) # After character 0xFFFF, UTF-16 considers characters to have length 2 and we have to account for that # -# source://ruby-lsp/lib/ruby_lsp/document.rb#211 +# source://ruby-lsp/lib/ruby_lsp/document.rb#240 RubyLsp::Document::Scanner::SURROGATE_PAIR_START = T.let(T.unsafe(nil), Integer) # source://ruby-lsp/lib/ruby_lsp/utils.rb#90 @@ -1315,19 +1536,19 @@ RubyLsp::GEMFILE_NAME = T.let(T.unsafe(nil), String) # source://ruby-lsp/lib/ruby_lsp/global_state.rb#5 class RubyLsp::GlobalState - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#27 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#30 sig { void } def initialize; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#46 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#50 sig { returns(T.nilable(::RubyLsp::Requests::Support::Formatter)) } def active_formatter; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#51 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#55 sig { returns(T::Array[::RubyLsp::Requests::Support::Formatter]) } def active_linters; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#56 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#60 sig { params(options: T::Hash[::Symbol, T.untyped]).void } def apply_options(options); end @@ -1335,7 +1556,7 @@ class RubyLsp::GlobalState sig { returns(::Encoding) } def encoding; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#93 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#98 sig { returns(::String) } def encoding_name; end @@ -1348,11 +1569,15 @@ class RubyLsp::GlobalState # source://ruby-lsp/lib/ruby_lsp/global_state.rb#12 def formatter=(_arg0); end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#15 + sig { returns(T::Boolean) } + def has_type_checker; end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#18 sig { returns(::RubyIndexer::Index) } def index; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#41 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#45 sig { params(identifier: ::String, instance: ::RubyLsp::Requests::Support::Formatter).void } def register_formatter(identifier, instance); end @@ -1364,40 +1589,52 @@ class RubyLsp::GlobalState sig { returns(::String) } def test_library; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#15 - sig { returns(T::Boolean) } - def typechecker; end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#27 + sig { returns(::RubyLsp::TypeInferrer) } + def type_inferrer; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#88 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#93 sig { returns(::String) } def workspace_path; end private - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#107 - sig { params(dependencies: T::Array[::String]).returns(::String) } - def detect_formatter(dependencies); end + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#173 + sig { returns(T::Boolean) } + def bin_rails_present; end + + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#112 + sig { params(direct_dependencies: T::Array[::String], all_dependencies: T::Array[::String]).returns(::String) } + def detect_formatter(direct_dependencies, all_dependencies); end # Try to detect if there are linters in the project's dependencies. For auto-detection, we always only consider a # single linter. To have multiple linters running, the user must configure them manually # - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#121 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#128 sig { params(dependencies: T::Array[::String]).returns(T::Array[::String]) } def detect_linters(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#128 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#135 sig { params(dependencies: T::Array[::String]).returns(::String) } def detect_test_library(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#148 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#155 sig { params(dependencies: T::Array[::String]).returns(T::Boolean) } def detect_typechecker(dependencies); end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#166 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#178 + sig { returns(T::Boolean) } + def dot_rubocop_yml_present; end + + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#198 sig { returns(T::Array[::String]) } - def gather_dependencies; end + def gather_direct_and_indirect_dependencies; end - # source://ruby-lsp/lib/ruby_lsp/global_state.rb#174 + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#183 + sig { returns(T::Array[::String]) } + def gather_direct_dependencies; end + + # source://ruby-lsp/lib/ruby_lsp/global_state.rb#191 sig { returns(T::Array[::String]) } def gemspec_dependencies; end end @@ -1498,7 +1735,7 @@ RubyLsp::Listeners::CodeLens::SUPPORTED_TEST_LIBRARIES = T.let(T.unsafe(nil), Ar class RubyLsp::Listeners::Completion include ::RubyLsp::Requests::Support::Common - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#20 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#21 sig do params( response_builder: RubyLsp::ResponseBuilders::CollectionResponseBuilder[::LanguageServer::Protocol::Interface::CompletionItem], @@ -1506,54 +1743,55 @@ class RubyLsp::Listeners::Completion node_context: ::RubyLsp::NodeContext, typechecker_enabled: T::Boolean, dispatcher: ::Prism::Dispatcher, - uri: ::URI::Generic + uri: ::URI::Generic, + trigger_character: T.nilable(::String) ).void end - def initialize(response_builder, global_state, node_context, typechecker_enabled, dispatcher, uri); end + def initialize(response_builder, global_state, node_context, typechecker_enabled, dispatcher, uri, trigger_character); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#75 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#86 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end # Handle completion on namespaced constant references (e.g. `Foo::Bar`) # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#65 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#76 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end # Handle completion on regular constant references (e.g. `Bar`) # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#44 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#55 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#125 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#136 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#130 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#141 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#135 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#146 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#115 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#126 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#140 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#151 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#120 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#131 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#297 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#336 sig do params( label: ::String, @@ -1562,7 +1800,7 @@ class RubyLsp::Listeners::Completion end def build_completion(label, node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#320 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#359 sig do params( real_name: ::String, @@ -1574,32 +1812,32 @@ class RubyLsp::Listeners::Completion end def build_entry_completion(real_name, incomplete_name, range, entries, top_level); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#277 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#316 sig do params( - entry: ::RubyIndexer::Entry::Member, + entry: T.any(::RubyIndexer::Entry::Member, ::RubyIndexer::Entry::MethodAlias), node: ::Prism::CallNode ).returns(::LanguageServer::Protocol::Interface::CompletionItem) end def build_method_completion(entry, node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#215 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#274 + sig { params(node: ::Prism::CallNode, name: ::String).void } + def complete_methods(node, name); end + + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#229 sig { params(node: ::Prism::CallNode).void } def complete_require(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#231 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#245 sig { params(node: ::Prism::CallNode).void } def complete_require_relative(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#260 - sig { params(node: ::Prism::CallNode, name: ::String).void } - def complete_self_receiver_method(node, name); end - - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#147 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#158 sig { params(name: ::String, range: ::LanguageServer::Protocol::Interface::Range).void } def constant_path_completion(name, range); end - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#194 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#205 sig { params(name: ::String, location: ::Prism::Location).void } def handle_instance_variable_completion(name, location); end @@ -1618,7 +1856,7 @@ class RubyLsp::Listeners::Completion # end # ``` # - # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#403 + # source://ruby-lsp/lib/ruby_lsp/listeners/completion.rb#442 sig { params(entry_name: ::String).returns(T::Boolean) } def top_level?(entry_name); end end @@ -1640,65 +1878,65 @@ class RubyLsp::Listeners::Definition end def initialize(response_builder, global_state, uri, node_context, dispatcher, typechecker_enabled); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#66 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#67 sig { params(node: ::Prism::BlockArgumentNode).void } def on_block_argument_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#47 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#48 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#77 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#78 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#85 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#86 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#103 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#104 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#108 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#109 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#113 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#114 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#93 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#94 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#118 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#119 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#98 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#99 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#55 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#56 sig { params(node: ::Prism::StringNode).void } def on_string_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#207 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#211 sig { params(value: ::String).void } def find_in_index(value); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#125 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#126 sig { params(name: ::String).void } def handle_instance_variable_definition(name); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#145 - sig { params(message: ::String, self_receiver: T::Boolean).void } - def handle_method_definition(message, self_receiver); end + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#149 + sig { params(message: ::String, receiver_type: T.nilable(::String)).void } + def handle_method_definition(message, receiver_type); end - # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#172 + # source://ruby-lsp/lib/ruby_lsp/listeners/definition.rb#176 sig { params(node: ::Prism::StringNode, message: ::Symbol).void } def handle_require_definition(node, message); end end @@ -2299,57 +2537,57 @@ class RubyLsp::Listeners::Hover end def initialize(response_builder, global_state, uri, node_context, dispatcher, typechecker_enabled); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#97 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#98 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#87 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#88 sig { params(node: ::Prism::ConstantPathNode).void } def on_constant_path_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#70 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#71 sig { params(node: ::Prism::ConstantReadNode).void } def on_constant_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#80 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#81 sig { params(node: ::Prism::ConstantWriteNode).void } def on_constant_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#129 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#133 sig { params(node: ::Prism::InstanceVariableAndWriteNode).void } def on_instance_variable_and_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#134 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#138 sig { params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def on_instance_variable_operator_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#139 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#143 sig { params(node: ::Prism::InstanceVariableOrWriteNode).void } def on_instance_variable_or_write_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#119 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#123 sig { params(node: ::Prism::InstanceVariableReadNode).void } def on_instance_variable_read_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#144 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#148 sig { params(node: ::Prism::InstanceVariableTargetNode).void } def on_instance_variable_target_node_enter(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#124 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#128 sig { params(node: ::Prism::InstanceVariableWriteNode).void } def on_instance_variable_write_node_enter(node); end private - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#178 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#185 sig { params(node: ::Prism::CallNode).void } def generate_gem_hover(node); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#163 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#170 sig { params(name: ::String, location: ::Prism::Location).void } def generate_hover(name, location); end - # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#151 + # source://ruby-lsp/lib/ruby_lsp/listeners/hover.rb#155 sig { params(name: ::String).void } def handle_instance_variable_hover(name); end end @@ -2566,7 +2804,7 @@ class RubyLsp::Listeners::SignatureHelp end def initialize(response_builder, global_state, node_context, dispatcher, typechecker_enabled); end - # source://ruby-lsp/lib/ruby_lsp/listeners/signature_help.rb#29 + # source://ruby-lsp/lib/ruby_lsp/listeners/signature_help.rb#30 sig { params(node: ::Prism::CallNode).void } def on_call_node_enter(node); end end @@ -2603,22 +2841,23 @@ end # # source://ruby-lsp/lib/ruby_lsp/node_context.rb#7 class RubyLsp::NodeContext - # source://ruby-lsp/lib/ruby_lsp/node_context.rb#27 + # source://ruby-lsp/lib/ruby_lsp/node_context.rb#31 sig do params( node: T.nilable(::Prism::Node), parent: T.nilable(::Prism::Node), nesting: T::Array[::String], - call_node: T.nilable(::Prism::CallNode) + call_node: T.nilable(::Prism::CallNode), + surrounding_method: T.nilable(::String) ).void end - def initialize(node, parent, nesting, call_node); end + def initialize(node, parent, nesting, call_node, surrounding_method); end # source://ruby-lsp/lib/ruby_lsp/node_context.rb#17 sig { returns(T.nilable(::Prism::CallNode)) } def call_node; end - # source://ruby-lsp/lib/ruby_lsp/node_context.rb#35 + # source://ruby-lsp/lib/ruby_lsp/node_context.rb#40 sig { returns(::String) } def fully_qualified_name; end @@ -2634,6 +2873,10 @@ class RubyLsp::NodeContext # # source://ruby-lsp/lib/ruby_lsp/node_context.rb#11 def parent; end + + # source://ruby-lsp/lib/ruby_lsp/node_context.rb#20 + sig { returns(T.nilable(::String)) } + def surrounding_method; end end # source://ruby-lsp/lib/ruby_lsp/utils.rb#52 @@ -2907,14 +3150,14 @@ class RubyLsp::Requests::Completion < ::RubyLsp::Requests::Request params( document: ::RubyLsp::Document, global_state: ::RubyLsp::GlobalState, - position: T::Hash[::Symbol, T.untyped], + params: T::Hash[::Symbol, T.untyped], typechecker_enabled: T::Boolean, dispatcher: ::Prism::Dispatcher ).void end - def initialize(document, global_state, position, typechecker_enabled, dispatcher); end + def initialize(document, global_state, params, typechecker_enabled, dispatcher); end - # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#108 + # source://ruby-lsp/lib/ruby_lsp/requests/completion.rb#109 sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::CompletionItem]) } def perform; end @@ -3394,6 +3637,48 @@ end # source://ruby-lsp/lib/ruby_lsp/requests/on_type_formatting.rb#33 RubyLsp::Requests::OnTypeFormatting::END_REGEXES = T.let(T.unsafe(nil), Array) +# ![Prepare type hierarchy demo](../../prepare_type_hierarchy.gif) +# +# The [prepare type hierarchy +# request](https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareTypeHierarchy) +# displays the list of ancestors (supertypes) and descendants (subtypes) for the selected type. +# +# Currently only supports supertypes due to a limitation of the index. +# +# # Example +# +# ```ruby +# class Foo; end +# class Bar < Foo; end +# +# puts Bar # <-- right click on `Bar` and select "Show Type Hierarchy" +# ``` +# +# source://ruby-lsp/lib/ruby_lsp/requests/prepare_type_hierarchy.rb#22 +class RubyLsp::Requests::PrepareTypeHierarchy < ::RubyLsp::Requests::Request + include ::RubyLsp::Requests::Support::Common + + # source://ruby-lsp/lib/ruby_lsp/requests/prepare_type_hierarchy.rb#43 + sig do + params( + document: ::RubyLsp::Document, + index: ::RubyIndexer::Index, + position: T::Hash[::Symbol, T.untyped] + ).void + end + def initialize(document, index, position); end + + # source://ruby-lsp/lib/ruby_lsp/requests/prepare_type_hierarchy.rb#52 + sig { override.returns(T.nilable(T::Array[::LanguageServer::Protocol::Interface::TypeHierarchyItem])) } + def perform; end + + class << self + # source://ruby-lsp/lib/ruby_lsp/requests/prepare_type_hierarchy.rb#31 + sig { returns(::LanguageServer::Protocol::Interface::TypeHierarchyOptions) } + def provider; end + end +end + # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # # source://ruby-lsp/lib/ruby_lsp/requests/request.rb#7 @@ -3615,7 +3900,7 @@ class RubyLsp::Requests::SignatureHelp < ::RubyLsp::Requests::Request end end -# source://ruby-lsp/lib/ruby_lsp/requests.rb#52 +# source://ruby-lsp/lib/ruby_lsp/requests.rb#54 module RubyLsp::Requests::Support; end # source://ruby-lsp/lib/ruby_lsp/requests/support/annotation.rb#7 @@ -3681,6 +3966,10 @@ module RubyLsp::Requests::Support::Common sig { params(node: ::Prism::Node, block: T.proc.params(part: ::Prism::Node).void).void } def each_constant_path_part(node, &block); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#191 + sig { params(entry: ::RubyIndexer::Entry).returns(T.nilable(::Integer)) } + def kind_for_entry(entry); end + # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#135 sig do params( @@ -3700,7 +3989,11 @@ module RubyLsp::Requests::Support::Common def not_in_dependencies?(file_path); end # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#30 - sig { params(location: ::Prism::Location).returns(::LanguageServer::Protocol::Interface::Range) } + sig do + params( + location: T.any(::Prism::Location, ::RubyIndexer::Location) + ).returns(::LanguageServer::Protocol::Interface::Range) + end def range_from_location(location); end # source://ruby-lsp/lib/ruby_lsp/requests/support/common.rb#17 @@ -3778,6 +4071,14 @@ class RubyLsp::Requests::Support::RuboCopDiagnostic sig { params(config: ::RuboCop::Config).returns(T.nilable(::LanguageServer::Protocol::Interface::CodeDescription)) } def code_description(config); end + # When `RuboCop::LSP.enable` is called, contextual autocorrect will not offer itself + # as `correctable?` to prevent annoying changes while typing. Instead check if + # a corrector is present. If it is, then that means some code transformation can be applied. + # + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#201 + sig { returns(T::Boolean) } + def correctable?; end + # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#140 sig { returns(::LanguageServer::Protocol::Interface::CodeAction) } def disable_line_action; end @@ -3895,6 +4196,40 @@ class RubyLsp::Requests::Support::Sorbet end end +# ![Type hierarchy supertypes demo](../../type_hierarchy_supertypes.gif) +# +# The [type hierarchy supertypes +# request](https://microsoft.github.io/language-server-protocol/specification#typeHierarchy_supertypes) +# displays the list of ancestors (supertypes) for the selected type. +# +# # Example +# +# ```ruby +# class Foo; end +# class Bar < Foo; end +# +# puts Bar # <-- right click on `Bar` and select "Show Type Hierarchy" +# ``` +# +# source://ruby-lsp/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb#20 +class RubyLsp::Requests::TypeHierarchySupertypes < ::RubyLsp::Requests::Request + include ::RubyLsp::Requests::Support::Common + + # source://ruby-lsp/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb#26 + sig { params(index: ::RubyIndexer::Index, item: T::Hash[::Symbol, T.untyped]).void } + def initialize(index, item); end + + # source://ruby-lsp/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb#34 + sig { override.returns(T.nilable(T::Array[::LanguageServer::Protocol::Interface::TypeHierarchyItem])) } + def perform; end + + private + + # source://ruby-lsp/lib/ruby_lsp/requests/type_hierarchy_supertypes.rb#77 + sig { params(entry: ::RubyIndexer::Entry).returns(::LanguageServer::Protocol::Interface::TypeHierarchyItem) } + def hierarchy_item(entry); end +end + # ![Workspace symbol demo](../../workspace_symbol.gif) # # The [workspace symbol](https://microsoft.github.io/language-server-protocol/specification#workspace_symbol) @@ -3921,12 +4256,6 @@ class RubyLsp::Requests::WorkspaceSymbol < ::RubyLsp::Requests::Request # source://ruby-lsp/lib/ruby_lsp/requests/workspace_symbol.rb#34 sig { override.returns(T::Array[::LanguageServer::Protocol::Interface::WorkspaceSymbol]) } def perform; end - - private - - # source://ruby-lsp/lib/ruby_lsp/requests/workspace_symbol.rb#71 - sig { params(entry: ::RubyIndexer::Entry).returns(T.nilable(::Integer)) } - def kind_for_entry(entry); end end # source://ruby-lsp/lib/ruby_lsp/response_builders.rb#5 @@ -4200,7 +4529,7 @@ class RubyLsp::Server < ::RubyLsp::BaseServer sig { returns(::RubyLsp::GlobalState) } def global_state; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#92 + # source://ruby-lsp/lib/ruby_lsp/server.rb#108 sig { void } def load_addons; end @@ -4210,47 +4539,47 @@ class RubyLsp::Server < ::RubyLsp::BaseServer private - # source://ruby-lsp/lib/ruby_lsp/server.rb#719 + # source://ruby-lsp/lib/ruby_lsp/server.rb#769 sig { params(id: ::String, title: ::String, percentage: ::Integer).void } def begin_progress(id, title, percentage: T.unsafe(nil)); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#780 + # source://ruby-lsp/lib/ruby_lsp/server.rb#830 sig { void } def check_formatter_is_available; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#484 + # source://ruby-lsp/lib/ruby_lsp/server.rb#505 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def code_action_resolve(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#762 + # source://ruby-lsp/lib/ruby_lsp/server.rb#812 sig { params(id: ::String).void } def end_progress(id); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#692 + # source://ruby-lsp/lib/ruby_lsp/server.rb#740 sig { params(config_hash: T::Hash[::String, T.untyped]).void } def perform_initial_indexing(config_hash); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#743 + # source://ruby-lsp/lib/ruby_lsp/server.rb#793 sig { params(id: ::String, percentage: ::Integer).void } def progress(id, percentage); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#319 + # source://ruby-lsp/lib/ruby_lsp/server.rb#340 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_combined_requests(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#114 + # source://ruby-lsp/lib/ruby_lsp/server.rb#130 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def run_initialize(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#221 + # source://ruby-lsp/lib/ruby_lsp/server.rb#242 sig { void } def run_initialized; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#687 + # source://ruby-lsp/lib/ruby_lsp/server.rb#735 sig { override.void } def shutdown; end - # source://ruby-lsp/lib/ruby_lsp/server.rb#467 + # source://ruby-lsp/lib/ruby_lsp/server.rb#488 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_code_action(message); end @@ -4260,35 +4589,35 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # source://sorbet-runtime/0.5.11406lib/types/private/methods/_methods.rb#257 def text_document_code_lens(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#543 + # source://ruby-lsp/lib/ruby_lsp/server.rb#564 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_completion(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#563 + # source://ruby-lsp/lib/ruby_lsp/server.rb#584 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_completion_item_resolve(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#592 + # source://ruby-lsp/lib/ruby_lsp/server.rb#613 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_definition(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#514 + # source://ruby-lsp/lib/ruby_lsp/server.rb#535 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_diagnostic(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#288 + # source://ruby-lsp/lib/ruby_lsp/server.rb#309 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_change(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#272 + # source://ruby-lsp/lib/ruby_lsp/server.rb#293 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_close(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#259 + # source://ruby-lsp/lib/ruby_lsp/server.rb#280 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_did_open(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#404 + # source://ruby-lsp/lib/ruby_lsp/server.rb#425 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_document_highlight(message); end @@ -4310,23 +4639,27 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # source://sorbet-runtime/0.5.11406lib/types/private/methods/_methods.rb#257 def text_document_folding_range(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#377 + # source://ruby-lsp/lib/ruby_lsp/server.rb#398 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#431 + # source://ruby-lsp/lib/ruby_lsp/server.rb#452 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_hover(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#456 + # source://ruby-lsp/lib/ruby_lsp/server.rb#477 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_inlay_hint(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#414 + # source://ruby-lsp/lib/ruby_lsp/server.rb#435 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_on_type_formatting(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#298 + # source://ruby-lsp/lib/ruby_lsp/server.rb#685 + sig { params(message: T::Hash[::Symbol, T.untyped]).void } + def text_document_prepare_type_hierarchy(message); end + + # source://ruby-lsp/lib/ruby_lsp/server.rb#319 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_selection_range(message); end @@ -4336,31 +4669,39 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # source://sorbet-runtime/0.5.11406lib/types/private/methods/_methods.rb#257 def text_document_semantic_tokens_full(*args, **_arg1, &blk); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#360 + # source://ruby-lsp/lib/ruby_lsp/server.rb#381 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_semantic_tokens_range(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#652 + # source://ruby-lsp/lib/ruby_lsp/server.rb#673 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_show_syntax_tree(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#571 + # source://ruby-lsp/lib/ruby_lsp/server.rb#592 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def text_document_signature_help(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#451 + # source://ruby-lsp/lib/ruby_lsp/server.rb#705 + sig { params(message: T::Hash[::Symbol, T.untyped]).void } + def type_hierarchy_subtypes(message); end + + # source://ruby-lsp/lib/ruby_lsp/server.rb#696 + sig { params(message: T::Hash[::Symbol, T.untyped]).void } + def type_hierarchy_supertypes(message); end + + # source://ruby-lsp/lib/ruby_lsp/server.rb#472 sig { params(document: ::RubyLsp::Document).returns(T::Boolean) } def typechecker_enabled?(document); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#664 + # source://ruby-lsp/lib/ruby_lsp/server.rb#712 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_dependencies(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#612 + # source://ruby-lsp/lib/ruby_lsp/server.rb#633 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_did_change_watched_files(message); end - # source://ruby-lsp/lib/ruby_lsp/server.rb#639 + # source://ruby-lsp/lib/ruby_lsp/server.rb#660 sig { params(message: T::Hash[::Symbol, T.untyped]).void } def workspace_symbol(message); end end @@ -4462,6 +4803,30 @@ end # source://ruby-lsp/lib/ruby_lsp/utils.rb#8 RubyLsp::Transport = LanguageServer::Protocol::Transport +# A minimalistic type checker to try to resolve types that can be inferred without requiring a type system or +# annotations +# +# source://ruby-lsp/lib/ruby_lsp/type_inferrer.rb#7 +class RubyLsp::TypeInferrer + # source://ruby-lsp/lib/ruby_lsp/type_inferrer.rb#11 + sig { params(index: ::RubyIndexer::Index).void } + def initialize(index); end + + # source://ruby-lsp/lib/ruby_lsp/type_inferrer.rb#16 + sig { params(node_context: ::RubyLsp::NodeContext).returns(T.nilable(::String)) } + def infer_receiver_type(node_context); end + + private + + # source://ruby-lsp/lib/ruby_lsp/type_inferrer.rb#79 + sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(T.nilable(::String)) } + def constant_name(node); end + + # source://ruby-lsp/lib/ruby_lsp/type_inferrer.rb#39 + sig { params(node: ::Prism::CallNode, node_context: ::RubyLsp::NodeContext).returns(T.nilable(::String)) } + def infer_receiver_for_call_node(node, node_context); end +end + # source://ruby-lsp/lib/ruby-lsp.rb#5 RubyLsp::VERSION = T.let(T.unsafe(nil), String)