Refactor top-level AST nodes v2
The previous version of this patch was tainted by parts of another
change to remove a memory leak, and ended up trying to treat a bare
pointer like a unique_ptr in a few places. This combines both changes in
to one.
Previous patch was b696437d842d59c0cc26411fa3d71cb91897c572:
We now return an AidlDocument from parsing. This type is non-polymorphic
and contains either a vector of parcelables or an interface. This gets
rid of all of our reinterpret_cast calls and the public item_type field.
Change-Id: I77fbb1d8448343bd02484d896289a514d636df25
Test: Unit tests pass
Bug: none
Signed-off-by: Casey Dahlin <sadmac@google.com>
diff --git a/main_java.cpp b/main_java.cpp
index fc2d748..7d32b24 100644
--- a/main_java.cpp
+++ b/main_java.cpp
@@ -37,7 +37,9 @@
case JavaOptions::COMPILE_AIDL_TO_JAVA:
return android::aidl::compile_aidl_to_java(*options, io_delegate);
case JavaOptions::PREPROCESS_AIDL:
- return android::aidl::preprocess_aidl(*options, io_delegate);
+ if (android::aidl::preprocess_aidl(*options, io_delegate))
+ return 0;
+ return 1;
}
std::cerr << "aidl: internal error" << std::endl;
return 1;