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
2de6982f
Commit
2de6982f
authored
Sep 19, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added is expression implementation.
parent
33a81218
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
0 deletions
+88
-0
compile.c
dlls/vbscript/compile.c
+2
-0
interp.c
dlls/vbscript/interp.c
+71
-0
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+1
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+12
-0
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
2de6982f
...
...
@@ -387,6 +387,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_gteq
);
case
EXPR_IDIV
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_idiv
);
case
EXPR_IS
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_is
);
case
EXPR_IMP
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_imp
);
case
EXPR_LT
:
...
...
dlls/vbscript/interp.c
View file @
2de6982f
...
...
@@ -1005,6 +1005,77 @@ static HRESULT interp_lteq(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
disp_cmp
(
IDispatch
*
disp1
,
IDispatch
*
disp2
,
VARIANT_BOOL
*
ret
)
{
IObjectIdentity
*
identity
;
IUnknown
*
unk1
,
*
unk2
;
HRESULT
hres
;
if
(
disp1
==
disp2
)
{
*
ret
=
VARIANT_TRUE
;
return
S_OK
;
}
if
(
!
disp1
||
!
disp2
)
{
*
ret
=
VARIANT_FALSE
;
return
S_OK
;
}
hres
=
IDispatch_QueryInterface
(
disp1
,
&
IID_IUnknown
,
(
void
**
)
&
unk1
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IDispatch_QueryInterface
(
disp2
,
&
IID_IUnknown
,
(
void
**
)
&
unk2
);
if
(
FAILED
(
hres
))
{
IUnknown_Release
(
unk1
);
return
hres
;
}
if
(
unk1
==
unk2
)
{
*
ret
=
VARIANT_TRUE
;
}
else
{
hres
=
IUnknown_QueryInterface
(
unk1
,
&
IID_IObjectIdentity
,
(
void
**
)
&
identity
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IObjectIdentity_IsEqualObject
(
identity
,
unk2
);
IObjectIdentity_Release
(
identity
);
*
ret
=
hres
==
S_OK
?
VARIANT_TRUE
:
VARIANT_FALSE
;
}
else
{
*
ret
=
VARIANT_FALSE
;
}
}
IUnknown_Release
(
unk1
);
IUnknown_Release
(
unk2
);
return
S_OK
;
}
static
HRESULT
interp_is
(
exec_ctx_t
*
ctx
)
{
IDispatch
*
l
,
*
r
;
VARIANT
v
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
stack_pop_disp
(
ctx
,
&
r
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
stack_pop_disp
(
ctx
,
&
l
);
if
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
v
)
=
VT_BOOL
;
hres
=
disp_cmp
(
l
,
r
,
&
V_BOOL
(
&
v
));
if
(
l
)
IDispatch_Release
(
l
);
}
if
(
r
)
IDispatch_Release
(
r
);
if
(
FAILED
(
hres
))
return
hres
;
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_concat
(
exec_ctx_t
*
ctx
)
{
variant_val_t
r
,
l
;
...
...
dlls/vbscript/parse.h
View file @
2de6982f
...
...
@@ -31,6 +31,7 @@ typedef enum {
EXPR_GTEQ
,
EXPR_IDIV
,
EXPR_IMP
,
EXPR_IS
,
EXPR_LT
,
EXPR_LTEQ
,
EXPR_MEMBER
,
...
...
dlls/vbscript/parser.y
View file @
2de6982f
...
...
@@ -252,6 +252,7 @@ EqualityExpression
| EqualityExpression '<' ConcatExpression { $$ = new_binary_expression(ctx, EXPR_LT, $1, $3); CHECK_ERROR; }
| EqualityExpression tGTEQ ConcatExpression { $$ = new_binary_expression(ctx, EXPR_GTEQ, $1, $3); CHECK_ERROR; }
| EqualityExpression tLTEQ ConcatExpression { $$ = new_binary_expression(ctx, EXPR_LTEQ, $1, $3); CHECK_ERROR; }
| EqualityExpression tIS ConcatExpression { $$ = new_binary_expression(ctx, EXPR_IS, $1, $3); CHECK_ERROR; }
ConcatExpression
: AdditiveExpression { $$ = $1; }
...
...
dlls/vbscript/tests/lang.vbs
View file @
2de6982f
...
...
@@ -608,4 +608,16 @@ funcCalled = ""
Set
obj
=
Nothing
Call
ok
(
funcCalled
=
"terminate"
,
"funcCalled = "
&
funcCalled
)
Set
obj
=
new
EmptyClass
Set
x
=
obj
Set
y
=
new
EmptyClass
Call
ok
(
obj
is
x
,
"obj is not x"
)
Call
ok
(
x
is
obj
,
"x is not obj"
)
Call
ok
(
not
(
obj
is
y
),
"obj is not y"
)
Call
ok
(
not
obj
is
y
,
"obj is not y"
)
Call
ok
(
not
(
x
is
Nothing
),
"x is 1"
)
Call
ok
(
Nothing
is
Nothing
,
"Nothing is not Nothing"
)
Call
ok
(
x
is
obj
and
true
,
"x is obj and true is false"
)
reportSuccess
()
dlls/vbscript/vbscript.h
View file @
2de6982f
...
...
@@ -167,6 +167,7 @@ typedef enum {
X(icallv, 1, ARG_BSTR, ARG_UINT) \
X(idiv, 1, 0, 0) \
X(imp, 1, 0, 0) \
X(is, 1, 0, 0) \
X(jmp, 0, ARG_ADDR, 0) \
X(jmp_false, 0, ARG_ADDR, 0) \
X(jmp_true, 0, ARG_ADDR, 0) \
...
...
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