summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-11-06 04:06:25 (GMT)
committerSteven Knight <knight@baldmt.com>2005-11-06 04:06:25 (GMT)
commit5e49f4123a40948490d8115de909323476f77f3b (patch)
treeb530bc66d178bee8eee514a8f3277cd3c3317652 /src/engine/SCons
parentc780f70aebdf0fa9d7142303216e11bd68ae59cd (diff)
downloadSCons-5e49f4123a40948490d8115de909323476f77f3b.zip
SCons-5e49f4123a40948490d8115de909323476f77f3b.tar.gz
SCons-5e49f4123a40948490d8115de909323476f77f3b.tar.bz2
Add support for the Java 1.5 enum keyword. (Kian Win Ong)
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Tool/JavaCommon.py2
-rw-r--r--src/engine/SCons/Tool/JavaCommonTests.py10
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 ]