Class: RedParse::Token

Inherits:
Object
  • Object
show all
Extended by:
Stackable::Meta
Includes:
Stackable
Defined in:
lib/redparse/node.rb

Direct Known Subclasses

GoalPostToken, StartToken

Instance Attribute Summary collapse

Attributes included from Stackable::Meta

#boolean_identity_params, #identity_params

Instance Method Summary collapse

Methods included from Stackable::Meta

build_exemplars, enumerate_exemplars, identity_param

Methods included from Stackable

#identity_name

Instance Attribute Details

#lineObject (readonly) Also known as: endline

Returns the value of attribute line.



187
188
189
# File 'lib/redparse/node.rb', line 187

def line
  @line
end

#startlineObject



191
192
193
# File 'lib/redparse/node.rb', line 191

def startline
  @startline||=endline
end

Instance Method Details

#begin_parsetree(o) ⇒ Object



185
# File 'lib/redparse/node.rb', line 185

def begin_parsetree(o); parsetree(o) end

#dataObject



182
# File 'lib/redparse/node.rb', line 182

def data; [self] end

#imageObject



167
# File 'lib/redparse/node.rb', line 167

def image; "#{inspect}" end

#lvalueObject



181
# File 'lib/redparse/node.rb', line 181

def lvalue; nil end

#rescue_parsetree(o) ⇒ Object



184
# File 'lib/redparse/node.rb', line 184

def rescue_parsetree(o); parsetree(o) end

#to_parsetree(*options) ⇒ Object

this shouldn’t be needed anymore



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/redparse/node.rb', line 169

def to_parsetree(*options) #this shouldn't be needed anymore
  o={}
  [:newlines,:quirks,:ruby187].each{|opt| 
    o[opt]=true if options.include? opt
  }

  result=[parsetree(o)] 

  result=[] if result==[[]]

  return result
end

#unaryObject



183
# File 'lib/redparse/node.rb', line 183

def unary; false end