aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_parser.c')
-rw-r--r--LuaSL/src/LuaSL_parser.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/LuaSL/src/LuaSL_parser.c b/LuaSL/src/LuaSL_parser.c
index f5a56d3..35cb782 100644
--- a/LuaSL/src/LuaSL_parser.c
+++ b/LuaSL/src/LuaSL_parser.c
@@ -5,14 +5,16 @@
5int main(void) 5int main(void)
6{ 6{
7 const char test[] = " 4 + 2*10 + 3*( 5 + 1 )"; 7 const char test[] = " 4 + 2*10 + 3*( 5 + 1 )";
8 SExpression *e = NULL; 8 LSL_Expression *exp;
9 9
10 if ((e = getAST(test))) 10 if ((exp = newTree(test)))
11 { 11 {
12 int result = evaluate(e); 12 int result = evaluateExpression(exp, 0);
13 13
14 printf("Result of '%s' is %d\n", test, result); 14 printf("Result of '%s' is %d\n", test, result);
15 deleteExpression(e); 15 outputExpression(exp);
16 printf("\n");
17 burnLSLExpression(exp);
16 } 18 }
17 19
18 return 0; 20 return 0;