Class: CodeTools::AST::StringLiteral
- Defined in:
- lib/rubinius/code/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.
398 399 400 401 |
# File 'lib/rubinius/code/ast/literals.rb', line 398 def initialize(line, str) @line = line @string = str end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
396 397 398 |
# File 'lib/rubinius/code/ast/literals.rb', line 396 def string @string end |
Instance Method Details
#bytecode(g) ⇒ Object
403 404 405 406 407 408 |
# File 'lib/rubinius/code/ast/literals.rb', line 403 def bytecode(g) pos(g) g.push_literal @string g.string_dup end |
#defined(g) ⇒ Object
410 411 412 |
# File 'lib/rubinius/code/ast/literals.rb', line 410 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
414 415 416 |
# File 'lib/rubinius/code/ast/literals.rb', line 414 def to_sexp [:str, @string] end |