Class: CSS::Selectors::AnBParser::Impl
- Inherits:
-
Object
- Object
- CSS::Selectors::AnBParser::Impl
- Includes:
- TokenCursor
- Defined in:
- lib/css/selectors/anb_parser.rb
Constant Summary
Constants included from TokenCursor
Instance Method Summary collapse
-
#initialize(tokens) ⇒ Impl
constructor
A new instance of Impl.
- #parse ⇒ Object
Methods included from TokenCursor
#consume, #eof?, #init_cursor, #parse_error!, #peek, #peek_token, #skip_whitespace
Constructor Details
#initialize(tokens) ⇒ Impl
Returns a new instance of Impl.
20 21 22 |
# File 'lib/css/selectors/anb_parser.rb', line 20 def initialize(tokens) init_cursor(tokens) end |
Instance Method Details
#parse ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/css/selectors/anb_parser.rb', line 24 def parse skip_whitespace result = parse_value skip_whitespace unless peek.type == :eof raise ParseError, "trailing tokens in AnB: #{peek.type}" end result end |