vbscript: Allow Not operator as operand of comparison expressions.

vbscript: Allow Not operator as operand of comparison expressions.

The Not operator was only reachable from the NotExpression grammar rule, which sat above EqualityExpression in the precedence chain. This meant expressions like "a <> Not b" caused a syntax error because the right-hand side of a comparison could not contain Not.

Fold Not directly into EqualityExpression as a unary prefix and use bison precedence declarations to resolve the resulting ambiguity: %right tNOT at lower precedence than %left comparison operators ensures "Not 1 = 2" parses as "Not(1 = 2)" while "a <> Not b = c" correctly lets Not capture the comparison on its right.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55093

Edited by Francis De Brabandere

Merge request reports

Loading