aboutsummaryrefslogtreecommitdiff
path: root/aidl_language_y.yy
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2022-02-07 23:07:39 -0800
committerXin Li <delphij@google.com>2022-02-08 08:49:51 -0800
commit169d4ba53f0b1f8465fdb81bcdc93051cdf0c97f (patch)
treef502ad0ea56ee90d492cce7add7cf709aeae5c62 /aidl_language_y.yy
parentaad0e4bde0594d4d0b5b686585a6b77ccff3045d (diff)
parentcc7fe4565268eaa99f80f8395dee0e2c29da9d13 (diff)
downloadaidl-169d4ba53f0b1f8465fdb81bcdc93051cdf0c97f.tar.gz
Bug: 213904741 Merged-In: I7924d7b19ec30e42fd1d17ec913c4a75d51ea6bc Change-Id: I73618ff8ee69680cdbe3b493d2c06d12f9128502
Diffstat (limited to 'aidl_language_y.yy')
-rw-r--r--aidl_language_y.yy8
1 files changed, 5 insertions, 3 deletions
diff --git a/aidl_language_y.yy b/aidl_language_y.yy
index 7f0b5bf7..11ab29e9 100644
--- a/aidl_language_y.yy
+++ b/aidl_language_y.yy
@@ -94,7 +94,6 @@ AidlLocation loc(const yy::parser::location_type& l) {
std::vector<std::unique_ptr<AidlDefinedType>>* declarations;
}
-%destructor { } <character>
%destructor { } <direction>
%destructor { delete ($$); } <*>
@@ -110,7 +109,7 @@ AidlLocation loc(const yy::parser::location_type& l) {
%token<token> UNION "union"
%token<token> CONST "const"
-%token<character> CHARVALUE "char literal"
+%token<token> CHARVALUE "char literal"
%token<token> FLOATVALUE "float literal"
%token<token> HEXVALUE "hex literal"
%token<token> INTVALUE "int literal"
@@ -408,7 +407,10 @@ interface_members
const_expr
: TRUE_LITERAL { $$ = AidlConstantValue::Boolean(loc(@1), true); }
| FALSE_LITERAL { $$ = AidlConstantValue::Boolean(loc(@1), false); }
- | CHARVALUE { $$ = AidlConstantValue::Character(loc(@1), $1); }
+ | CHARVALUE {
+ $$ = AidlConstantValue::Character(loc(@1), $1->GetText());
+ delete $1;
+ }
| INTVALUE {
$$ = AidlConstantValue::Integral(loc(@1), $1->GetText());
if ($$ == nullptr) {