It would be really nice if AST nodes had start/end positions for every node:
parse("Hello **World**")
[
{
type: "text",
content: "Hello",
loc: { start: 0, end: 6 },
},
{
type: "strong",
content: [
{
type: "text",
content: "World",
loc: { start: 8, end: 13 },
}
],
loc: { start: 6, end: 15 },
},
]
Right now it's impossible to reconstruct this data from just the AST.
It would be really nice if AST nodes had start/end positions for every node:
Right now it's impossible to reconstruct this data from just the AST.