From 04ee61f336cf9bd848c9d922619db2ee45faafe9 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 5 Dec 2014 13:53:06 +0100 Subject: added an 'accepting' attribute to SelectorNodes to make them properly usable as finite state machine nodes without relying on rulesets. --- src/plugins/css/CSSParser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/css/CSSParser.cpp b/src/plugins/css/CSSParser.cpp index d239359..00b5af5 100644 --- a/src/plugins/css/CSSParser.cpp +++ b/src/plugins/css/CSSParser.cpp @@ -99,6 +99,15 @@ void CSSParser::parseDocument(Rooted root, std::vector> leafList; parseSelectors(root, tokenizer, leafList, ctx); // TODO: Parse Ruleset + for (auto &leaf : leafList) { + /* every leaf is an accepting node, if one considers the SelectorTree + * to be a finite state machine. This is relevant, if users do not use + * the CSS Parser to parse actual Ruleset content but to construct a + * SelectorTree just to identify a part of the DocumentTree. + */ + leaf->setAccepting(true); + //TODO: append RuleSets + } parseDocument(root, tokenizer, ctx); } -- cgit v1.2.3