grammar for fixed-size array
The grammar is extended to accept `T[N]` fixed-size array types.
Multiple-dimensional fixed-size arrays are supported while, for
simplicity, T[][N](dynamic array of fixed-size arrays) and
T[N][](fixed-size array of dynamic arrays) are not supported yet.
AIDL AST is changed as well, but fixed-size arrays are treated like a
dynamic array when compiling. Each backend support will follow.
Bug: 207087196
Test: aidl_unittests
Change-Id: Ife72ac04a9af516477df6bf8926a40a29de40e91
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
index 47d81e1..6c4b177 100644
--- a/aidl_const_expressions.cpp
+++ b/aidl_const_expressions.cpp
@@ -760,7 +760,8 @@
if (pos == string::npos) {
field_name_ = value;
} else {
- ref_type_ = std::make_unique<AidlTypeSpecifier>(location, value.substr(0, pos), false, nullptr,
+ ref_type_ = std::make_unique<AidlTypeSpecifier>(location, value.substr(0, pos),
+ /*array=*/std::nullopt, /*type_params=*/nullptr,
Comments{});
field_name_ = value.substr(pos + 1);
}