BadScript 2
Loading...
Searching...
No Matches
BadEmptyForEachBlockValidator.cs
Go to the documentation of this file.
2
4
8public class BadEmptyForEachBlockValidator : BadExpressionValidator<BadForEachExpression>
9{
11 protected override void Validate(BadExpressionValidatorContext context, BadForEachExpression expr)
12 {
13 if (!expr.Body.Any())
14 {
15 context.AddError(
16 "For-Each statement has no expressions",
17 expr,
18 expr,
19 this
20 );
21 }
22 }
23}
override void Validate(BadExpressionValidatorContext context, BadForEachExpression expr)
Contains the Loop Expressions for the BadScript2 Language.
Contains the Expression Validators for the BadScript2 Language.
void AddError(string message, BadExpression parentExpression, BadExpression expression, BadExpressionValidator validator)
Adds an error message to the context.