Beispiel #1
0
		public static void parseLine(CodeLine currentLine, CodeLine originalLine){
			if (handleReturn())
				return;

			if (currentLineIndex >= currentScope.codeLines.Count)
				if (currentScope.parentScope == null)
				{
					doEndWalker.Invoke();
					return;
				}
				else
				{
					SetFinalScopeCommands(false, currentScope.codeLines[currentScope.codeLines.Count - 1].lineNumber);
					return;
				}

			currentScope.lastReadLine = currentLineIndex;

			if (currentLine.logicOrder[0] is ScopeStarter){

				if ((currentLine.logicOrder[0] as ScopeStarter).doParseLine == false)
				{
					currentLineIndex++;
					parseLine();
					return;
				}
			}

			showCurrentActiveCodeLine.Invoke(currentLine.lineNumber);

			try{
				currentLine.theCommandType = parseCommandType(currentLine.lineNumber, currentScope);
			}
			catch (Exception e){
				if (e is FunctionCallException)
					return;
				throw e;
			}

			ReturnMemoryClear.clearLineMemory(currentLine);

			//Enter New Scope
			if ((currentLine.logicOrder[0] is ScopeStarter) && NTScopeStarter(currentLine))
				return;

			VariableWindow.sendStackVariables(currentScope);
			currentLineIndex++;
			
			// Reset current line so input can be run again if line is inside loop
			currentScope.setCurrentLine(originalLine);
		}
Beispiel #2
0
		public static void parseLine(){
			if (handleReturn ())
				return;

			if (currentLineIndex >= currentScope.codeLines.Count)
				if (currentScope.parentScope == null) {
					doEndWalker.Invoke ();
					return;
				}
				else {
					SetFinalScopeCommands (false, currentScope.codeLines[currentScope.codeLines.Count-1].lineNumber);
					return;
				}

			if (!isWaitingForUserInput)
				currentScope.lastReadLine = currentLineIndex;

			CodeLine currentLine = currentScope.getCurrentLine ();

			if (currentLine.logicOrder [0] is ScopeStarter) {

				if ((currentLine.logicOrder [0] as ScopeStarter).doParseLine == false) {
					currentLineIndex++;
					parseLine();
					return;
				}
			}

			showCurrentActiveCodeLine.Invoke (currentLine.lineNumber);

			try{
				currentLine.theCommandType = parseCommandType (currentLine.lineNumber, currentScope);
			}
			catch(Exception e){
				if (e is FunctionCallException)
					return;	
				throw e;
			}

			if (!isWaitingForUserInput)
			{
				ReturnMemoryClear.clearLineMemory (currentLine);

				//Enter New Scope
				if ((currentLine.logicOrder[0] is ScopeStarter) && NTScopeStarter (currentLine))
					return;

				VariableWindow.sendStackVariables (currentScope);
				currentLineIndex++;
			}
		}