HaxeCheckstyle / haxeparser

A Haxe parser for Haxe
61 stars 23 forks source link

Failing string interpolation parsing case #32

Closed Simn closed 8 years ago

Simn commented 8 years ago
class Main {
    static function main() {
        var s = "
class C {
    static inline function printClass(c:Table<String,Dynamic>, s : String) : String {
        return '{${printClassRec(c,'',s)}}';
    }
}";
        var parser = new haxeparser.HaxeParser(byte.ByteData.ofString(s), "");
        trace(parser.parse());
    }
}

From lua.Boot, currently fails with this:

C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:495: characters 5-10 : { msg => MissingSemicolon, pos => { file => , max => 127, min => 106 } }
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1068: characters 25-36 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1058: characters 11-26 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1057: lines 1057-1060 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1039: characters 13-22 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1165: characters 35-43 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:1267: characters 9-15 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:923: characters 17-31 : Called from
C:\GitHub\haxeparser\src\haxeparser/HaxeParser.hx:923: characters 13-31 : Called from

The related Haxe change could be this: https://github.com/HaxeFoundation/haxe/commit/b94ee60b07b4c7e204e5f9e06aeba462fc8277f6

Although this was quite a while ago...

Simn commented 8 years ago

I have ported the Haxe implementation but this is a bit of a nightmare to test properly, so there are likely gonna be some more problems.