Class: RubyLexer::KeywordToken
- Defined in:
- lib/rubylexer/token.rb
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#grouping ⇒ Object
Returns the value of attribute grouping.
-
#ternary ⇒ Object
Returns the value of attribute ternary.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Token
#allow_ooo_offset, #as, #endline, #ident, #offset, #startline, #tag
Instance Method Summary collapse
-
#callsite? ⇒ Boolean
———————————–.
-
#has_end! ⇒ Object
———————————–.
-
#has_end? ⇒ Boolean
———————————–.
- #has_no_block! ⇒ Object
- #has_no_block? ⇒ Boolean
- #infix ⇒ Object
-
#infix? ⇒ Boolean
———————————–.
-
#initialize(*args) ⇒ KeywordToken
constructor
also some operators.
- #prefix? ⇒ Boolean (also: #unary)
-
#set_callsite!(x = true) ⇒ Object
———————————–.
-
#set_infix! ⇒ Object
———————————–.
-
#unary=(flag) ⇒ Object
———————————–.
Methods inherited from WToken
Methods inherited from Token
#dump, #error, #inspect, #linecount, #orig_inspect, #to_s, #ws_munge
Constructor Details
#initialize(*args) ⇒ KeywordToken
also some operators
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/rubylexer/token.rb', line 79 def initialize(*args) if Hash===args.last opts=args.pop as=opts.delete :as fail unless opts.empty? end super(*args) self.as=as end |
Instance Attribute Details
#grouping ⇒ Object
Returns the value of attribute grouping.
130 131 132 |
# File 'lib/rubylexer/token.rb', line 130 def grouping @grouping end |
#ternary ⇒ Object
Returns the value of attribute ternary.
130 131 132 |
# File 'lib/rubylexer/token.rb', line 130 def ternary @ternary end |
#value ⇒ Object
Returns the value of attribute value.
101 102 103 |
# File 'lib/rubylexer/token.rb', line 101 def value @value end |
Instance Method Details
#callsite? ⇒ Boolean
97 98 99 |
# File 'lib/rubylexer/token.rb', line 97 def callsite? @callsite if defined? @callsite end |
#has_end! ⇒ Object
121 122 123 |
# File 'lib/rubylexer/token.rb', line 121 def has_end! @has_end=true end |
#has_end? ⇒ Boolean
126 127 128 |
# File 'lib/rubylexer/token.rb', line 126 def has_end? self===RubyLexer::BEGINWORDS and @has_end||=nil end |
#has_no_block! ⇒ Object
132 133 134 |
# File 'lib/rubylexer/token.rb', line 132 def has_no_block! @has_no_block=true end |
#has_no_block? ⇒ Boolean
136 137 138 |
# File 'lib/rubylexer/token.rb', line 136 def has_no_block? @has_no_block if defined? @has_no_block end |
#infix ⇒ Object
140 141 142 |
# File 'lib/rubylexer/token.rb', line 140 def infix @infix if defined? @infix end |
#infix? ⇒ Boolean
114 115 116 |
# File 'lib/rubylexer/token.rb', line 114 def infix? @infix ||= nil end |
#prefix? ⇒ Boolean Also known as: unary
117 |
# File 'lib/rubylexer/token.rb', line 117 def prefix?; !infix? end |
#set_callsite!(x = true) ⇒ Object
92 93 94 |
# File 'lib/rubylexer/token.rb', line 92 def set_callsite!(x=true) @callsite=x end |
#set_infix! ⇒ Object
104 105 106 |
# File 'lib/rubylexer/token.rb', line 104 def set_infix! @infix=true end |
#unary=(flag) ⇒ Object
109 110 111 |
# File 'lib/rubylexer/token.rb', line 109 def unary= flag @infix=!flag end |