protected override Boolean OnToken(CssSelectorToken token) { return(_state switch { ParseState.Initial => OnInitial(token), ParseState.AfterInitialSign => OnAfterInitialSign(token), ParseState.Offset => OnOffset(token), ParseState.BeforeOf => OnBeforeOf(token), _ => OnAfter(token) });
protected override Boolean OnToken(CssSelectorToken token) { if (token.Type != CssTokenType.RoundBracketClose || _selector._state != State.Data) { _selector.Apply(token); return(false); } return(true); }
protected override Boolean OnToken(CssSelectorToken token) { if (token.Type == CssTokenType.Ident || token.Type == CssTokenType.String) { _value = token.Data; } else if (token.Type == CssTokenType.RoundBracketClose) { return(true); } else if (token.Type != CssTokenType.Whitespace) { _valid = false; } return(false); }
protected override Boolean OnToken(CssSelectorToken token) { if (token.Type != CssTokenType.RoundBracketClose || _nested._state != State.Data) { if (_firstToken && token.Type == CssTokenType.Delim) { // Roughly equivalent to inserting an implicit :scope _nested.Insert(ScopePseudoClassSelector.Instance); _nested.Apply(CssSelectorToken.Whitespace); _matchSiblings = true; } _firstToken = false; _nested.Apply(token); return(false); } return(true); }
protected abstract Boolean OnToken(CssSelectorToken token);
public Boolean Finished(CssSelectorToken token) { return(OnToken(token)); }