Fixed failing tests and action engine props

This commit is contained in:
Thaum Rystra
2024-02-22 09:11:00 +02:00
parent b41d26b3ad
commit 5141704e23
18 changed files with 181 additions and 140 deletions

View File

@@ -173,16 +173,13 @@ const call: CallFactory = {
expectedType = argumentsExpected[index];
}
if (expectedType === 'parseNode') return;
if (
node.parseType !== expectedType
|| (
node.parseType === 'constant'
&& node.valueType !== expectedType
)
) failed = true;
failed = !(
node.parseType === expectedType
|| (node.parseType === 'constant' && node.valueType === expectedType)
);
if (failed && fn === 'reduce') {
const typeName = typeof expectedType === 'string' ? expectedType : expectedType.constructor.name;
const nodeName = node.parseType;
const nodeName = node.parseType === 'constant' ? node.valueType : node.parseType;
context.error(`Incorrect arguments to ${callNode.functionName} function` +
`expected ${typeName} got ${nodeName}`);
}