https://bugs.winehq.org/show_bug.cgi?id=53644
Bug ID: 53644 Summary: vbscript can not compile classes with lists of private / public / dim declarations Product: Wine Version: 7.16 Hardware: x86-64 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com
I am working on porting Visual Pinball to MacOS. I am using the vbscript engine from Wine and just found out that it is having issues compiling classes that have lists of private / public declarations.
For example:
Class FlipperPolarity Public DebugOn, Enabled private Flipper, FlipperStart,FlipperEnd, FlipperEndY, LR, PartialFlipCoef Private Balls(20), balldata(20)
dim PolarityIn, PolarityOut dim VelocityIn, VelocityOut dim YcoefIn, YcoefOut . . . End Class
To get this to compile, I had to split everything to a separate line. I also had to switch the arrays to dim
Class FlipperPolarity Public DebugOn Public Enabled private Flipper private FlipperStart private FlipperEnd private FlipperEndY private LR private PartialFlipCoef dim Balls(20) dim balldata(20)
dim PolarityIn dim PolarityOut dim VelocityIn dim VelocityOut dim YcoefIn dim YcoefOut . . . End Class
I think an update is required in parser.y, but I'm not sure yet:
ClassBody : /* empty */ { $$ = new_class_decl(ctx); } | FunctionDecl { $$ = add_class_function(ctx, new_class_decl(ctx), $1); CHECK_ERROR; } | FunctionDecl StSep ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; } /* FIXME: We should use DimDecl here to support arrays, but that conflicts with PropertyDecl. */ | Storage tIdentifier { dim_decl_t *dim_decl = new_dim_decl(ctx, $2, FALSE, NULL); CHECK_ERROR; $$ = add_dim_prop(ctx, new_class_decl(ctx), dim_decl, $1); CHECK_ERROR; } | Storage tIdentifier StSep ClassBody { dim_decl_t *dim_decl = new_dim_decl(ctx, $2, FALSE, NULL); CHECK_ERROR; $$ = add_dim_prop(ctx, $4, dim_decl, $1); CHECK_ERROR; } | tDIM DimDecl { $$ = add_dim_prop(ctx, new_class_decl(ctx), $2, 0); CHECK_ERROR; } | tDIM DimDecl StSep ClassBody { $$ = add_dim_prop(ctx, $4, $2, 0); CHECK_ERROR; } | PropertyDecl { $$ = add_class_function(ctx, new_class_decl(ctx), $1); CHECK_ERROR; } | PropertyDecl StSep ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; }