BadScript 2
Loading...
Searching...
No Matches
BadEmptyForBlockValidator.cs
Go to the documentation of this file.
2
4
8public class BadEmptyForBlockValidator : BadExpressionValidator<BadForExpression>
9{
11 protected override void Validate(BadExpressionValidatorContext context, BadForExpression expr)
12 {
13 if (!expr.Body.Any())
14 {
15 context.AddError(
16 "For statement has no expressions",
17 expr,
18 expr,
19 this
20 );
21 }
22 }
23}
Checks if there are any expressions in the for block.
override void Validate(BadExpressionValidatorContext context, BadForExpression 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.