diff options
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r-- | src/engine/SCons/Tool/JavaCommon.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/JavaCommonTests.py | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py index 96d6486..06a4199 100644 --- a/src/engine/SCons/Tool/JavaCommon.py +++ b/src/engine/SCons/Tool/JavaCommon.py @@ -115,7 +115,7 @@ if java_parsing: if len(self.listClasses) > 0: return self.__getAnonClassState() return self.__getSkipState() # Skip the class name - elif token == 'class' or token == 'interface': + elif token in ['class', 'interface', 'enum']: if len(self.listClasses) == 0: self.nextAnon = 1 self.stackBrackets.append(self.brackets) diff --git a/src/engine/SCons/Tool/JavaCommonTests.py b/src/engine/SCons/Tool/JavaCommonTests.py index f8f38c2..484fbf8 100644 --- a/src/engine/SCons/Tool/JavaCommonTests.py +++ b/src/engine/SCons/Tool/JavaCommonTests.py @@ -202,6 +202,16 @@ public class MyTabs assert pkg_dir == None, pkg_dir assert classes == ['MyTabs$MyInternal', 'MyTabs'], classes + def test_enum(self): + """Test the Java 1.5 enum keyword""" + + pkg_dir, classes = SCons.Tool.JavaCommon.parse_java("""\ +package p; +public enum a {} +""") + assert pkg_dir == 'p', pkg_dir + assert classes == ['a'], classes + if __name__ == "__main__": suite = unittest.TestSuite() tclasses = [ parse_javaTestCase ] |