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
4520815c
Commit
4520815c
authored
Sep 09, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added null literal support.
parent
6d8f84e5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
2 deletions
+24
-2
compile.c
dlls/vbscript/compile.c
+2
-0
interp.c
dlls/vbscript/interp.c
+18
-2
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+1
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+1
-0
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
4520815c
...
...
@@ -204,6 +204,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
return
compile_member_expression
(
ctx
,
(
member_expression_t
*
)
expr
,
TRUE
);
case
EXPR_NOT
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_not
);
case
EXPR_NULL
:
return
push_instr
(
ctx
,
OP_null
)
!=
-
1
?
S_OK
:
E_OUTOFMEMORY
;
case
EXPR_STRING
:
return
push_instr_str
(
ctx
,
OP_string
,
((
string_expression_t
*
)
expr
)
->
value
);
default:
...
...
dlls/vbscript/interp.c
View file @
4520815c
...
...
@@ -261,6 +261,16 @@ static HRESULT interp_empty(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_null
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
TRACE
(
"
\n
"
);
V_VT
(
&
v
)
=
VT_NULL
;
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_not
(
exec_ctx_t
*
ctx
)
{
variant_val_t
val
;
...
...
@@ -291,8 +301,14 @@ static HRESULT cmp_oper(exec_ctx_t *ctx)
return
hres
;
hres
=
stack_pop_val
(
ctx
,
&
l
);
if
(
SUCCEEDED
(
hres
))
hres
=
VarCmp
(
l
.
v
,
r
.
v
,
ctx
->
script
->
lcid
,
0
);
if
(
SUCCEEDED
(
hres
))
{
if
(
V_VT
(
l
.
v
)
==
VT_NULL
||
V_VT
(
r
.
v
)
==
VT_NULL
)
{
FIXME
(
"comparing nulls is not implemented
\n
"
);
hres
=
E_NOTIMPL
;
}
else
{
hres
=
VarCmp
(
l
.
v
,
r
.
v
,
ctx
->
script
->
lcid
,
0
);
}
}
release_val
(
&
r
);
release_val
(
&
l
);
...
...
dlls/vbscript/parse.h
View file @
4520815c
...
...
@@ -22,6 +22,7 @@ typedef enum {
EXPR_EQUAL
,
EXPR_MEMBER
,
EXPR_NOT
,
EXPR_NULL
,
EXPR_STRING
}
expression_type_t
;
...
...
dlls/vbscript/parser.y
View file @
4520815c
...
...
@@ -147,6 +147,7 @@ LiteralExpression
| tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; }
| tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; }
| tEMPTY { $$ = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; }
| tNULL { $$ = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; }
PrimaryExpression
: '(' Expression ')' { $$ = $2; }
...
...
dlls/vbscript/tests/lang.vbs
View file @
4520815c
...
...
@@ -37,5 +37,6 @@ Call ok(getVT(true) = "VT_BOOL", "getVT(true) is not VT_BOOL")
Call
ok
(
getVT
(
""
)
=
"VT_BSTR"
,
"getVT(
""""
) is not VT_BSTR"
)
Call
ok
(
getVT
(
"test"
)
=
"VT_BSTR"
,
"getVT(
""
test
""
) is not VT_BSTR"
)
Call
ok
(
getVT
(
Empty
)
=
"VT_EMPTY"
,
"getVT(Empty) is not VT_EMPTY"
)
Call
ok
(
getVT
(
null
)
=
"VT_NULL"
,
"getVT(null) is not VT_NULL"
)
reportSuccess
()
dlls/vbscript/vbscript.h
View file @
4520815c
...
...
@@ -81,6 +81,7 @@ typedef enum {
X(icall, 1, ARG_BSTR, ARG_UINT) \
X(icallv, 1, ARG_BSTR, ARG_UINT) \
X(not, 1, 0, 0) \
X(null, 1, 0, 0) \
X(ret, 0, 0, 0) \
X(string, 1, ARG_STR, 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