Module: wine Branch: master Commit: 04b43c721a9f006c4c7d2a097eec7116958db8a3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=04b43c721a9f006c4c7d2a097...
Author: Robert Wilhelm robert.wilhelm@gmx.net Date: Mon Nov 9 22:09:40 2020 +0100
vbscript: Allow keywords to be used as property name.
Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/vbscript/parser.y | 6 +++--- dlls/vbscript/tests/lang.vbs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 7c749b5ef77..a9f4c540fcb 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -452,11 +452,11 @@ ClassBody | PropertyDecl StSep ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; }
PropertyDecl - : Storage_opt tPROPERTY tGET tIdentifier ArgumentsDecl_opt StSep BodyStatements tEND tPROPERTY + : Storage_opt tPROPERTY tGET Identifier ArgumentsDecl_opt StSep BodyStatements tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, $5, $7); CHECK_ERROR; } - | Storage_opt tPROPERTY tLET tIdentifier '(' ArgumentDecl ')' StSep BodyStatements tEND tPROPERTY + | Storage_opt tPROPERTY tLET Identifier '(' ArgumentDecl ')' StSep BodyStatements tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; } - | Storage_opt tPROPERTY tSET tIdentifier '(' ArgumentDecl ')' StSep BodyStatements tEND tPROPERTY + | Storage_opt tPROPERTY tSET Identifier '(' ArgumentDecl ')' StSep BodyStatements tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPSET, $1, $6, $9); CHECK_ERROR; }
FunctionDecl diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 570bb7fbcb3..53f36b6e710 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1656,6 +1656,19 @@ Class class_test_identifiers_as_function_name End Sub End Class
+Class class_test_identifiers_as_property_name + Public Property Get Property() + End Property + + Public Property Let Error(par) + Error = par + End Property + + Public Property Set Default(par) + Set Default = par + End Property +End Class + sub test_dotIdentifiers ' test keywords that can also be an identifier after a dot Call ok(testObj.rem = 10, "testObj.rem = " & testObj.rem & " expected 10")