class Ripper::Filter
This class handles only scanner events, which are dispatched in the ‘right’ order (same with input).
Public Class Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 151
def initialize: (File | _Gets | String src, ?String filename, ?Integer lineno) -> void
Creates a new Ripper::Filter instance, passes parameters src, filename, and lineno to Ripper::Lexer.new
The lexer is for internal use only.
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 162
def column: () -> Integer?
The column number of the current token. This value starts from 0. This method is valid only in event handlers.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 170
def filename: () -> String
The file name of the input.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 179
def lineno: () -> Integer?
The line number of the current token. This value starts from 1. This method is valid only in event handlers.
(untyped event, untyped token, untyped data) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 211
def on_default: (untyped event, untyped token, untyped data) -> untyped
This method is called when some event handler is undefined. event is :on_XXX, token is the scanned token, and data is a data accumulator.
The return value of this method is passed to the next event handler (as of Enumerable#inject).
(?untyped init) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 188
def parse: (?untyped init) -> untyped
Starts the parser. init is a data accumulator and is passed to the next event handler (as of Enumerable#inject).
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/ripper/0/ripper.rbs, line 197
def state: () -> Ripper::Lexer::State
The scanner’s state of the current token. This value is the bitwise OR of zero or more of the Ripper::EXPR_* constants.