Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
32f336bd
Commit
32f336bd
authored
Sep 16, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added getters/setters parser implementation.
parent
e8436087
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
5 deletions
+56
-5
compile.c
dlls/vbscript/compile.c
+4
-0
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+33
-4
lang.vbs
dlls/vbscript/tests/lang.vbs
+14
-0
vbscript.h
dlls/vbscript/vbscript.h
+4
-1
No files found.
dlls/vbscript/compile.c
View file @
32f336bd
...
...
@@ -666,6 +666,10 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
if
(
ctx
->
sub_end_label
==
-
1
)
return
E_OUTOFMEMORY
;
break
;
case
FUNC_PROPGET
:
case
FUNC_PROPLET
:
case
FUNC_PROPSET
:
/* FIXME */
case
FUNC_GLOBAL
:
break
;
}
...
...
dlls/vbscript/parse.h
View file @
32f336bd
...
...
@@ -140,6 +140,7 @@ typedef struct _function_decl_t {
arg_decl_t
*
args
;
statement_t
*
body
;
struct
_function_decl_t
*
next
;
struct
_function_decl_t
*
next_prop_func
;
}
function_decl_t
;
typedef
struct
{
...
...
dlls/vbscript/parser.y
View file @
32f336bd
...
...
@@ -115,7 +115,7 @@ static class_decl_t *add_variant_prop(parser_ctx_t*,class_decl_t*,const WCHAR*,u
%type <expression> Arguments_opt ArgumentList_opt ArgumentList
%type <bool> OptionExplicit_opt
%type <arg_decl> ArgumentsDecl_opt ArgumentDeclList ArgumentDecl
%type <func_decl> FunctionDecl
%type <func_decl> FunctionDecl
PropertyDecl
%type <elseif> ElseIfs_opt ElseIfs ElseIf
%type <class_decl> ClassDeclaration ClassBody
%type <uint> Storage Storage_opt
...
...
@@ -295,6 +295,15 @@ ClassBody
: /* empty */ { $$ = new_class_decl(ctx); }
| FunctionDecl tNL ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; }
| Storage tIdentifier tNL ClassBody { $$ = add_variant_prop(ctx, $4, $2, $1); CHECK_ERROR; }
| PropertyDecl tNL ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; }
PropertyDecl
: Storage_opt tPROPERTY tGET tIdentifier EmptyBrackets_opt tNL StatementsNl_opt tEND tPROPERTY
{ $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, NULL, $7); CHECK_ERROR; }
| Storage_opt tPROPERTY tLET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY
{ $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; }
| Storage_opt tPROPERTY tSET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY
{ $$ = new_function_decl(ctx, $4, FUNC_PROPSET, $1, $6, $9); CHECK_ERROR; }
FunctionDecl
: Storage_opt tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB
...
...
@@ -591,9 +600,14 @@ static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name,
function_decl_t *decl;
if(storage_flags & STORAGE_IS_DEFAULT) {
FIXME("Function declared as default property\n");
ctx->hres = E_FAIL;
return NULL;
if(type == FUNC_PROPGET) {
FIXME("default value not implemented\n");
ctx->hres = E_NOTIMPL;
}else {
FIXME("Invalid default property\n");
ctx->hres = E_FAIL;
return NULL;
}
}
decl = parser_alloc(ctx, sizeof(*decl));
...
...
@@ -606,6 +620,7 @@ static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name,
decl->args = arg_decl;
decl->body = body;
decl->next = NULL;
decl->next_prop_func = NULL;
return decl;
}
...
...
@@ -646,6 +661,20 @@ static class_decl_t *add_class_function(parser_ctx_t *ctx, class_decl_t *class_d
ctx->hres = E_FAIL;
return NULL;
}
while(1) {
if(iter->type == decl->type) {
FIXME("Redefinition of %s::%s\n", debugstr_w(class_decl->name), debugstr_w(decl->name));
ctx->hres = E_FAIL;
return NULL;
}
if(!iter->next_prop_func)
break;
iter = iter->next_prop_func;
}
iter->next_prop_func = decl;
return class_decl;
}
}
...
...
dlls/vbscript/tests/lang.vbs
View file @
32f336bd
...
...
@@ -399,11 +399,25 @@ Class TestClass
publicFunction
=
4
End
Function
Public
Property
Get
gsProp
()
gsProp
=
privateProp
funcCalled
=
"gsProp get"
End
Property
Public
publicProp2
Public
Sub
publicSub
End
Sub
Public
Property
Let
gsProp
(
val
)
privateProp
=
val
funcCalled
=
"gsProp let"
End
Property
Public
Property
Set
gsProp
(
val
)
funcCalled
=
"gsProp set"
End
Property
Public
Sub
setPrivateProp
(
x
)
privateProp
=
x
End
Sub
...
...
dlls/vbscript/vbscript.h
View file @
32f336bd
...
...
@@ -211,7 +211,10 @@ typedef struct {
typedef
enum
{
FUNC_GLOBAL
,
FUNC_FUNCTION
,
FUNC_SUB
FUNC_SUB
,
FUNC_PROPGET
,
FUNC_PROPLET
,
FUNC_PROPSET
}
function_type_t
;
typedef
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment