Class: SyntaxTree::TStringEnd
Overview
TStringEnd represents the end of a string literal.
"string"
In the example above, TStringEnd represents the second set of quotes. Strings can also use single quotes. They can also be declared using the %q and %Q syntax, as in:
%q{string}
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the end of the string.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ TStringEnd
constructor
A new instance of TStringEnd.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TStringEnd
Returns a new instance of TStringEnd.
8956 8957 8958 8959 |
# File 'lib/syntax_tree/node.rb', line 8956 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the end of the string
8954 8955 8956 |
# File 'lib/syntax_tree/node.rb', line 8954 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8961 8962 8963 |
# File 'lib/syntax_tree/node.rb', line 8961 def accept(visitor) visitor.visit_tstring_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8965 8966 8967 |
# File 'lib/syntax_tree/node.rb', line 8965 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8971 8972 8973 |
# File 'lib/syntax_tree/node.rb', line 8971 def deconstruct_keys(_keys) { value: value, location: location } end |