Parse '/*' comments as well.
Fix: 124382459
Test: TH
Change-Id: I47bc9592b36d7e620294f500ae1ed20e61fe9fb1
diff --git a/AST.h b/AST.h
index aab2d16..d567d92 100644
--- a/AST.h
+++ b/AST.h
@@ -34,6 +34,7 @@
struct Coordinator;
struct ConstantExpression;
+struct DocComment;
struct EnumValue;
struct Formatter;
struct Interface;
@@ -213,6 +214,14 @@
bool addMethod(Method* method, Interface* iface);
bool addAllReservedMethodsToInterface(Interface* iface);
+ void setHeader(const DocComment* header);
+ const DocComment* getHeader() const;
+
+ // TODO: Clean up all interface usages of unhandled comments and ensure they are attached to the
+ // right element
+ void addUnhandledComment(const DocComment* docComment);
+ const std::vector<const DocComment*> getUnhandledComments() const;
+
private:
const Coordinator* mCoordinator;
const Hash* mFileHash;
@@ -221,6 +230,12 @@
FQName mPackage;
+ // Header for the file
+ const DocComment* mHeader = nullptr;
+
+ // A list of trailing DocComments.
+ std::vector<const DocComment*> mUnhandledComments;
+
// A list of the FQNames present in the import statements
std::vector<ImportStatement> mImportStatements;