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
fa3e6917
Commit
fa3e6917
authored
Oct 14, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Don't use VARTYPE as is in literal_t.
parent
b462e34c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
22 deletions
+34
-22
engine.c
dlls/jscript/engine.c
+16
-14
engine.h
dlls/jscript/engine.h
+11
-1
lex.c
dlls/jscript/lex.c
+3
-3
parser.y
dlls/jscript/parser.y
+4
-4
No files found.
dlls/jscript/engine.c
View file @
fa3e6917
...
...
@@ -349,31 +349,33 @@ static HRESULT equal2_values(VARIANT *lval, VARIANT *rval, BOOL *ret)
static
HRESULT
literal_to_var
(
literal_t
*
literal
,
VARIANT
*
v
)
{
V_VT
(
v
)
=
literal
->
vt
;
switch
(
V_VT
(
v
))
{
case
VT_EMPTY
:
case
VT_NULL
:
switch
(
literal
->
type
)
{
case
LT_UNDEFINED
:
V_VT
(
v
)
=
VT_EMPTY
;
break
;
case
VT_I4
:
case
LT_NULL
:
V_VT
(
v
)
=
VT_NULL
;
break
;
case
LT_INT
:
V_VT
(
v
)
=
VT_I4
;
V_I4
(
v
)
=
literal
->
u
.
lval
;
break
;
case
VT_R8
:
case
LT_DOUBLE
:
V_VT
(
v
)
=
VT_R8
;
V_R8
(
v
)
=
literal
->
u
.
dval
;
break
;
case
VT_BSTR
:
case
LT_STRING
:
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
SysAllocString
(
literal
->
u
.
wstr
);
break
;
case
VT_BOOL
:
case
LT_BOOL
:
V_VT
(
v
)
=
VT_BOOL
;
V_BOOL
(
v
)
=
literal
->
u
.
bval
;
break
;
case
VT_DISPATCH
:
case
LT_DISPATCH
:
V_VT
(
v
)
=
VT_DISPATCH
;
IDispatch_AddRef
(
literal
->
u
.
disp
);
V_DISPATCH
(
v
)
=
literal
->
u
.
disp
;
break
;
default:
ERR
(
"wrong type %d
\n
"
,
V_VT
(
v
));
return
E_NOTIMPL
;
}
return
S_OK
;
...
...
dlls/jscript/engine.h
View file @
fa3e6917
...
...
@@ -126,8 +126,18 @@ typedef struct _parameter_t parameter_t;
HRESULT
create_source_function
(
parser_ctx_t
*
,
parameter_t
*
,
source_elements_t
*
,
scope_chain_t
*
,
const
WCHAR
*
,
DWORD
,
DispatchEx
**
);
typedef
enum
{
LT_INT
,
LT_DOUBLE
,
LT_STRING
,
LT_BOOL
,
LT_DISPATCH
,
LT_UNDEFINED
,
LT_NULL
}
literal_type_t
;
typedef
struct
{
VARTYPE
vt
;
literal_type_t
type
;
union
{
LONG
lval
;
double
dval
;
...
...
dlls/jscript/lex.c
View file @
fa3e6917
...
...
@@ -369,7 +369,7 @@ static literal_t *alloc_int_literal(parser_ctx_t *ctx, LONG l)
{
literal_t
*
ret
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
ret
->
vt
=
VT_I4
;
ret
->
type
=
LT_INT
;
ret
->
u
.
lval
=
l
;
return
ret
;
...
...
@@ -447,7 +447,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
}
*
literal
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
(
*
literal
)
->
vt
=
VT_R8
;
(
*
literal
)
->
type
=
LT_DOUBLE
;
(
*
literal
)
->
u
.
dval
=
(
double
)
d
*
pow
(
10
,
exp
);
return
tNumericLiteral
;
...
...
@@ -801,7 +801,7 @@ literal_t *parse_regexp(parser_ctx_t *ctx)
add_object_literal
(
ctx
,
regexp
);
ret
=
parser_alloc
(
ctx
,
sizeof
(
literal_t
));
ret
->
vt
=
V
T_DISPATCH
;
ret
->
type
=
L
T_DISPATCH
;
ret
->
u
.
disp
=
(
IDispatch
*
)
_IDispatchEx_
(
regexp
);
return
ret
;
}
dlls/jscript/parser.y
View file @
fa3e6917
...
...
@@ -841,7 +841,7 @@ static literal_t *new_string_literal(parser_ctx_t *ctx, const WCHAR *str)
{
literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
ret->
vt = VT_BSTR
;
ret->
type = LT_STRING
;
ret->u.wstr = str;
return ret;
...
...
@@ -851,7 +851,7 @@ static literal_t *new_null_literal(parser_ctx_t *ctx)
{
literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
ret->
vt = V
T_NULL;
ret->
type = L
T_NULL;
return ret;
}
...
...
@@ -860,7 +860,7 @@ static literal_t *new_undefined_literal(parser_ctx_t *ctx)
{
literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
ret->
vt = VT_EMPTY
;
ret->
type = LT_UNDEFINED
;
return ret;
}
...
...
@@ -869,7 +869,7 @@ static literal_t *new_boolean_literal(parser_ctx_t *ctx, VARIANT_BOOL bval)
{
literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
ret->
vt = V
T_BOOL;
ret->
type = L
T_BOOL;
ret->u.bval = bval;
return ret;
...
...
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