Class: CodeTools::AST::RangeExclude

Inherits:
Range
  • Object
show all
Defined in:
lib/rubinius/code/ast/literals.rb

Instance Attribute Summary

Attributes inherited from Range

#finish, #start

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Range

#defined

Methods inherited from Node

#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, start, finish) ⇒ RangeExclude

Returns a new instance of RangeExclude.



328
329
330
331
332
# File 'lib/rubinius/code/ast/literals.rb', line 328

def initialize(line, start, finish)
  @line = line
  @start = start
  @finish = finish
end

Instance Method Details

#bytecode(g) ⇒ Object



334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/rubinius/code/ast/literals.rb', line 334

def bytecode(g)
  pos(g)

  g.push_cpath_top
  g.find_const :Range
  g.send :allocate, 0, true
  g.dup
  @start.bytecode(g)
  @finish.bytecode(g)
  g.push_true
  g.send :initialize, 3, true
  g.pop
end

#to_sexpObject



348
349
350
# File 'lib/rubinius/code/ast/literals.rb', line 348

def to_sexp
  [:dot3, @start.to_sexp, @finish.to_sexp]
end