Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
5ecf4364
Commit
5ecf4364
authored
13 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
vbscript: Added call statement compilation implementation.
parent
6c557029
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/vbscript/compile.c
+65
-5
65 additions, 5 deletions
dlls/vbscript/compile.c
dlls/vbscript/interp.c
+8
-2
8 additions, 2 deletions
dlls/vbscript/interp.c
dlls/vbscript/vbscript.h
+15
-3
15 additions, 3 deletions
dlls/vbscript/vbscript.h
with
88 additions
and
10 deletions
dlls/vbscript/compile.c
+
65
−
5
View file @
5ecf4364
...
...
@@ -34,6 +34,12 @@ typedef struct {
vbscode_t
*
code
;
}
compile_ctx_t
;
static
inline
instr_t
*
instr_ptr
(
compile_ctx_t
*
ctx
,
unsigned
id
)
{
assert
(
id
<
ctx
->
instr_cnt
);
return
ctx
->
code
->
instrs
+
id
;
}
static
unsigned
push_instr
(
compile_ctx_t
*
ctx
,
vbsop_t
op
)
{
assert
(
ctx
->
instr_size
&&
ctx
->
instr_size
>=
ctx
->
instr_cnt
);
...
...
@@ -53,18 +59,72 @@ static unsigned push_instr(compile_ctx_t *ctx, vbsop_t op)
return
ctx
->
instr_cnt
++
;
}
static
HRESULT
compile_func
(
compile_ctx_t
*
ctx
,
statement_t
*
stat
,
function_t
*
func
)
static
HRESULT
push_instr_str
(
compile_ctx_t
*
ctx
,
vbsop_t
op
,
const
WCHAR
*
arg
)
{
f
un
c
->
code_off
=
ctx
->
instr
_cnt
;
un
signed
instr
;
if
(
push_instr
(
ctx
,
OP_ret
)
==
-
1
)
instr
=
push_instr
(
ctx
,
op
);
if
(
instr
==
-
1
)
return
E_OUTOFMEMORY
;
if
(
stat
)
{
FIXME
(
"statements compilation not implemented
\n
"
);
instr_ptr
(
ctx
,
instr
)
->
arg1
.
str
=
arg
;
return
S_OK
;
}
static
HRESULT
compile_member_expression
(
compile_ctx_t
*
ctx
,
member_expression_t
*
expr
)
{
HRESULT
hres
;
if
(
expr
->
args
)
{
FIXME
(
"arguments not implemented
\n
"
);
return
E_NOTIMPL
;
}
if
(
expr
->
obj_expr
)
{
FIXME
(
"obj_expr not implemented
\n
"
);
hres
=
E_NOTIMPL
;
}
else
{
hres
=
push_instr_str
(
ctx
,
OP_icallv
,
expr
->
identifier
);
}
return
hres
;
}
static
HRESULT
compile_statement
(
compile_ctx_t
*
ctx
,
statement_t
*
stat
)
{
HRESULT
hres
;
while
(
stat
)
{
switch
(
stat
->
type
)
{
case
STAT_CALL
:
hres
=
compile_member_expression
(
ctx
,
((
call_statement_t
*
)
stat
)
->
expr
);
break
;
default:
FIXME
(
"Unimplemented statement type %d
\n
"
,
stat
->
type
);
hres
=
E_NOTIMPL
;
}
if
(
FAILED
(
hres
))
return
hres
;
stat
=
stat
->
next
;
}
return
S_OK
;
}
static
HRESULT
compile_func
(
compile_ctx_t
*
ctx
,
statement_t
*
stat
,
function_t
*
func
)
{
HRESULT
hres
;
func
->
code_off
=
ctx
->
instr_cnt
;
hres
=
compile_statement
(
ctx
,
stat
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
push_instr
(
ctx
,
OP_ret
)
==
-
1
)
return
E_OUTOFMEMORY
;
return
S_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/vbscript/interp.c
+
8
−
2
View file @
5ecf4364
...
...
@@ -33,6 +33,12 @@ typedef struct {
typedef
HRESULT
(
*
instr_func_t
)(
exec_ctx_t
*
);
static
HRESULT
interp_icallv
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_ret
(
exec_ctx_t
*
ctx
)
{
TRACE
(
"
\n
"
);
...
...
@@ -42,13 +48,13 @@ static HRESULT interp_ret(exec_ctx_t *ctx)
}
static
const
instr_func_t
op_funcs
[]
=
{
#define X(x,n) interp_ ## x,
#define X(x,n
,a,b
) interp_ ## x,
OP_LIST
#undef X
};
static
const
unsigned
op_move
[]
=
{
#define X(x,n) n,
#define X(x,n
,a,b
) n,
OP_LIST
#undef X
};
...
...
This diff is collapsed.
Click to expand it.
dlls/vbscript/vbscript.h
+
15
−
3
View file @
5ecf4364
...
...
@@ -62,18 +62,30 @@ typedef struct {
HRESULT
init_global
(
script_ctx_t
*
);
#define OP_LIST \
X(ret, 0)
typedef
enum
{
ARG_NONE
=
0
,
ARG_STR
}
instr_arg_type_t
;
#define OP_LIST \
X(icallv, 1, ARG_STR, 0) \
X(ret, 0, 0, 0)
typedef
enum
{
#define X(x,n) OP_##x,
#define X(x,n
,a,b
) OP_##x,
OP_LIST
#undef X
OP_LAST
}
vbsop_t
;
typedef
union
{
const
WCHAR
*
str
;
}
instr_arg_t
;
typedef
struct
{
vbsop_t
op
;
instr_arg_t
arg1
;
instr_arg_t
arg2
;
}
instr_t
;
struct
_function_t
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment