- Supply the help text when -h is used with the -u, -U or -D options.
+ From Leanid Nazdrynau:
+
+ - Fix the Java parser's handling of backslashes in strings.
+
From Christian Neeb:
- Fix the Java parser's handling of string definitions to avoid ignoring
# begin and end tokens /* and */; single or double quotes;
# single or double quotes preceeded by a backslash; array
# declarations "[]".
- _reToken = re.compile(r'(\n|//|\\[\'"]|[\'"\{\}]|[A-Za-z_][\w\.]*|' +
+ _reToken = re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"\{\}]|[A-Za-z_][\w\.]*|' +
r'/\*|\*/|\[\])')
class OuterState:
assert pkg_dir == None, pkg_dir
assert classes == ['Test'], classes
+ def test_backslash(self):
+ """Test backslash handling"""
+
+ pkg_dir, classes = SCons.Tool.JavaCommon.parse_java("""\
+public class MyTabs
+{
+ private class MyInternal
+ {
+ }
+ private final static String PATH = "images\\\\";
+}
+""")
+ assert pkg_dir == None, pkg_dir
+ assert classes == ['MyTabs$MyInternal', 'MyTabs'], classes
+
if __name__ == "__main__":
suite = unittest.TestSuite()
tclasses = [ parse_javaTestCase ]