3.2 RC 1: xml/Parser.hx error

40 views
Skip to first unread message

Tom

unread,
Mar 17, 2015, 2:58:32 AM3/17/15
to haxe...@googlegroups.com
Hi!

I updated Haxe to 3.2. RC 1, and tried to compile a very big project to Flash, with it. I got this error: (in a switch ... case statement)

haxe\std/haxe/xml/Parser.hx:249: characters 11-12 : Unknown identifier : _

I use -D no-pattern-matching, but without it also get the error above.

There is a new definable variable to use native flash XML?

Thanks for any idea!
Tom


Simon Krajewski

unread,
Mar 17, 2015, 3:49:15 AM3/17/15
to haxe...@googlegroups.com
-D no-pattern-matching is obsolete and we should probably remove it. It
was meant to help with transition from Haxe 2 to Haxe 3, but now parts
of our standard library rely on pattern matching.

I don't believe you could get the error above without it though. Make
sure you don't have it defined anywhere else.

As for the native XML, you can add `import flash.NativeXml as Xml` to
the top of the file that uses Xml.

Simon

Tom

unread,
Mar 17, 2015, 5:21:46 AM3/17/15
to haxe...@googlegroups.com
Thank you!
Without -D no-pattern-matching there aren't the error above, really. (There was a similar error in an svg Parser.hx file, so my bad.)

Another one:
public static var DEFAULT:String = "log";

switch(type)
{
   
case: DEFAULT: color = 0xffffff; // Capture variables must be lower-case
   
case: INFO: color = 0x00ffff;
   
case ERROR: color = 0xff0000;
}

The error: Capture variables must be lower-case. This is because of the pattern matching engine?
Thanks again, Simon!

Simon Krajewski

unread,
Mar 17, 2015, 5:24:40 AM3/17/15
to haxe...@googlegroups.com
Am 17.03.2015 um 10:21 schrieb Tom:
Thank you!
Without -D no-pattern-matching there aren't the error above, really. (There was a similar error in an svg Parser.hx file, so my bad.)

Another one:
public static var DEFAULT:String = "log";

switch(type)
{
   
case: DEFAULT: color = 0xffffff; // Capture variables must be lower-case
   
case: INFO: color = 0x00ffff;
   
case ERROR: color = 0xff0000;
}

The error: Capture variables must be lower-case. This is because of the pattern matching engine?

case: would be a syntax error. But yes, you cannot match like that because any plain identifier is treated as a capture variable. You may want to change that to an if-else chain.

Simon

Tom

unread,
Mar 17, 2015, 5:32:17 AM3/17/15
to haxe...@googlegroups.com
Thanks, I did it, and working.
Reply all
Reply to author
Forward
0 new messages