瀏覽代碼

Fix repeat untill command not showing the correct name in the menu

Fix a bug that prevent a return inside the main function
Lucas de Souza 4 年之前
父節點
當前提交
e79a7f541f
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 1 1
      i18n/pt/ui.json
  2. 5 1
      js/processor/ivprogProcessor.js

+ 1 - 1
i18n/pt/ui.json

@@ -67,7 +67,7 @@
   "text_repeatNtimes": "Repita N vezes",
   "text_receives": "recebe",
   "text_whiletrue": "Enquanto verdadeiro",
-  "text_dowhiletrue": "Faça até que verdadeiro",
+  "text_dowhiletrue": "Repita até que verdadeiro",
   "text_switch": "Escolha",
   "text_functioncall": "Chamada de função",
   "text_value": "Valor",

+ 5 - 1
js/processor/ivprogProcessor.js

@@ -109,6 +109,9 @@ export class IVProgProcessor {
 
   findFunction (name) {
     if(name.match(/^\$.+$/)) {
+      if(name === IVProgProcessor.MAIN_INTERNAL_ID) {
+        return this.findMainFunction();
+      }
       const fun = LanguageDefinedFunction.getFunction(name);
       if(!fun) {
         throw ProcessorErrorFactory.not_implemented(name);
@@ -458,7 +461,8 @@ export class IVProgProcessor {
     try {
       const funcName = store.name === IVProgProcessor.MAIN_INTERNAL_ID ? 
         LanguageDefinedFunction.getMainFunctionName() : store.name;
-      const func = this.findFunction(funcName);
+      console.log(funcName,  store.name === IVProgProcessor.MAIN_INTERNAL_ID);
+      const func = this.findFunction(store.name);
       const funcType = func.returnType;
       const $value = this.evaluateExpression(store, cmd.expression);