diff --git a/eci/Lexer.cpp b/eci/Lexer.cpp index 4b369cd..7b21495 100644 --- a/eci/Lexer.cpp +++ b/eci/Lexer.cpp @@ -29,26 +29,8 @@ eci::LexerResult eci::Lexer::interprete(const std::string& _data) { ECI_INFO("Parse RegEx : " << it.first << " : " << it.second.getRegExDecorated()); if (it.second.parse(_data, 0, _data.size()) == true) { ECI_INFO(" match [" << it.second.start() << ".." << it.second.stop() << "] "); - ECI_INFO(" ==> '" << std::string(_data, it.second.start(), it.second.stop()) << "'"); + ECI_INFO(" ==> '" << std::string(_data, it.second.start(), it.second.stop()-it.second.start()) << "'"); } - /* - std::smatch m; - std::regex_search (_data, m, it.second); - for (unsigned i=0; i int main(int argc, char** argv) { + etk::log::setLevel(etk::log::logLevelDebug); + etk::log::setLevel(etk::log::logLevelInfo); ECI_INFO("Start Application interpeter languages"); if (argc<=1) { ECI_CRITICAL("need the file to parse"); @@ -19,6 +21,8 @@ int main(int argc, char** argv) { } eci::ParserCpp tmpParser; std::string data = "/* plop */ \n int eee = 22; // error value \nint main(void) {\n return 0;\n}\n";//etk::FSNodeReadAllData(argv[1]); + //std::string data = "alpha /* plop */ test"; + //std::string data = "pp \n // qdfqdfsdf \nde"; tmpParser.parse(data); return 0; diff --git a/eci/lang/ParserCpp.cpp b/eci/lang/ParserCpp.cpp index 1c0b828..2e71794 100644 --- a/eci/lang/ParserCpp.cpp +++ b/eci/lang/ParserCpp.cpp @@ -18,6 +18,7 @@ enum cppTokenList { eci::ParserCpp::ParserCpp() { m_lexer.append(tokenCppMultilineComment, "/\\*.*\\*/"); m_lexer.append(tokenCppSingleLineComment, "//.*$"); + m_lexer.append(82939, "/\\*.*"); m_lexer.append(tokenCppString, "[a-z]"); }