syntax
syntax copied to clipboard
Should the location of `~xx` include `~` ?
See https://github.com/rescript-lang/rescript-vscode/pull/247
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?
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.
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.