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
6afc32c9
Commit
6afc32c9
authored
Sep 19, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added On Error statement parser implementation.
parent
afffa2c5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
compile.c
dlls/vbscript/compile.c
+8
-0
interp.c
dlls/vbscript/interp.c
+7
-0
parse.h
dlls/vbscript/parse.h
+6
-0
parser.y
dlls/vbscript/parser.y
+15
-0
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
6afc32c9
...
...
@@ -697,6 +697,11 @@ static HRESULT compile_exitprop_statement(compile_ctx_t *ctx)
return
push_instr_addr
(
ctx
,
OP_jmp
,
ctx
->
prop_end_label
);
}
static
HRESULT
compile_onerror_statement
(
compile_ctx_t
*
ctx
,
onerror_statement_t
*
stat
)
{
return
push_instr_int
(
ctx
,
OP_errmode
,
stat
->
resume_next
);
}
static
HRESULT
compile_statement
(
compile_ctx_t
*
ctx
,
statement_t
*
stat
)
{
HRESULT
hres
;
...
...
@@ -734,6 +739,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat)
case
STAT_IF
:
hres
=
compile_if_statement
(
ctx
,
(
if_statement_t
*
)
stat
);
break
;
case
STAT_ONERROR
:
hres
=
compile_onerror_statement
(
ctx
,
(
onerror_statement_t
*
)
stat
);
break
;
case
STAT_SET
:
hres
=
compile_assign_statement
(
ctx
,
(
assign_statement_t
*
)
stat
,
TRUE
);
break
;
...
...
dlls/vbscript/interp.c
View file @
6afc32c9
...
...
@@ -732,6 +732,13 @@ static HRESULT interp_bool(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_errmode
(
exec_ctx_t
*
ctx
)
{
const
int
err_mode
=
ctx
->
instr
->
arg1
.
uint
;
FIXME
(
"%d
\n
"
,
err_mode
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_string
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
...
...
dlls/vbscript/parse.h
View file @
6afc32c9
...
...
@@ -107,6 +107,7 @@ typedef enum {
STAT_EXITSUB
,
STAT_FUNC
,
STAT_IF
,
STAT_ONERROR
,
STAT_SET
,
STAT_STOP
,
STAT_UNTIL
,
...
...
@@ -195,6 +196,11 @@ typedef struct {
}
while_statement_t
;
typedef
struct
{
statement_t
stat
;
BOOL
resume_next
;
}
onerror_statement_t
;
typedef
struct
{
const
WCHAR
*
code
;
const
WCHAR
*
ptr
;
const
WCHAR
*
end
;
...
...
dlls/vbscript/parser.y
View file @
6afc32c9
...
...
@@ -55,6 +55,7 @@ static statement_t *new_dim_statement(parser_ctx_t*,dim_decl_t*);
static statement_t *new_while_statement(parser_ctx_t*,statement_type_t,expression_t*,statement_t*);
static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*);
static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*);
static statement_t *new_onerror_statement(parser_ctx_t*,BOOL);
static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,dim_decl_t*);
static elseif_decl_t *new_elseif_decl(parser_ctx_t*,expression_t*,statement_t*);
...
...
@@ -170,6 +171,8 @@ Statement
| tSET MemberExpression Arguments_opt '=' Expression
{ $2->args = $3; $$ = new_set_statement(ctx, $2, $5); CHECK_ERROR; }
| tSTOP { $$ = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; }
| tON tERROR tRESUME tNEXT { $$ = new_onerror_statement(ctx, TRUE); CHECK_ERROR; }
| tON tERROR tGOTO '0' { $$ = new_onerror_statement(ctx, FALSE); CHECK_ERROR; }
MemberExpression
: tIdentifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; }
...
...
@@ -614,6 +617,18 @@ static statement_t *new_if_statement(parser_ctx_t *ctx, expression_t *expr, stat
return &stat->stat;
}
static statement_t *new_onerror_statement(parser_ctx_t *ctx, BOOL resume_next)
{
onerror_statement_t *stat;
stat = new_statement(ctx, STAT_ONERROR, sizeof(*stat));
if(!stat)
return NULL;
stat->resume_next = resume_next;
return &stat->stat;
}
static arg_decl_t *new_argument_decl(parser_ctx_t *ctx, const WCHAR *name, BOOL by_ref)
{
arg_decl_t *arg_decl;
...
...
dlls/vbscript/vbscript.h
View file @
6afc32c9
...
...
@@ -186,6 +186,7 @@ typedef enum {
X(double, 1, ARG_DOUBLE, 0) \
X(empty, 1, 0, 0) \
X(equal, 1, 0, 0) \
X(errmode, 1, ARG_INT, 0) \
X(eqv, 1, 0, 0) \
X(exp, 1, 0, 0) \
X(gt, 1, 0, 0) \
...
...
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