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
8108b404
Commit
8108b404
authored
Sep 09, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added parser/compiler support for |option explicit|.
parent
a921bd2e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
4 deletions
+22
-4
compile.c
dlls/vbscript/compile.c
+2
-0
interp.c
dlls/vbscript/interp.c
+4
-1
parse.h
dlls/vbscript/parse.h
+1
-0
parser.y
dlls/vbscript/parser.y
+11
-3
lang.vbs
dlls/vbscript/tests/lang.vbs
+2
-0
vbscript.h
dlls/vbscript/vbscript.h
+2
-0
No files found.
dlls/vbscript/compile.c
View file @
8108b404
...
@@ -256,6 +256,8 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
...
@@ -256,6 +256,8 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
ctx
->
instr_cnt
=
0
;
ctx
->
instr_cnt
=
0
;
ctx
->
instr_size
=
32
;
ctx
->
instr_size
=
32
;
ret
->
option_explicit
=
ctx
->
parser
.
option_explicit
;
ret
->
bstr_pool
=
NULL
;
ret
->
bstr_pool
=
NULL
;
ret
->
bstr_pool_size
=
0
;
ret
->
bstr_pool_size
=
0
;
ret
->
bstr_cnt
=
0
;
ret
->
bstr_cnt
=
0
;
...
...
dlls/vbscript/interp.c
View file @
8108b404
...
@@ -29,6 +29,7 @@ typedef struct {
...
@@ -29,6 +29,7 @@ typedef struct {
vbscode_t
*
code
;
vbscode_t
*
code
;
instr_t
*
instr
;
instr_t
*
instr
;
script_ctx_t
*
script
;
script_ctx_t
*
script
;
function_t
*
func
;
unsigned
stack_size
;
unsigned
stack_size
;
unsigned
top
;
unsigned
top
;
...
@@ -70,7 +71,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref)
...
@@ -70,7 +71,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref)
}
}
}
}
FIXME
(
"create if no option explicit
\n
"
);
if
(
!
ctx
->
func
->
code_ctx
->
option_explicit
)
FIXME
(
"create an attempt to set
\n
"
);
ref
->
type
=
REF_NONE
;
ref
->
type
=
REF_NONE
;
return
S_OK
;
return
S_OK
;
...
@@ -223,6 +225,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func)
...
@@ -223,6 +225,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func)
exec
.
code
=
func
->
code_ctx
;
exec
.
code
=
func
->
code_ctx
;
exec
.
instr
=
exec
.
code
->
instrs
+
func
->
code_off
;
exec
.
instr
=
exec
.
code
->
instrs
+
func
->
code_off
;
exec
.
script
=
ctx
;
exec
.
script
=
ctx
;
exec
.
func
=
func
;
while
(
exec
.
instr
)
{
while
(
exec
.
instr
)
{
op
=
exec
.
instr
->
op
;
op
=
exec
.
instr
->
op
;
...
...
dlls/vbscript/parse.h
View file @
8108b404
...
@@ -63,6 +63,7 @@ typedef struct {
...
@@ -63,6 +63,7 @@ typedef struct {
const
WCHAR
*
ptr
;
const
WCHAR
*
ptr
;
const
WCHAR
*
end
;
const
WCHAR
*
end
;
BOOL
option_explicit
;
BOOL
parse_complete
;
BOOL
parse_complete
;
HRESULT
hres
;
HRESULT
hres
;
...
...
dlls/vbscript/parser.y
View file @
8108b404
...
@@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
...
@@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
static int parser_error(const char*);
static int parser_error(const char*);
static void parse_complete(parser_ctx_t*
);
static void parse_complete(parser_ctx_t*,BOOL
);
static void source_add_statement(parser_ctx_t*,statement_t*);
static void source_add_statement(parser_ctx_t*,statement_t*);
...
@@ -54,6 +54,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
...
@@ -54,6 +54,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
statement_t *statement;
statement_t *statement;
expression_t *expression;
expression_t *expression;
member_expression_t *member;
member_expression_t *member;
BOOL bool;
}
}
%token tEOF tNL tREM tEMPTYBRACKETS
%token tEOF tNL tREM tEMPTYBRACKETS
...
@@ -75,11 +76,16 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
...
@@ -75,11 +76,16 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%type <expression> Expression LiteralExpression
%type <expression> Expression LiteralExpression
%type <member> MemberExpression
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt ArgumentList
%type <expression> Arguments_opt ArgumentList_opt ArgumentList
%type <bool> OptionExplicit_opt
%%
%%
Program
Program
: SourceElements tEOF { parse_complete(ctx); }
: OptionExplicit_opt SourceElements tEOF { parse_complete(ctx, $1); }
OptionExplicit_opt
: /* empty */ { $$ = FALSE; }
| tOPTION tEXPLICIT tNL { $$ = TRUE; }
SourceElements
SourceElements
: /* empty */
: /* empty */
...
@@ -137,9 +143,10 @@ static void source_add_statement(parser_ctx_t *ctx, statement_t *stat)
...
@@ -137,9 +143,10 @@ static void source_add_statement(parser_ctx_t *ctx, statement_t *stat)
}
}
}
}
static void parse_complete(parser_ctx_t *ctx)
static void parse_complete(parser_ctx_t *ctx
, BOOL option_explicit
)
{
{
ctx->parse_complete = TRUE;
ctx->parse_complete = TRUE;
ctx->option_explicit = option_explicit;
}
}
static void *new_expression(parser_ctx_t *ctx, expression_type_t type, unsigned size)
static void *new_expression(parser_ctx_t *ctx, expression_type_t type, unsigned size)
...
@@ -240,6 +247,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
...
@@ -240,6 +247,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
ctx->last_token = tNL;
ctx->last_token = tNL;
ctx->last_nl = 0;
ctx->last_nl = 0;
ctx->stats = ctx->stats_tail = NULL;
ctx->stats = ctx->stats_tail = NULL;
ctx->option_explicit = FALSE;
parser_parse(ctx);
parser_parse(ctx);
...
...
dlls/vbscript/tests/lang.vbs
View file @
8108b404
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
'
'
Option
Explicit
call
ok
(
true
,
"true is not true?"
)
call
ok
(
true
,
"true is not true?"
)
ok
true
,
"true is not true?"
ok
true
,
"true is not true?"
...
...
dlls/vbscript/vbscript.h
View file @
8108b404
...
@@ -109,6 +109,8 @@ struct _vbscode_t {
...
@@ -109,6 +109,8 @@ struct _vbscode_t {
instr_t
*
instrs
;
instr_t
*
instrs
;
WCHAR
*
source
;
WCHAR
*
source
;
BOOL
option_explicit
;
BOOL
global_executed
;
BOOL
global_executed
;
function_t
global_code
;
function_t
global_code
;
...
...
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