Class: RubyLexer::KeywordToken

Inherits:
WToken show all
Defined in:
lib/rubylexer/token.rb

Overview


Instance Attribute Summary collapse

Attributes inherited from Token

#allow_ooo_offset, #as, #ident, #offset, #tag

Instance Method Summary collapse

Methods inherited from WToken

#===

Methods inherited from Token

#error, #initialize, #to_s, #ws_munge

Constructor Details

This class inherits a constructor from RubyLexer::Token

Instance Attribute Details

#groupingObject

Returns the value of attribute grouping.



95
96
97
# File 'lib/rubylexer/token.rb', line 95

def grouping
  @grouping
end

#ternaryObject

Returns the value of attribute ternary.



95
96
97
# File 'lib/rubylexer/token.rb', line 95

def ternary
  @ternary
end

#valueObject

Returns the value of attribute value.



66
67
68
# File 'lib/rubylexer/token.rb', line 66

def value
  @value
end

Instance Method Details

#callsite?Boolean


Returns:

  • (Boolean)


62
63
64
# File 'lib/rubylexer/token.rb', line 62

def callsite? 
  @callsite if defined? @callsite
end

#has_end!Object




86
87
88
# File 'lib/rubylexer/token.rb', line 86

def has_end!
  @has_end=true
end

#has_end?Boolean


Returns:

  • (Boolean)


91
92
93
# File 'lib/rubylexer/token.rb', line 91

def has_end?
  self===RubyLexer::BEGINWORDS and @has_end||=nil
end

#has_no_block!Object



97
98
99
# File 'lib/rubylexer/token.rb', line 97

def has_no_block!
   @has_no_block=true
end

#has_no_block?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/rubylexer/token.rb', line 101

def has_no_block?
   @has_no_block if defined? @has_no_block
end

#infixObject



105
106
107
# File 'lib/rubylexer/token.rb', line 105

def infix
  @infix if defined? @infix
end

#infix?Boolean


Returns:

  • (Boolean)


79
80
81
# File 'lib/rubylexer/token.rb', line 79

def infix? 
  @infix ||= nil
end

#prefix?Boolean Also known as: unary

Returns:

  • (Boolean)


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

def prefix?; !infix? end

#set_callsite!(x = true) ⇒ Object




57
58
59
# File 'lib/rubylexer/token.rb', line 57

def set_callsite!(x=true)
  @callsite=x
end

#set_infix!Object




69
70
71
# File 'lib/rubylexer/token.rb', line 69

def set_infix! 
  @infix=true
end

#unary=(flag) ⇒ Object




74
75
76
# File 'lib/rubylexer/token.rb', line 74

def unary= flag
  @infix=!flag
end