From 2784a07764c90dfda0b84ea2014a7cc030793ef0 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 5 Jan 2012 09:08:13 +1000 Subject: Bit more cleanup. --- LuaSL/src/LuaSL_parser.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'LuaSL') diff --git a/LuaSL/src/LuaSL_parser.c b/LuaSL/src/LuaSL_parser.c index c6026e2..f5a56d3 100644 --- a/LuaSL/src/LuaSL_parser.c +++ b/LuaSL/src/LuaSL_parser.c @@ -4,14 +4,16 @@ int main(void) { - char test[]=" 4 + 2*10 + 3*( 5 + 1 )"; + const char test[] = " 4 + 2*10 + 3*( 5 + 1 )"; SExpression *e = NULL; - int result = 0; - e = getAST(test); - result = evaluate(e); - printf("Result of '%s' is %d\n", test, result); - deleteExpression(e); + if ((e = getAST(test))) + { + int result = evaluate(e); + + printf("Result of '%s' is %d\n", test, result); + deleteExpression(e); + } return 0; } -- cgit v1.1