a6f9da13
by Francis De Brabandere at 2026-04-20T20:39:17+02:00
vbscript: Return error 1045 for non-literal constant expressions.
When a Const declaration uses a non-literal expression (e.g.
"Const x = 1 + \"a\""), Windows parses the full expression and then
rejects it with error 1045 ("expected literal constant").
Change ConstDecl to accept Expression instead of ConstExpression, and
validate in new_const_decl() that the expression is a literal or
negated numeric literal. Remove the now-unused ConstExpression rule.
This fixes both the error code (was generic E_FAIL/16389) and the
error character position (now points to the end of the expression).