public TreeTryReceiveNode(TreeContext context, SourceLocation location, TreeLocal result, TreeReference then, TreeReference @else) : base(context, location) { Result = result; Then = then; Else = @else; }
public TreeTryCallNode(TreeContext context, SourceLocation location, TreeReference subject, ImmutableArray <TreeReference> arguments, TreeReference?variadicArgument, TreeLocal exception, TreeReference @catch) : base(context, location) { Subject = subject; Arguments = arguments; VariadicArgument = variadicArgument; Exception = exception; Catch = @catch; }
public abstract TreeReference Compile(TreeContext context, SourceLocation location, TreeLocal operand);
public override TreeReference Compile(TreeContext context, SourceLocation location, TreeLocal operand) { throw new System.NotImplementedException(); // TODO }
public override TreeReference Compile(TreeContext context, SourceLocation location, TreeLocal operand) { var local = context.CreateLocal(); var exprs = ImmutableArray.Create <TreeReference>( new TreeAssignNode(context, location, new TreeVariableNode(context, location, local), new TreeRelationalNode(context, location, new TreeVariableNode(context, location, operand), TreeRelationalOperator.Equal, new TreeLiteralNode(context, location, Value)))); if (Alias is TreeLocal alias) { exprs = exprs.Add( new TreeAssignNode(context, location, new TreeVariableNode(context, location, alias), new TreeVariableNode(context, location, operand))); } return(new TreeBlockNode(context, location, exprs.Add( new TreeVariableNode(context, location, local)))); }
public override TreeReference Compile(TreeContext context, SourceLocation location, TreeLocal operand) { var exprs = ImmutableArray.Create <TreeReference>( new TreeAssignNode(context, location, new TreeVariableNode(context, location, Identifier), new TreeVariableNode(context, location, operand))); if (Alias is TreeLocal alias) { exprs = exprs.Add( new TreeAssignNode(context, location, new TreeVariableNode(context, location, alias), new TreeVariableNode(context, location, operand))); } return(new TreeBlockNode(context, location, exprs.Add( new TreeLiteralNode(context, location, true)))); }
public TreeIdentifierPattern(TreeLocal?alias, TreeLocal identifier) : base(alias) { Identifier = identifier; }