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
880d7066
Commit
880d7066
authored
Sep 12, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added compiler support for numeric literals.
parent
7f835c96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
compile.c
dlls/vbscript/compile.c
+24
-0
interp.c
dlls/vbscript/interp.c
+18
-0
vbscript.h
dlls/vbscript/vbscript.h
+6
-1
No files found.
dlls/vbscript/compile.c
View file @
880d7066
...
...
@@ -107,6 +107,24 @@ static HRESULT push_instr_str(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg)
return
S_OK
;
}
static
HRESULT
push_instr_double
(
compile_ctx_t
*
ctx
,
vbsop_t
op
,
double
arg
)
{
unsigned
instr
;
double
*
d
;
d
=
compiler_alloc
(
ctx
->
code
,
sizeof
(
double
));
if
(
!
d
)
return
E_OUTOFMEMORY
;
instr
=
push_instr
(
ctx
,
op
);
if
(
instr
==
-
1
)
return
E_OUTOFMEMORY
;
*
d
=
arg
;
instr_ptr
(
ctx
,
instr
)
->
arg1
.
dbl
=
d
;
return
S_OK
;
}
static
BSTR
alloc_bstr_arg
(
compile_ctx_t
*
ctx
,
const
WCHAR
*
str
)
{
if
(
!
ctx
->
code
->
bstr_pool_size
)
{
...
...
@@ -218,6 +236,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_DOUBLE
:
return
push_instr_double
(
ctx
,
OP_double
,
((
double_expression_t
*
)
expr
)
->
value
);
case
EXPR_EMPTY
:
return
push_instr
(
ctx
,
OP_empty
)
!=
-
1
?
S_OK
:
E_OUTOFMEMORY
;
case
EXPR_EQUAL
:
...
...
@@ -230,6 +250,10 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
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
);
case
EXPR_USHORT
:
return
push_instr_int
(
ctx
,
OP_short
,
((
int_expression_t
*
)
expr
)
->
value
);
case
EXPR_ULONG
:
return
push_instr_int
(
ctx
,
OP_long
,
((
int_expression_t
*
)
expr
)
->
value
);
default:
FIXME
(
"Unimplemented expression type %d
\n
"
,
expr
->
type
);
return
E_NOTIMPL
;
...
...
dlls/vbscript/interp.c
View file @
880d7066
...
...
@@ -251,6 +251,24 @@ static HRESULT interp_string(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_long
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_short
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_double
(
exec_ctx_t
*
ctx
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_empty
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
...
...
dlls/vbscript/vbscript.h
View file @
880d7066
...
...
@@ -83,18 +83,22 @@ typedef enum {
ARG_STR
,
ARG_BSTR
,
ARG_INT
,
ARG_UINT
ARG_UINT
,
ARG_DOUBLE
}
instr_arg_type_t
;
#define OP_LIST \
X(bool, 1, ARG_INT, 0) \
X(double, 1, ARG_DOUBLE, 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) \
X(long, 1, ARG_INT, 0) \
X(not, 1, 0, 0) \
X(null, 1, 0, 0) \
X(ret, 0, 0, 0) \
X(short, 1, ARG_INT, 0) \
X(string, 1, ARG_STR, 0)
typedef
enum
{
...
...
@@ -109,6 +113,7 @@ typedef union {
BSTR
bstr
;
unsigned
uint
;
LONG
lng
;
double
*
dbl
;
}
instr_arg_t
;
typedef
struct
{
...
...
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