Commit 72977a75 authored by Robert Wilhelm's avatar Robert Wilhelm Committed by Alexandre Julliard

vbscript: Allow keywords to be used as function name.

parent f5831eda
...@@ -490,11 +490,11 @@ ArgumentDecl ...@@ -490,11 +490,11 @@ ArgumentDecl
/* these keywords may also be an identifier, depending on context */ /* these keywords may also be an identifier, depending on context */
Identifier Identifier
: tIdentifier { $$ = $1; } : tIdentifier { $$ = $1; }
| tDEFAULT { $$ = $1; } | tDEFAULT { ctx->last_token = tIdentifier; $$ = $1; }
| tERROR { $$ = $1; } | tERROR { ctx->last_token = tIdentifier; $$ = $1; }
| tEXPLICIT { $$ = $1; } | tEXPLICIT { ctx->last_token = tIdentifier; $$ = $1; }
| tPROPERTY { $$ = $1; } | tPROPERTY { ctx->last_token = tIdentifier; $$ = $1; }
| tSTEP { $$ = $1; } | tSTEP { ctx->last_token = tIdentifier; $$ = $1; }
/* Most statements accept both new line and ':' as separators */ /* Most statements accept both new line and ':' as separators */
StSep StSep
......
...@@ -1631,9 +1631,31 @@ sub test_identifiers ...@@ -1631,9 +1631,31 @@ sub test_identifiers
Dim step Dim step
step = "xx" step = "xx"
Call ok(step = "xx", "step = " & step & " expected ""xx""") Call ok(step = "xx", "step = " & step & " expected ""xx""")
Dim property
property = "xx"
Call ok(property = "xx", "property = " & property & " expected ""xx""")
end sub end sub
call test_identifiers() call test_identifiers()
Class class_test_identifiers_as_function_name
Sub Property ( par )
End Sub
Function Error( par )
End Function
Sub Default ()
End Sub
Function Explicit (par)
Explicit = par
End Function
Sub Step ( default )
End Sub
End Class
sub test_dotIdentifiers sub test_dotIdentifiers
' test keywords that can also be an identifier after a dot ' test keywords that can also be an identifier after a dot
Call ok(testObj.rem = 10, "testObj.rem = " & testObj.rem & " expected 10") Call ok(testObj.rem = 10, "testObj.rem = " & testObj.rem & " expected 10")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment