BadScript 2
Loading...
Searching...
No Matches
BadReturnExpressionCompiler.cs
Go to the documentation of this file.
2
4
8public class BadReturnExpressionCompiler : BadExpressionCompiler<BadReturnExpression>
9{
11 public override void Compile(BadExpressionCompileContext context, BadReturnExpression expression)
12 {
13 if (expression.Right != null)
14 {
15 context.Compile(expression.Right);
16 context.Emit(BadOpCode.Return, expression.Position, expression.IsRefReturn);
17 }
18 else
19 {
20 context.Emit(BadOpCode.Return, expression.Position);
21 }
22 }
23}
BadSourcePosition Position
The source Position of the Expression.
Implements the Return expression that is used to exit the current function with an Optional Return Va...
bool IsRefReturn
Indicates if the return value is meant to be a reference.
override void Compile(BadExpressionCompileContext context, BadReturnExpression expression)
Contains the Controlflow Expressions for the BadScript2 Language.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7