Class: RDoc::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/parsers/parse_f95.rb

Constant Summary collapse

NO_TEXT =
"??".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line_no, char_no) ⇒ Token

Returns a new instance of Token.



158
159
160
161
162
# File 'lib/rdoc/parsers/parse_f95.rb', line 158

def initialize(line_no, char_no)
  @line_no = line_no
  @char_no = char_no
  @text    = NO_TEXT
end

Instance Attribute Details

#char_noObject (readonly)

Returns the value of attribute char_no



170
171
172
# File 'lib/rdoc/parsers/parse_f95.rb', line 170

def char_no
  @char_no
end

#line_noObject (readonly)

Returns the value of attribute line_no



170
171
172
# File 'lib/rdoc/parsers/parse_f95.rb', line 170

def line_no
  @line_no
end

#textObject (readonly)

Returns the value of attribute text



170
171
172
# File 'lib/rdoc/parsers/parse_f95.rb', line 170

def text
  @text
end

Instance Method Details

#set_text(text) ⇒ Object

Because we're used in contexts that expect to return a token, we set the text string and then return ourselves



165
166
167
168
# File 'lib/rdoc/parsers/parse_f95.rb', line 165

def set_text(text)
  @text = text
  self
end