diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/css/CSSParser.cpp | 18 | ||||
-rw-r--r-- | src/plugins/css/CSSParser.hpp | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/css/CSSParser.cpp b/src/plugins/css/CSSParser.cpp index fc37184..51b2fd2 100644 --- a/src/plugins/css/CSSParser.cpp +++ b/src/plugins/css/CSSParser.cpp @@ -123,13 +123,13 @@ void CSSParser::parseSelectors(Rooted<SelectorNode> root, auto tuple = parseSelector(tokenizer, ctx); // append the SelectorPath to the root node. std::vector<Rooted<SelectorNode>> unmergedLeafs = - root->append(std::get<0>(tuple)); + root->append(tuple.first); // append the leaf to the leafList. switch (unmergedLeafs.size()) { case 0: // if the leaf could be merged we take the leaf reference from the // parseSelector method. - leafList.push_back(std::get<1>(tuple)); + leafList.push_back(tuple.second); break; case 1: // if the leaf could not be merged we take the existing leaf. @@ -149,7 +149,7 @@ void CSSParser::parseSelectors(Rooted<SelectorNode> root, } } -std::tuple<Rooted<SelectorNode>, Rooted<SelectorNode>> CSSParser::parseSelector( +std::pair<Rooted<SelectorNode>, Rooted<SelectorNode>> CSSParser::parseSelector( CodeTokenizer &tokenizer, ParserContext &ctx) { Rooted<SelectorNode> s = parsePrimitiveSelector(tokenizer, ctx); @@ -157,7 +157,7 @@ std::tuple<Rooted<SelectorNode>, Rooted<SelectorNode>> CSSParser::parseSelector( if (!tokenizer.peek(t)) { // if we are at the end the found selector is the immediate child as // well as the leaf. - return std::make_tuple(s, s); + return std::make_pair(s, s); } switch (t.tokenId) { case TOKEN_TEXT: { @@ -168,9 +168,9 @@ std::tuple<Rooted<SelectorNode>, Rooted<SelectorNode>> CSSParser::parseSelector( auto tuple = parseSelector(tokenizer, ctx); // then we establish the DESCENDANT relationship s->getEdges().push_back(new SelectorNode::SelectorEdge( - ctx.manager, std::get<0>(tuple))); + ctx.manager, tuple.first)); // and we return this node as well as the leaf. - return std::make_tuple(s, std::get<1>(tuple)); + return std::make_pair(s, tuple.second); } case ARROW: { tokenizer.consumePeek(); @@ -180,15 +180,15 @@ std::tuple<Rooted<SelectorNode>, Rooted<SelectorNode>> CSSParser::parseSelector( auto tuple = parseSelector(tokenizer, ctx); // then we establish the DESCENDANT relationship s->getEdges().push_back(new SelectorNode::SelectorEdge( - ctx.manager, std::get<0>(tuple), + ctx.manager, tuple.first, SelectionOperator::DIRECT_DESCENDANT)); // and we return this node as well as the leaf. - return std::make_tuple(s, std::get<1>(tuple)); + return std::make_pair(s, tuple.second); } default: // everything else is not part of the SelectorPath anymore. tokenizer.resetPeek(); - return std::make_tuple(s, s); + return std::make_pair(s, s); } } diff --git a/src/plugins/css/CSSParser.hpp b/src/plugins/css/CSSParser.hpp index 27a483d..a4d8cdc 100644 --- a/src/plugins/css/CSSParser.hpp +++ b/src/plugins/css/CSSParser.hpp @@ -20,7 +20,7 @@ #define _OUSIA_CSS_PARSER_HPP_ #include <vector> -#include <tuple> +#include <utility> #include <core/BufferedCharReader.hpp> #include <core/CodeTokenizer.hpp> @@ -79,7 +79,7 @@ private: * of the SelectorTree and returns the beginning node of the path as first * element as well as the leaf of the path as second tuple element. */ - std::tuple<Rooted<SelectorNode>, Rooted<SelectorNode>> parseSelector( + std::pair<Rooted<SelectorNode>, Rooted<SelectorNode>> parseSelector( CodeTokenizer &tokenizer, ParserContext &ctx); /** |