diff --git a/genxml.ml b/genxml.ml index 69e20db9df3..47075143e5a 100644 --- a/genxml.ml +++ b/genxml.ml @@ -110,8 +110,7 @@ let rec gen_type ?(values=None) t = let e = PMap.find n values in has_value := true; let s = Ast.s_expr e in - (* the XML parser has issues otherwise *) - String.concat "'" (ExtString.String.nsplit s "\"") + s with Not_found -> "" ) args in diff --git a/std/haxe/xml/Parser.hx b/std/haxe/xml/Parser.hx index 1816306c207..8fedce37145 100644 --- a/std/haxe/xml/Parser.hx +++ b/std/haxe/xml/Parser.hx @@ -329,7 +329,7 @@ class Parser } start = p + 1; state = escapeNext; - } else if (!isValidChar(c)) { + } else if (!isValidChar(c) && c != "#".code) { throw 'Invalid character in entity: ' + String.fromCharCode(c); } } diff --git a/tests/unit/src/unit/issues/Issue3725.hx b/tests/unit/src/unit/issues/Issue3725.hx index 105b9f80d27..0c1ae2393ae 100644 --- a/tests/unit/src/unit/issues/Issue3725.hx +++ b/tests/unit/src/unit/issues/Issue3725.hx @@ -5,8 +5,6 @@ class Issue3725 extends Test { static function myStaticArgs(stringValue = "foo", intValue = 12, intHexValue = 0xFFFFFF, floatValue = 12.2223, boolValue = true) { } - #if !php - function testStaticArgs() { var rtti = haxe.rtti.Rtti.getRtti(Issue3725); var valueMap = new Map(); @@ -21,7 +19,7 @@ class Issue3725 extends Test { } } } - eq("'foo'", valueMap["stringValue"]); + eq('"foo"', valueMap["stringValue"]); eq("12", valueMap["intValue"]); eq("0xFFFFFF", valueMap["intHexValue"]); eq("12.2223", valueMap["floatValue"]); @@ -40,7 +38,7 @@ class Issue3725 extends Test { for (cf in rtti.statics) { valueMap[cf.name] = cf.expr; } - eq("'foo'", valueMap["stringValue"]); + eq('"foo"', valueMap["stringValue"]); eq("12", valueMap["intValue"]); eq("0xFFFFFF", valueMap["intHexValue"]); eq("12.2223", valueMap["floatValue"]); @@ -63,7 +61,7 @@ class Issue3725 extends Test { } } } - eq("'foo'", valueMap["stringValue"]); + eq('"foo"', valueMap["stringValue"]); eq("12", valueMap["intValue"]); eq("0xFFFFFF", valueMap["intHexValue"]); eq("12.2223", valueMap["floatValue"]); @@ -82,12 +80,10 @@ class Issue3725 extends Test { for (cf in rtti.fields) { valueMap[cf.name] = cf.expr; } - eq("'foo'", valueMap["stringValueM"]); + eq('"foo"', valueMap["stringValueM"]); eq("12", valueMap["intValueM"]); eq("0xFFFFFF", valueMap["intHexValueM"]); eq("12.2223", valueMap["floatValueM"]); eq("true", valueMap["boolValueM"]); } - - #end } \ No newline at end of file