class YARD::Parser::Ruby::Legacy::RubyToken::Token
Represents a token in the Ruby
lexer
Constants
- NO_TEXT
@private
Attributes
char_no[R]
@return [Integer] the character number in the file/stream the token
is located.
lex_state[RW]
@return [Symbol] the lexical state at the token
line_no[R]
@return [Integer] the line number in the file/stream the token is
located.
text[R]
@return [String] the token text value
Public Class Methods
new(line_no, char_no)
click to toggle source
Creates a new Token
object @param [Integer] line_no
the line number to initialize the token to @param [Integer] char_no
the char number to initialize the token to
# File lib/yard/parser/ruby/legacy/ruby_lex.rb, line 38 def initialize(line_no, char_no) @line_no = line_no @char_no = char_no @text = NO_TEXT end
Public Instance Methods
set_text(text)
click to toggle source
Chainable way to sets the text attribute
@param [String] text the new text @return [Token] this token object
# File lib/yard/parser/ruby/legacy/ruby_lex.rb, line 48 def set_text(text) @text = text self end