Class: RubyLexer::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ident, offset = nil) ⇒ Token

Returns a new instance of Token.



33
34
35
36
# File 'lib/rubylexer/token.rb', line 33

def initialize(ident,offset=nil)
   @ident=ident
   @offset=offset
end

Instance Attribute Details

#allow_ooo_offsetObject

hack



31
32
33
# File 'lib/rubylexer/token.rb', line 31

def allow_ooo_offset
  @allow_ooo_offset
end

#asObject

if defined, a KeywordToken which this token stands in for.



30
31
32
# File 'lib/rubylexer/token.rb', line 30

def as
  @as
end

#identObject

Returns the value of attribute ident.



25
26
27
# File 'lib/rubylexer/token.rb', line 25

def ident
  @ident
end

#offsetObject

file offset of start of this token



29
30
31
# File 'lib/rubylexer/token.rb', line 29

def offset
  @offset
end

#tagObject

Returns the value of attribute tag.



42
43
44
# File 'lib/rubylexer/token.rb', line 42

def tag
  @tag
end

Instance Method Details

#errorObject



38
# File 'lib/rubylexer/token.rb', line 38

def error; end

#has_no_block?Boolean

Returns:

  • (Boolean)


40
# File 'lib/rubylexer/token.rb', line 40

def has_no_block?; false end

#to_sObject



26
27
28
# File 'lib/rubylexer/token.rb', line 26

def to_s
  @ident || "<#{self.class.name}>"
end

#ws_munge(tp) ⇒ Object



96
97
98
# File 'lib/rubylexer/tokenprinter.rb', line 96

def ws_munge(tp)
   nil
end