Exemplo n.º 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");
		}
Exemplo 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);
		}
Exemplo n.º 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);
			}
		}
Exemplo n.º 4
0
		protected abstract void TranslateReturnStatement(List<string> output, ReturnStatement returnStatement);