@@ -271,7 +271,9 @@ static bool cFunction() {
cError("unexpected end of file: function not closed on line %d", oldLine);
return false;
}
- cLine();
+ if(!cLine()) {
+ return false;
+ }
varIndex = 0;
@@ -320,6 +322,7 @@ static void cForEachLine() {
static void cAllocAndCompile() {
+ varIndex = 0;
simInit(vars);
simInit(vars + 1);
simInit(&functions);
@@ -1,11 +1,17 @@
a = 2;
b = 3;
+function wusi(c, d) {
+ print c;
+ print d;
+}
+
function test(c, d) {
print a;
print b;
print c;
print d;
+ wusi(4, 5 + 6);
test(a, b);
@@ -2,6 +2,8 @@ null
null
2
3
+4
+11
@@ -0,0 +1,13 @@
+function wusi() {
+ print 6;
+ print 7;
+function test() {
+ print 4;
+ print 5;
+ wusi();
+test();
@@ -0,0 +1,8 @@
+5
+6
+7