Turned on expression parsing and printing

git-svn-id: svn://10.0.0.236/trunk@69335 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waldemar%netscape.com 2000-05-12 03:26:43 +00:00
parent 310fb63a5a
commit bb48faf496
2 changed files with 26 additions and 6 deletions

View File

@ -191,8 +191,18 @@ static void readEvalPrint(FILE *in, World &world)
t.print(stdOut, true);
}
} else {
ExprNode *parseTree = p.parsePostfixExpression();
genCode(parseTree);
ExprNode *parseTree = p.parseExpression(false);
{
PrettyPrinter f(stdOut, 20);
{
PrettyPrinter::Block b(f, 2);
f << "Expression =";
f.linearBreak(1);
f << parseTree;
}
f.end();
}
// genCode(parseTree);
}
clear(buffer);
stdOut << '\n';
@ -685,7 +695,7 @@ int main(int argc, char **argv)
assert(testObjects(world, 5) == 5);
assert(testProto(world, 5) == 5);
// testICG(world);
assert(testFunctionCall(world, 5) == 5);
// assert(testFunctionCall(world, 5) == 5);
testPrint(world);
readEvalPrint(stdin, world);
return 0;

View File

@ -191,8 +191,18 @@ static void readEvalPrint(FILE *in, World &world)
t.print(stdOut, true);
}
} else {
ExprNode *parseTree = p.parsePostfixExpression();
genCode(parseTree);
ExprNode *parseTree = p.parseExpression(false);
{
PrettyPrinter f(stdOut, 20);
{
PrettyPrinter::Block b(f, 2);
f << "Expression =";
f.linearBreak(1);
f << parseTree;
}
f.end();
}
// genCode(parseTree);
}
clear(buffer);
stdOut << '\n';
@ -685,7 +695,7 @@ int main(int argc, char **argv)
assert(testObjects(world, 5) == 5);
assert(testProto(world, 5) == 5);
// testICG(world);
assert(testFunctionCall(world, 5) == 5);
// assert(testFunctionCall(world, 5) == 5);
testPrint(world);
readEvalPrint(stdin, world);
return 0;