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
6d8f84e5
Commit
6d8f84e5
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 empty literal support.
parent
ddc47d69
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
1 deletion
+20
-1
compile.c
dlls/vbscript/compile.c
+2
-0
interp.c
dlls/vbscript/interp.c
+10
-0
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+3
-1
lang.vbs
dlls/vbscript/tests/lang.vbs
+3
-0
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
6d8f84e5
...
...
@@ -196,6 +196,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
switch
(
expr
->
type
)
{
case
EXPR_BOOL
:
return
push_instr_int
(
ctx
,
OP_bool
,
((
bool_expression_t
*
)
expr
)
->
value
);
case
EXPR_EMPTY
:
return
push_instr
(
ctx
,
OP_empty
)
!=
-
1
?
S_OK
:
E_OUTOFMEMORY
;
case
EXPR_EQUAL
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_equal
);
case
EXPR_MEMBER
:
...
...
dlls/vbscript/interp.c
View file @
6d8f84e5
...
...
@@ -251,6 +251,16 @@ static HRESULT interp_string(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_empty
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
TRACE
(
"
\n
"
);
V_VT
(
&
v
)
=
VT_EMPTY
;
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_not
(
exec_ctx_t
*
ctx
)
{
variant_val_t
val
;
...
...
dlls/vbscript/parse.h
View file @
6d8f84e5
...
...
@@ -18,6 +18,7 @@
typedef
enum
{
EXPR_BOOL
,
EXPR_EMPTY
,
EXPR_EQUAL
,
EXPR_MEMBER
,
EXPR_NOT
,
...
...
dlls/vbscript/parser.y
View file @
6d8f84e5
...
...
@@ -35,6 +35,7 @@ static int parser_error(const char*);
static void source_add_statement(parser_ctx_t*,statement_t*);
static void *new_expression(parser_ctx_t*,expression_type_t,size_t);
static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL);
static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*);
static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*);
...
...
@@ -145,6 +146,7 @@ LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
| 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; }
PrimaryExpression
: '(' Expression ')' { $$ = $2; }
...
...
@@ -172,7 +174,7 @@ static void parse_complete(parser_ctx_t *ctx, BOOL option_explicit)
ctx->option_explicit = option_explicit;
}
static void *new_expression(parser_ctx_t *ctx, expression_type_t type,
unsigned
size)
static void *new_expression(parser_ctx_t *ctx, expression_type_t type,
size_t
size)
{
expression_t *expr;
...
...
dlls/vbscript/tests/lang.vbs
View file @
6d8f84e5
...
...
@@ -29,10 +29,13 @@ Call ok(true = true, "true = true is false")
Call
ok
(
false
=
false
,
"false = false is false"
)
Call
ok
(
not
(
true
=
false
),
"true = false is true"
)
Call
ok
(
"x"
=
"x"
,
"
""
x
""
=
""
x
""
is false"
)
Call
ok
(
empty
=
empty
,
"empty = empty is false"
)
Call
ok
(
empty
=
""
,
"empty =
""""
is false"
)
Call
ok
(
getVT
(
false
)
=
"VT_BOOL"
,
"getVT(false) is not VT_BOOL"
)
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"
)
reportSuccess
()
dlls/vbscript/vbscript.h
View file @
6d8f84e5
...
...
@@ -76,6 +76,7 @@ typedef enum {
#define OP_LIST \
X(bool, 1, ARG_INT, 0) \
X(empty, 1, 0, 0) \
X(equal, 1, 0, 0) \
X(icall, 1, ARG_BSTR, ARG_UINT) \
X(icallv, 1, ARG_BSTR, ARG_UINT) \
...
...
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