BadScript 2
Loading...
Searching...
No Matches
BadEmptyLockBlockValidator.cs
Go to the documentation of this file.
1
using
BadScript2.Parser.Expressions.Block.Lock
;
2
3
namespace
BadScript2.Parser.Validation.Validators
;
4
8
public
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
}
BadScript2.Parser.Expressions.Block.Lock.BadLockExpression
Implements the Lock Expression.
Definition
BadLockExpression.cs:16
BadScript2.Parser.Expressions.Block.Lock.BadLockExpression.Block
IEnumerable< BadExpression > Block
The Block Body.
Definition
BadLockExpression.cs:45
BadScript2.Parser.Validation.BadExpressionValidator
Base class for all expression validators.
Definition
BadExpressionValidator.cs:27
BadScript2.Parser.Validation.Validators.BadEmptyLockBlockValidator
Checks if there are any expressions in the lock block.
Definition
BadEmptyLockBlockValidator.cs:9
BadScript2.Parser.Validation.Validators.BadEmptyLockBlockValidator.Validate
override void Validate(BadExpressionValidatorContext context, BadLockExpression expr)
Definition
BadEmptyLockBlockValidator.cs:11
BadScript2.Parser.Expressions.Block.Lock
Contains the Locking Expressions for the BadScript2 Language.
Definition
BadLockExpression.cs:10
BadScript2.Parser.Validation.Validators
Contains the Expression Validators for the BadScript2 Language.
Definition
BadConstantIfBranchValidator.cs:4
BadScript2.Parser.Validation.BadExpressionValidatorContext
Implements a context for expression validation.
Definition
BadExpressionValidatorContext.cs:14
BadScript2.Parser.Validation.BadExpressionValidatorContext.AddError
void AddError(string message, BadExpression parentExpression, BadExpression expression, BadExpressionValidator validator)
Adds an error message to the context.
Definition
BadExpressionValidatorContext.cs:88
src
BadScript2
Parser
Validation
Validators
BadEmptyLockBlockValidator.cs
Generated by
1.9.8