From 251a9af5e8c4976373b71935457d1ce17c6888a1 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 31 Aug 2016 18:59:42 +0000 Subject: Add token class --- parser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'parser.cpp') diff --git a/parser.cpp b/parser.cpp index 91e4067..76da588 100644 --- a/parser.cpp +++ b/parser.cpp @@ -1,9 +1,10 @@ #include "parser.h" #include #include +#include "token.h" Parser::Parser(std::string& input) { - std::vector result; + std::vector result; bool isString = false; std::string tmp; @@ -14,7 +15,8 @@ Parser::Parser(std::string& input) { } if (c == '"' && isString) { - result.push_back(tmp); + Token token(tmp, true); + result.push_back(token); tmp = ""; isString = false; continue; @@ -22,7 +24,8 @@ Parser::Parser(std::string& input) { if (!isString) { std::string parsed(1, c); - result.push_back(parsed); + Token token(parsed, false); + result.push_back(token); } else { tmp += c; -- cgit v1.3