Class: SyntaxTree::CSS::BadStringToken

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/css/nodes.rb

Overview

A parsed token that was a quotes string that had a syntax error. It is mostly here for error recovery. www.w3.org/TR/css-syntax-3/#typedef-bad-string-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(value:, location:) ⇒ BadStringToken

Returns a new instance of BadStringToken.



99
100
101
102
# File 'lib/syntax_tree/css/nodes.rb', line 99

def initialize(value:, location:)
  @value = value
  @location = Location.from(location)
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



97
98
99
# File 'lib/syntax_tree/css/nodes.rb', line 97

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



97
98
99
# File 'lib/syntax_tree/css/nodes.rb', line 97

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



104
105
106
# File 'lib/syntax_tree/css/nodes.rb', line 104

def accept(visitor)
  visitor.visit_bad_string_token(self)
end

#child_nodesObject Also known as: deconstruct



108
109
110
# File 'lib/syntax_tree/css/nodes.rb', line 108

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



114
115
116
# File 'lib/syntax_tree/css/nodes.rb', line 114

def deconstruct_keys(keys)
  { value: value, location: location }
end