BadScript 2
Loading...
Searching...
No Matches
BadEmptyUsingBlockValidator.cs
Go to the documentation of this file.
2
4
8public class BadEmptyUsingBlockValidator : BadExpressionValidator<BadUsingExpression>
9{
11 protected override void Validate(BadExpressionValidatorContext context, BadUsingExpression expr)
12 {
13 if (!expr.Expressions.Any())
14 {
15 context.AddError(
16 "Using statement has no expressions",
17 expr,
18 expr,
19 this
20 );
21 }
22 }
23}
IEnumerable< BadExpression > Expressions
Creates a new Using Expression.
Checks if there are any expressions in the using block.
override void Validate(BadExpressionValidatorContext context, BadUsingExpression expr)
Contains the Block 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.