BadScript 2
Loading...
Searching...
No Matches
BadNullCoalescingExpression.cs
Go to the documentation of this file.
5
7
13{
21 left,
22 right,
23 position
24 ) { }
25
26 protected override IEnumerable<BadObject> InnerExecute(BadExecutionContext context)
27 {
29
30 foreach (BadObject o in Left.Execute(context))
31 {
32 left = o;
33 }
34
35 left = left.Dereference();
36
37 if (left == BadObject.Null)
38 {
39 foreach (BadObject o in Right.Execute(context))
40 {
41 yield return o;
42 }
43 }
44 else
45 {
46 yield return left;
47 }
48 }
49
50 protected override string GetSymbol()
51 {
52 return "??";
53 }
54}
Describes a specific position inside a source file.
Implements the Null Coalescing Expression LEFT ?? RIGHT.
BadNullCoalescingExpression(BadExpression left, BadExpression right, BadSourcePosition position)
Constructor of the Null Coalescing Expression.
override IEnumerable< BadObject > InnerExecute(BadExecutionContext context)
Base Implementation for all Expressions used inside the Script.
IEnumerable< BadObject > Execute(BadExecutionContext context)
Evaluates the Expression within the current Execution Context.
Base Implementation of all Binary Expressions.
BadExpression Right
Right side of the Expression.
The Execution Context. Every execution of a script needs a context the script is running in....
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Contains Shared Data Structures and Functionality.
Contains the Access Expressions for the BadScript2 Language.
Contains the Binary Expressions for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.