Browse Source

Rename DoUntil command to RepeatUntil

Lucas de Souza 5 years ago
parent
commit
7ecbf60a43

+ 1 - 1
grammar/pt/ivprog.g4

@@ -78,7 +78,7 @@ RK_BREAK
   ;
 
 RK_DO
-  : 'faca'
+  : 'repita'
   ;
 
 RK_DO_UNTIL

+ 2 - 2
i18n/pt/ui.json

@@ -48,9 +48,9 @@
   "text_else":"senao",
   "text_for":"repita_para",
   "text_code_while":"repita_enquanto",
-  "text_code_do":"faca",
+  "text_code_do":"repita",
   "text_code_do_until":"ate_que",
-  "text_command_do":"faça",
+  "text_command_do":"repita",
   "text_command_while":"repita enquanto",
   "text_command_do_until":"até que",
   "text_code_switch": "escolha",

+ 2 - 2
js/ast/commands/index.js

@@ -9,7 +9,7 @@ import { For } from './for';
 import { Function } from './function';
 import { IfThenElse } from './ifThenElse';
 import { CommandBlock } from './commandBlock';
-import { DoUntil } from './doUntil';
+import { RepeatUntil } from './repeatUntil';
 import { Switch } from './switch';
 import { Case } from './case';
 import { SysCall } from './sysCall';
@@ -28,7 +28,7 @@ export {
   Function,
   IfThenElse,
   CommandBlock,
-  DoUntil,
+  RepeatUntil,
   Switch,
   Case,
   SysCall,

+ 1 - 1
js/ast/commands/doUntil.js

@@ -1,6 +1,6 @@
 import { While } from './while';
 
-export class DoUntil extends While {
+export class RepeatUntil extends While {
 
   constructor(condition, commandBlock) {
     super(condition, commandBlock);

+ 3 - 3
js/ast/ivprogParser.js

@@ -796,7 +796,7 @@ export class IVProgParser {
     } else if (token.type === this.lexerClass.RK_SWITCH) {
       return this.parseSwitchCase();
     } else if (token.type === this.lexerClass.RK_DO) {
-      return this.parseDoUntil();
+      return this.parseRepeatUntil();
     } else if (token.type === this.lexerClass.RK_IF) {
       return this.parseIfThenElse();
     } else if (this.checkEOS(true)){
@@ -831,7 +831,7 @@ export class IVProgParser {
     return new Commands.Switch(exp, casesList);
   }
 
-  parseDoUntil () {
+  parseRepeatUntil () {
     this.pos++;
     this.consumeNewLines();
     this.pushScope(IVProgParser.BREAKABLE);
@@ -851,7 +851,7 @@ export class IVProgParser {
     this.pos++;
     this.checkEOS();
     this.popScope();
-    return new Commands.DoUntil(condition, commandsBlock);
+    return new Commands.RepeatUntil(condition, commandsBlock);
   }
 
   parseIfThenElse () {

+ 3 - 3
js/processor/ivprogProcessor.js

@@ -234,8 +234,8 @@ export class IVProgProcessor {
       return this.executeReturn(store, cmd);
     } else if (cmd instanceof Commands.IfThenElse) {
       return this.executeIfThenElse(store, cmd);
-    } else if (cmd instanceof Commands.DoUntil) {
-      return this.executeDoUntil(store, cmd);
+    } else if (cmd instanceof Commands.RepeatUntil) {
+      return this.executeRepeatUntil(store, cmd);
     } else if (cmd instanceof Commands.While) {
       return this.executeWhile(store, cmd);
     } else if (cmd instanceof Commands.For) {
@@ -350,7 +350,7 @@ export class IVProgProcessor {
     }).catch(error => Promise.reject(error));
   }
 
-  executeDoUntil (store, cmd) {
+  executeRepeatUntil (store, cmd) {
     try {
       this.loopTimers.push(Date.now());
       this.context.push(Context.BREAKABLE);