BadScript 2
Loading...
Searching...
No Matches
BadFunctionNameIsReservedKeywordValidator.cs
Go to the documentation of this file.
3
5
10{
12 protected override void Validate(BadExpressionValidatorContext context, BadFunctionExpression expr)
13 {
14 if (BadStaticKeys.IsReservedKeyword(expr.Name?.ToString() ?? string.Empty))
15 {
16 context.AddError(
17 $"Name {expr.Name} is a reserved keyword",
18 expr,
19 expr,
20 this
21 );
22 }
23 }
24}
Contains Static Data for the BadScript Language.
static bool IsReservedKeyword(string keyword)
override void Validate(BadExpressionValidatorContext context, BadFunctionExpression expr)
Contains Shared Data Structures and Functionality.
Contains the Function 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.