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
78957118
Commit
78957118
authored
Sep 14, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added function parser implementation.
parent
0b9b021a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
3 deletions
+68
-3
compile.c
dlls/vbscript/compile.c
+2
-0
parser.y
dlls/vbscript/parser.y
+2
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+63
-0
vbscript.c
dlls/vbscript/tests/vbscript.c
+0
-3
vbscript.h
dlls/vbscript/vbscript.h
+1
-0
No files found.
dlls/vbscript/compile.c
View file @
78957118
...
...
@@ -621,6 +621,7 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
if
(
ctx
->
sub_end_label
==
-
1
)
return
E_OUTOFMEMORY
;
break
;
case
FUNC_FUNCTION
:
/* FIXME */
case
FUNC_GLOBAL
:
break
;
}
...
...
@@ -833,6 +834,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
ret
->
bstr_pool
=
NULL
;
ret
->
bstr_pool_size
=
0
;
ret
->
bstr_cnt
=
0
;
ret
->
global_executed
=
FALSE
;
ret
->
global_code
.
type
=
FUNC_GLOBAL
;
ret
->
global_code
.
name
=
NULL
;
...
...
dlls/vbscript/parser.y
View file @
78957118
...
...
@@ -253,6 +253,8 @@ PrimaryExpression
FunctionDecl
: /* Storage_opt */ tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB
{ $$ = new_function_decl(ctx, $2, FUNC_SUB, $3, $5); CHECK_ERROR; }
| /* Storage_opt */ tFUNCTION tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tFUNCTION
{ $$ = new_function_decl(ctx, $2, FUNC_FUNCTION, $3, $5); CHECK_ERROR; }
ArgumentsDecl_opt
: EmptyBrackets_opt { $$ = NULL; }
...
...
dlls/vbscript/tests/lang.vbs
View file @
78957118
...
...
@@ -241,4 +241,67 @@ y = true
Call
TestSubLocalVal
Call
ok
(
x
,
"global x is not true?"
)
if
false
then
Function
testfunc
x
=
true
End
Function
end
if
x
=
false
Call
TestFunc
Call
ok
(
x
,
"x is false, testfunc not called?"
)
Function
FuncSetTrue
(
v
)
Call
ok
(
not
v
,
"v is not true"
)
v
=
true
End
Function
x
=
false
FuncSetTrue
x
Call
ok
(
x
,
"x was not set by FuncSetTrue"
)
FuncSetTrue
false
Call
ok
(
not
false
,
"false is no longer false?"
)
Function
FuncSetTrue2
(
ByRef
v
)
Call
ok
(
not
v
,
"v is not true"
)
v
=
true
End
Function
x
=
false
FuncSetTrue2
x
Call
ok
(
x
,
"x was not set by FuncSetTrue"
)
Function
TestFuncArgVal
(
ByVal
v
)
Call
ok
(
not
v
,
"v is not false"
)
v
=
true
Call
ok
(
v
,
"v is not true?"
)
End
Function
x
=
false
Call
TestFuncArgVal
(
x
)
Call
ok
(
not
x
,
"x is true after TestFuncArgVal call?"
)
Function
TestFuncMultiArgs
(
a
,
b
,
c
,
d
,
e
)
Call
ok
(
a
=
1
,
"a = "
&
a
)
Call
ok
(
b
=
2
,
"b = "
&
b
)
Call
ok
(
c
=
3
,
"c = "
&
c
)
Call
ok
(
d
=
4
,
"d = "
&
d
)
Call
ok
(
e
=
5
,
"e = "
&
e
)
End
Function
TestFuncMultiArgs
1
,
2
,
3
,
4
,
5
Call
TestFuncMultiArgs
(
1
,
2
,
3
,
4
,
5
)
Function
TestFuncLocalVal
x
=
false
Call
ok
(
not
x
,
"local x is not false?"
)
Dim
x
End
Function
x
=
true
y
=
true
Call
TestFuncLocalVal
Call
ok
(
x
,
"global x is not true?"
)
reportSuccess
()
dlls/vbscript/tests/vbscript.c
View file @
78957118
...
...
@@ -412,7 +412,6 @@ static void test_vbscript_uninitializing(void)
test_state
(
script
,
SCRIPTSTATE_INITIALIZED
);
hres
=
IActiveScriptParse64_ParseScriptText
(
parse
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0x42
,
NULL
,
NULL
);
todo_wine
ok
(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
...
...
@@ -441,9 +440,7 @@ static void test_vbscript_uninitializing(void)
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CONNECTED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CONNECTED
);
todo_wine
CHECK_CALLED
(
OnEnterScript
);
todo_wine
CHECK_CALLED
(
OnLeaveScript
);
test_state
(
script
,
SCRIPTSTATE_CONNECTED
);
...
...
dlls/vbscript/vbscript.h
View file @
78957118
...
...
@@ -164,6 +164,7 @@ typedef struct {
typedef
enum
{
FUNC_GLOBAL
,
FUNC_FUNCTION
,
FUNC_SUB
}
function_type_t
;
...
...
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