Class: Rubinius::ToolSet.current::TS::AST::StringLiteral
- Defined in:
- lib/rubinius/ast/literals.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, str) ⇒ StringLiteral
constructor
A new instance of StringLiteral.
- #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, str) ⇒ StringLiteral
Returns a new instance of StringLiteral.
338 339 340 341 |
# File 'lib/rubinius/ast/literals.rb', line 338 def initialize(line, str) @line = line @string = str end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
336 337 338 |
# File 'lib/rubinius/ast/literals.rb', line 336 def string @string end |
Instance Method Details
#bytecode(g) ⇒ Object
343 344 345 346 347 348 349 |
# File 'lib/rubinius/ast/literals.rb', line 343 def bytecode(g) pos(g) # TODO: change to push_unique_literal g.push_literal @string g.string_dup end |
#defined(g) ⇒ Object
351 352 353 |
# File 'lib/rubinius/ast/literals.rb', line 351 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
355 356 357 |
# File 'lib/rubinius/ast/literals.rb', line 355 def to_sexp [:str, @string] end |