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
d0ae4c47
Commit
d0ae4c47
authored
Sep 20, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for ':' as statement separator.
parent
13fef511
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
lex.c
dlls/vbscript/lex.c
+1
-0
parser.y
dlls/vbscript/parser.y
+24
-2
lang.vbs
dlls/vbscript/tests/lang.vbs
+5
-0
No files found.
dlls/vbscript/lex.c
View file @
d0ae4c47
...
...
@@ -333,6 +333,7 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
else
ctx
->
ptr
=
ctx
->
end
;
return
tNL
;
case
':'
:
case
')'
:
case
','
:
case
'='
:
...
...
dlls/vbscript/parser.y
View file @
d0ae4c47
...
...
@@ -66,6 +66,8 @@ static class_decl_t *new_class_decl(parser_ctx_t*);
static class_decl_t *add_class_function(parser_ctx_t*,class_decl_t*,function_decl_t*);
static class_decl_t *add_variant_prop(parser_ctx_t*,class_decl_t*,const WCHAR*,unsigned);
static statement_t *link_statements(statement_t*,statement_t*);
#define STORAGE_IS_PRIVATE 1
#define STORAGE_IS_DEFAULT 2
...
...
@@ -109,7 +111,7 @@ static class_decl_t *add_variant_prop(parser_ctx_t*,class_decl_t*,const WCHAR*,u
%token <lng> tLong tShort
%token <dbl> tDouble
%type <statement> Statement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt
%type <statement> Statement S
impleStatement S
tatementNl StatementsNl StatementsNl_opt IfStatement Else_opt
%type <expression> Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression
%type <expression> ConcatExpression AdditiveExpression ModExpression IntdivExpression MultiplicativeExpression ExpExpression
%type <expression> NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression
...
...
@@ -143,12 +145,19 @@ StatementsNl_opt
StatementsNl
: StatementNl { $$ = $1; }
| StatementNl StatementsNl { $
1->next = $2; $$ = $1
; }
| StatementNl StatementsNl { $
$ = link_statements($1, $2)
; }
StatementNl
: Statement tNL { $$ = $1; }
Statement
: ':' { $$ = NULL; }
| ':' Statement { $$ = $2; }
| SimpleStatement { $$ = $1; }
| SimpleStatement ':' Statement { $1->next = $3; $$ = $1; }
| SimpleStatement ':' { $$ = $1; }
SimpleStatement
: MemberExpression ArgumentList_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 Arguments_opt '=' Expression
...
...
@@ -366,6 +375,9 @@ static int parser_error(const char *str)
static void source_add_statement(parser_ctx_t *ctx, statement_t *stat)
{
if(!stat)
return;
if(ctx->stats) {
ctx->stats_tail->next = stat;
ctx->stats_tail = stat;
...
...
@@ -752,6 +764,16 @@ static class_decl_t *add_variant_prop(parser_ctx_t *ctx, class_decl_t *class_dec
return class_decl;
}
static statement_t *link_statements(statement_t *head, statement_t *tail)
{
statement_t *iter;
for(iter = head; iter->next; iter = iter->next);
iter->next = tail;
return head;
}
void *parser_alloc(parser_ctx_t *ctx, size_t size)
{
void *ret;
...
...
dlls/vbscript/tests/lang.vbs
View file @
d0ae4c47
...
...
@@ -608,6 +608,11 @@ funcCalled = ""
Set
obj
=
Nothing
Call
ok
(
funcCalled
=
"terminate"
,
"funcCalled = "
&
funcCalled
)
x
=
"following ':' is correct syntax"
:
x
=
"following ':' is correct syntax"
::
:
::
x
=
"also correct syntax"
:
Set
obj
=
new
EmptyClass
Set
x
=
obj
Set
y
=
new
EmptyClass
...
...
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