Skip to content

[Bug]: end offset of AST node is incorrect #39

@sxzz

Description

@sxzz

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/parser version: @wxml/parser@0.4.0
  • nodejs version: N/A

BTW, maybe you can take a look this #38

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions