Convert file and line number into Pos in macro

As part of my build/test process, I run a script in an external browser. When traces are made in this script I would like to output them in the development environment by using This requires a position, which I somehow need to construct from a file and a line number.

I believe the haxe.display.Location file seems like something that closely matches what I have, but how can I convert this into a Pos?

This sounds very much like source mapping—have you tried that? Sorry if that’s not what you’re after.