Lexer passes the list of comments to parser
The lexer has been squashing comments into a single string, which makes
it hard to distinguish the type of comments later.
Instead of re-parsing comments, now, the lexer keeps the list of
comments and pass it to the parser.
But note that we still need to parse the contents of the body of block
comments to extract @hide/@deprecated tags.
Bug: 177276676
Test: aidl_unittests
Change-Id: I5f683ba6bf9fa3fbc5e73c4f80237a25eb410f71
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
index 3267cfc..b97889d 100644
--- a/aidl_const_expressions.cpp
+++ b/aidl_const_expressions.cpp
@@ -739,8 +739,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), false, nullptr,
+ Comments{});
field_name_ = value.substr(pos + 1);
}
}