| 
															
																@@ -18,6 +18,7 @@ import { StoreValueRef } from './store/value/store_value_ref'; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { ArrayStoreValue } from './store/value/array_store_value'; 
															 | 
															
															 | 
															
																 import { ArrayStoreValue } from './store/value/array_store_value'; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { ArrayStoreValueRef } from './store/value/array_store_value_ref'; 
															 | 
															
															 | 
															
																 import { ArrayStoreValueRef } from './store/value/array_store_value_ref'; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { StoreValueAddress } from './store/value/store_value_address'; 
															 | 
															
															 | 
															
																 import { StoreValueAddress } from './store/value/store_value_address'; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import { LocalizedStrings } from '../services/localizedStringsService'; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 export class IVProgProcessor { 
															 | 
															
															 | 
															
																 export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -42,10 +43,12 @@ export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.forceKill = false; 
															 | 
															
															 | 
															
																     this.forceKill = false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.loopTimers = []; 
															 | 
															
															 | 
															
																     this.loopTimers = []; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.output = null; 
															 | 
															
															 | 
															
																     this.output = null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    this.mode = Modes.RUN; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     /** 
															 | 
															
															 | 
															
																     /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																      * Stores the sourceInfo of every function call, command or expression 
															 | 
															
															 | 
															
																      * Stores the sourceInfo of every function call, command or expression 
															 | 
														
													
												
													
														
															| 
															 | 
															
																      */ 
															 | 
															
															 | 
															
																      */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.function_call_stack = []; 
															 | 
															
															 | 
															
																     this.function_call_stack = []; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    this.command_count = 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																   registerInput (input) { 
															 | 
															
															 | 
															
																   registerInput (input) { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -86,6 +89,7 @@ export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.globalStore = new Store("$global"); 
															 | 
															
															 | 
															
																     this.globalStore = new Store("$global"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.stores = [this.globalStore]; 
															 | 
															
															 | 
															
																     this.stores = [this.globalStore]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     this.context = [Context.BASE]; 
															 | 
															
															 | 
															
																     this.context = [Context.BASE]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    this.command_count = 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																   interpretAST () { 
															 | 
															
															 | 
															
																   interpretAST () { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -220,8 +224,9 @@ export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																   executeCommand (store, cmd) { 
															 | 
															
															 | 
															
																   executeCommand (store, cmd) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    this.command_count += 1; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     return new Promise((resolve, reject) => { 
															 | 
															
															 | 
															
																     return new Promise((resolve, reject) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      setTimeout(() => { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      const command_lambda = () => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         if(this.forceKill) { 
															 | 
															
															 | 
															
																         if(this.forceKill) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           return reject("FORCED_KILL!"); 
															 | 
															
															 | 
															
																           return reject("FORCED_KILL!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } else if (store.mode === Modes.PAUSE) { 
															 | 
															
															 | 
															
																         } else if (store.mode === Modes.PAUSE) { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -230,6 +235,8 @@ export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           return resolve(store); 
															 | 
															
															 | 
															
																           return resolve(store); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } else if(this.checkContext(Context.BREAKABLE) && store.mode === Modes.BREAK) { 
															 | 
															
															 | 
															
																         } else if(this.checkContext(Context.BREAKABLE) && store.mode === Modes.BREAK) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           return resolve(store); 
															 | 
															
															 | 
															
																           return resolve(store); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        } else if (this.mode === Modes.ABORT) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+          return reject(LocalizedStrings.getMessage('aborted_execution')); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         if (cmd instanceof Commands.Declaration) { 
															 | 
															
															 | 
															
																         if (cmd instanceof Commands.Declaration) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           return resolve(this.executeDeclaration(store, cmd)); 
															 | 
															
															 | 
															
																           return resolve(this.executeDeclaration(store, cmd)); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -258,7 +265,13 @@ export class IVProgProcessor { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } else { 
															 | 
															
															 | 
															
																         } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           return reject(ProcessorErrorFactory.unknown_command(cmd.sourceInfo)) 
															 | 
															
															 | 
															
																           return reject(ProcessorErrorFactory.unknown_command(cmd.sourceInfo)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      }, 5); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      }; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      if(this.command_count % 100 == 0) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        //every 100th command should briefly delay its execution in order to allow the browser to process other things 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        setTimeout(command_lambda, 5); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        command_lambda(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     }) 
															 | 
															
															 | 
															
																     }) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																      
															 | 
															
															 | 
															
																      
															 | 
														
													
												
													
														
															| 
															 | 
															
																   } 
															 | 
															
															 | 
															
																   } 
															 |