Beginning support for new parser error messages

This commit is contained in:
ridiculousfish
2013-06-15 15:21:35 -07:00
parent 827a9d640c
commit 4ca46b7883
4 changed files with 103 additions and 21 deletions

View File

@@ -1725,13 +1725,18 @@ static void test_new_parser(void)
const wcstring src = L"echo hello world";
parse_node_tree_t parse_tree;
parse_t parser;
parser.parse(src, &parse_tree);
parse_execution_context_t ctx(parse_tree, src);
say(L"Simulating execution:");
wcstring simulation = ctx.simulate();
printf("%ls\n", simulation.c_str());
bool success = parser.parse(src, &parse_tree, NULL);
if (! success)
{
say(L"Parsing failed");
}
else
{
parse_execution_context_t ctx(parse_tree, src);
say(L"Simulating execution:");
wcstring simulation = ctx.simulate();
say(simulation.c_str());
}
}
/**