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.c14
1 files changed, 8 insertions, 6 deletions
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 @@
4 4
5int main(void) 5int main(void)
6{ 6{
7 char test[]=" 4 + 2*10 + 3*( 5 + 1 )"; 7 const char test[] = " 4 + 2*10 + 3*( 5 + 1 )";
8 SExpression *e = NULL; 8 SExpression *e = NULL;
9 int result = 0;
10 9
11 e = getAST(test); 10 if ((e = getAST(test)))
12 result = evaluate(e); 11 {
13 printf("Result of '%s' is %d\n", test, result); 12 int result = evaluate(e);
14 deleteExpression(e); 13
14 printf("Result of '%s' is %d\n", test, result);
15 deleteExpression(e);
16 }
15 17
16 return 0; 18 return 0;
17} 19}