wxml-parser
wxml-parser copied to clipboard
[Bug]: end offset of AST node is incorrect
To reproduce:
1
https://ast.sxzz.moe/#eNqrVspRslIqr8jNUdJRKoAydQsSi4pTi4AiyUARQyCdD6Sra5VqAVDcDaY=
Current behavior:
{
"type": "Program",
"body": [
{
"type": "WXText",
"value": "1",
"start": 0,
"end": 0,
"range": [0, 0]
}
],
"comments": [],
"errors": [],
"tokens": [],
"start": 0,
"end": 0,
"range": [0, 0]
}
Expected behavior:
{
"type": "Program",
"body": [
{
"type": "WXText",
"value": "1",
"start": 0,
--- "end": 0,
+++ "end": 1,
--- "range": [0, 0]
+++ "range": [0, 1]
}
],
"comments": [],
"errors": [],
"tokens": [],
"start": 0,
--"end": 0,
++"end": 1,
--"range": [0, 0]
++"range": [0, 1]
}
Environment information:
-
@wxml/parserversion:@wxml/[email protected] -
nodejsversion: N/A
BTW, maybe you can take a look this https://github.com/wxmlfile/wxml-parser/discussions/38