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

Parsing a `return macro @:pos` crashes the parser

Open dubspeed opened this issue 6 months ago • 1 comments

👋 Hello,

given a macro like this:

class TestCrashMacro {
	static function combine(structure:Expr):Expr {
		if (structure.expr.match(EDisplay(_, DKMarked))) {
			return macro @:pos(Context.currentPos()) ($structure : {});
		}
        return Expr();
	}
}

will crash rename.js when parsing @:pos.

haxe_ValueException [Error]: failed to parse src/SecondRenameCrash.hx - Exception: invalid token tree structure - found:[@] Called from tokentree_walk_WalkTypedefBody.walkTypedefCurlyBody (rename.js line 12750 column 26)

dubspeed avatar Jul 31 '24 10:07 dubspeed