Browse Source

Fix MAIN_FUNCTION error message

Lucas Souza 5 years ago
parent
commit
fef92fdf6d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      js/ast/ivprogParser.js

+ 1 - 1
js/ast/ivprogParser.js

@@ -380,7 +380,7 @@ export class IVProgParser {
     const func = new Commands.Function(functionID, returnType, formalParams, commandsBlock);
     if (functionID === null && !func.isMain) {
       // TODO: better error message
-      throw new Error("");
+      throw new Error(`Function ${this.lexerClass.MAIN_FUNCTION_NAME} must return void (line ${token.line})`);
     }
     return func;
   }