diff --git a/src/Components/SetOperation.php b/src/Components/SetOperation.php index 2faf0c61..104f71d9 100644 --- a/src/Components/SetOperation.php +++ b/src/Components/SetOperation.php @@ -139,6 +139,11 @@ public static function parse(Parser $parser, TokensList $list, array $options = $parser->error('Unexpected token.', $commaLastSeenAt); } + // We got a SET operation without any assignment + if ($ret === []) { + $parser->error('Missing assignment in SET operation.', $list->tokens[$list->idx]); + } + return $ret; } diff --git a/tests/data/parser/parseUpdateEmptySet.out b/tests/data/parser/parseUpdateEmptySet.out index ce0632df..dbeff527 100644 --- a/tests/data/parser/parseUpdateEmptySet.out +++ b/tests/data/parser/parseUpdateEmptySet.out @@ -171,6 +171,14 @@ }, "errors": { "lexer": [], - "parser": [] + "parser": [ + [ + "Missing assignment in SET operation.", + { + "@type": "@7" + }, + 0 + ] + ] } } \ No newline at end of file