From 62d07878d75c13ffaf544ea2a94c20e52b403203 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Wed, 2 Jul 2014 14:28:21 +0200 Subject: [PATCH] Fixed two issues in matchcompiler: - Use correct findmatch or findsimplematch for verification - Print failing pattern also for findmatch/findsimplematch --- tools/matchcompiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/matchcompiler.py b/tools/matchcompiler.py index 95c6b6585..06acdba28 100755 --- a/tools/matchcompiler.py +++ b/tools/matchcompiler.py @@ -324,7 +324,7 @@ class MatchCompiler: # ret += ' std::cout << "tok: " << tok->str();\n' # ret += ' if (tok->next())\n' # ret += ' std::cout << "tok next: " << tok->next()->str();\n' - ret += ' throw InternalError(tok, "Internal error. compiled match returned different result than parsed match: " + std::string("' + pattern + '"));\n' + ret += ' throw InternalError(tok, "Internal error. compiled match returned different result than parsed match: ' + pattern + '");\n' ret += ' }\n' ret += ' return res_compiled_match;\n' ret += '}\n' @@ -425,7 +425,7 @@ class MatchCompiler: origFindMatchName = 'findmatch' if is_findsimplematch: - origMatchName = 'findsimplematch' + origFindMatchName = 'findsimplematch' assert(varId is None) ret += ' T * res_compiled_findmatch = findmatch' + \ @@ -448,7 +448,7 @@ class MatchCompiler: # Don't use assert() here, it's disabled for optimized builds. # We also need to verify builds in 'release' mode ret += ' if (res_parsed_findmatch != res_compiled_findmatch) {\n' - ret += ' throw InternalError(tok, "Internal error. compiled findmatch returned different result than parsed findmatch");\n' + ret += ' throw InternalError(tok, "Internal error. compiled findmatch returned different result than parsed findmatch: ' + pattern + '");\n' ret += ' }\n' ret += ' return res_compiled_findmatch;\n' ret += '}\n'