BadScript 2
Loading...
Searching...
No Matches
BadNullCoalescingAssignExpressionCompiler.cs
Go to the documentation of this file.
2
4
8public class BadNullCoalescingAssignExpressionCompiler : BadExpressionCompiler<BadNullCoalescingAssignExpression>
9{
12 {
13 context.Compile(expression.Left);
14 context.Emit(BadOpCode.Dup, expression.Position);
15 int jend = context.EmitEmpty();
16 context.Compile(expression.Right);
17 context.Emit(BadOpCode.Assign, expression.Position);
18 context.ResolveEmpty(jend, BadOpCode.JumpRelativeIfNotNull, expression.Position, context.InstructionCount - jend - 1);
19 }
20}
Implements the Null Coalescing Assign Expression LEFT ??= RIGHT.
BadSourcePosition Position
The source Position of the Expression.
BadExpression Right
Right side of the Expression.
override void Compile(BadExpressionCompileContext context, BadNullCoalescingAssignExpression expression)
Contains the Access Expressions for the BadScript2 Language.
BadOpCode
Defines the Operations that the BadVirtualMachine can execute.
Definition BadOpCode.cs:7
void ResolveEmpty(int index, BadOpCode code, BadSourcePosition position, params object[] args)