Przeglądaj źródła

show better line for double functions

Kajetan Johannes Hammerle 4 lat temu
rodzic
commit
6191d26fa8
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      Compiler.c

+ 2 - 1
Compiler.c

@@ -268,6 +268,7 @@ static void cFunctionInnerBody(int arguments) {
 }
 
 static void cFunctionBody(const char* name, int arguments) {
+    int oldLine = line;
     cConsumeToken(T_OPEN_CURVED_BRACKET);
     cAddOperation(OP_GOTO);
     int gotoIndex = cReserveInt();
@@ -276,7 +277,7 @@ static void cFunctionBody(const char* name, int arguments) {
     returnState = 0;
     cFunctionInnerBody(arguments);
     if(!fmAdd(&functions, name, arguments, address, returnState == 2)) {
-        cError("function registered twice on line %d", line);
+        cError("function registered twice on line %d", oldLine);
     }
 
     cAddOperation(OP_RETURN);