From 85762bf61d7184b38dac7f7eacc2da480b6d089a Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 8 Oct 2021 15:04:22 -0700 Subject: remove AidlPackage This AidlNode is not part of the AIDL AST, and so it can't be visited. Bug: 201584220 Test: aidl_unittests Change-Id: I008c5e6648ed27cc1e8d8e7f672389266457707d --- aidl_language_y.yy | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'aidl_language_y.yy') diff --git a/aidl_language_y.yy b/aidl_language_y.yy index a98e4442..c7c72875 100644 --- a/aidl_language_y.yy +++ b/aidl_language_y.yy @@ -92,7 +92,6 @@ AidlLocation loc(const yy::parser::location_type& l) { std::vector* type_params; std::vector>* imports; AidlImport* import; - AidlPackage* package; std::vector>* declarations; } @@ -178,14 +177,13 @@ AidlLocation loc(const yy::parser::location_type& l) { %type constant_value_non_empty_list %type imports %type import -%type package %type decls -%type identifier error qualified_name +%type identifier error qualified_name optional_package %% document - : package imports decls { + : optional_package imports decls { Comments comments; if ($1) { comments = $1->GetComments(); @@ -209,14 +207,13 @@ identifier | CPP_HEADER ; -package +optional_package : { $$ = nullptr; } | PACKAGE qualified_name ';' { - $$ = new AidlPackage(loc(@1, @3), $2->GetText(), $1->GetComments()); - ps->SetPackage(*$$); - delete $1; + ps->SetPackage($2->GetText()); + $$ = $1; // for comments delete $2; } ; -- cgit v1.2.3