This commit allows for parameters that does not require any arguments to be provided in function calls. It changes collection syntax where parameters are list of objects instead of primitive strings. A parameter has now 'name' and 'optional' properties. 'name' is required and used in same way as older strings as parameter definitions. 'Optional' property is optional, 'false' is the default behavior if undefined. It also adds additional validation to restrict parameter names to alphanumeric strings to have a clear syntax in expressions.
16 lines
586 B
TypeScript
16 lines
586 B
TypeScript
// tslint:disable-next-line:max-line-length
|
|
import { IFunctionCallArgument } from '@/application/Parser/Script/Compiler/FunctionCall/Argument/IFunctionCallArgument';
|
|
|
|
export class FunctionCallArgumentStub implements IFunctionCallArgument {
|
|
public parameterName = 'stub-parameter-name';
|
|
public argumentValue = 'stub-arg-name';
|
|
public withParameterName(parameterName: string) {
|
|
this.parameterName = parameterName;
|
|
return this;
|
|
}
|
|
public withArgumentValue(argumentValue: string) {
|
|
this.argumentValue = argumentValue;
|
|
return this;
|
|
}
|
|
}
|