summaryrefslogtreecommitdiffstats
path: root/aidl_language_l.l
diff options
context:
space:
mode:
authorCasey Dahlin <sadmac@google.com>2015-10-05 17:24:28 -0700
committerCasey Dahlin <sadmac@google.com>2015-10-06 10:59:46 -0700
commitf7a421c02d43c3289ca45f0d5ccdf8d27e605f5a (patch)
tree61b7e0ddfd85e0189fae29949085ba7e6b07591f /aidl_language_l.l
parentf4a9311fa018c78a7b30a73bd8ebbaa33c701ae4 (diff)
downloadandroid_system_tools_aidl-f7a421c02d43c3289ca45f0d5ccdf8d27e605f5a.tar.gz
android_system_tools_aidl-f7a421c02d43c3289ca45f0d5ccdf8d27e605f5a.tar.bz2
android_system_tools_aidl-f7a421c02d43c3289ca45f0d5ccdf8d27e605f5a.zip
Use parser to find array brackets
Change-Id: Ib93032113c92fe23e1a7e4ac9b990a065f2b5d19 Test: Unit tests, Full Android Rebuild Bugs: 24680682 Signed-off-by: Casey Dahlin <sadmac@google.com>
Diffstat (limited to 'aidl_language_l.l')
-rw-r--r--aidl_language_l.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/aidl_language_l.l b/aidl_language_l.l
index dc2f80c..34ab720 100644
--- a/aidl_language_l.l
+++ b/aidl_language_l.l
@@ -41,7 +41,6 @@ using android::aidl::cpp_strdup;
identifier [_a-zA-Z][_a-zA-Z0-9\.]*
whitespace ([ \t\r]+)
-brackets \[{whitespace}?\]
idvalue (0|[1-9][0-9]*)
%%
@@ -92,6 +91,8 @@ idvalue (0|[1-9][0-9]*)
, { return ','; }
\( { return '('; }
\) { return ')'; }
+\[ { return '['; }
+\] { return ']'; }
/* keywords */
parcelable { SET_BUFFER(yy::parser::token::PARCELABLE); return yy::parser::token::PARCELABLE; }
@@ -102,9 +103,8 @@ in { return yy::parser::token::IN; }
out { return yy::parser::token::OUT; }
inout { return yy::parser::token::INOUT; }
-{brackets}+ { SET_BUFFER(yy::parser::token::ARRAY); return yy::parser::token::ARRAY; }
{idvalue} { SET_BUFFER(yy::parser::token::IDVALUE); return yy::parser::token::IDVALUE; }
-{identifier} { SET_BUFFER(yy::parser::token::IDENTIFIER); return yy::parser::token::IDENTIFIER; }
+{identifier} { SET_BUFFER(yy::parser::token::IDENTIFIER); return yy::parser::token::IDENTIFIER; }
{identifier}\<{whitespace}*{identifier}({whitespace}*,{whitespace}*{identifier})*{whitespace}*\> {
SET_BUFFER(yy::parser::token::GENERIC); return yy::parser::token::GENERIC; }