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
a921bd2e
Commit
a921bd2e
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 support for |f a, b, c| call statement.
parent
908834fe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
lex.c
dlls/vbscript/lex.c
+19
-3
parser.y
dlls/vbscript/parser.y
+9
-5
lang.vbs
dlls/vbscript/tests/lang.vbs
+1
-0
No files found.
dlls/vbscript/lex.c
View file @
a921bd2e
...
...
@@ -240,12 +240,17 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret)
return
tString
;
}
static
void
skip_spaces
(
parser_ctx_t
*
ctx
)
{
while
(
*
ctx
->
ptr
==
' '
||
*
ctx
->
ptr
==
'\t'
||
*
ctx
->
ptr
==
'\r'
)
ctx
->
ptr
++
;
}
static
int
parse_next_token
(
void
*
lval
,
parser_ctx_t
*
ctx
)
{
WCHAR
c
;
while
(
*
ctx
->
ptr
==
' '
||
*
ctx
->
ptr
==
'\t'
||
*
ctx
->
ptr
==
'\r'
)
ctx
->
ptr
++
;
skip_spaces
(
ctx
);
if
(
ctx
->
ptr
==
ctx
->
end
)
return
ctx
->
last_token
==
tNL
?
tEOF
:
tNL
;
...
...
@@ -269,7 +274,6 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
else
ctx
->
ptr
=
ctx
->
end
;
return
tNL
;
case
'('
:
case
')'
:
case
','
:
case
'='
:
...
...
@@ -281,6 +285,18 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
case
'\\'
:
case
'.'
:
return
*
ctx
->
ptr
++
;
case
'('
:
/* NOTE:
* We resolve empty brackets in lexer instead of parser to avoid complex conflicts
* in call statement special case |f()| without 'call' keyword
*/
ctx
->
ptr
++
;
skip_spaces
(
ctx
);
if
(
*
ctx
->
ptr
==
')'
)
{
ctx
->
ptr
++
;
return
tEMPTYBRACKETS
;
}
return
'('
;
case
'"'
:
return
parse_string_literal
(
ctx
,
lval
);
default:
...
...
dlls/vbscript/parser.y
View file @
a921bd2e
...
...
@@ -56,7 +56,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
member_expression_t *member;
}
%token tEOF tNL tREM
%token tEOF tNL tREM
tEMPTYBRACKETS
%token tTRUE tFALSE
%token tNOT tAND tOR tXOR tEQV tIMP tNEQ
%token tIS tLTEQ tGTEQ tMOD
...
...
@@ -89,7 +89,7 @@ StatementNl
: Statement tNL { $$ = $1; }
Statement
: MemberExpression Argument
s_opt
{ $1->args = $2; $$ = new_call_statement(ctx, $1); CHECK_ERROR; }
: MemberExpression Argument
List_opt
{ $1->args = $2; $$ = new_call_statement(ctx, $1); CHECK_ERROR; }
| tCALL MemberExpression Arguments_opt { $2->args = $3; $$ = new_call_statement(ctx, $2); CHECK_ERROR; }
MemberExpression
...
...
@@ -97,17 +97,21 @@ MemberExpression
/* FIXME: MemberExpressionArgs '.' tIdentifier */
Arguments_opt
:
/* empty */
{ $$ = NULL; }
| '(' ArgumentList
_opt ')'
{ $$ = $2; }
:
EmptyBrackets_opt
{ $$ = NULL; }
| '(' ArgumentList
')'
{ $$ = $2; }
ArgumentList_opt
:
/* empty */
{ $$ = NULL; }
:
EmptyBrackets_opt
{ $$ = NULL; }
| ArgumentList { $$ = $1; }
ArgumentList
: Expression { $$ = $1; }
| Expression ',' ArgumentList { $1->next = $3; $$ = $1; }
EmptyBrackets_opt
: /* empty */
| tEMPTYBRACKETS
Expression
: LiteralExpression /* FIXME */ { $$ = $1; }
...
...
dlls/vbscript/tests/lang.vbs
View file @
a921bd2e
...
...
@@ -17,5 +17,6 @@
'
call
ok
(
true
,
"true is not true?"
)
ok
true
,
"true is not true?"
reportSuccess
()
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