diff options
author | Steven Knight <knight@baldmt.com> | 2005-11-06 04:06:25 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-11-06 04:06:25 (GMT) |
commit | 65b2ec6b93efcb9947fb90126dfb6d00748769e8 (patch) | |
tree | b530bc66d178bee8eee514a8f3277cd3c3317652 | |
parent | ad6055f3ff5ec00a381fc989209c8db4dd59170d (diff) | |
download | SCons-65b2ec6b93efcb9947fb90126dfb6d00748769e8.zip SCons-65b2ec6b93efcb9947fb90126dfb6d00748769e8.tar.gz SCons-65b2ec6b93efcb9947fb90126dfb6d00748769e8.tar.bz2 |
Add support for the Java 1.5 enum keyword. (Kian Win Ong)
-rw-r--r-- | src/CHANGES.txt | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/JavaCommon.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/JavaCommonTests.py | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5688178..b94a7f7 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -523,6 +523,8 @@ RELEASE 0.97 - XXX - When building a .jar file and there is a $JARCHDIR, put the -C in front of each .class file on the command line. + - Recognize the Java 1.5 enum keyword. + From Chris Pawling: - Have the linkloc tool use $MSVS_VERSION to select the Microsoft 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 ] |