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
b2de64ee
Commit
b2de64ee
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: Use parser_error to set unhandled parser error.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5436fc90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
lex.c
dlls/vbscript/lex.c
+1
-1
parse.h
dlls/vbscript/parse.h
+0
-1
parser.y
dlls/vbscript/parser.y
+10
-15
No files found.
dlls/vbscript/lex.c
View file @
b2de64ee
...
...
@@ -351,7 +351,7 @@ static int parse_next_token(void *lval, unsigned *loc, parser_ctx_t *ctx)
skip_spaces
(
ctx
);
*
loc
=
ctx
->
ptr
-
ctx
->
code
;
if
(
ctx
->
ptr
==
ctx
->
end
)
return
ctx
->
last_token
==
tNL
?
tEOF
:
tNL
;
return
ctx
->
last_token
==
tNL
?
0
:
tNL
;
c
=
*
ctx
->
ptr
;
...
...
dlls/vbscript/parse.h
View file @
b2de64ee
...
...
@@ -284,7 +284,6 @@ typedef struct {
const
WCHAR
*
end
;
BOOL
option_explicit
;
BOOL
parse_complete
;
BOOL
is_html
;
HRESULT
hres
;
...
...
dlls/vbscript/parser.y
View file @
b2de64ee
...
...
@@ -110,7 +110,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
double dbl;
}
%token tEXPRESSION t
EOF t
NL tEMPTYBRACKETS tEXPRLBRACKET
%token tEXPRESSION tNL tEMPTYBRACKETS tEXPRLBRACKET
%token tLTEQ tGTEQ tNEQ
%token tSTOP tME tREM tDOT
%token <string> tTRUE tFALSE
...
...
@@ -153,8 +153,8 @@ static statement_t *link_statements(statement_t*,statement_t*);
%%
Program
: OptionExplicit_opt SourceElements
tEOF
{ parse_complete(ctx, $1); }
| tEXPRESSION ExpressionNl_opt
tEOF
{ handle_isexpression_script(ctx, $2); }
: OptionExplicit_opt SourceElements { parse_complete(ctx, $1); }
| tEXPRESSION ExpressionNl_opt { handle_isexpression_script(ctx, $2); }
OptionExplicit_opt
: /* empty */ { $$ = FALSE; }
...
...
@@ -506,6 +506,12 @@ StSep
static int parser_error(unsigned *loc, parser_ctx_t *ctx, const char *str)
{
if(ctx->hres == S_OK) {
FIXME("%s: %s\n", debugstr_w(ctx->code + *loc), debugstr_a(str));
ctx->hres = E_FAIL;
}else {
WARN("%s: %08x\n", debugstr_w(ctx->code + *loc), ctx->hres);
}
return 0;
}
...
...
@@ -530,7 +536,6 @@ static void source_add_class(parser_ctx_t *ctx, class_decl_t *class_decl)
static void parse_complete(parser_ctx_t *ctx, BOOL option_explicit)
{
ctx->parse_complete = TRUE;
ctx->option_explicit = option_explicit;
}
...
...
@@ -538,7 +543,6 @@ static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr)
{
retval_statement_t *stat;
ctx->parse_complete = TRUE;
if(!expr)
return;
...
...
@@ -1143,9 +1147,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite
heap_pool_init(&ctx->heap);
ctx->parse_complete = FALSE;
ctx->hres = S_OK;
ctx->last_token = tNL;
ctx->last_nl = 0;
ctx->stats = ctx->stats_tail = NULL;
...
...
@@ -1158,14 +1160,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite
parser_parse(ctx);
if(FAILED(ctx->hres))
return ctx->hres;
if(!ctx->parse_complete) {
FIXME("parser failed around %s\n", debugstr_w(ctx->code+20 > ctx->ptr ? ctx->code : ctx->ptr-20));
return E_FAIL;
}
return S_OK;
return ctx->hres;
}
void parser_release(parser_ctx_t *ctx)
...
...
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