HaxeCheckstyle / haxeparser

A Haxe parser for Haxe
61 stars 23 forks source link

Positions and non-Expr stuff #20

Open mcheshkov opened 10 years ago

mcheshkov commented 10 years ago

I've find that it's really awkward to work with position-related stuff on everything other that Expr. I.e. check style for A->B->C notation of ComplexType, but there's no position information. So one have to infer all that from some higher level position, for EVar i.e. And, since ComplexType is recursive it really means to parse again some part of source.

My proposition is to add Position to more parts of AST. But that means to break compatibility with haxe.macro types and with ocaml AST. I can implement this, in a case.

mcheshkov commented 10 years ago

Or implement parse tree generation in hxparse.

Simn commented 10 years ago

I'm not sure if it's worth deviating from the Haxe AST for this. I acknowledge the problem though. In fact I've come across it even in core Haxe where sometimes I was missing some position information.

Simn commented 8 years ago

For what it's worth I have added positions to a lot of constructs in Haxe itself. The problem is that this isn't exposed to the macro API because doing that would be a breaking change.