BadScript 2
Loading...
Searching...
No Matches
BadConstantIfBranchValidator.cs
Go to the documentation of this file.
3
5
10{
12 protected override void Validate(BadExpressionValidatorContext context, BadIfExpression expr)
13 {
14 foreach (KeyValuePair<BadExpression, BadExpression[]> branch in expr.ConditionalBranches)
15 {
16 if (branch.Key.IsConstant)
17 {
18 context.AddError(
19 "If branch condition is constant",
20 expr,
21 branch.Key,
22 this
23 );
24 }
25 }
26 }
27}
Base Implementation for all Expressions used inside the Script.
Implements the If Statement Expression.
Checks if there are any constant expressions in the if branches conditions.
override void Validate(BadExpressionValidatorContext context, BadIfExpression expr)
Contains the Block Expressions for the BadScript2 Language.
Contains the Expressions for the BadScript2 Language.
Contains the Expression Validators for the BadScript2 Language.