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
117fd7c0
Commit
117fd7c0
authored
Sep 16, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added class property parser implementation.
parent
005808cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
parse.h
dlls/vbscript/parse.h
+8
-1
parser.y
dlls/vbscript/parser.y
+24
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+4
-0
No files found.
dlls/vbscript/parse.h
View file @
117fd7c0
...
...
@@ -142,14 +142,21 @@ typedef struct _function_decl_t {
struct
_function_decl_t
*
next
;
}
function_decl_t
;
typedef
struct
_function_statement_t
{
typedef
struct
{
statement_t
stat
;
function_decl_t
*
func_decl
;
}
function_statement_t
;
typedef
struct
_class_prop_decl_t
{
BOOL
is_public
;
const
WCHAR
*
name
;
struct
_class_prop_decl_t
*
next
;
}
class_prop_decl_t
;
typedef
struct
_class_decl_t
{
const
WCHAR
*
name
;
function_decl_t
*
funcs
;
class_prop_decl_t
*
props
;
struct
_class_decl_t
*
next
;
}
class_decl_t
;
...
...
dlls/vbscript/parser.y
View file @
117fd7c0
...
...
@@ -62,6 +62,7 @@ static arg_decl_t *new_argument_decl(parser_ctx_t*,const WCHAR*,BOOL);
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);
#define STORAGE_IS_PRIVATE 1
#define STORAGE_IS_DEFAULT 2
...
...
@@ -293,6 +294,7 @@ ClassDeclaration
ClassBody
: /* empty */ { $$ = new_class_decl(ctx); }
| FunctionDecl tNL ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; }
| Storage tIdentifier tNL ClassBody { $$ = add_variant_prop(ctx, $4, $2, $1); CHECK_ERROR; }
FunctionDecl
: Storage_opt tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB
...
...
@@ -628,6 +630,7 @@ static class_decl_t *new_class_decl(parser_ctx_t *ctx)
return NULL;
class_decl->funcs = NULL;
class_decl->props = NULL;
class_decl->next = NULL;
return class_decl;
}
...
...
@@ -651,6 +654,27 @@ static class_decl_t *add_class_function(parser_ctx_t *ctx, class_decl_t *class_d
return class_decl;
}
static class_decl_t *add_variant_prop(parser_ctx_t *ctx, class_decl_t *class_decl, const WCHAR *identifier, unsigned storage_flags)
{
class_prop_decl_t *prop;
if(storage_flags & STORAGE_IS_DEFAULT) {
FIXME("variant prop van't be default value\n");
ctx->hres = E_FAIL;
return NULL;
}
prop = parser_alloc(ctx, sizeof(*prop));
if(!prop)
return NULL;
prop->name = identifier;
prop->is_public = !(storage_flags & STORAGE_IS_PRIVATE);
prop->next = class_decl->props;
class_decl->props = prop;
return class_decl;
}
void *parser_alloc(parser_ctx_t *ctx, size_t size)
{
void *ret;
...
...
dlls/vbscript/tests/lang.vbs
View file @
117fd7c0
...
...
@@ -390,6 +390,10 @@ Class EmptyClass
End
Class
Class
TestClass
Public
publicProp
Private
privateProp
Public
Function
publicFunction
()
privateSub
()
publicFunction
=
4
...
...
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