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.
429 430 431 432 |
# File 'lib/rubinius/code/ast/literals.rb', line 429 def initialize(line, str) @line = line @string = str end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
427 428 429 |
# File 'lib/rubinius/code/ast/literals.rb', line 427 def string @string end |
Instance Method Details
#bytecode(g) ⇒ Object
434 435 436 437 438 439 |
# File 'lib/rubinius/code/ast/literals.rb', line 434 def bytecode(g) pos(g) g.push_literal @string g.string_dup end |
#defined(g) ⇒ Object
441 442 443 |
# File 'lib/rubinius/code/ast/literals.rb', line 441 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
445 446 447 |
# File 'lib/rubinius/code/ast/literals.rb', line 445 def to_sexp [:str, @string] end |