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