Class: SyntaxTree::CSS::BadURLToken

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

Overview

A parsed token that was a call to “url” that had a syntax error. It is mostly here for error recovery. www.w3.org/TR/css-syntax-3/#typedef-bad-url-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(value:, location:) ⇒ BadURLToken

Returns a new instance of BadURLToken.



125
126
127
128
# File 'lib/syntax_tree/css/nodes.rb', line 125

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



123
124
125
# File 'lib/syntax_tree/css/nodes.rb', line 123

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



123
124
125
# File 'lib/syntax_tree/css/nodes.rb', line 123

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



130
131
132
# File 'lib/syntax_tree/css/nodes.rb', line 130

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

#child_nodesObject Also known as: deconstruct



134
135
136
# File 'lib/syntax_tree/css/nodes.rb', line 134

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



140
141
142
# File 'lib/syntax_tree/css/nodes.rb', line 140

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