https://bugs.winehq.org/show_bug.cgi?id=54234
Bug ID: 54234 Summary: vbscript fails to compile when colon follows Else in If...Else Product: Wine Version: 7.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
I just ran into a script where there is a ':' separator on a new line after an ELSE:
if IsEmpty(BallData(idx).id) and aBall.VelY < -12 then 'if tip hit with no collected data, do vel correction anyway if PSlope(aBall.x, FlipperStart, 0, FlipperEnd, 1) > 1.1 then 'adjust plz VelCoef = LinearEnvelope(5, VelocityIn, VelocityOut) if partialflipcoef < 1 then VelCoef = PSlope(partialflipcoef, 0, 1, 1, VelCoef) if Enabled then aBall.Velx = aBall.Velx*VelCoef'VelCoef if Enabled then aBall.Vely = aBall.Vely*VelCoef'VelCoef end if Else : VelCoef = LinearEnvelope(BallPos, VelocityIn, VelocityOut) if Enabled then aBall.Velx = aBall.Velx*VelCoef if Enabled then aBall.Vely = aBall.Vely*VelCoef end if
I was able to fix this by changing:
Else_opt : /* empty */ { $$ = NULL; } | tELSE NL StatementsNl_opt { $$ = $3; } | tELSE StatementsNl_opt { $$ = $2; }
to
Else_opt : /* empty */ { $$ = NULL; } | tELSE StSep_opt StatementsNl_opt { $$ = $3; } | tELSE StatementsNl_opt { $$ = $2; }