Multiple schemas parsed by flatc are now parsed independently.
It used to be such that later schemas could depend on earlier
schemas. This was a convenience from days before include files
were implemented. Nowadays they cause subtle bugs rather than being
useful, so this functionality has been removed.
You now need to explicitly include files you depend upon.
Change-Id: Id8292c3c621fc38fbd796da2d2cbdd63efc230d1
Tested: on Linux.
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp
index 233eece..f2b7fc9 100644
--- a/src/idl_parser.cpp
+++ b/src/idl_parser.cpp
@@ -1072,10 +1072,9 @@
}
void Parser::MarkGenerated() {
- // Since the Parser object retains definitions across files, we must
- // ensure we only output code for definitions once, in the file they are first
- // declared. This function marks all existing definitions as having already
- // been generated.
+ // This function marks all existing definitions as having already
+ // been generated, which signals no code for included files should be
+ // generated.
for (auto it = enums_.vec.begin();
it != enums_.vec.end(); ++it) {
(*it)->generated = true;