BadScript 2
Loading...
Searching...
No Matches
BadDuplicateFunctionParameterNameValidator.cs
Go to the documentation of this file.
3
8
13{
15 protected override void Validate(BadExpressionValidatorContext context, BadFunctionExpression expr)
16 {
17 HashSet<string> names = new HashSet<string>();
18
19 foreach (BadFunctionParameter parameter in expr.Parameters)
20 {
21 if (!names.Add(parameter.Name))
22 {
23 context.AddError(
24 $"Duplicate parameter name '{parameter.Name}'",
25 expr,
26 expr,
27 this
28 );
29 }
30 }
31 }
32}
override void Validate(BadExpressionValidatorContext context, BadFunctionExpression expr)
Contains the Function Expressions for the BadScript2 Language.
Contains the Expression Validators for the BadScript2 Language.
Contains Runtime Function Objects.