haxe-checkstyle icon indicating copy to clipboard operation
haxe-checkstyle copied to clipboard

"Parsing failed: Unexpected ï" if file has byte order mark

Open Gama11 opened this issue 10 years ago • 4 comments

If checkstyle is run on a file with a byte order mark (for example this file), it causes the following error:

./source/Test.hx:1:1: error: Parsing failed: Unexpected ï
Stacktrace: 
Called from hxparse/Lexer.hx line 100
Called from Checker.hx line 104
Called from Checker.hx line 133

Checkstyle version: 191bf0c245

Gama11 avatar Feb 27 '16 22:02 Gama11

This should be fixed in hxparse, because if I remove the BOM from content before sending it to Lexer, all positions are off by three. And that would likely affect a lot of checks.

So the solution for now is to remove the BOM from your files.

AlexHaxe avatar Feb 27 '16 22:02 AlexHaxe

Makes sense. And yeah, that's what I did. :)

Gama11 avatar Feb 27 '16 22:02 Gama11

Ping @Simn.

Gama11 avatar Feb 29 '16 13:02 Gama11

I don't think hxparse is the right place to fix this, haxeparser is more appropriate.

Simn avatar Feb 29 '16 13:02 Simn