Found a rare lexer bug

This commit is contained in:
2022-09-10 19:11:16 +01:00
parent 60ddd151a6
commit cbc937884e
2 changed files with 6 additions and 1 deletions

View File

@@ -791,6 +791,11 @@ static Opcode dot(Parser* parser, Node** nodeHandle) {
parsePrecedence(parser, &node, PREC_CALL);
if (node == NULL || node->binary.right == NULL) {
error(parser, parser->previous, "Expected function call after dot operator");
return OP_EOF;
}
//hijack the function call, and hack in an extra parameter
node->binary.right->fnCall.argumentCount++;
node->binary.opcode = OP_DOT;