예제 #1
0
		protected override void TranslateReturnStatement(List<string> output, ReturnStatement returnStatement)
		{
			output.Add(this.CurrentTabIndention);
			output.Add("return");
			if (returnStatement.Expression != null)
			{
				output.Add(" ");
				TranslateExpression(output, returnStatement.Expression);
			}
			output.Add("\r\n");
		}
예제 #2
0
		protected override void TranslateReturnStatement(List<string> output, ReturnStatement returnStatement)
		{
			output.Add(this.CurrentTabIndention);
			output.Add("return ");
			if (returnStatement.Expression != null)
			{
				TranslateExpression(output, returnStatement.Expression);
			}
			else
			{
				this.TranslateNullConstant(output, null);
			}
			output.Add(";" + this.NL);
		}
예제 #3
0
		private void CompileReturnStatement(Parser parser, ByteBuffer buffer, ReturnStatement returnStatement)
		{
			if (returnStatement.Expression == null || returnStatement.Expression is NullConstant)
			{
				buffer.Add(returnStatement.FirstToken, OpCode.RETURN, 0);
			}
			else
			{
				this.CompileExpression(parser, buffer, returnStatement.Expression, true);
				buffer.Add(returnStatement.FirstToken, OpCode.RETURN, 1);
			}
		}
예제 #4
0
		protected abstract void TranslateReturnStatement(List<string> output, ReturnStatement returnStatement);