Class: Rubinius::ToolSet.current::TS::AST::Range
- Defined in:
- lib/rubinius/ast/literals.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#finish ⇒ Object
Returns the value of attribute finish.
-
#start ⇒ Object
Returns the value of attribute start.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, start, finish) ⇒ Range
constructor
A new instance of Range.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, 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) ⇒ Range
Returns a new instance of Range.
239 240 241 242 243 |
# File 'lib/rubinius/ast/literals.rb', line 239 def initialize(line, start, finish) @line = line @start = start @finish = finish end |
Instance Attribute Details
#finish ⇒ Object
Returns the value of attribute finish.
237 238 239 |
# File 'lib/rubinius/ast/literals.rb', line 237 def finish @finish end |
#start ⇒ Object
Returns the value of attribute start.
237 238 239 |
# File 'lib/rubinius/ast/literals.rb', line 237 def start @start end |
Instance Method Details
#bytecode(g) ⇒ Object
245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/rubinius/ast/literals.rb', line 245 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.send :initialize, 2, true g.pop end |
#defined(g) ⇒ Object
258 259 260 |
# File 'lib/rubinius/ast/literals.rb', line 258 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
262 263 264 |
# File 'lib/rubinius/ast/literals.rb', line 262 def to_sexp [:dot2, @start.to_sexp, @finish.to_sexp] end |