Class: SyntaxTree::CSS::EOFToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A conceptual token representing the end of the list of tokens. Whenever the list of tokens is empty, the next input token is always an EOFToken. www.w3.org/TR/css-syntax-3/#typedef-eof-token
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Class Method Summary collapse
-
.[](index) ⇒ Object
Since we create EOFToken objects a lot with ranges that are empty, it’s nice to have this convenience method.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location:) ⇒ EOFToken
constructor
A new instance of EOFToken.
Methods inherited from Node
Constructor Details
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
467 468 469 |
# File 'lib/syntax_tree/css/nodes.rb', line 467 def location @location end |
Class Method Details
.[](index) ⇒ Object
Since we create EOFToken objects a lot with ranges that are empty, it’s nice to have this convenience method.
489 490 491 |
# File 'lib/syntax_tree/css/nodes.rb', line 489 def self.[](index) new(location: index...index) end |
Instance Method Details
#accept(visitor) ⇒ Object
473 474 475 |
# File 'lib/syntax_tree/css/nodes.rb', line 473 def accept(visitor) visitor.visit_eof_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
477 478 479 |
# File 'lib/syntax_tree/css/nodes.rb', line 477 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
483 484 485 |
# File 'lib/syntax_tree/css/nodes.rb', line 483 def deconstruct_keys(keys) { location: location } end |