wxml-parser icon indicating copy to clipboard operation
wxml-parser copied to clipboard

[Bug]: end offset of AST node is incorrect

Open sxzz opened this issue 1 year ago • 0 comments

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:

BTW, maybe you can take a look this https://github.com/wxmlfile/wxml-parser/discussions/38

sxzz avatar Aug 13 '24 21:08 sxzz