From 468da9dcde24fca935c9b596a9fb25a9530f202c Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 3 Jul 2014 18:17:35 -0400 Subject: [PATCH] Parser - Sets proper ambiguity required during Parser::initialize. --- src/Parser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 960d66606..46105f21b 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -83,16 +83,16 @@ void Parser::initialize (int argc, const char** argv) if (! noSpaces (raw)) branch->tag ("QUOTED"); - std::vector > lexemes; - Lexer::token_split (lexemes, raw); - - std::vector >::iterator lex; - for (lex = lexemes.begin (); lex != lexemes.end (); ++lex) + std::string lexeme; + Lexer::Type type; + Lexer lex (raw); + lex.ambiguity (false); + while (lex.token (lexeme, type)) { Tree* sub = branch->addBranch (new Tree ("argSub")); - sub->attribute ("raw", lex->first); + sub->attribute ("raw", lexeme); - if (lex->second == Lexer::typeOperator) + if (type == Lexer::typeOperator) sub->tag ("OP"); // TODO More types needed.