Module: wine Branch: oldstable Commit: 5a0ea90c5b57a29d5e169b55bc9ae1b2932c8fea URL: https://source.winehq.org/git/wine.git/?a=commit;h=5a0ea90c5b57a29d5e169b55b...
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 (cherry picked from commit 04b43c721a9f006c4c7d2a097eec7116958db8a3) Signed-off-by: Michael Stefaniuc mstefani@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 924f6d61c7d..2e329fd0ad6 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -448,11 +448,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 7504da16e35..4fd4291e621 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1581,6 +1581,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")