https://bugs.winehq.org/show_bug.cgi?id=56480
Bug ID: 56480 Summary: vbscript: underscore line continue issues Product: Wine Version: 9.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: francisdb@gmail.com Distribution: ---
cat test.vbs
Class Tween Public Function Delay(length) Set Delay = Me WScript.Echo "Delay " & length End Function
Public Function Clear() Set Clear = Me WScript.Echo "Clear" End Function End Class
Dim instance Set instance = new Tween
WScript.Echo "chained"
instance.Clear().Delay(1)
WScript.Echo "chained with continuation dots after" ' works as expected instance. _ Clear(). _ Delay(1)
WScript.Echo "chained with continuation dots before" ' 0114:fixme:wscript:ActiveScriptSite_OnScriptError instance.Clear() _ .Delay(1)
WScript.Echo "chained with continuation dots before2" ' 0114:fixme:wscript:run_script ParseScriptText failed: 80004005 instance _ .Clear() _ .Delay(1)
WScript.Echo "done"
--
Linux Wine.
wine cscript test.vbs
0114:fixme:vbscript:parser_error L".Delay(1)\n\nWScript.Echo "done"\n": "syntax error" 0114:fixme:wscript:ActiveScriptSite_OnScriptError () 0114:fixme:wscript:run_script ParseScriptText failed: 80004005
--
Windows cscript
cscript test.vbs
Microsoft (R) Windows Script Host Version 5.812 Copyright (C) Microsoft Corporation. All rights reserved.
chained Clear Delay 1 chained with continuation dots after Clear Delay 1 chained with continuation dots before Clear Delay 1 chained with continuation dots before2 Clear Delay 1 done
--
Some more notes: * On wine by commenting out the last section you get a different error * I have also seen different errors depending on weather the functions called have arguments or not * Other uses of underscore do seem to work. Eg multiline Dim, multiline if.
https://bugs.winehq.org/show_bug.cgi?id=56480
Jason Millard jsm174@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm174@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=56480
Robert Wilhelm sloper42@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sloper42@yahoo.com Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #1 from Robert Wilhelm sloper42@yahoo.com --- confirming.
https://bugs.winehq.org/show_bug.cgi?id=56480
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=56480
--- Comment #2 from Robert Wilhelm sloper42@yahoo.com --- This is a lexer issue.
In lex.c line 432ff, we check the char before the dot (ctx->ptr[-1]). This is wrong for line continuation.
lex.c:
case '.': /* * We need to distinguish between '.' used as part of a member expression and * a beginning of a dot expression (a member expression accessing with statement * expression) and a floating point number like ".2" . */ c = ctx->ptr > ctx->code ? ctx->ptr[-1] : '\n';