Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8fb2b985
Commit
8fb2b985
authored
Sep 15, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added class function compiler implementation.
parent
ee67bc7a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
7 deletions
+48
-7
compile.c
dlls/vbscript/compile.c
+33
-0
vbscript.h
dlls/vbscript/vbscript.h
+15
-7
No files found.
dlls/vbscript/compile.c
View file @
8fb2b985
...
...
@@ -804,9 +804,26 @@ static BOOL lookup_class_name(compile_ctx_t *ctx, const WCHAR *name)
return
FALSE
;
}
static
HRESULT
create_class_funcprop
(
compile_ctx_t
*
ctx
,
function_decl_t
*
func_decl
,
vbdisp_funcprop_desc_t
*
desc
)
{
desc
->
name
=
compiler_alloc_string
(
ctx
->
code
,
func_decl
->
name
);
if
(
!
desc
->
name
)
return
E_OUTOFMEMORY
;
assert
(
!
desc
->
entries
[
0
]);
if
(
func_decl
->
is_public
)
desc
->
is_public
=
TRUE
;
return
create_function
(
ctx
,
func_decl
,
desc
->
entries
);
}
static
HRESULT
compile_class
(
compile_ctx_t
*
ctx
,
class_decl_t
*
class_decl
)
{
function_decl_t
*
func_decl
;
class_desc_t
*
class_desc
;
unsigned
i
;
HRESULT
hres
;
if
(
lookup_dim_decls
(
ctx
,
class_decl
->
name
)
||
lookup_funcs_name
(
ctx
,
class_decl
->
name
)
||
lookup_class_name
(
ctx
,
class_decl
->
name
))
{
...
...
@@ -822,6 +839,22 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
if
(
!
class_desc
->
name
)
return
E_OUTOFMEMORY
;
class_desc
->
func_cnt
=
1
;
/* always allocate slot for default getter */
for
(
func_decl
=
class_decl
->
funcs
;
func_decl
;
func_decl
=
func_decl
->
next
)
class_desc
->
func_cnt
++
;
class_desc
->
funcs
=
compiler_alloc
(
ctx
->
code
,
class_desc
->
func_cnt
*
sizeof
(
*
class_desc
->
funcs
));
if
(
!
class_desc
->
funcs
)
return
E_OUTOFMEMORY
;
memset
(
class_desc
->
funcs
,
0
,
class_desc
->
func_cnt
*
sizeof
(
*
class_desc
->
funcs
));
for
(
func_decl
=
class_decl
->
funcs
,
i
=
1
;
func_decl
;
func_decl
=
func_decl
->
next
,
i
++
)
{
hres
=
create_class_funcprop
(
ctx
,
func_decl
,
class_desc
->
funcs
+
i
);
if
(
FAILED
(
hres
))
return
hres
;
}
class_desc
->
next
=
ctx
->
classes
;
ctx
->
classes
=
class_desc
;
return
S_OK
;
...
...
dlls/vbscript/vbscript.h
View file @
8fb2b985
...
...
@@ -55,9 +55,24 @@ typedef struct named_item_t {
struct
list
entry
;
}
named_item_t
;
typedef
enum
{
VBDISP_CALLGET
,
VBDISP_LET
,
VBDISP_SET
,
VBDISP_ANY
}
vbdisp_invoke_type_t
;
typedef
struct
{
const
WCHAR
*
name
;
BOOL
is_public
;
function_t
*
entries
[
VBDISP_ANY
];
}
vbdisp_funcprop_desc_t
;
typedef
struct
_class_desc_t
{
const
WCHAR
*
name
;
script_ctx_t
*
ctx
;
unsigned
func_cnt
;
vbdisp_funcprop_desc_t
*
funcs
;
struct
_class_desc_t
*
next
;
}
class_desc_t
;
...
...
@@ -69,13 +84,6 @@ typedef struct {
const
class_desc_t
*
desc
;
}
vbdisp_t
;
typedef
enum
{
VBDISP_CALLGET
,
VBDISP_LET
,
VBDISP_SET
,
VBDISP_ANY
}
vbdisp_invoke_type_t
;
HRESULT
create_vbdisp
(
const
class_desc_t
*
,
vbdisp_t
**
);
HRESULT
disp_get_id
(
IDispatch
*
,
BSTR
,
DISPID
*
);
HRESULT
disp_call
(
script_ctx_t
*
,
IDispatch
*
,
DISPID
,
DISPPARAMS
*
,
VARIANT
*
);
...
...
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