Class: RubyLexer::MethNameToken

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

Overview


Instance Attribute Summary

Attributes inherited from Token

#allow_ooo_offset, #as, #endline, #ident, #offset, #startline, #tag

Instance Method Summary collapse

Methods inherited from Token

#dump, #error, #inspect, #linecount, #orig_inspect, #to_s, #ws_munge

Constructor Details

#initialize(ident, offset = nil, bogus = nil) ⇒ MethNameToken

< SymbolToken



236
237
238
239
240
241
# File 'lib/rubylexer/token.rb', line 236

def initialize(ident,offset=nil,bogus=nil)
   @ident= (VarNameToken===ident)? ident.ident : ident
   @offset=offset
   @has_no_block=false
#   @char=''
end

Instance Method Details

#===(pattern) ⇒ Object



246
247
248
# File 'lib/rubylexer/token.rb', line 246

def ===(pattern)
   pattern===@ident
end

#[](regex) ⇒ Object

is this used?



243
244
245
# File 'lib/rubylexer/token.rb', line 243

def [](regex) #is this used?
   regex===ident
end

#has_equalsObject



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

def has_equals; /[a-z_0-9]=$/i===ident end

#has_no_block!Object



250
251
252
# File 'lib/rubylexer/token.rb', line 250

def has_no_block!
  @has_no_block=true
end

#has_no_block?Boolean

Returns:

  • (Boolean)


254
255
256
# File 'lib/rubylexer/token.rb', line 254

def has_no_block?
  @has_no_block
end