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, #ident, #offset, #tag

Instance Method Summary collapse

Methods inherited from Token

#error, #to_s, #ws_munge

Constructor Details

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

< SymbolToken



183
184
185
186
187
188
# File 'lib/rubylexer/token.rb', line 183

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



193
194
195
# File 'lib/rubylexer/token.rb', line 193

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

#[](regex) ⇒ Object

is this used?



190
191
192
# File 'lib/rubylexer/token.rb', line 190

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

#has_equalsObject



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

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

#has_no_block!Object



197
198
199
# File 'lib/rubylexer/token.rb', line 197

def has_no_block!
  @has_no_block=true
end

#has_no_block?Boolean

Returns:

  • (Boolean)


201
202
203
# File 'lib/rubylexer/token.rb', line 201

def has_no_block?
  @has_no_block
end