Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d145d0c0
Commit
d145d0c0
authored
Sep 08, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added bool literals parsing support.
parent
7cbc5235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
parse.h
dlls/vbscript/parse.h
+6
-0
parser.y
dlls/vbscript/parser.y
+28
-2
No files found.
dlls/vbscript/parse.h
View file @
d145d0c0
...
...
@@ -17,6 +17,7 @@
*/
typedef
enum
{
EXPR_BOOL
,
EXPR_MEMBER
}
expression_type_t
;
...
...
@@ -27,6 +28,11 @@ typedef struct _expression_t {
typedef
struct
{
expression_t
expr
;
VARIANT_BOOL
value
;
}
bool_expression_t
;
typedef
struct
{
expression_t
expr
;
expression_t
*
obj_expr
;
const
WCHAR
*
identifier
;
expression_t
*
args
;
...
...
dlls/vbscript/parser.y
View file @
d145d0c0
...
...
@@ -35,6 +35,8 @@ static void parse_complete(parser_ctx_t*);
static void source_add_statement(parser_ctx_t*,statement_t*);
static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL);
static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
...
...
@@ -69,8 +71,9 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%token <string> tIdentifier
%type <statement> Statement StatementNl
%type <expression> Expression LiteralExpression
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt
%type <expression> Arguments_opt ArgumentList_opt
ArgumentList
%%
...
...
@@ -98,7 +101,18 @@ Arguments_opt
ArgumentList_opt
: /* empty */ { $$ = NULL; }
/* | ArgumentList { $$ = $1; } */
| ArgumentList { $$ = $1; }
ArgumentList
: Expression { $$ = $1; }
| Expression ',' ArgumentList { $1->next = $3; $$ = $1; }
Expression
: LiteralExpression /* FIXME */ { $$ = $1; }
LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
| tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; }
%%
...
...
@@ -135,6 +149,18 @@ static void *new_expression(parser_ctx_t *ctx, expression_type_t type, unsigned
return expr;
}
static expression_t *new_bool_expression(parser_ctx_t *ctx, VARIANT_BOOL value)
{
bool_expression_t *expr;
expr = new_expression(ctx, EXPR_BOOL, sizeof(*expr));
if(!expr)
return NULL;
expr->value = value;
return &expr->expr;
}
static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *obj_expr, const WCHAR *identifier)
{
member_expression_t *expr;
...
...
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