From 374321f83619f5f71eb67ddf3aff368651c51367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Feb 2021 09:30:46 +0100 Subject: [PATCH] widl: Remove aNAMESPACE token from the lexer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- tools/widl/parser.h | 1 - tools/widl/parser.l | 2 +- tools/widl/parser.y | 13 ++----------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/widl/parser.h b/tools/widl/parser.h index a6dc94ae6b8..a67b160d48a 100644 --- a/tools/widl/parser.h +++ b/tools/widl/parser.h @@ -38,7 +38,6 @@ void pop_import(void); #define parse_only import_stack_ptr int is_type(const char *name); -int is_namespace(const char *name); int do_warning(char *toggle, warning_list_t *wnum); int is_warning_enabled(int warning); diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 7e20d30e7f0..8acc9c9590c 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -468,7 +468,7 @@ static int kw_token(const char *kw) return kwp->token; } parser_lval.str = xstrdup(kw); - return is_type(kw) ? aKNOWNTYPE : is_namespace(kw) ? aNAMESPACE : aIDENTIFIER; + return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; } static int attr_token(const char *kw) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 9fb6772ba33..d3a79e9fcb7 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -154,7 +154,7 @@ static typelib_t *current_typelib; } %token aIDENTIFIER aPRAGMA -%token aKNOWNTYPE aNAMESPACE +%token aKNOWNTYPE %token aNUM aHEXNUM %token aDOUBLE %token aSTRING aWSTRING aSQSTRING @@ -887,8 +887,7 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); } ; namespace_pfx: - aNAMESPACE '.' { $$ = find_namespace_or_error(&global_namespace, $1); } - | namespace_pfx aNAMESPACE '.' { $$ = find_namespace_or_error($1, $2); } + aIDENTIFIER '.' { $$ = find_namespace_or_error(&global_namespace, $1); } | namespace_pfx aIDENTIFIER '.' { $$ = find_namespace_or_error($1, $2); } ; @@ -919,7 +918,6 @@ apicontract_def: attributes apicontract '{' '}' semicolon_opt ; namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } - | tNAMESPACE aNAMESPACE { $$ = $2; } ; class_interfaces: { $$ = NULL; } @@ -2061,13 +2059,6 @@ int is_type(const char *name) return find_type(name, current_namespace, 0) != NULL; } -int is_namespace(const char *name) -{ - if (!winrt_mode) return 0; - return find_sub_namespace(current_namespace, name) != NULL || - find_sub_namespace(&global_namespace, name) != NULL; -} - type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t) { type_t *tp;