diff options
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 1239077681b..82f90b974cd 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1377,18 +1377,18 @@ Slice::Container::hasNonLocalClassDecls() const } bool -Slice::Container::hasNonLocalInterfaceDefs() const +Slice::Container::hasNonLocalClassDefs() const { for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); - if(cl && !cl->isLocal() && cl->isInterface()) + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); + if(cl && !cl->isLocal()) { return true; } ContainerPtr container = ContainerPtr::dynamicCast(*p); - if(container && container->hasNonLocalInterfaceDefs()) + if(container && container->hasNonLocalClassDefs()) { return true; } @@ -1440,6 +1440,27 @@ Slice::Container::hasNonLocalDictionaries() const } bool +Slice::Container::hasNonLocalExceptions() const +{ + for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) + { + ExceptionPtr q = ExceptionPtr::dynamicCast(*p); + if(q && !q->isLocal()) + { + return true; + } + + ContainerPtr container = ContainerPtr::dynamicCast(*p); + if(container && container->hasNonLocalExceptions()) + { + return true; + } + } + + return false; +} + +bool Slice::Container::hasClassDecls() const { for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) @@ -1525,27 +1546,6 @@ Slice::Container::hasDataOnlyClasses() const } bool -Slice::Container::hasNonLocalExceptions() const -{ - for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) - { - ExceptionPtr q = ExceptionPtr::dynamicCast(*p); - if(q && !q->isLocal()) - { - return true; - } - - ContainerPtr container = ContainerPtr::dynamicCast(*p); - if(container && container->hasNonLocalExceptions()) - { - return true; - } - } - - return false; -} - -bool Slice::Container::hasOtherConstructedOrExceptions() const { for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) @@ -5026,7 +5026,8 @@ Slice::Unit::parse(FILE* file, bool debug, bool disallowDeprecatedFeatures) assert(!Slice::unit); Slice::unit = this; - _disallowDeprecatedFeatures = disallowDeprecatedFeatures; // TODO: remove this once global definitions are outlawed. + // TODO: remove this once global definitions are outlawed. + _disallowDeprecatedFeatures = disallowDeprecatedFeatures; _currentComment = ""; _currentLine = 1; |