syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Should the location of `~xx` include `~` ?

Open cristianoc opened this issue 3 years ago • 2 comments

See https://github.com/rescript-lang/rescript-vscode/pull/247

cristianoc avatar May 23 '21 02:05 cristianoc

Hmm, I see what you're getting at. Labels don't currently have a location in the ast. For the printer we need a location, so we parse an extra attribute ns.namedArgLoc. This attribute contains the exact location of the label. Do we still have this available in the typed tree?

IwanKaramazow avatar May 25 '21 10:05 IwanKaramazow

In the typed tree, this looks like Tpat_var "xx". And currently the location range of xx includes ~. The parser must create that location range somewhere, or it would not show up.

cristianoc avatar May 25 '21 11:05 cristianoc

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 28 '23 19:05 stale[bot]