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
eb73571f
Commit
eb73571f
authored
Jan 22, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Pass parser error location to compiler.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12b1bcdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
compile.c
dlls/vbscript/compile.c
+7
-8
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+3
-0
No files found.
dlls/vbscript/compile.c
View file @
eb73571f
...
...
@@ -1917,27 +1917,25 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli
vbscode_t
*
code
;
HRESULT
hres
;
memset
(
&
ctx
,
0
,
sizeof
(
ctx
));
code
=
ctx
.
code
=
alloc_vbscode
(
&
ctx
,
src
,
cookie
,
start_line
);
if
(
!
ctx
.
code
)
return
E_OUTOFMEMORY
;
hres
=
parse_script
(
&
ctx
.
parser
,
code
->
source
,
delimiter
,
flags
);
if
(
FAILED
(
hres
))
{
if
(
ctx
.
parser
.
error_loc
!=
-
1
)
ctx
.
loc
=
ctx
.
parser
.
error_loc
;
hres
=
compile_error
(
script
,
hres
);
release_vbscode
(
code
);
return
hres
;
}
ctx
.
func_decls
=
NULL
;
ctx
.
labels
=
NULL
;
ctx
.
global_consts
=
NULL
;
ctx
.
stat_ctx
=
NULL
;
ctx
.
labels_cnt
=
ctx
.
labels_size
=
0
;
hres
=
compile_func
(
&
ctx
,
ctx
.
parser
.
stats
,
&
ctx
.
code
->
main_code
);
if
(
FAILED
(
hres
))
{
hres
=
compile_error
(
script
,
hres
);
release_compiler
(
&
ctx
);
return
compile_error
(
script
,
hres
)
;
return
hres
;
}
ctx
.
global_consts
=
ctx
.
const_decls
;
...
...
@@ -1947,8 +1945,9 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli
for
(
func_decl
=
ctx
.
func_decls
;
func_decl
;
func_decl
=
func_decl
->
next
)
{
hres
=
create_function
(
&
ctx
,
func_decl
,
&
new_func
);
if
(
FAILED
(
hres
))
{
hres
=
compile_error
(
script
,
hres
);
release_compiler
(
&
ctx
);
return
compile_error
(
script
,
hres
)
;
return
hres
;
}
new_func
->
next
=
ctx
.
code
->
funcs
;
...
...
dlls/vbscript/parse.h
View file @
eb73571f
...
...
@@ -286,6 +286,7 @@ typedef struct {
BOOL
option_explicit
;
BOOL
is_html
;
HRESULT
hres
;
int
error_loc
;
int
last_token
;
unsigned
last_nl
;
...
...
dlls/vbscript/parser.y
View file @
eb73571f
...
...
@@ -505,6 +505,8 @@ StSep
static int parser_error(unsigned *loc, parser_ctx_t *ctx, const char *str)
{
if(ctx->error_loc == -1)
ctx->error_loc = *loc;
if(ctx->hres == S_OK) {
FIXME("%s: %s\n", debugstr_w(ctx->code + *loc), debugstr_a(str));
ctx->hres = E_FAIL;
...
...
@@ -1142,6 +1144,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite
heap_pool_init(&ctx->heap);
ctx->hres = S_OK;
ctx->error_loc = -1;
ctx->last_token = tNL;
ctx->last_nl = 0;
ctx->stats = ctx->stats_tail = NULL;
...
...
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