Class: RDocF95::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc-f95/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.


244
245
246
247
248
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 244

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


256
257
258
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 256

def char_no
  @char_no
end

#line_noObject (readonly)

Returns the value of attribute line_no


256
257
258
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 256

def line_no
  @line_no
end

#textObject (readonly)

Returns the value of attribute text


256
257
258
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 256

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


251
252
253
254
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 251

def set_text(text)
  @text = text
  self
end