"
+ },
+ {
+ "type": "Keyword",
+ "value": "import",
+ "start": 79,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "range": [
+ 79,
+ 85
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "Foo",
+ "start": 86,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 86,
+ 89
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "from",
+ "start": 90,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 90,
+ 94
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'./Foo.vue'",
+ "start": 95,
+ "end": 106,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 95,
+ 106
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "import",
+ "start": 109,
+ "end": 115,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "range": [
+ 109,
+ 115
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 116,
+ "end": 117,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "range": [
+ 116,
+ 117
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "ref",
+ "start": 118,
+ "end": 121,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "range": [
+ 118,
+ 121
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 122,
+ "end": 123,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "range": [
+ 122,
+ 123
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "from",
+ "start": 124,
+ "end": 128,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "range": [
+ 124,
+ 128
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'vue'",
+ "start": 129,
+ "end": 134,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 27
+ }
+ },
+ "range": [
+ 129,
+ 134
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "const",
+ "start": 247,
+ "end": 252,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "range": [
+ 247,
+ 252
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "count",
+ "start": 253,
+ "end": 258,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "range": [
+ 253,
+ 258
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "start": 259,
+ "end": 260,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "range": [
+ 259,
+ 260
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "ref",
+ "start": 261,
+ "end": 264,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 261,
+ 264
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 264,
+ "end": 265,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 8,
+ "column": 20
+ }
+ },
+ "range": [
+ 264,
+ 265
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "0",
+ "start": 265,
+ "end": 266,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 21
+ }
+ },
+ "range": [
+ 265,
+ 266
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 266,
+ "end": 267,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 21
+ },
+ "end": {
+ "line": 8,
+ "column": 22
+ }
+ },
+ "range": [
+ 266,
+ 267
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "const",
+ "start": 270,
+ "end": 275,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "range": [
+ 270,
+ 275
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "inc",
+ "start": 276,
+ "end": 279,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "range": [
+ 276,
+ 279
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "start": 280,
+ "end": 281,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 12
+ },
+ "end": {
+ "line": 9,
+ "column": 13
+ }
+ },
+ "range": [
+ 280,
+ 281
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 282,
+ "end": 283,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "range": [
+ 282,
+ 283
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 283,
+ "end": 284,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 16
+ }
+ },
+ "range": [
+ 283,
+ 284
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "start": 285,
+ "end": 287,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "range": [
+ 285,
+ 287
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 288,
+ "end": 289,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "range": [
+ 288,
+ 289
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "count",
+ "start": 294,
+ "end": 299,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "range": [
+ 294,
+ 299
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 299,
+ "end": 300,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "range": [
+ 299,
+ 300
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "value",
+ "start": 300,
+ "end": 305,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "range": [
+ 300,
+ 305
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "++",
+ "start": 305,
+ "end": 307,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 10,
+ "column": 17
+ }
+ },
+ "range": [
+ 305,
+ 307
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 310,
+ "end": 311,
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 3
+ }
+ },
+ "range": [
+ 310,
+ 311
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 312,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 323,
+ 383
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 323,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 336,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 37
+ }
+ },
+ "name": "foo",
+ "rawName": "Foo",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 336,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 37
+ }
+ },
+ "selfClosing": true,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 341,
+ 355
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 21
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 341,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 13
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 341,
+ 342
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 15
+ },
+ "end": {
+ "column": 8,
+ "line": 15
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 342,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 15
+ },
+ "end": {
+ "column": 13,
+ "line": 15
+ }
+ },
+ "name": "count",
+ "rawName": "count"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 348,
+ 355
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 14
+ },
+ "end": {
+ "line": 15,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 349,
+ "end": 354,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 15
+ },
+ "end": {
+ "line": 15,
+ "column": 20
+ }
+ },
+ "range": [
+ 349,
+ 354
+ ],
+ "name": "count"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 349,
+ "end": 354,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 15
+ },
+ "end": {
+ "line": 15,
+ "column": 20
+ }
+ },
+ "range": [
+ 349,
+ 354
+ ],
+ "name": "count"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 356,
+ 368
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 22
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 356,
+ 362
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 22
+ },
+ "end": {
+ "line": 15,
+ "column": 28
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 356,
+ 357
+ ],
+ "loc": {
+ "start": {
+ "column": 22,
+ "line": 15
+ },
+ "end": {
+ "column": 23,
+ "line": 15
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 357,
+ 362
+ ],
+ "loc": {
+ "start": {
+ "column": 23,
+ "line": 15
+ },
+ "end": {
+ "column": 28,
+ "line": 15
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 363,
+ 368
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 364,
+ "end": 367,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 33
+ }
+ },
+ "range": [
+ 364,
+ 367
+ ],
+ "name": "inc"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 364,
+ "end": 367,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 33
+ }
+ },
+ "range": [
+ 364,
+ 367
+ ],
+ "name": "inc"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 371,
+ 372
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 37
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 372,
+ 383
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "imported"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": "components"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 40,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "value": "are"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 44,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": "also"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 49,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": "directly"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "value": "usable"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 49
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 65,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 52
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 68,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 53
+ },
+ "end": {
+ "line": 2,
+ "column": 61
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 76,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 61
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 79,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 86,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 90,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "'./Foo.vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 106,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 121
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": "ref"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 121,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 124,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 27
+ }
+ },
+ "value": "'vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 134,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 141,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "write"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 147,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": "Composition"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 159,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "value": "API"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 163,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "value": "code"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 167,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 31
+ },
+ "end": {
+ "line": 6,
+ "column": 32
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 168,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 36
+ }
+ },
+ "value": "just"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 36
+ },
+ "end": {
+ "line": 6,
+ "column": 37
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 173,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 37
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": "like"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 42
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 178,
+ 180
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 42
+ },
+ "end": {
+ "line": 6,
+ "column": 44
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 180,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 44
+ },
+ "end": {
+ "line": 6,
+ "column": 45
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 181,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 45
+ },
+ "end": {
+ "line": 6,
+ "column": 46
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 46
+ },
+ "end": {
+ "line": 6,
+ "column": 47
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 183,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 47
+ },
+ "end": {
+ "line": 6,
+ "column": 53
+ }
+ },
+ "value": "normal"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 189,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 53
+ },
+ "end": {
+ "line": 6,
+ "column": 54
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 190,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 54
+ },
+ "end": {
+ "line": 6,
+ "column": 61
+ }
+ },
+ "value": "setup()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 197,
+ 200
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 61
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 200,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 203,
+ 206
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 5
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": "but"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 206,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 207,
+ 209
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": "no"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 209,
+ 210
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 210,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "need"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 214,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 215,
+ 217
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 19
+ }
+ },
+ "value": "to"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 217,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 19
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 218,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 28
+ }
+ },
+ "value": "manually"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 226,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 28
+ },
+ "end": {
+ "line": 7,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 227,
+ 233
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 29
+ },
+ "end": {
+ "line": 7,
+ "column": 35
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 233,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 35
+ },
+ "end": {
+ "line": 7,
+ "column": 36
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 234,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 36
+ },
+ "end": {
+ "line": 7,
+ "column": 46
+ }
+ },
+ "value": "everything"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 244,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 46
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 247,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 252,
+ 253
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 253,
+ 258
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "value": "count"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 258,
+ 259
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 259,
+ 260
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 260,
+ 261
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 261,
+ 267
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 22
+ }
+ },
+ "value": "ref(0)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 267,
+ 270
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 22
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 270,
+ 275
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 275,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 276,
+ 279
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": "inc"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 279,
+ 280
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 280,
+ 281
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 12
+ },
+ "end": {
+ "line": 9,
+ "column": 13
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 281,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 13
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 282,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 16
+ }
+ },
+ "value": "()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 284,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 16
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 285,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "value": "=>"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 287,
+ 288
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 288,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 289,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 294,
+ 307
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 17
+ }
+ },
+ "value": "count.value++"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 307,
+ 310
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 17
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 310,
+ 311
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 311,
+ 312
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 3
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 312,
+ 320
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 320,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 321,
+ 323
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 323,
+ 332
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 332,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 336,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 341,
+ 342
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 15
+ },
+ "end": {
+ "column": 8,
+ "line": 15
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 342,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 15
+ },
+ "end": {
+ "column": 13,
+ "line": 15
+ }
+ },
+ "value": "count"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 347,
+ 348
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 13
+ },
+ "end": {
+ "line": 15,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 348,
+ 349
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 14
+ },
+ "end": {
+ "line": 15,
+ "column": 15
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "count",
+ "start": 349,
+ "end": 354,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 15
+ },
+ "end": {
+ "line": 15,
+ "column": 20
+ }
+ },
+ "range": [
+ 349,
+ 354
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 354,
+ 355
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 20
+ },
+ "end": {
+ "line": 15,
+ "column": 21
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 356,
+ 357
+ ],
+ "loc": {
+ "start": {
+ "column": 22,
+ "line": 15
+ },
+ "end": {
+ "column": 23,
+ "line": 15
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 357,
+ 362
+ ],
+ "loc": {
+ "start": {
+ "column": 23,
+ "line": 15
+ },
+ "end": {
+ "column": 28,
+ "line": 15
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 362,
+ 363
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 28
+ },
+ "end": {
+ "line": 15,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 363,
+ 364
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 30
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "inc",
+ "start": 364,
+ "end": 367,
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 33
+ }
+ },
+ "range": [
+ 364,
+ 367
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 367,
+ 368
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 33
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 369,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 35
+ },
+ "end": {
+ "line": 15,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 371,
+ 372
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 37
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 372,
+ 382
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 382,
+ 383
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 383,
+ 384
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 11
+ },
+ "end": {
+ "line": 17,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 336,
+ "lineNumber": 15,
+ "column": 2
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example01/parser-options.json b/test/fixtures/ast/script-setup-example01/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example01/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example01/requirements.json b/test/fixtures/ast/script-setup-example01/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example01/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example01/source.vue b/test/fixtures/ast/script-setup-example01/source.vue
new file mode 100644
index 00000000..5668e615
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example01/source.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/script-setup-example01/token-ranges.json b/test/fixtures/ast/script-setup-example01/token-ranges.json
new file mode 100644
index 00000000..147d127a
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example01/token-ranges.json
@@ -0,0 +1,164 @@
+[
+ "",
+ "// imported components are also directly usable in template",
+ "// write Composition API code just like in a normal setup()",
+ "// but no need to manually return everything",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example01/tree.json b/test/fixtures/ast/script-setup-example01/tree.json
new file mode 100644
index 00000000..268d4c65
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example01/tree.json
@@ -0,0 +1,106 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":count=\"count\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":count",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "count",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"count\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "count",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "@click=\"inc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"inc\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "inc",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example02/ast.json b/test/fixtures/ast/script-setup-example02/ast.json
new file mode 100644
index 00000000..f7f9e75c
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/ast.json
@@ -0,0 +1,915 @@
+{
+ "type": "Program",
+ "start": 44,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 48
+ }
+ },
+ "range": [
+ 44,
+ 169
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 44,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 44,
+ 93
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 50,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 50,
+ 93
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 50,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 50,
+ 55
+ ],
+ "name": "props"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 58,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 58,
+ 93
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 69
+ ],
+ "name": "defineProps"
+ },
+ "arguments": [
+ {
+ "type": "ObjectExpression",
+ "start": 70,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "range": [
+ 70,
+ 92
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 76,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "range": [
+ 76,
+ 87
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 76,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "range": [
+ 76,
+ 79
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "range": [
+ 81,
+ 87
+ ],
+ "name": "String"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 123,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 48
+ }
+ },
+ "range": [
+ 123,
+ 169
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 129,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 48
+ }
+ },
+ "range": [
+ 129,
+ 169
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 129,
+ "end": 133,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "range": [
+ 129,
+ 133
+ ],
+ "name": "emit"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 136,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 48
+ }
+ },
+ "range": [
+ 136,
+ 169
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 136,
+ "end": 147,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 136,
+ 147
+ ],
+ "name": "defineEmits"
+ },
+ "arguments": [
+ {
+ "type": "ArrayExpression",
+ "start": 148,
+ "end": 168,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 27
+ },
+ "end": {
+ "line": 7,
+ "column": 47
+ }
+ },
+ "range": [
+ 148,
+ 168
+ ],
+ "elements": [
+ {
+ "type": "Literal",
+ "start": 149,
+ "end": 157,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 28
+ },
+ "end": {
+ "line": 7,
+ "column": 36
+ }
+ },
+ "range": [
+ 149,
+ 157
+ ],
+ "value": "update",
+ "raw": "'update'"
+ },
+ {
+ "type": "Literal",
+ "start": 159,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 38
+ },
+ "end": {
+ "line": 7,
+ "column": 46
+ }
+ },
+ "range": [
+ 159,
+ 167
+ ],
+ "value": "delete",
+ "raw": "'delete'"
+ }
+ ]
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [
+ {
+ "type": "Line",
+ "value": " expects props options",
+ "start": 17,
+ "end": 41,
+ "range": [
+ 17,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Line",
+ "value": " expects emits options",
+ "start": 96,
+ "end": 120,
+ "range": [
+ 96,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example02/parser-options.json b/test/fixtures/ast/script-setup-example02/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example02/requirements.json b/test/fixtures/ast/script-setup-example02/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example02/source.vue b/test/fixtures/ast/script-setup-example02/source.vue
new file mode 100644
index 00000000..444a488c
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/source.vue
@@ -0,0 +1,8 @@
+
diff --git a/test/fixtures/ast/script-setup-example02/token-ranges.json b/test/fixtures/ast/script-setup-example02/token-ranges.json
new file mode 100644
index 00000000..eeb110c6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/token-ranges.json
@@ -0,0 +1,29 @@
+[
+ "",
+ "// expects props options",
+ "// expects emits options"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example02/tree.json b/test/fixtures/ast/script-setup-example02/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example02/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example03/ast.json b/test/fixtures/ast/script-setup-example03/ast.json
new file mode 100644
index 00000000..4cf27b21
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example03/ast.json
@@ -0,0 +1,81 @@
+{
+ "type": "Program",
+ "start": 14,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "range": [
+ 14,
+ 35
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [
+ {
+ "type": "Line",
+ "value": " syntax enabled",
+ "start": 17,
+ "end": 34,
+ "range": [
+ 17,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ }
+ }
+ ],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example03/parser-options.json b/test/fixtures/ast/script-setup-example03/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example03/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example03/source.vue b/test/fixtures/ast/script-setup-example03/source.vue
new file mode 100644
index 00000000..72b679a6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example03/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup-example03/token-ranges.json b/test/fixtures/ast/script-setup-example03/token-ranges.json
new file mode 100644
index 00000000..b83274c6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example03/token-ranges.json
@@ -0,0 +1,5 @@
+[
+ "",
+ "// syntax enabled"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example03/tree.json b/test/fixtures/ast/script-setup-example03/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example03/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example04/ast.json b/test/fixtures/ast/script-setup-example04/ast.json
new file mode 100644
index 00000000..637a4493
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/ast.json
@@ -0,0 +1,967 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 17,
+ 37
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 17,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 17,
+ 37
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 23,
+ 37
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 23,
+ 26
+ ],
+ "name": "msg"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 29,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 29,
+ 37
+ ],
+ "value": "Hello!",
+ "raw": "'Hello!'"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 49,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 49,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 59,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 62,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 62,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 67,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "name": "msg"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "name": "msg"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 76,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 83,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 23,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "msg"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "'Hello!'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 38,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 47,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 49,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 62,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 67,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "msg",
+ "start": 70,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 74,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 76,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 83,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example04/parser-options.json b/test/fixtures/ast/script-setup-example04/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example04/requirements.json b/test/fixtures/ast/script-setup-example04/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example04/source.vue b/test/fixtures/ast/script-setup-example04/source.vue
new file mode 100644
index 00000000..648028f5
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/source.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{ msg }}
+
diff --git a/test/fixtures/ast/script-setup-example04/token-ranges.json b/test/fixtures/ast/script-setup-example04/token-ranges.json
new file mode 100644
index 00000000..eec92350
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/token-ranges.json
@@ -0,0 +1,37 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "",
+ "{{",
+ "msg",
+ "}}",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example04/tree.json b/test/fixtures/ast/script-setup-example04/tree.json
new file mode 100644
index 00000000..d2c8c9d4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example04/tree.json
@@ -0,0 +1,55 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n {{ msg }}
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "{{ msg }}
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{ msg }}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "msg",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example05/ast.json b/test/fixtures/ast/script-setup-example05/ast.json
new file mode 100644
index 00000000..a187f101
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/ast.json
@@ -0,0 +1,1284 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "range": [
+ 17,
+ 90
+ ],
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 17,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 17,
+ 44
+ ],
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "local": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "name": "Foo"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 33,
+ 44
+ ],
+ "value": "./Foo.vue",
+ "raw": "'./Foo.vue'"
+ },
+ "attributes": []
+ },
+ {
+ "type": "ImportDeclaration",
+ "start": 47,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "range": [
+ 47,
+ 90
+ ],
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 54,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 54,
+ 65
+ ],
+ "local": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 54,
+ 65
+ ],
+ "name": "MyComponent"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 71,
+ "end": 90,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "range": [
+ 71,
+ 90
+ ],
+ "value": "./MyComponent.vue",
+ "raw": "'./MyComponent.vue'"
+ },
+ "attributes": []
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 102,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 102,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 112,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 115,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "name": "foo",
+ "rawName": "Foo",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 115,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "selfClosing": true,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VText",
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 32
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 158,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "name": "my-component",
+ "rawName": "my-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 158,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "selfClosing": true,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 175,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": "'./Foo.vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 47,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 54,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "value": "MyComponent"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 71,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "value": "'./MyComponent.vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 91,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 102,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 115,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 6
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 120,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 32
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 158,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": "my-component"
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 172,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 16
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 175,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 185,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 186,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "HTMLComment",
+ "range": [
+ 125,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 32
+ }
+ },
+ "value": " kebab-case also works "
+ }
+ ],
+ "errors": [
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 115,
+ "lineNumber": 7,
+ "column": 2
+ },
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 158,
+ "lineNumber": 9,
+ "column": 2
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example05/parser-options.json b/test/fixtures/ast/script-setup-example05/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example05/requirements.json b/test/fixtures/ast/script-setup-example05/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example05/source.vue b/test/fixtures/ast/script-setup-example05/source.vue
new file mode 100644
index 00000000..bd432d32
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/source.vue
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/script-setup-example05/token-ranges.json b/test/fixtures/ast/script-setup-example05/token-ranges.json
new file mode 100644
index 00000000..80b6caeb
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/token-ranges.json
@@ -0,0 +1,49 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example05/tree.json b/test/fixtures/ast/script-setup-example05/tree.json
new file mode 100644
index 00000000..f2cb42a4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example05/tree.json
@@ -0,0 +1,60 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example06/ast.json b/test/fixtures/ast/script-setup-example06/ast.json
new file mode 100644
index 00000000..e07644fb
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/ast.json
@@ -0,0 +1,1908 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 17,
+ 74
+ ],
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 17,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 17,
+ 44
+ ],
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "local": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "name": "Foo"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 33,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 33,
+ 44
+ ],
+ "value": "./Foo.vue",
+ "raw": "'./Foo.vue'"
+ },
+ "attributes": []
+ },
+ {
+ "type": "ImportDeclaration",
+ "start": 47,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 47,
+ 74
+ ],
+ "specifiers": [
+ {
+ "type": "ImportDefaultSpecifier",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 54,
+ 57
+ ],
+ "local": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 54,
+ 57
+ ],
+ "name": "Bar"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 63,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 63,
+ 74
+ ],
+ "value": "./Bar.vue",
+ "raw": "'./Bar.vue'"
+ },
+ "attributes": []
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 86,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 86,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 96,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 99,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "name": "component",
+ "rawName": "component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 99,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "selfClosing": true,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 110,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 110,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 7
+ },
+ "end": {
+ "column": 14,
+ "line": 7
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 111,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "column": 14,
+ "line": 7
+ },
+ "end": {
+ "column": 16,
+ "line": 7
+ }
+ },
+ "name": "is",
+ "rawName": "is"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 114,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 115,
+ "end": 118,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "range": [
+ 115,
+ 118
+ ],
+ "name": "Foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 115,
+ "end": 118,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "range": [
+ 115,
+ 118
+ ],
+ "name": "Foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 25
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 125,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 47
+ }
+ },
+ "name": "component",
+ "rawName": "component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 125,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 47
+ }
+ },
+ "selfClosing": true,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 136,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 44
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 136,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 16
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 8
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 137,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "column": 14,
+ "line": 8
+ },
+ "end": {
+ "column": 16,
+ "line": 8
+ }
+ },
+ "name": "is",
+ "rawName": "is"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 140,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "ConditionalExpression",
+ "start": 141,
+ "end": 166,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "range": [
+ 141,
+ 166
+ ],
+ "test": {
+ "type": "Identifier",
+ "start": 141,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 31
+ }
+ },
+ "range": [
+ 141,
+ 154
+ ],
+ "name": "someCondition"
+ },
+ "consequent": {
+ "type": "Identifier",
+ "start": 157,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 34
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "range": [
+ 157,
+ 160
+ ],
+ "name": "Foo"
+ },
+ "alternate": {
+ "type": "Identifier",
+ "start": 163,
+ "end": 166,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 40
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "range": [
+ 163,
+ 166
+ ],
+ "name": "Bar"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 141,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 31
+ }
+ },
+ "range": [
+ 141,
+ 154
+ ],
+ "name": "someCondition"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 157,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 34
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "range": [
+ 157,
+ 160
+ ],
+ "name": "Foo"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 163,
+ "end": 166,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 40
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "range": [
+ 163,
+ 166
+ ],
+ "name": "Bar"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 47
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 171,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": "'./Foo.vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 47,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 54,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": "Bar"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 63,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "'./Bar.vue'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 75,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 83,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 84,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 86,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 99,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "component"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 7
+ },
+ "end": {
+ "column": 14,
+ "line": 7
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 111,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "column": 14,
+ "line": 7
+ },
+ "end": {
+ "column": 16,
+ "line": 7
+ }
+ },
+ "value": "is"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "Foo",
+ "start": 115,
+ "end": 118,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "range": [
+ 115,
+ 118
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 118,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 120,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 23
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 25
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 125,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": "component"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 8
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 137,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "column": 14,
+ "line": 8
+ },
+ "end": {
+ "column": 16,
+ "line": 8
+ }
+ },
+ "value": "is"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 18
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "someCondition",
+ "start": 141,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 31
+ }
+ },
+ "range": [
+ 141,
+ 154
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "?",
+ "start": 155,
+ "end": 156,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 32
+ },
+ "end": {
+ "line": 8,
+ "column": 33
+ }
+ },
+ "range": [
+ 155,
+ 156
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "Foo",
+ "start": 157,
+ "end": 160,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 34
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "range": [
+ 157,
+ 160
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ":",
+ "start": 161,
+ "end": 162,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 38
+ },
+ "end": {
+ "line": 8,
+ "column": 39
+ }
+ },
+ "range": [
+ 161,
+ 162
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "Bar",
+ "start": 163,
+ "end": 166,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 40
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "range": [
+ 163,
+ 166
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 43
+ },
+ "end": {
+ "line": 8,
+ "column": 44
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 168,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 45
+ },
+ "end": {
+ "line": 8,
+ "column": 47
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 47
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 171,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 181,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 99,
+ "lineNumber": 7,
+ "column": 2
+ },
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 125,
+ "lineNumber": 8,
+ "column": 2
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example06/parser-options.json b/test/fixtures/ast/script-setup-example06/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example06/requirements.json b/test/fixtures/ast/script-setup-example06/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example06/source.vue b/test/fixtures/ast/script-setup-example06/source.vue
new file mode 100644
index 00000000..cb1a5379
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/source.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/test/fixtures/ast/script-setup-example06/token-ranges.json b/test/fixtures/ast/script-setup-example06/token-ranges.json
new file mode 100644
index 00000000..1b81a518
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/token-ranges.json
@@ -0,0 +1,63 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example06/tree.json b/test/fixtures/ast/script-setup-example06/tree.json
new file mode 100644
index 00000000..0e040608
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example06/tree.json
@@ -0,0 +1,139 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":is=\"Foo\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":is",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "is",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"Foo\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "Foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":is=\"someCondition ? Foo : Bar\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":is",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "is",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"someCondition ? Foo : Bar\"",
+ "children": [
+ {
+ "type": "ConditionalExpression",
+ "text": "someCondition ? Foo : Bar",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "someCondition",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "Foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "Bar",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example07/ast.json b/test/fixtures/ast/script-setup-example07/ast.json
new file mode 100644
index 00000000..1f16bdb6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/ast.json
@@ -0,0 +1,1123 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 17,
+ 77
+ ],
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 17,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 17,
+ 77
+ ],
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 26,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 26,
+ 52
+ ],
+ "imported": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 26,
+ 35
+ ],
+ "name": "directive"
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 39,
+ 52
+ ],
+ "name": "vClickOutside"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 60,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 60,
+ 77
+ ],
+ "value": "v-click-outside",
+ "raw": "'v-click-outside'"
+ },
+ "attributes": []
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 89,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 99,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 102,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 102,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "selfClosing": true,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 107,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 107,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 107,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 22,
+ "line": 6
+ }
+ },
+ "name": "click-outside",
+ "rawName": "click-outside"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 126,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "import"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 26,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "directive"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 36,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": "as"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 39,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "value": "vClickOutside"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 55,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "value": "from"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 44
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 60,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "value": "'v-click-outside'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 62
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 78,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 87,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 89,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 99,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 102,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 107,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 22,
+ "line": 6
+ }
+ },
+ "value": "v-click-outside"
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 123,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 126,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 102,
+ "lineNumber": 6,
+ "column": 2
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example07/parser-options.json b/test/fixtures/ast/script-setup-example07/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example07/requirements.json b/test/fixtures/ast/script-setup-example07/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example07/source.vue b/test/fixtures/ast/script-setup-example07/source.vue
new file mode 100644
index 00000000..5dc21392
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/source.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/script-setup-example07/token-ranges.json b/test/fixtures/ast/script-setup-example07/token-ranges.json
new file mode 100644
index 00000000..72d2f42e
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/token-ranges.json
@@ -0,0 +1,45 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example07/tree.json b/test/fixtures/ast/script-setup-example07/tree.json
new file mode 100644
index 00000000..4a519bfd
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example07/tree.json
@@ -0,0 +1,57 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-click-outside",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-click-outside",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-click-outside",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example08/ast.json b/test/fixtures/ast/script-setup-example08/ast.json
new file mode 100644
index 00000000..0d64e4a4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/ast.json
@@ -0,0 +1,895 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 48
+ }
+ },
+ "range": [
+ 17,
+ 116
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 17,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 17,
+ 66
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 23,
+ 66
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 23,
+ 28
+ ],
+ "name": "props"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 31,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 31,
+ 66
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 31,
+ 42
+ ],
+ "name": "defineProps"
+ },
+ "arguments": [
+ {
+ "type": "ObjectExpression",
+ "start": 43,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "range": [
+ 43,
+ 65
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 49,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 49,
+ 60
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "range": [
+ 49,
+ 52
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 54,
+ 60
+ ],
+ "name": "String"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 70,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 48
+ }
+ },
+ "range": [
+ 70,
+ 116
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 76,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 48
+ }
+ },
+ "range": [
+ 76,
+ 116
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 76,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "range": [
+ 76,
+ 80
+ ],
+ "name": "emit"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 83,
+ "end": 116,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 48
+ }
+ },
+ "range": [
+ 83,
+ 116
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 83,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 83,
+ 94
+ ],
+ "name": "defineEmits"
+ },
+ "arguments": [
+ {
+ "type": "ArrayExpression",
+ "start": 95,
+ "end": 115,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 6,
+ "column": 47
+ }
+ },
+ "range": [
+ 95,
+ 115
+ ],
+ "elements": [
+ {
+ "type": "Literal",
+ "start": 96,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 36
+ }
+ },
+ "range": [
+ 96,
+ 104
+ ],
+ "value": "change",
+ "raw": "'change'"
+ },
+ {
+ "type": "Literal",
+ "start": 106,
+ "end": 114,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 38
+ },
+ "end": {
+ "line": 6,
+ "column": 46
+ }
+ },
+ "range": [
+ 106,
+ 114
+ ],
+ "value": "delete",
+ "raw": "'delete'"
+ }
+ ]
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [
+ {
+ "type": "Line",
+ "value": " setup code",
+ "start": 119,
+ "end": 132,
+ "range": [
+ 119,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 15
+ }
+ }
+ }
+ ],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example08/parser-options.json b/test/fixtures/ast/script-setup-example08/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example08/requirements.json b/test/fixtures/ast/script-setup-example08/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example08/source.vue b/test/fixtures/ast/script-setup-example08/source.vue
new file mode 100644
index 00000000..e8da0cce
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/source.vue
@@ -0,0 +1,8 @@
+
diff --git a/test/fixtures/ast/script-setup-example08/token-ranges.json b/test/fixtures/ast/script-setup-example08/token-ranges.json
new file mode 100644
index 00000000..65c748a9
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/token-ranges.json
@@ -0,0 +1,28 @@
+[
+ "",
+ "// setup code"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example08/tree.json b/test/fixtures/ast/script-setup-example08/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example08/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example09/ast.json b/test/fixtures/ast/script-setup-example09/ast.json
new file mode 100644
index 00000000..02ac7838
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/ast.json
@@ -0,0 +1,826 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 17,
+ 112
+ ],
+ "body": [
+ {
+ "type": "ImportDeclaration",
+ "start": 17,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 17,
+ 57
+ ],
+ "specifiers": [
+ {
+ "type": "ImportSpecifier",
+ "start": 26,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 26,
+ 34
+ ],
+ "imported": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 26,
+ 34
+ ],
+ "name": "useSlots"
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 26,
+ 34
+ ],
+ "name": "useSlots"
+ }
+ },
+ {
+ "type": "ImportSpecifier",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 36,
+ 44
+ ],
+ "imported": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 36,
+ 44
+ ],
+ "name": "useAttrs"
+ },
+ "local": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 36,
+ 44
+ ],
+ "name": "useAttrs"
+ }
+ }
+ ],
+ "source": {
+ "type": "Literal",
+ "start": 52,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 52,
+ 57
+ ],
+ "value": "vue",
+ "raw": "'vue'"
+ },
+ "attributes": []
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 61,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "range": [
+ 61,
+ 85
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 67,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "range": [
+ 67,
+ 85
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "range": [
+ 67,
+ 72
+ ],
+ "name": "slots"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 75,
+ "end": 85,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "range": [
+ 75,
+ 85
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 75,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "range": [
+ 75,
+ 83
+ ],
+ "name": "useSlots"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 88,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 88,
+ 112
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 94,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 94,
+ 112
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 94,
+ "end": 99,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "range": [
+ 94,
+ 99
+ ],
+ "name": "attrs"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 102,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 102,
+ 112
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 102,
+ "end": 110,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 102,
+ 110
+ ],
+ "name": "useAttrs"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example09/parser-options.json b/test/fixtures/ast/script-setup-example09/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example09/requirements.json b/test/fixtures/ast/script-setup-example09/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example09/source.vue b/test/fixtures/ast/script-setup-example09/source.vue
new file mode 100644
index 00000000..274985ef
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/source.vue
@@ -0,0 +1,6 @@
+
diff --git a/test/fixtures/ast/script-setup-example09/token-ranges.json b/test/fixtures/ast/script-setup-example09/token-ranges.json
new file mode 100644
index 00000000..98aa0896
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/token-ranges.json
@@ -0,0 +1,24 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example09/tree.json b/test/fixtures/ast/script-setup-example09/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example09/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example10/ast.json b/test/fixtures/ast/script-setup-example10/ast.json
new file mode 100644
index 00000000..7cc84e94
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/ast.json
@@ -0,0 +1,1694 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "props",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "range": [
+ 39,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ },
+ "arguments": [],
+ "optional": false,
+ "range": [
+ 39,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "typeParameters": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 50,
+ 84
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "name": "foo",
+ "range": [
+ 55,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 58,
+ 66
+ ],
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "range": [
+ 60,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ }
+ },
+ "range": [
+ 55,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "optional": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "name": "bar",
+ "range": [
+ 69,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "range": [
+ 73,
+ 81
+ ],
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "range": [
+ 75,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ }
+ }
+ },
+ "range": [
+ 69,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ }
+ }
+ ],
+ "range": [
+ 51,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ }
+ }
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ }
+ },
+ "range": [
+ 31,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ }
+ }
+ ],
+ "kind": "const",
+ "range": [
+ 25,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "emit",
+ "range": [
+ 94,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "defineEmits",
+ "range": [
+ 101,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 24
+ }
+ }
+ },
+ "arguments": [],
+ "optional": false,
+ "range": [
+ 101,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "typeParameters": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 112,
+ 188
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSCallSignatureDeclaration",
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "e",
+ "range": [
+ 118,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 3
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "range": [
+ 119,
+ 129
+ ],
+ "typeAnnotation": {
+ "type": "TSLiteralType",
+ "literal": {
+ "type": "Literal",
+ "value": "change",
+ "raw": "'change'",
+ "range": [
+ 121,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 121,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "id",
+ "range": [
+ 131,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "range": [
+ 133,
+ 141
+ ],
+ "typeAnnotation": {
+ "type": "TSNumberKeyword",
+ "range": [
+ 135,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ }
+ }
+ }
+ }
+ ],
+ "range": [
+ 117,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 33
+ }
+ },
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 27
+ },
+ "end": {
+ "line": 8,
+ "column": 33
+ }
+ },
+ "range": [
+ 142,
+ 148
+ ],
+ "typeAnnotation": {
+ "type": "TSVoidKeyword",
+ "range": [
+ 144,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 29
+ },
+ "end": {
+ "line": 8,
+ "column": 33
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "TSCallSignatureDeclaration",
+ "params": [
+ {
+ "type": "Identifier",
+ "name": "e",
+ "range": [
+ 152,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 3
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "range": [
+ 153,
+ 163
+ ],
+ "typeAnnotation": {
+ "type": "TSLiteralType",
+ "literal": {
+ "type": "Literal",
+ "value": "update",
+ "raw": "'update'",
+ "range": [
+ 155,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 155,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "name": "value",
+ "range": [
+ 165,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 16
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 170,
+ 178
+ ],
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "range": [
+ 172,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 23
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ }
+ }
+ }
+ }
+ ],
+ "range": [
+ 151,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ },
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ },
+ "range": [
+ 179,
+ 185
+ ],
+ "typeAnnotation": {
+ "type": "TSVoidKeyword",
+ "range": [
+ 181,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 32
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ }
+ }
+ }
+ }
+ ],
+ "range": [
+ 113,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 25
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ }
+ }
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 24
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ }
+ },
+ "range": [
+ 94,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ }
+ }
+ ],
+ "kind": "const",
+ "range": [
+ 88,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ }
+ }
+ ],
+ "sourceType": "module",
+ "range": [
+ 25,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example10/parser-options.json b/test/fixtures/ast/script-setup-example10/parser-options.json
new file mode 100644
index 00000000..6e1a0ab4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "parser": "@typescript-eslint/parser"
+}
diff --git a/test/fixtures/ast/script-setup-example10/requirements.json b/test/fixtures/ast/script-setup-example10/requirements.json
new file mode 100644
index 00000000..945cf775
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/requirements.json
@@ -0,0 +1,3 @@
+{
+ "@typescript-eslint/parser": "^4.0.0"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example10/source.vue b/test/fixtures/ast/script-setup-example10/source.vue
new file mode 100644
index 00000000..dd518a69
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/source.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/ast/script-setup-example10/token-ranges.json b/test/fixtures/ast/script-setup-example10/token-ranges.json
new file mode 100644
index 00000000..b95f769b
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/token-ranges.json
@@ -0,0 +1,53 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example10/tree.json b/test/fixtures/ast/script-setup-example10/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example10/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example11/ast.json b/test/fixtures/ast/script-setup-example11/ast.json
new file mode 100644
index 00000000..a1fb4046
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/ast.json
@@ -0,0 +1,913 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "TSInterfaceDeclaration",
+ "body": {
+ "type": "TSInterfaceBody",
+ "body": [
+ {
+ "type": "TSPropertySignature",
+ "optional": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "name": "msg",
+ "range": [
+ 45,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 49,
+ 57
+ ],
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "range": [
+ 51,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ }
+ }
+ },
+ "range": [
+ 45,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ }
+ }
+ ],
+ "range": [
+ 41,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "name": "Props",
+ "range": [
+ 35,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "range": [
+ 25,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "props",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "withDefaults",
+ "range": [
+ 75,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ }
+ },
+ "arguments": [
+ {
+ "type": "CallExpression",
+ "callee": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "range": [
+ 88,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ }
+ },
+ "arguments": [],
+ "optional": false,
+ "range": [
+ 88,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 6,
+ "column": 47
+ }
+ },
+ "typeParameters": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 99,
+ 106
+ ],
+ "params": [
+ {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "name": "Props",
+ "range": [
+ 100,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 6,
+ "column": 44
+ }
+ }
+ },
+ "range": [
+ 100,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 6,
+ "column": 44
+ }
+ }
+ }
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 38
+ },
+ "end": {
+ "line": 6,
+ "column": 45
+ }
+ }
+ }
+ },
+ {
+ "type": "ObjectExpression",
+ "properties": [
+ {
+ "type": "Property",
+ "key": {
+ "type": "Identifier",
+ "name": "msg",
+ "range": [
+ 114,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 5
+ }
+ }
+ },
+ "value": {
+ "type": "Literal",
+ "value": "hello",
+ "raw": "'hello'",
+ "range": [
+ 119,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ }
+ },
+ "computed": false,
+ "method": false,
+ "shorthand": false,
+ "kind": "init",
+ "range": [
+ 114,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ }
+ }
+ ],
+ "range": [
+ 110,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 49
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ }
+ }
+ ],
+ "optional": false,
+ "range": [
+ 75,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ }
+ },
+ "range": [
+ 67,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "kind": "const",
+ "range": [
+ 61,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "sourceType": "module",
+ "range": [
+ 25,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 24
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example11/parser-options.json b/test/fixtures/ast/script-setup-example11/parser-options.json
new file mode 100644
index 00000000..6e1a0ab4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "parser": "@typescript-eslint/parser"
+}
diff --git a/test/fixtures/ast/script-setup-example11/requirements.json b/test/fixtures/ast/script-setup-example11/requirements.json
new file mode 100644
index 00000000..945cf775
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/requirements.json
@@ -0,0 +1,3 @@
+{
+ "@typescript-eslint/parser": "^4.0.0"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example11/source.vue b/test/fixtures/ast/script-setup-example11/source.vue
new file mode 100644
index 00000000..f70c2d7e
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/source.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/ast/script-setup-example11/token-ranges.json b/test/fixtures/ast/script-setup-example11/token-ranges.json
new file mode 100644
index 00000000..e270378c
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/token-ranges.json
@@ -0,0 +1,30 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example11/tree.json b/test/fixtures/ast/script-setup-example11/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example11/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example12/ast.json b/test/fixtures/ast/script-setup-example12/ast.json
new file mode 100644
index 00000000..fffdf813
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/ast.json
@@ -0,0 +1,839 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 23,
+ 78
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 23,
+ 27
+ ],
+ "name": "post"
+ },
+ "init": {
+ "type": "AwaitExpression",
+ "start": 30,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 30,
+ 78
+ ],
+ "argument": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 36,
+ 78
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 36,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 36,
+ 61
+ ],
+ "object": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 36,
+ 56
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "name": "fetch"
+ },
+ "arguments": [
+ {
+ "type": "TemplateLiteral",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "value": {
+ "raw": "/api/post/1",
+ "cooked": "/api/post/1"
+ },
+ "tail": true
+ }
+ ]
+ }
+ ],
+ "optional": false
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 57,
+ 61
+ ],
+ "name": "then"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 62,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 47
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 62,
+ 77
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ],
+ "name": "r"
+ }
+ ],
+ "body": {
+ "type": "CallExpression",
+ "start": 69,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 69,
+ 77
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 69,
+ 75
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "range": [
+ 69,
+ 70
+ ],
+ "name": "r"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 56
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 71,
+ 75
+ ],
+ "name": "json"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "optional": false
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example12/parser-options.json b/test/fixtures/ast/script-setup-example12/parser-options.json
new file mode 100644
index 00000000..7535f8a6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/parser-options.json
@@ -0,0 +1,5 @@
+{
+ "sourceType": "module",
+ "ecmaVersion": 2022,
+ "parser": "espree"
+}
diff --git a/test/fixtures/ast/script-setup-example12/requirements.json b/test/fixtures/ast/script-setup-example12/requirements.json
new file mode 100644
index 00000000..e41b9f47
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/requirements.json
@@ -0,0 +1,3 @@
+{
+ "espree": "^8.0.0"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example12/source.vue b/test/fixtures/ast/script-setup-example12/source.vue
new file mode 100644
index 00000000..bc11f0b4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup-example12/token-ranges.json b/test/fixtures/ast/script-setup-example12/token-ranges.json
new file mode 100644
index 00000000..e8347441
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/token-ranges.json
@@ -0,0 +1,25 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example12/tree.json b/test/fixtures/ast/script-setup-example12/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example12/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example13/ast.json b/test/fixtures/ast/script-setup-example13/ast.json
new file mode 100644
index 00000000..8e2d4fe6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/ast.json
@@ -0,0 +1,855 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "range": [
+ 15,
+ 71
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 15,
+ 26
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 21,
+ 26
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 22,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 21,
+ 22
+ ],
+ "name": "a"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 25,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 25,
+ 26
+ ],
+ "value": 1,
+ "raw": "1"
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 27,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 27,
+ 43
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 33,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 33,
+ 43
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ],
+ "name": "b"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 37,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 37,
+ 43
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ],
+ "name": "ref"
+ },
+ "arguments": [
+ {
+ "type": "Literal",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ],
+ "value": 2,
+ "raw": "2"
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 45,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "range": [
+ 45,
+ 71
+ ],
+ "expression": {
+ "type": "CallExpression",
+ "start": 45,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "range": [
+ 45,
+ 71
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 45,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "range": [
+ 45,
+ 57
+ ],
+ "name": "defineExpose"
+ },
+ "arguments": [
+ {
+ "type": "ObjectExpression",
+ "start": 58,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 58,
+ 70
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "name": "a"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "name": "a"
+ },
+ "kind": "init"
+ },
+ {
+ "type": "Property",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "b"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "b"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ],
+ "optional": false
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example13/parser-options.json b/test/fixtures/ast/script-setup-example13/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example13/requirements.json b/test/fixtures/ast/script-setup-example13/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example13/source.vue b/test/fixtures/ast/script-setup-example13/source.vue
new file mode 100644
index 00000000..97e8c115
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/source.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/ast/script-setup-example13/token-ranges.json b/test/fixtures/ast/script-setup-example13/token-ranges.json
new file mode 100644
index 00000000..2dc98c2b
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/token-ranges.json
@@ -0,0 +1,23 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example13/tree.json b/test/fixtures/ast/script-setup-example13/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example13/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example14/ast.json b/test/fixtures/ast/script-setup-example14/ast.json
new file mode 100644
index 00000000..288e20da
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/ast.json
@@ -0,0 +1,604 @@
+{
+ "type": "Program",
+ "start": 8,
+ "end": 168,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "range": [
+ 11,
+ 167
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 11,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 11,
+ 36
+ ],
+ "expression": {
+ "type": "CallExpression",
+ "start": 11,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 11,
+ 36
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 11,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 11,
+ 34
+ ],
+ "name": "performGlobalSideEffect"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ },
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 103,
+ "end": 125,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 103,
+ 125
+ ],
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 110,
+ "end": 125,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 110,
+ 125
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 116,
+ "end": 125,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 116,
+ 125
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 116,
+ "end": 121,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 20
+ }
+ },
+ "range": [
+ 116,
+ 121
+ ],
+ "name": "named"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 124,
+ "end": 125,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 124,
+ 125
+ ],
+ "value": 1,
+ "raw": "1"
+ }
+ }
+ ],
+ "kind": "const"
+ },
+ "specifiers": [],
+ "source": null,
+ "attributes": []
+ },
+ {
+ "type": "VariableDeclaration",
+ "start": 154,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "range": [
+ 154,
+ 167
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 158,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "range": [
+ 158,
+ 167
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 158,
+ "end": 163,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "range": [
+ 158,
+ 163
+ ],
+ "name": "count"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 166,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "range": [
+ 166,
+ 167
+ ],
+ "value": 0,
+ "raw": "0"
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [
+ {
+ "type": "Line",
+ "value": " this can be imported as `import { named } from './*.vue'`",
+ "start": 40,
+ "end": 100,
+ "range": [
+ 40,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 62
+ }
+ }
+ }
+ ],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 137,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example14/parser-options.json b/test/fixtures/ast/script-setup-example14/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example14/requirements.json b/test/fixtures/ast/script-setup-example14/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example14/source.vue b/test/fixtures/ast/script-setup-example14/source.vue
new file mode 100644
index 00000000..3d927d00
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/source.vue
@@ -0,0 +1,10 @@
+
+
+
diff --git a/test/fixtures/ast/script-setup-example14/token-ranges.json b/test/fixtures/ast/script-setup-example14/token-ranges.json
new file mode 100644
index 00000000..d4dbe02d
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/token-ranges.json
@@ -0,0 +1,19 @@
+[
+ "",
+ "",
+ "// this can be imported as `import { named } from './*.vue'`"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example14/tree.json b/test/fixtures/ast/script-setup-example14/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example14/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example15/ast.json b/test/fixtures/ast/script-setup-example15/ast.json
new file mode 100644
index 00000000..7d2e71bd
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/ast.json
@@ -0,0 +1,689 @@
+{
+ "type": "Program",
+ "start": 8,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 11,
+ 103
+ ],
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 11,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 11,
+ 103
+ ],
+ "declaration": {
+ "type": "ObjectExpression",
+ "start": 26,
+ "end": 103,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 3
+ }
+ },
+ "range": [
+ 26,
+ 103
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 32,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 32,
+ 50
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "range": [
+ 32,
+ 36
+ ],
+ "name": "name"
+ },
+ "value": {
+ "type": "Literal",
+ "start": 38,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 38,
+ 50
+ ],
+ "value": "CustomName",
+ "raw": "'CustomName'"
+ },
+ "kind": "init"
+ },
+ {
+ "type": "Property",
+ "start": 56,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "range": [
+ 56,
+ 75
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "range": [
+ 56,
+ 68
+ ],
+ "name": "inheritAttrs"
+ },
+ "value": {
+ "type": "Literal",
+ "start": 70,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "range": [
+ 70,
+ 75
+ ],
+ "value": false,
+ "raw": "false"
+ },
+ "kind": "init"
+ },
+ {
+ "type": "Property",
+ "start": 81,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 81,
+ 98
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "range": [
+ 81,
+ 94
+ ],
+ "name": "customOptions"
+ },
+ "value": {
+ "type": "ObjectExpression",
+ "start": 96,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 96,
+ 98
+ ],
+ "properties": []
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [
+ {
+ "type": "Line",
+ "value": " script setup logic",
+ "start": 132,
+ "end": 153,
+ "range": [
+ 132,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 23
+ }
+ }
+ }
+ ],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 115,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example15/parser-options.json b/test/fixtures/ast/script-setup-example15/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-example15/requirements.json b/test/fixtures/ast/script-setup-example15/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example15/source.vue b/test/fixtures/ast/script-setup-example15/source.vue
new file mode 100644
index 00000000..ec003be2
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/source.vue
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/fixtures/ast/script-setup-example15/token-ranges.json b/test/fixtures/ast/script-setup-example15/token-ranges.json
new file mode 100644
index 00000000..b27e16ce
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/token-ranges.json
@@ -0,0 +1,24 @@
+[
+ "",
+ "",
+ "// script setup logic"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-example15/tree.json b/test/fixtures/ast/script-setup-example15/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-example15/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/ast.json b/test/fixtures/ast/script-setup-top-level-await-with-latest/ast.json
new file mode 100644
index 00000000..fffdf813
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/ast.json
@@ -0,0 +1,839 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 23,
+ 78
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 23,
+ 27
+ ],
+ "name": "post"
+ },
+ "init": {
+ "type": "AwaitExpression",
+ "start": 30,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 30,
+ 78
+ ],
+ "argument": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 36,
+ 78
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 36,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 36,
+ 61
+ ],
+ "object": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 36,
+ 56
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "name": "fetch"
+ },
+ "arguments": [
+ {
+ "type": "TemplateLiteral",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "value": {
+ "raw": "/api/post/1",
+ "cooked": "/api/post/1"
+ },
+ "tail": true
+ }
+ ]
+ }
+ ],
+ "optional": false
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 57,
+ 61
+ ],
+ "name": "then"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 62,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 47
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 62,
+ 77
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ],
+ "name": "r"
+ }
+ ],
+ "body": {
+ "type": "CallExpression",
+ "start": 69,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 69,
+ 77
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 69,
+ 75
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "range": [
+ 69,
+ 70
+ ],
+ "name": "r"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 56
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 71,
+ 75
+ ],
+ "name": "json"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "optional": false
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/parser-options.json b/test/fixtures/ast/script-setup-top-level-await-with-latest/parser-options.json
new file mode 100644
index 00000000..c88b43d6
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "ecmaVersion": "latest"
+}
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/requirements.json b/test/fixtures/ast/script-setup-top-level-await-with-latest/requirements.json
new file mode 100644
index 00000000..e41b9f47
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/requirements.json
@@ -0,0 +1,3 @@
+{
+ "espree": "^8.0.0"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/source.vue b/test/fixtures/ast/script-setup-top-level-await-with-latest/source.vue
new file mode 100644
index 00000000..bc11f0b4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/token-ranges.json b/test/fixtures/ast/script-setup-top-level-await-with-latest/token-ranges.json
new file mode 100644
index 00000000..e8347441
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/token-ranges.json
@@ -0,0 +1,25 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await-with-latest/tree.json b/test/fixtures/ast/script-setup-top-level-await-with-latest/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await-with-latest/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await/ast.json b/test/fixtures/ast/script-setup-top-level-await/ast.json
new file mode 100644
index 00000000..fffdf813
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/ast.json
@@ -0,0 +1,839 @@
+{
+ "type": "Program",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 17,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 17,
+ 78
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 23,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 23,
+ 78
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 23,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 23,
+ 27
+ ],
+ "name": "post"
+ },
+ "init": {
+ "type": "AwaitExpression",
+ "start": 30,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 30,
+ 78
+ ],
+ "argument": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "range": [
+ 36,
+ 78
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 36,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 36,
+ 61
+ ],
+ "object": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 56,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 36,
+ 56
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "name": "fetch"
+ },
+ "arguments": [
+ {
+ "type": "TemplateLiteral",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "start": 42,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 55
+ ],
+ "value": {
+ "raw": "/api/post/1",
+ "cooked": "/api/post/1"
+ },
+ "tail": true
+ }
+ ]
+ }
+ ],
+ "optional": false
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "range": [
+ 57,
+ 61
+ ],
+ "name": "then"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [
+ {
+ "type": "ArrowFunctionExpression",
+ "start": 62,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 47
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 62,
+ 77
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ],
+ "name": "r"
+ }
+ ],
+ "body": {
+ "type": "CallExpression",
+ "start": 69,
+ "end": 77,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "range": [
+ 69,
+ 77
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 69,
+ 75
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "range": [
+ 69,
+ 70
+ ],
+ "name": "r"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 56
+ },
+ "end": {
+ "line": 2,
+ "column": 60
+ }
+ },
+ "range": [
+ 71,
+ 75
+ ],
+ "name": "json"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "optional": false
+ }
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await/parser-options.json b/test/fixtures/ast/script-setup-top-level-await/parser-options.json
new file mode 100644
index 00000000..9f047d2c
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "sourceType": "module",
+ "ecmaVersion": 2022
+}
diff --git a/test/fixtures/ast/script-setup-top-level-await/requirements.json b/test/fixtures/ast/script-setup-top-level-await/requirements.json
new file mode 100644
index 00000000..e41b9f47
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/requirements.json
@@ -0,0 +1,3 @@
+{
+ "espree": "^8.0.0"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await/source.vue b/test/fixtures/ast/script-setup-top-level-await/source.vue
new file mode 100644
index 00000000..bc11f0b4
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup-top-level-await/token-ranges.json b/test/fixtures/ast/script-setup-top-level-await/token-ranges.json
new file mode 100644
index 00000000..e8347441
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/token-ranges.json
@@ -0,0 +1,25 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-top-level-await/tree.json b/test/fixtures/ast/script-setup-top-level-await/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-top-level-await/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-with-export/ast.json b/test/fixtures/ast/script-setup-with-export/ast.json
new file mode 100644
index 00000000..f97586b0
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/ast.json
@@ -0,0 +1,265 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 15,
+ 40
+ ],
+ "body": [
+ {
+ "type": "ExportNamedDeclaration",
+ "start": 15,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 15,
+ 40
+ ],
+ "declaration": {
+ "type": "VariableDeclaration",
+ "start": 22,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 22,
+ 40
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 26,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 26,
+ 40
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "range": [
+ 26,
+ 29
+ ],
+ "name": "msg"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 32,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 32,
+ 40
+ ],
+ "value": "Hello!",
+ "raw": "'Hello!'"
+ }
+ }
+ ],
+ "kind": "let"
+ },
+ "specifiers": [],
+ "source": null,
+ "attributes": []
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-with-export/parser-options.json b/test/fixtures/ast/script-setup-with-export/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup-with-export/requirements.json b/test/fixtures/ast/script-setup-with-export/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-with-export/source.vue b/test/fixtures/ast/script-setup-with-export/source.vue
new file mode 100644
index 00000000..8aae4009
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup-with-export/token-ranges.json b/test/fixtures/ast/script-setup-with-export/token-ranges.json
new file mode 100644
index 00000000..72b76885
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/token-ranges.json
@@ -0,0 +1,9 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup-with-export/tree.json b/test/fixtures/ast/script-setup-with-export/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup-with-export/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup/ast.json b/test/fixtures/ast/script-setup/ast.json
new file mode 100644
index 00000000..7ae70685
--- /dev/null
+++ b/test/fixtures/ast/script-setup/ast.json
@@ -0,0 +1,223 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 15,
+ 28
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 15,
+ 28
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 19,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 19,
+ 28
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 19,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 19,
+ 24
+ ],
+ "name": "count"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ],
+ "value": 0,
+ "raw": "0"
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup/parser-options.json b/test/fixtures/ast/script-setup/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/script-setup/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/script-setup/requirements.json b/test/fixtures/ast/script-setup/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/script-setup/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup/source.vue b/test/fixtures/ast/script-setup/source.vue
new file mode 100644
index 00000000..7290631a
--- /dev/null
+++ b/test/fixtures/ast/script-setup/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/script-setup/token-ranges.json b/test/fixtures/ast/script-setup/token-ranges.json
new file mode 100644
index 00000000..24aad52a
--- /dev/null
+++ b/test/fixtures/ast/script-setup/token-ranges.json
@@ -0,0 +1,8 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/script-setup/tree.json b/test/fixtures/ast/script-setup/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/script-setup/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/self-closing-elements/ast.json b/test/fixtures/ast/self-closing-elements/ast.json
index ff1cbfb7..68aecb41 100644
--- a/test/fixtures/ast/self-closing-elements/ast.json
+++ b/test/fixtures/ast/self-closing-elements/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
diff --git a/test/fixtures/ast/slot-scope-default/ast.json b/test/fixtures/ast/slot-scope-default/ast.json
new file mode 100644
index 00000000..1dadf2d4
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-default/ast.json
@@ -0,0 +1,1010 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 45,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "name": "slot-scope",
+ "rawName": "slot-scope"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 56,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 57,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "params": [
+ {
+ "type": "AssignmentPattern",
+ "start": 57,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 57,
+ 64
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ],
+ "name": "foo"
+ },
+ "right": {
+ "type": "Literal",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ],
+ "value": 1,
+ "raw": "1"
+ }
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 66,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 68,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 68,
+ 71
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 68,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 68,
+ 71
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 73,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 47
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 84,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 102,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "value": "slot-scope"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "1",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 66,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 68,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 68,
+ 71
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 71,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 73,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 46
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 47
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 84,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 102,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-default/source.vue b/test/fixtures/ast/slot-scope-default/source.vue
new file mode 100644
index 00000000..a8cede16
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-default/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{foo}}
+
+
diff --git a/test/fixtures/ast/slot-scope-default/token-ranges.json b/test/fixtures/ast/slot-scope-default/token-ranges.json
new file mode 100644
index 00000000..676a57b0
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-default/token-ranges.json
@@ -0,0 +1,29 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "{{",
+ "foo",
+ "}}",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-default/tree.json b/test/fixtures/ast/slot-scope-default/tree.json
new file mode 100644
index 00000000..26b80fbc
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-default/tree.json
@@ -0,0 +1,127 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{foo}}
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "{{foo}}
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "slot-scope=\"foo = 1\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "slot-scope",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "slot-scope",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo = 1\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "foo = 1",
+ "children": [
+ {
+ "type": "AssignmentPattern",
+ "text": "foo = 1",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Literal",
+ "text": "1",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-destructuring/ast.json b/test/fixtures/ast/slot-scope-destructuring/ast.json
new file mode 100644
index 00000000..9ef5942d
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-destructuring/ast.json
@@ -0,0 +1,1569 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 60
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 45,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "name": "slot-scope",
+ "rawName": "slot-scope"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 56,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 57,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 57,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "range": [
+ 57,
+ 69
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "name": "a"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "name": "a"
+ },
+ "kind": "init"
+ },
+ {
+ "type": "Property",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ],
+ "name": "b"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ],
+ "name": "b"
+ },
+ "kind": "init"
+ },
+ {
+ "type": "RestElement",
+ "start": 64,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 64,
+ 68
+ ],
+ "argument": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "c"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 71,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 54
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 73,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 52
+ }
+ },
+ "range": [
+ 73,
+ 84
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 73,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "range": [
+ 73,
+ 78
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 73,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 77,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "range": [
+ 77,
+ 78
+ ],
+ "name": "b"
+ }
+ },
+ "operator": "+",
+ "right": {
+ "type": "MemberExpression",
+ "start": 81,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 49
+ },
+ "end": {
+ "line": 3,
+ "column": 52
+ }
+ },
+ "range": [
+ 81,
+ 84
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 49
+ },
+ "end": {
+ "line": 3,
+ "column": 50
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ],
+ "name": "c"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 83,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 52
+ }
+ },
+ "range": [
+ 83,
+ 84
+ ],
+ "name": "d"
+ },
+ "computed": false,
+ "optional": false
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 73,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 77,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "range": [
+ 77,
+ 78
+ ],
+ "name": "b"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 49
+ },
+ "end": {
+ "line": 3,
+ "column": 50
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ],
+ "name": "c"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 86,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 54
+ },
+ "end": {
+ "line": 3,
+ "column": 60
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "name": "a"
+ },
+ "kind": "scope"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ],
+ "name": "b"
+ },
+ "kind": "scope"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "c"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 92,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 60
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 97,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 115,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "value": "slot-scope"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 57,
+ "end": 58,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 57,
+ 58
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 59,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 59,
+ 60
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "start": 64,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "range": [
+ 64,
+ 67
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 68,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 71,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 73,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 75,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 44
+ }
+ },
+ "range": [
+ 75,
+ 76
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 77,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 46
+ }
+ },
+ "range": [
+ 77,
+ 78
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 79,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 47
+ },
+ "end": {
+ "line": 3,
+ "column": 48
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 49
+ },
+ "end": {
+ "line": 3,
+ "column": 50
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 82,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 50
+ },
+ "end": {
+ "line": 3,
+ "column": 51
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "d",
+ "start": 83,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 52
+ }
+ },
+ "range": [
+ 83,
+ 84
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 84,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 52
+ },
+ "end": {
+ "line": 3,
+ "column": 54
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 86,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 54
+ },
+ "end": {
+ "line": 3,
+ "column": 59
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 59
+ },
+ "end": {
+ "line": 3,
+ "column": 60
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 60
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 97,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 115,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-destructuring/source.vue b/test/fixtures/ast/slot-scope-destructuring/source.vue
new file mode 100644
index 00000000..a45dce93
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-destructuring/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{a + b + c.d}}
+
+
diff --git a/test/fixtures/ast/slot-scope-destructuring/token-ranges.json b/test/fixtures/ast/slot-scope-destructuring/token-ranges.json
new file mode 100644
index 00000000..1efc3205
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-destructuring/token-ranges.json
@@ -0,0 +1,40 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "{{",
+ "a",
+ "+",
+ "b",
+ "+",
+ "c",
+ ".",
+ "d",
+ "}}",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-destructuring/tree.json b/test/fixtures/ast/slot-scope-destructuring/tree.json
new file mode 100644
index 00000000..50af446a
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-destructuring/tree.json
@@ -0,0 +1,193 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{a + b + c.d}}
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{a + b + c.d}}
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "{{a + b + c.d}}
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "slot-scope=\"{a, b, ...c}\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "slot-scope",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "slot-scope",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{a, b, ...c}\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "{a, b, ...c}",
+ "children": [
+ {
+ "type": "ObjectPattern",
+ "text": "{a, b, ...c}",
+ "children": [
+ {
+ "type": "Property",
+ "text": "a",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "Property",
+ "text": "b",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "RestElement",
+ "text": "...c",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "c",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{a + b + c.d}}",
+ "children": [
+ {
+ "type": "BinaryExpression",
+ "text": "a + b + c.d",
+ "children": [
+ {
+ "type": "BinaryExpression",
+ "text": "a + b",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "MemberExpression",
+ "text": "c.d",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "c",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "d",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-multi-parameters/ast.json b/test/fixtures/ast/slot-scope-multi-parameters/ast.json
new file mode 100644
index 00000000..a34a8fca
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-multi-parameters/ast.json
@@ -0,0 +1,882 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "name": "my-component",
+ "rawName": "my-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 29,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "name": "slot-scope",
+ "rawName": "slot-scope"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 40,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 41,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ],
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ],
+ "name": "b"
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 47,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 56,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "name": "a"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 61,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 66,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ],
+ "name": "a"
+ },
+ "kind": "scope"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ],
+ "name": "b"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 82,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "my-component"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "value": "slot-scope"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "range": [
+ 42,
+ 43
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 47,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 56,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 58,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 59,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 66,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "my-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 82,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-multi-parameters/source.vue b/test/fixtures/ast/slot-scope-multi-parameters/source.vue
new file mode 100644
index 00000000..87936757
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-multi-parameters/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{a}}
+
+
diff --git a/test/fixtures/ast/slot-scope-multi-parameters/token-ranges.json b/test/fixtures/ast/slot-scope-multi-parameters/token-ranges.json
new file mode 100644
index 00000000..61358baf
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-multi-parameters/token-ranges.json
@@ -0,0 +1,25 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "a",
+ "}}",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-multi-parameters/tree.json b/test/fixtures/ast/slot-scope-multi-parameters/tree.json
new file mode 100644
index 00000000..38148fc9
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-multi-parameters/tree.json
@@ -0,0 +1,105 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{a}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{a}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "slot-scope=\"a, b\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "slot-scope",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "slot-scope",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"a, b\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "a, b",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{a}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-rest-parameter/ast.json b/test/fixtures/ast/slot-scope-rest-parameter/ast.json
new file mode 100644
index 00000000..9a2ed552
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-rest-parameter/ast.json
@@ -0,0 +1,838 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "name": "my-component",
+ "rawName": "my-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 29,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "name": "slot-scope",
+ "rawName": "slot-scope"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 40,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 41,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "params": [
+ {
+ "type": "RestElement",
+ "start": 41,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 41,
+ 48
+ ],
+ "argument": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 44,
+ 48
+ ],
+ "name": "rest"
+ }
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 50,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 59,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 61,
+ 65
+ ],
+ "name": "rest"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 61,
+ 65
+ ],
+ "name": "rest"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 72,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 44,
+ 48
+ ],
+ "name": "rest"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 88,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "my-component"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 29,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "value": "slot-scope"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "...",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "rest",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 44,
+ 48
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 59,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "rest",
+ "start": 61,
+ "end": 65,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 61,
+ 65
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 65,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 72,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "my-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 88,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-rest-parameter/source.vue b/test/fixtures/ast/slot-scope-rest-parameter/source.vue
new file mode 100644
index 00000000..4725c8a5
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-rest-parameter/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{rest}}
+
+
diff --git a/test/fixtures/ast/slot-scope-rest-parameter/token-ranges.json b/test/fixtures/ast/slot-scope-rest-parameter/token-ranges.json
new file mode 100644
index 00000000..fb2a1056
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-rest-parameter/token-ranges.json
@@ -0,0 +1,24 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "rest",
+ "}}",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope-rest-parameter/tree.json b/test/fixtures/ast/slot-scope-rest-parameter/tree.json
new file mode 100644
index 00000000..1522fdba
--- /dev/null
+++ b/test/fixtures/ast/slot-scope-rest-parameter/tree.json
@@ -0,0 +1,106 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{rest}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{rest}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "slot-scope=\"...rest\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "slot-scope",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "slot-scope",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"...rest\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "...rest",
+ "children": [
+ {
+ "type": "RestElement",
+ "text": "...rest",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "rest",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{rest}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "rest",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope/ast.json b/test/fixtures/ast/slot-scope/ast.json
new file mode 100644
index 00000000..ecf8d2f1
--- /dev/null
+++ b/test/fixtures/ast/slot-scope/ast.json
@@ -0,0 +1,930 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 45,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "name": "slot-scope",
+ "rawName": "slot-scope"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 56,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 57,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ],
+ "name": "foo"
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 62,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 64,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "range": [
+ 64,
+ 67
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 64,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "range": [
+ 64,
+ 67
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 69,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 75,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 80,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 98,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 45,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 3
+ },
+ "end": {
+ "column": 23,
+ "line": 3
+ }
+ },
+ "value": "slot-scope"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 62,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 64,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "range": [
+ 64,
+ 67
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 67,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 75,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 80,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 96,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 98,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope/source.vue b/test/fixtures/ast/slot-scope/source.vue
new file mode 100644
index 00000000..ae103f1e
--- /dev/null
+++ b/test/fixtures/ast/slot-scope/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{foo}}
+
+
diff --git a/test/fixtures/ast/slot-scope/token-ranges.json b/test/fixtures/ast/slot-scope/token-ranges.json
new file mode 100644
index 00000000..4e126545
--- /dev/null
+++ b/test/fixtures/ast/slot-scope/token-ranges.json
@@ -0,0 +1,27 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "{{",
+ "foo",
+ "}}",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/slot-scope/tree.json b/test/fixtures/ast/slot-scope/tree.json
new file mode 100644
index 00000000..fc99b978
--- /dev/null
+++ b/test/fixtures/ast/slot-scope/tree.json
@@ -0,0 +1,116 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{foo}}
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "{{foo}}
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "slot-scope=\"foo\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "slot-scope",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "slot-scope",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "foo",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-camel-case.ast.json b/test/fixtures/ast/svg-attrs-camel-case/ast.json
similarity index 81%
rename from test/fixtures/template-ast/svg-attrs-camel-case.ast.json
rename to test/fixtures/ast/svg-attrs-camel-case/ast.json
index 0f72f495..3a3a3927 100644
--- a/test/fixtures/template-ast/svg-attrs-camel-case.ast.json
+++ b/test/fixtures/ast/svg-attrs-camel-case/ast.json
@@ -1,6 +1,7 @@
{
"type": "Program",
- "end": 114,
+ "start": 94,
+ "end": 113,
"loc": {
"start": {
"line": 8,
@@ -111,7 +112,8 @@
],
"name": "exports"
},
- "computed": false
+ "computed": false,
+ "optional": false
},
"right": {
"type": "ObjectExpression",
@@ -136,7 +138,7 @@
}
}
],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [
{
@@ -297,6 +299,7 @@
}
],
"templateBody": {
+ "type": "VElement",
"range": [
0,
83
@@ -311,7 +314,9 @@
"column": 11
}
},
- "type": "VElement",
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -328,26 +333,8 @@
"column": 10
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 1,
- 9
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 9
- }
- },
- "name": "template"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -369,6 +356,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
15,
71
@@ -383,7 +371,9 @@
"column": 10
}
},
- "type": "VElement",
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -400,26 +390,8 @@
"column": 9
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 16,
- 19
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 5
- },
- "end": {
- "line": 2,
- "column": 8
- }
- },
- "name": "div"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -441,6 +413,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
29,
60
@@ -455,7 +428,9 @@
"column": 39
}
},
- "type": "VElement",
+ "name": "svg",
+ "rawName": "svg",
+ "namespace": "http://www.w3.org/2000/svg",
"startTag": {
"type": "VStartTag",
"range": [
@@ -472,24 +447,7 @@
"column": 33
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 30,
- 33
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 9
- },
- "end": {
- "line": 3,
- "column": 12
- }
- },
- "name": "svg"
- },
+ "selfClosing": false,
"attributes": [
{
"type": "VAttribute",
@@ -524,10 +482,11 @@
"column": 20
}
},
- "name": "viewBox"
+ "name": "viewBox",
+ "rawName": "viewBox"
},
"value": {
- "type": "VAttributeValue",
+ "type": "VLiteral",
"range": [
42,
53
@@ -545,8 +504,7 @@
"value": "0 0 40 40"
}
}
- ],
- "selfClosing": false
+ ]
},
"children": [],
"endTag": {
@@ -564,24 +522,6 @@
"line": 3,
"column": 39
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 56,
- 59
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 35
- },
- "end": {
- "line": 3,
- "column": 38
- }
- },
- "name": "svg"
}
},
"variables": []
@@ -620,24 +560,6 @@
"line": 4,
"column": 10
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 67,
- 70
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 6
- },
- "end": {
- "line": 4,
- "column": 9
- }
- },
- "name": "div"
}
},
"variables": []
@@ -676,56 +598,20 @@
"line": 5,
"column": 11
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 74,
- 82
- ],
- "loc": {
- "start": {
- "line": 5,
- "column": 2
- },
- "end": {
- "line": 5,
- "column": 10
- }
- },
- "name": "template"
}
},
"variables": [],
"tokens": [
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
0,
- 1
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 1
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 1,
9
],
"loc": {
"start": {
"line": 1,
- "column": 1
+ "column": 0
},
"end": {
"line": 1,
@@ -735,7 +621,7 @@
"value": "template"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
9,
10
@@ -750,10 +636,10 @@
"column": 10
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
10,
15
@@ -771,33 +657,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
15,
- 16
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 4
- },
- "end": {
- "line": 2,
- "column": 5
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 16,
19
],
"loc": {
"start": {
"line": 2,
- "column": 5
+ "column": 4
},
"end": {
"line": 2,
@@ -807,7 +675,7 @@
"value": "div"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
19,
20
@@ -822,10 +690,10 @@
"column": 9
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
20,
29
@@ -843,33 +711,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
29,
- 30
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 8
- },
- "end": {
- "line": 3,
- "column": 9
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 30,
33
],
"loc": {
"start": {
"line": 3,
- "column": 9
+ "column": 8
},
"end": {
"line": 3,
@@ -879,7 +729,7 @@
"value": "svg"
},
{
- "type": "VIdentifier",
+ "type": "HTMLIdentifier",
"range": [
34,
41
@@ -894,10 +744,10 @@
"column": 20
}
},
- "value": "viewBox"
+ "value": "viewbox"
},
{
- "type": "Punctuator",
+ "type": "HTMLAssociation",
"range": [
41,
42
@@ -912,10 +762,10 @@
"column": 21
}
},
- "value": "="
+ "value": ""
},
{
- "type": "VAttributeValue",
+ "type": "HTMLLiteral",
"range": [
42,
53
@@ -930,10 +780,10 @@
"column": 32
}
},
- "value": "\"0 0 40 40\""
+ "value": "0 0 40 40"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
53,
54
@@ -948,36 +798,18 @@
"column": 33
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
54,
- 56
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 33
- },
- "end": {
- "line": 3,
- "column": 35
- }
- },
- "value": ""
- },
- {
- "type": "VIdentifier",
- "range": [
- 56,
59
],
"loc": {
"start": {
"line": 3,
- "column": 35
+ "column": 33
},
"end": {
"line": 3,
@@ -987,7 +819,7 @@
"value": "svg"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
59,
60
@@ -1002,10 +834,10 @@
"column": 39
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
60,
65
@@ -1023,33 +855,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
65,
- 67
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 4
- },
- "end": {
- "line": 4,
- "column": 6
- }
- },
- "value": ""
- },
- {
- "type": "VIdentifier",
- "range": [
- 67,
70
],
"loc": {
"start": {
"line": 4,
- "column": 6
+ "column": 4
},
"end": {
"line": 4,
@@ -1059,7 +873,7 @@
"value": "div"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
70,
71
@@ -1074,10 +888,10 @@
"column": 10
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
71,
72
@@ -1095,10 +909,10 @@
"value": "\n"
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
72,
- 74
+ 82
],
"loc": {
"start": {
@@ -1107,48 +921,265 @@
},
"end": {
"line": 5,
- "column": 2
+ "column": 10
}
},
- "value": ""
+ "value": "template"
},
{
- "type": "VIdentifier",
+ "type": "HTMLTagClose",
"range": [
- 74,
- 82
+ 82,
+ 83
],
"loc": {
"start": {
"line": 5,
- "column": 2
+ "column": 10
},
"end": {
"line": 5,
- "column": 10
+ "column": 11
}
},
- "value": "template"
+ "value": ""
},
{
- "type": "Punctuator",
+ "type": "HTMLWhitespace",
"range": [
- 82,
- 83
+ 83,
+ 85
],
"loc": {
"start": {
"line": 5,
- "column": 10
+ "column": 11
},
"end": {
- "line": 5,
- "column": 11
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 85,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 94,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "module.exports"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 16
}
},
- "value": ">"
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 111,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "{}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 114,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
}
],
- "comments": []
+ "comments": [],
+ "errors": []
}
}
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-attrs-camel-case/requirements.json b/test/fixtures/ast/svg-attrs-camel-case/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-camel-case/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-camel-case.source.vue b/test/fixtures/ast/svg-attrs-camel-case/source.vue
similarity index 100%
rename from test/fixtures/template-ast/svg-attrs-camel-case.source.vue
rename to test/fixtures/ast/svg-attrs-camel-case/source.vue
diff --git a/test/fixtures/ast/svg-attrs-camel-case/token-ranges.json b/test/fixtures/ast/svg-attrs-camel-case/token-ranges.json
new file mode 100644
index 00000000..56ed419a
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-camel-case/token-ranges.json
@@ -0,0 +1,42 @@
+[
+ "",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-attrs-camel-case/tree.json b/test/fixtures/ast/svg-attrs-camel-case/tree.json
new file mode 100644
index 00000000..4ed2860a
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-camel-case/tree.json
@@ -0,0 +1,87 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "viewBox=\"0 0 40 40\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "viewBox",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"0 0 40 40\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-colon.ast.json b/test/fixtures/ast/svg-attrs-colon/ast.json
similarity index 81%
rename from test/fixtures/template-ast/svg-attrs-colon.ast.json
rename to test/fixtures/ast/svg-attrs-colon/ast.json
index 3d224c06..46367cd4 100644
--- a/test/fixtures/template-ast/svg-attrs-colon.ast.json
+++ b/test/fixtures/ast/svg-attrs-colon/ast.json
@@ -1,6 +1,7 @@
{
"type": "Program",
- "end": 113,
+ "start": 93,
+ "end": 112,
"loc": {
"start": {
"line": 8,
@@ -111,7 +112,8 @@
],
"name": "exports"
},
- "computed": false
+ "computed": false,
+ "optional": false
},
"right": {
"type": "ObjectExpression",
@@ -136,7 +138,7 @@
}
}
],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [
{
@@ -297,6 +299,7 @@
}
],
"templateBody": {
+ "type": "VElement",
"range": [
0,
82
@@ -311,7 +314,9 @@
"column": 11
}
},
- "type": "VElement",
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -328,26 +333,8 @@
"column": 10
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 1,
- 9
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 9
- }
- },
- "name": "template"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -369,6 +356,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
15,
70
@@ -383,7 +371,9 @@
"column": 10
}
},
- "type": "VElement",
+ "name": "svg",
+ "rawName": "svg",
+ "namespace": "http://www.w3.org/2000/svg",
"startTag": {
"type": "VStartTag",
"range": [
@@ -400,26 +390,8 @@
"column": 9
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 16,
- 19
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 5
- },
- "end": {
- "line": 2,
- "column": 8
- }
- },
- "name": "svg"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -441,6 +413,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
29,
59
@@ -455,7 +428,9 @@
"column": 38
}
},
- "type": "VElement",
+ "name": "use",
+ "rawName": "use",
+ "namespace": "http://www.w3.org/2000/svg",
"startTag": {
"type": "VStartTag",
"range": [
@@ -472,24 +447,7 @@
"column": 32
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 30,
- 33
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 9
- },
- "end": {
- "line": 3,
- "column": 12
- }
- },
- "name": "use"
- },
+ "selfClosing": false,
"attributes": [
{
"type": "VAttribute",
@@ -524,10 +482,11 @@
"column": 23
}
},
- "name": "xlink:href"
+ "name": "xlink:href",
+ "rawName": "xlink:href"
},
"value": {
- "type": "VAttributeValue",
+ "type": "VLiteral",
"range": [
45,
52
@@ -545,8 +504,7 @@
"value": "#test"
}
}
- ],
- "selfClosing": false
+ ]
},
"children": [],
"endTag": {
@@ -564,24 +522,6 @@
"line": 3,
"column": 38
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 55,
- 58
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 34
- },
- "end": {
- "line": 3,
- "column": 37
- }
- },
- "name": "use"
}
},
"variables": []
@@ -620,24 +560,6 @@
"line": 4,
"column": 10
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 66,
- 69
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 6
- },
- "end": {
- "line": 4,
- "column": 9
- }
- },
- "name": "svg"
}
},
"variables": []
@@ -676,56 +598,20 @@
"line": 5,
"column": 11
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 73,
- 81
- ],
- "loc": {
- "start": {
- "line": 5,
- "column": 2
- },
- "end": {
- "line": 5,
- "column": 10
- }
- },
- "name": "template"
}
},
"variables": [],
"tokens": [
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
0,
- 1
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 1
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 1,
9
],
"loc": {
"start": {
"line": 1,
- "column": 1
+ "column": 0
},
"end": {
"line": 1,
@@ -735,7 +621,7 @@
"value": "template"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
9,
10
@@ -750,10 +636,10 @@
"column": 10
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
10,
15
@@ -771,33 +657,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
15,
- 16
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 4
- },
- "end": {
- "line": 2,
- "column": 5
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 16,
19
],
"loc": {
"start": {
"line": 2,
- "column": 5
+ "column": 4
},
"end": {
"line": 2,
@@ -807,7 +675,7 @@
"value": "svg"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
19,
20
@@ -822,10 +690,10 @@
"column": 9
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
20,
29
@@ -843,33 +711,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
29,
- 30
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 8
- },
- "end": {
- "line": 3,
- "column": 9
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 30,
33
],
"loc": {
"start": {
"line": 3,
- "column": 9
+ "column": 8
},
"end": {
"line": 3,
@@ -879,7 +729,7 @@
"value": "use"
},
{
- "type": "VIdentifier",
+ "type": "HTMLIdentifier",
"range": [
34,
44
@@ -897,7 +747,7 @@
"value": "xlink:href"
},
{
- "type": "Punctuator",
+ "type": "HTMLAssociation",
"range": [
44,
45
@@ -912,10 +762,10 @@
"column": 24
}
},
- "value": "="
+ "value": ""
},
{
- "type": "VAttributeValue",
+ "type": "HTMLLiteral",
"range": [
45,
52
@@ -930,10 +780,10 @@
"column": 31
}
},
- "value": "\"#test\""
+ "value": "#test"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
52,
53
@@ -948,36 +798,18 @@
"column": 32
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
53,
- 55
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 32
- },
- "end": {
- "line": 3,
- "column": 34
- }
- },
- "value": ""
- },
- {
- "type": "VIdentifier",
- "range": [
- 55,
58
],
"loc": {
"start": {
"line": 3,
- "column": 34
+ "column": 32
},
"end": {
"line": 3,
@@ -987,7 +819,7 @@
"value": "use"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
58,
59
@@ -1002,10 +834,10 @@
"column": 38
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
59,
64
@@ -1023,33 +855,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
64,
- 66
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 4
- },
- "end": {
- "line": 4,
- "column": 6
- }
- },
- "value": ""
- },
- {
- "type": "VIdentifier",
- "range": [
- 66,
69
],
"loc": {
"start": {
"line": 4,
- "column": 6
+ "column": 4
},
"end": {
"line": 4,
@@ -1059,7 +873,7 @@
"value": "svg"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
69,
70
@@ -1074,10 +888,10 @@
"column": 10
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
70,
71
@@ -1095,10 +909,10 @@
"value": "\n"
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
71,
- 73
+ 81
],
"loc": {
"start": {
@@ -1107,48 +921,265 @@
},
"end": {
"line": 5,
- "column": 2
+ "column": 10
}
},
- "value": ""
+ "value": "template"
},
{
- "type": "VIdentifier",
+ "type": "HTMLTagClose",
"range": [
- 73,
- 81
+ 81,
+ 82
],
"loc": {
"start": {
"line": 5,
- "column": 2
+ "column": 10
},
"end": {
"line": 5,
- "column": 10
+ "column": 11
}
},
- "value": "template"
+ "value": ""
},
{
- "type": "Punctuator",
+ "type": "HTMLWhitespace",
"range": [
- 81,
- 82
+ 82,
+ 84
],
"loc": {
"start": {
"line": 5,
- "column": 10
+ "column": 11
},
"end": {
- "line": 5,
- "column": 11
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 84,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 93,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "module.exports"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 16
}
},
- "value": ">"
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "{}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 113,
+ 121
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 121,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
}
],
- "comments": []
+ "comments": [],
+ "errors": []
}
}
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-attrs-colon/requirements.json b/test/fixtures/ast/svg-attrs-colon/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-colon/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-colon.source.vue b/test/fixtures/ast/svg-attrs-colon/source.vue
similarity index 100%
rename from test/fixtures/template-ast/svg-attrs-colon.source.vue
rename to test/fixtures/ast/svg-attrs-colon/source.vue
diff --git a/test/fixtures/ast/svg-attrs-colon/token-ranges.json b/test/fixtures/ast/svg-attrs-colon/token-ranges.json
new file mode 100644
index 00000000..2eea4612
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-colon/token-ranges.json
@@ -0,0 +1,42 @@
+[
+ "",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-attrs-colon/tree.json b/test/fixtures/ast/svg-attrs-colon/tree.json
new file mode 100644
index 00000000..56239961
--- /dev/null
+++ b/test/fixtures/ast/svg-attrs-colon/tree.json
@@ -0,0 +1,87 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "xlink:href=\"#test\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "xlink:href",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"#test\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-namespace/ast.json b/test/fixtures/ast/svg-namespace/ast.json
new file mode 100644
index 00000000..ce6d4e1b
--- /dev/null
+++ b/test/fixtures/ast/svg-namespace/ast.json
@@ -0,0 +1,1404 @@
+{
+ "type": "Program",
+ "start": 150,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 150,
+ 169
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 150,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 150,
+ 169
+ ],
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 150,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 150,
+ 169
+ ],
+ "operator": "=",
+ "left": {
+ "type": "MemberExpression",
+ "start": 150,
+ "end": 164,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "range": [
+ 150,
+ 164
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 150,
+ "end": 156,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "range": [
+ 150,
+ 156
+ ],
+ "name": "module"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 157,
+ "end": 164,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "range": [
+ 157,
+ 164
+ ],
+ "name": "exports"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "right": {
+ "type": "ObjectExpression",
+ "start": 167,
+ "end": 169,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "range": [
+ 167,
+ 169
+ ],
+ "properties": []
+ }
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 141,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/2000/svg",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 10,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "name": "xmlns",
+ "rawName": "xmlns"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 16,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "value": "http://www.w3.org/2000/svg"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 50,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "name": "defs",
+ "rawName": "defs",
+ "namespace": "http://www.w3.org/2000/svg",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 50,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 56,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 65,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 58
+ }
+ },
+ "name": "pattern",
+ "rawName": "pattern",
+ "namespace": "http://www.w3.org/2000/svg",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 65,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 48
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 74,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 74,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "name": "id",
+ "rawName": "id"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 77,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "pat"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 83,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 83,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "name": "viewBox",
+ "rawName": "viewBox"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 91,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "value": "0 0 100 100"
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 105,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 48
+ },
+ "end": {
+ "line": 3,
+ "column": 58
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 115,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 58
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 120,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 128,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": "xmlns"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 16
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 16,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 44
+ }
+ },
+ "value": "http://www.w3.org/2000/svg"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 44
+ },
+ "end": {
+ "line": 1,
+ "column": 45
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 50,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "defs"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 56,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 65,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "pattern"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 74,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "value": "id"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 77,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": "pat"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 83,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "value": "viewbox"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 91,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 47
+ }
+ },
+ "value": "0 0 100 100"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 47
+ },
+ "end": {
+ "line": 3,
+ "column": 48
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 105,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 48
+ },
+ "end": {
+ "line": 3,
+ "column": 57
+ }
+ },
+ "value": "pattern"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 57
+ },
+ "end": {
+ "line": 3,
+ "column": 58
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 58
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 120,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "defs"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 128,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 141,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 150,
+ 164
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "module.exports"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 164,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 16
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "{}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 169,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 170,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 178,
+ 179
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 179,
+ 180
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-namespace/requirements.json b/test/fixtures/ast/svg-namespace/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/svg-namespace/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-namespace/source.vue b/test/fixtures/ast/svg-namespace/source.vue
new file mode 100644
index 00000000..f88c5f91
--- /dev/null
+++ b/test/fixtures/ast/svg-namespace/source.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/svg-namespace/token-ranges.json b/test/fixtures/ast/svg-namespace/token-ranges.json
new file mode 100644
index 00000000..6527f753
--- /dev/null
+++ b/test/fixtures/ast/svg-namespace/token-ranges.json
@@ -0,0 +1,48 @@
+[
+ "",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-namespace/tree.json b/test/fixtures/ast/svg-namespace/tree.json
new file mode 100644
index 00000000..62b52d25
--- /dev/null
+++ b/test/fixtures/ast/svg-namespace/tree.json
@@ -0,0 +1,120 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "xmlns=\"http://www.w3.org/2000/svg\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "xmlns",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"http://www.w3.org/2000/svg\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "id=\"pat\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "id",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"pat\"",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "viewBox=\"0 0 100 100\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "viewBox",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"0 0 100 100\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-upper/ast.json b/test/fixtures/ast/svg-upper/ast.json
new file mode 100644
index 00000000..26e58850
--- /dev/null
+++ b/test/fixtures/ast/svg-upper/ast.json
@@ -0,0 +1,743 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "name": "svg",
+ "rawName": "SVG",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": "width",
+ "rawName": "Width"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "100"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 32,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "name": "height",
+ "rawName": "heiGht"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 39,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": "100"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 45,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 45,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "name": "viewbox",
+ "rawName": "viewbox"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 53,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "value": "0 0 100 100"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 56
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 72,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 79,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "svg"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "width"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "100"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": "height"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 39,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": "100"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 45,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "value": "viewbox"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 53,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 55
+ }
+ },
+ "value": "0 0 100 100"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 55
+ },
+ "end": {
+ "line": 2,
+ "column": 56
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 56
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 72,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": "svg"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 79,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-upper/source.vue b/test/fixtures/ast/svg-upper/source.vue
new file mode 100644
index 00000000..38ed7f68
--- /dev/null
+++ b/test/fixtures/ast/svg-upper/source.vue
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/test/fixtures/ast/svg-upper/token-ranges.json b/test/fixtures/ast/svg-upper/token-ranges.json
new file mode 100644
index 00000000..e473bac2
--- /dev/null
+++ b/test/fixtures/ast/svg-upper/token-ranges.json
@@ -0,0 +1,23 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/svg-upper/tree.json b/test/fixtures/ast/svg-upper/tree.json
new file mode 100644
index 00000000..d51fc5c2
--- /dev/null
+++ b/test/fixtures/ast/svg-upper/tree.json
@@ -0,0 +1,98 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "Width=\"100\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "Width",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"100\"",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "heiGht=\"100\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "heiGht",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"100\"",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "viewbox=\"0 0 100 100\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "viewbox",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"0 0 100 100\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/table.ast.json b/test/fixtures/ast/table/ast.json
similarity index 69%
rename from test/fixtures/template-ast/table.ast.json
rename to test/fixtures/ast/table/ast.json
index a3b927e7..f0488a41 100644
--- a/test/fixtures/template-ast/table.ast.json
+++ b/test/fixtures/ast/table/ast.json
@@ -17,10 +17,11 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
+ "type": "VElement",
"range": [
0,
82
@@ -35,7 +36,9 @@
"column": 11
}
},
- "type": "VElement",
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -52,26 +55,8 @@
"column": 10
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 1,
- 9
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 1
- },
- "end": {
- "line": 1,
- "column": 9
- }
- },
- "name": "template"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -93,6 +78,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
15,
70
@@ -107,7 +93,9 @@
"column": 12
}
},
- "type": "VElement",
+ "name": "table",
+ "rawName": "table",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -124,26 +112,8 @@
"column": 11
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 16,
- 21
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 5
- },
- "end": {
- "line": 2,
- "column": 10
- }
- },
- "name": "table"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -165,6 +135,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
31,
62
@@ -179,7 +150,9 @@
"column": 4
}
},
- "type": "VElement",
+ "name": "tr",
+ "rawName": "tr",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -196,26 +169,8 @@
"column": 12
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 32,
- 34
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 9
- },
- "end": {
- "line": 3,
- "column": 11
- }
- },
- "name": "tr"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -237,6 +192,7 @@
"value": "\n "
},
{
+ "type": "VElement",
"range": [
48,
62
@@ -251,7 +207,9 @@
"column": 4
}
},
- "type": "VElement",
+ "name": "td",
+ "rawName": "td",
+ "namespace": "http://www.w3.org/1999/xhtml",
"startTag": {
"type": "VStartTag",
"range": [
@@ -268,26 +226,8 @@
"column": 16
}
},
- "id": {
- "type": "VIdentifier",
- "range": [
- 49,
- 51
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 13
- },
- "end": {
- "line": 4,
- "column": 15
- }
- },
- "name": "td"
- },
- "attributes": [],
- "selfClosing": false
+ "selfClosing": false,
+ "attributes": []
},
"children": [
{
@@ -332,24 +272,6 @@
"line": 5,
"column": 12
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 64,
- 69
- ],
- "loc": {
- "start": {
- "line": 5,
- "column": 6
- },
- "end": {
- "line": 5,
- "column": 11
- }
- },
- "name": "table"
}
},
"variables": []
@@ -388,56 +310,20 @@
"line": 6,
"column": 11
}
- },
- "id": {
- "type": "VIdentifier",
- "range": [
- 73,
- 81
- ],
- "loc": {
- "start": {
- "line": 6,
- "column": 2
- },
- "end": {
- "line": 6,
- "column": 10
- }
- },
- "name": "template"
}
},
"variables": [],
"tokens": [
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
0,
- 1
- ],
- "loc": {
- "start": {
- "line": 1,
- "column": 0
- },
- "end": {
- "line": 1,
- "column": 1
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 1,
9
],
"loc": {
"start": {
"line": 1,
- "column": 1
+ "column": 0
},
"end": {
"line": 1,
@@ -447,7 +333,7 @@
"value": "template"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
9,
10
@@ -462,10 +348,10 @@
"column": 10
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
10,
15
@@ -483,33 +369,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
15,
- 16
- ],
- "loc": {
- "start": {
- "line": 2,
- "column": 4
- },
- "end": {
- "line": 2,
- "column": 5
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 16,
21
],
"loc": {
"start": {
"line": 2,
- "column": 5
+ "column": 4
},
"end": {
"line": 2,
@@ -519,7 +387,7 @@
"value": "table"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
21,
22
@@ -534,10 +402,10 @@
"column": 11
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
22,
31
@@ -555,33 +423,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
31,
- 32
- ],
- "loc": {
- "start": {
- "line": 3,
- "column": 8
- },
- "end": {
- "line": 3,
- "column": 9
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 32,
34
],
"loc": {
"start": {
"line": 3,
- "column": 9
+ "column": 8
},
"end": {
"line": 3,
@@ -591,7 +441,7 @@
"value": "tr"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
34,
35
@@ -606,10 +456,10 @@
"column": 12
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
35,
48
@@ -627,33 +477,15 @@
"value": "\n "
},
{
- "type": "Punctuator",
+ "type": "HTMLTagOpen",
"range": [
48,
- 49
- ],
- "loc": {
- "start": {
- "line": 4,
- "column": 12
- },
- "end": {
- "line": 4,
- "column": 13
- }
- },
- "value": "<"
- },
- {
- "type": "VIdentifier",
- "range": [
- 49,
51
],
"loc": {
"start": {
"line": 4,
- "column": 13
+ "column": 12
},
"end": {
"line": 4,
@@ -663,7 +495,7 @@
"value": "td"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
51,
52
@@ -678,13 +510,13 @@
"column": 16
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLText",
"range": [
52,
- 62
+ 57
],
"loc": {
"start": {
@@ -692,40 +524,40 @@
"column": 16
},
"end": {
- "line": 5,
- "column": 4
+ "line": 4,
+ "column": 21
}
},
- "value": "hello\n "
+ "value": "hello"
},
{
- "type": "Punctuator",
+ "type": "HTMLWhitespace",
"range": [
- 62,
- 64
+ 57,
+ 62
],
"loc": {
"start": {
- "line": 5,
- "column": 4
+ "line": 4,
+ "column": 21
},
"end": {
"line": 5,
- "column": 6
+ "column": 4
}
},
- "value": ""
+ "value": "\n "
},
{
- "type": "VIdentifier",
+ "type": "HTMLEndTagOpen",
"range": [
- 64,
+ 62,
69
],
"loc": {
"start": {
"line": 5,
- "column": 6
+ "column": 4
},
"end": {
"line": 5,
@@ -735,7 +567,7 @@
"value": "table"
},
{
- "type": "Punctuator",
+ "type": "HTMLTagClose",
"range": [
69,
70
@@ -750,10 +582,10 @@
"column": 12
}
},
- "value": ">"
+ "value": ""
},
{
- "type": "VText",
+ "type": "HTMLWhitespace",
"range": [
70,
71
@@ -771,10 +603,10 @@
"value": "\n"
},
{
- "type": "Punctuator",
+ "type": "HTMLEndTagOpen",
"range": [
71,
- 73
+ 81
],
"loc": {
"start": {
@@ -783,48 +615,49 @@
},
"end": {
"line": 6,
- "column": 2
+ "column": 10
}
},
- "value": ""
+ "value": "template"
},
{
- "type": "VIdentifier",
+ "type": "HTMLTagClose",
"range": [
- 73,
- 81
+ 81,
+ 82
],
"loc": {
"start": {
"line": 6,
- "column": 2
+ "column": 10
},
"end": {
"line": 6,
- "column": 10
+ "column": 11
}
},
- "value": "template"
+ "value": ""
},
{
- "type": "Punctuator",
+ "type": "HTMLWhitespace",
"range": [
- 81,
- 82
+ 82,
+ 83
],
"loc": {
"start": {
"line": 6,
- "column": 10
+ "column": 11
},
"end": {
- "line": 6,
- "column": 11
+ "line": 7,
+ "column": 0
}
},
- "value": ">"
+ "value": "\n"
}
],
- "comments": []
+ "comments": [],
+ "errors": []
}
}
\ No newline at end of file
diff --git a/test/fixtures/template-ast/table.source.vue b/test/fixtures/ast/table/source.vue
similarity index 100%
rename from test/fixtures/template-ast/table.source.vue
rename to test/fixtures/ast/table/source.vue
diff --git a/test/fixtures/ast/table/token-ranges.json b/test/fixtures/ast/table/token-ranges.json
new file mode 100644
index 00000000..230be934
--- /dev/null
+++ b/test/fixtures/ast/table/token-ranges.json
@@ -0,0 +1,21 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "hello",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/table/tree.json b/test/fixtures/ast/table/tree.json
new file mode 100644
index 00000000..19c50923
--- /dev/null
+++ b/test/fixtures/ast/table/tree.json
@@ -0,0 +1,81 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n hello\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "hello\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "hello\n ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/text-and-expression-container/ast.json b/test/fixtures/ast/text-and-expression-container/ast.json
index 3983af11..233bcc06 100644
--- a/test/fixtures/ast/text-and-expression-container/ast.json
+++ b/test/fixtures/ast/text-and-expression-container/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
diff --git a/test/fixtures/ast/text/ast.json b/test/fixtures/ast/text/ast.json
index ffb6c8b5..d529f26e 100644
--- a/test/fixtures/ast/text/ast.json
+++ b/test/fixtures/ast/text/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
diff --git a/test/fixtures/ast/textarea/ast.json b/test/fixtures/ast/textarea/ast.json
index 8e1cd026..793c9979 100644
--- a/test/fixtures/ast/textarea/ast.json
+++ b/test/fixtures/ast/textarea/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json
new file mode 100644
index 00000000..5f70958e
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json
@@ -0,0 +1,1085 @@
+{
+ "type": "Program",
+ "range": [
+ 116,
+ 116
+ ],
+ "body": [],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 91,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 24
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 0
+ },
+ "start": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 20,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 29,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "ObjectExpression",
+ "properties": [
+ {
+ "type": "Property",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "test",
+ "optional": false,
+ "range": [
+ 49,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ }
+ },
+ "kind": "init",
+ "method": false,
+ "optional": false,
+ "shorthand": false,
+ "value": {
+ "type": "Literal",
+ "raw": "'test'",
+ "value": "test",
+ "range": [
+ 55,
+ 61
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 40
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ }
+ },
+ "range": [
+ 49,
+ 61
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 40
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ }
+ }
+ ],
+ "range": [
+ 47,
+ 62
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 41
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "JSON",
+ "optional": false,
+ "range": [
+ 32,
+ 36
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "stringify",
+ "optional": false,
+ "range": [
+ 37,
+ 46
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ }
+ },
+ "range": [
+ 32,
+ 46
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 32,
+ 63
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 42
+ },
+ "start": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "JSON",
+ "optional": false,
+ "range": [
+ 32,
+ 36
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 66,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 71,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 78,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 29,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "range": [
+ 32,
+ 36
+ ],
+ "value": "JSON"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 37,
+ 46
+ ],
+ "value": "stringify"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 26
+ },
+ "start": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 27
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ],
+ "value": "{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 49,
+ 53
+ ],
+ "value": "test"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ],
+ "value": ":"
+ },
+ {
+ "type": "String",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 40
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 55,
+ 61
+ ],
+ "value": "'test'"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 41
+ },
+ "start": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ],
+ "value": "}"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 42
+ },
+ "start": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 64,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 45
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 66,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 71,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 78,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 89,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 91,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 99,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 104,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 17
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 109,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 23
+ },
+ "end": {
+ "line": 7,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 24
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 116,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/parser-options.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json
new file mode 100644
index 00000000..3849ae94
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json
@@ -0,0 +1,1174 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "Intl",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SymbolConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Function",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Disposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySetLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Set",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Math",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseWithResolvers",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExp",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Atomics",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "String",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMemberDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadataObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadata",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMethodDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassGetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassSetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorTarget",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassFieldDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorYieldResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorReturnResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BuiltinIteratorReturn",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IArguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Map",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Promise",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKeyTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntToLocaleStringOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Error",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpMatchArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpExecArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpIndicesArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRef",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRefConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistry",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistryConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Date",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Number",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseFulfilledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseRejectedResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseSettledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpStringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Symbol",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "JSON",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FlatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGenerator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DateConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptorMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Object",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisParameterType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "OmitThisParameter",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "CallableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NewableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Boolean",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BooleanConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NumberConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TemplateStringsArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportMeta",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportCallOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAssertions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAttributes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConcatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypedPropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructorLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Awaited",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Partial",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Required",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Readonly",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Pick",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Record",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Exclude",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Extract",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Omit",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NonNullable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Parameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConstructorParameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReturnType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "InstanceType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uppercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Lowercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Capitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uncapitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NoInfer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataViewConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Generator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyHandler",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Reflect",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MethodDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ParameterDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "const",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [],
+ "references": [],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json
new file mode 100644
index 00000000..7f661a33
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json
@@ -0,0 +1,13 @@
+[
+ "defineCustomBlocksVisitor",
+ "defineDocumentVisitor",
+ "defineTemplateBodyVisitor",
+ "emitDecoratorMetadata",
+ "esTreeNodeToTSNodeMap",
+ "experimentalDecorators",
+ "getDocumentFragment",
+ "getTemplateBodyTokenStore",
+ "isolatedDeclarations",
+ "program",
+ "tsNodeToESTreeNodeMap"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/source.vue b/test/fixtures/ast/ts-script-setup-with-use-global-var/source.vue
new file mode 100644
index 00000000..32aa1772
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/source.vue
@@ -0,0 +1,8 @@
+
+
+ {{ JSON.stringify({ test: 'test'}) }}
+
+
+
+
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/token-ranges.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/token-ranges.json
new file mode 100644
index 00000000..b5c5f60f
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/token-ranges.json
@@ -0,0 +1,39 @@
+[
+ "",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "JSON",
+ ".",
+ "stringify",
+ "(",
+ "{",
+ "test",
+ ":",
+ "'test'",
+ "}",
+ ")",
+ "}}",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/tree.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/tree.json
new file mode 100644
index 00000000..d8308723
--- /dev/null
+++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/tree.json
@@ -0,0 +1,104 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n {{ JSON.stringify({ test: 'test'}) }}\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{ JSON.stringify({ test: 'test'}) }}\n
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{ JSON.stringify({ test: 'test'}) }}",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "JSON.stringify({ test: 'test'})",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "JSON.stringify",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "JSON",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "stringify",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "ObjectExpression",
+ "text": "{ test: 'test'}",
+ "children": [
+ {
+ "type": "Property",
+ "text": "test: 'test'",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "test",
+ "children": []
+ },
+ {
+ "type": "Literal",
+ "text": "'test'",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro01/ast.json b/test/fixtures/ast/user-macro01/ast.json
new file mode 100644
index 00000000..9aaf297b
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/ast.json
@@ -0,0 +1,283 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 15,
+ 38
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 15,
+ 38
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 21,
+ 38
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 21,
+ 24
+ ],
+ "name": "foo"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 27,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 27,
+ 38
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 27,
+ 36
+ ],
+ "name": "userMacro"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro01/parser-options.json b/test/fixtures/ast/user-macro01/parser-options.json
new file mode 100644
index 00000000..c53f27c2
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "vueFeatures": {
+ "customMacros": ["userMacro"]
+ }
+}
diff --git a/test/fixtures/ast/user-macro01/requirements.json b/test/fixtures/ast/user-macro01/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro01/scope.json b/test/fixtures/ast/user-macro01/scope.json
new file mode 100644
index 00000000..e43b8b3c
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/scope.json
@@ -0,0 +1,184 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "userMacro",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ "name": "foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ],
+ "childScopes": [],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro01/source.vue b/test/fixtures/ast/user-macro01/source.vue
new file mode 100644
index 00000000..9990d5a3
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/user-macro01/token-ranges.json b/test/fixtures/ast/user-macro01/token-ranges.json
new file mode 100644
index 00000000..7292be36
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/token-ranges.json
@@ -0,0 +1,10 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro01/tree.json b/test/fixtures/ast/user-macro01/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/user-macro01/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro02-without-option/ast.json b/test/fixtures/ast/user-macro02-without-option/ast.json
new file mode 100644
index 00000000..9aaf297b
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/ast.json
@@ -0,0 +1,283 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 15,
+ 38
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 15,
+ 38
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 21,
+ 38
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 21,
+ 24
+ ],
+ "name": "foo"
+ },
+ "init": {
+ "type": "CallExpression",
+ "start": 27,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 27,
+ 38
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 27,
+ 36
+ ],
+ "name": "userMacro"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro02-without-option/parser-options.json b/test/fixtures/ast/user-macro02-without-option/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/user-macro02-without-option/requirements.json b/test/fixtures/ast/user-macro02-without-option/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro02-without-option/scope.json b/test/fixtures/ast/user-macro02-without-option/scope.json
new file mode 100644
index 00000000..f8ecd4a8
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/scope.json
@@ -0,0 +1,180 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ "name": "foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ],
+ "childScopes": [],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+ }
+ ],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "userMacro",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro02-without-option/source.vue b/test/fixtures/ast/user-macro02-without-option/source.vue
new file mode 100644
index 00000000..9990d5a3
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/source.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/ast/user-macro02-without-option/token-ranges.json b/test/fixtures/ast/user-macro02-without-option/token-ranges.json
new file mode 100644
index 00000000..7292be36
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/token-ranges.json
@@ -0,0 +1,10 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/user-macro02-without-option/tree.json b/test/fixtures/ast/user-macro02-without-option/tree.json
new file mode 100644
index 00000000..0637a088
--- /dev/null
+++ b/test/fixtures/ast/user-macro02-without-option/tree.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-prop-shorthand/ast.json b/test/fixtures/ast/v-bind-prop-shorthand/ast.json
new file mode 100644
index 00000000..dc3c2610
--- /dev/null
+++ b/test/fixtures/ast/v-bind-prop-shorthand/ast.json
@@ -0,0 +1,1114 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "name": "bind",
+ "rawName": "."
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "name": "a",
+ "rawName": "a"
+ },
+ "modifiers": [
+ {
+ "type": "VIdentifier",
+ "range": [
+ 22,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "name": "prop",
+ "rawName": ""
+ }
+ ]
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 35,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 45,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 45,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 10,
+ "line": 3
+ }
+ },
+ "name": "bind",
+ "rawName": "."
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 11,
+ "line": 3
+ }
+ },
+ "name": "a",
+ "rawName": "a"
+ },
+ "modifiers": [
+ {
+ "type": "VIdentifier",
+ "range": [
+ 48,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 3
+ },
+ "end": {
+ "column": 16,
+ "line": 3
+ }
+ },
+ "name": "prop",
+ "rawName": "prop"
+ }
+ ]
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 53,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 54,
+ 57
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 54,
+ 57
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 59,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 66,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "value": "."
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 24,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "range": [
+ 24,
+ 27
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 29,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 10,
+ "line": 3
+ }
+ },
+ "value": "."
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 11,
+ "line": 3
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 3
+ },
+ "end": {
+ "column": 12,
+ "line": 3
+ }
+ },
+ "value": "."
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 48,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 3
+ },
+ "end": {
+ "column": 16,
+ "line": 3
+ }
+ },
+ "value": "prop"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 54,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 54,
+ 57
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 59,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 66,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-prop-shorthand/source.vue b/test/fixtures/ast/v-bind-prop-shorthand/source.vue
new file mode 100644
index 00000000..e9284b8d
--- /dev/null
+++ b/test/fixtures/ast/v-bind-prop-shorthand/source.vue
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-prop-shorthand/token-ranges.json b/test/fixtures/ast/v-bind-prop-shorthand/token-ranges.json
new file mode 100644
index 00000000..0846874a
--- /dev/null
+++ b/test/fixtures/ast/v-bind-prop-shorthand/token-ranges.json
@@ -0,0 +1,32 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-prop-shorthand/tree.json b/test/fixtures/ast/v-bind-prop-shorthand/tree.json
new file mode 100644
index 00000000..92d34c87
--- /dev/null
+++ b/test/fixtures/ast/v-bind-prop-shorthand/tree.json
@@ -0,0 +1,143 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ".a=\"foo\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ".a",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ".",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ".a.prop=\"foo\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ".a.prop",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ".",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "prop",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/ast.json
new file mode 100644
index 00000000..085e4279
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/ast.json
@@ -0,0 +1,968 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 15,
+ 57
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 15,
+ 57
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 21,
+ 57
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 24,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "range": [
+ 21,
+ 24
+ ],
+ "name": "src"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 27,
+ "end": 57,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 27,
+ 57
+ ],
+ "value": "https://github.com/vuejs.png",
+ "raw": "\"https://github.com/vuejs.png\""
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 69,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 69,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 79,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 82,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "name": "img",
+ "rawName": "img",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 82,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 87,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 87,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 8,
+ "line": 6
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 88,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "name": "src",
+ "rawName": "src"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 88,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 88,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "range": [
+ 88,
+ 91
+ ],
+ "name": "src"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 88,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "range": [
+ 88,
+ 91
+ ],
+ "name": "src"
+ },
+ "mode": "r",
+ "variable": null
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 93,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "src"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": "\"https://github.com/vuejs.png\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 58,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 69,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 79,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 82,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "img"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 8,
+ "line": 6
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 88,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "value": "src"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 93,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/scope.json
new file mode 100644
index 00000000..95d2857d
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/scope.json
@@ -0,0 +1,154 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "src",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ },
+ "name": "src"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "src",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ "init": true
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/source.vue
new file mode 100644
index 00000000..902ca750
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/source.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/token-ranges.json
new file mode 100644
index 00000000..1666d2b9
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/token-ranges.json
@@ -0,0 +1,34 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/tree.json
new file mode 100644
index 00000000..403f2688
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand01-script-setup/tree.json
@@ -0,0 +1,73 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "src",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/ast.json
new file mode 100644
index 00000000..55f56637
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/ast.json
@@ -0,0 +1,1644 @@
+{
+ "type": "Program",
+ "start": 9,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 9,
+ 104
+ ],
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 9,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 9,
+ 104
+ ],
+ "declaration": {
+ "type": "ObjectExpression",
+ "start": 24,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "range": [
+ 24,
+ 104
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 28,
+ "end": 102,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 28,
+ 102
+ ],
+ "method": true,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "range": [
+ 28,
+ 32
+ ],
+ "name": "data"
+ },
+ "value": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 102,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 33,
+ 102
+ ],
+ "id": null,
+ "expression": false,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 102,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "range": [
+ 36,
+ 102
+ ],
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 42,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "range": [
+ 42,
+ 98
+ ],
+ "argument": {
+ "type": "ObjectExpression",
+ "start": 49,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "range": [
+ 49,
+ 98
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 57,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "range": [
+ 57,
+ 92
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "range": [
+ 57,
+ 60
+ ],
+ "name": "src"
+ },
+ "value": {
+ "type": "Literal",
+ "start": 62,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "range": [
+ 62,
+ 92
+ ],
+ "value": "https://github.com/vuejs.png",
+ "raw": "\"https://github.com/vuejs.png\""
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 116,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 116,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 126,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 129,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 12
+ }
+ },
+ "name": "img",
+ "rawName": "img",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 129,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 12
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 134,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 7
+ },
+ "end": {
+ "line": 12,
+ "column": 11
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 134,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 7
+ },
+ "end": {
+ "line": 12,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 12
+ },
+ "end": {
+ "column": 8,
+ "line": 12
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 135,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 12
+ },
+ "end": {
+ "column": 11,
+ "line": 12
+ }
+ },
+ "name": "src",
+ "rawName": "src"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 135,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 12
+ },
+ "end": {
+ "column": 11,
+ "line": 12
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 135,
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "column": 11,
+ "line": 12
+ }
+ },
+ "range": [
+ 135,
+ 138
+ ],
+ "name": "src"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 135,
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "column": 11,
+ "line": 12
+ }
+ },
+ "range": [
+ 135,
+ 138
+ ],
+ "name": "src"
+ },
+ "mode": "r",
+ "variable": null
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 12
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 140,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 25,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "value": "data"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": "()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 42,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 57,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "src:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 62,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "value": "\"https://github.com/vuejs.png\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 98,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 3
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 105,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 114,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 116,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 129,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 6
+ }
+ },
+ "value": "img"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 12
+ },
+ "end": {
+ "column": 8,
+ "line": 12
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 135,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 12
+ },
+ "end": {
+ "column": 11,
+ "line": 12
+ }
+ },
+ "value": "src"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 11
+ },
+ "end": {
+ "line": 12,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 12
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 140,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 150,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 13,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 151,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 11
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json
new file mode 100644
index 00000000..66d2c7f4
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json
@@ -0,0 +1,22 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "function",
+ "variables": [
+ {
+ "name": "arguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ }
+ ],
+ "references": [],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand02-options/source.vue
new file mode 100644
index 00000000..633c03c2
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/source.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/token-ranges.json
new file mode 100644
index 00000000..75da3231
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/token-ranges.json
@@ -0,0 +1,62 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/tree.json
new file mode 100644
index 00000000..403f2688
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/tree.json
@@ -0,0 +1,73 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "src",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/ast.json
new file mode 100644
index 00000000..64389542
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/ast.json
@@ -0,0 +1,1736 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 120,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "range": [
+ 15,
+ 120
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 120,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "range": [
+ 15,
+ 120
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 120,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "range": [
+ 21,
+ 120
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 21,
+ 28
+ ],
+ "name": "srcList"
+ },
+ "init": {
+ "type": "ArrayExpression",
+ "start": 31,
+ "end": 120,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "range": [
+ 31,
+ 120
+ ],
+ "elements": [
+ {
+ "type": "Literal",
+ "start": 41,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 41,
+ 71
+ ],
+ "value": "https://github.com/vuejs.png",
+ "raw": "\"https://github.com/vuejs.png\""
+ },
+ {
+ "type": "Literal",
+ "start": 81,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 39
+ }
+ },
+ "range": [
+ 81,
+ 112
+ ],
+ "value": "https://github.com/vitejs.png",
+ "raw": "\"https://github.com/vitejs.png\""
+ }
+ ]
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 132,
+ 209
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 132,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 142,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 145,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 145,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 150,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 155,
+ 188
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 37
+ }
+ },
+ "name": "img",
+ "rawName": "img",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 155,
+ 188
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 37
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 160,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 31
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 10
+ },
+ "end": {
+ "column": 14,
+ "line": 10
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 166,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 10,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 167,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 16
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 167,
+ "end": 170,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 16
+ },
+ "end": {
+ "line": 10,
+ "column": 19
+ }
+ },
+ "range": [
+ 167,
+ 170
+ ],
+ "name": "src"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 174,
+ "end": 181,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 23
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "range": [
+ 174,
+ 181
+ ],
+ "name": "srcList"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 174,
+ "end": 181,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 23
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "range": [
+ 174,
+ 181
+ ],
+ "name": "srcList"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 183,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 32
+ },
+ "end": {
+ "line": 10,
+ "column": 36
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 183,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 32
+ },
+ "end": {
+ "line": 10,
+ "column": 36
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "column": 32,
+ "line": 10
+ },
+ "end": {
+ "column": 33,
+ "line": 10
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 184,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 10
+ },
+ "end": {
+ "column": 36,
+ "line": 10
+ }
+ },
+ "name": "src",
+ "rawName": "src"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 184,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 10
+ },
+ "end": {
+ "column": 36,
+ "line": 10
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 184,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 33
+ },
+ "end": {
+ "column": 36,
+ "line": 10
+ }
+ },
+ "range": [
+ 184,
+ 187
+ ],
+ "name": "src"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 184,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 33
+ },
+ "end": {
+ "column": 36,
+ "line": 10
+ }
+ },
+ "range": [
+ 184,
+ 187
+ ],
+ "name": "src"
+ },
+ "mode": "r",
+ "variable": {
+ "id": {
+ "type": "Identifier",
+ "start": 167,
+ "end": 170,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 16
+ },
+ "end": {
+ "line": 10,
+ "column": 19
+ }
+ },
+ "range": [
+ 167,
+ 170
+ ],
+ "name": "src"
+ },
+ "kind": "v-for"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 167,
+ "end": 170,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 16
+ },
+ "end": {
+ "line": 10,
+ "column": 19
+ }
+ },
+ "range": [
+ 167,
+ 170
+ ],
+ "name": "src"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 188,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 37
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 191,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 197,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 198,
+ 209
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "srcList"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "["
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 41,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "value": "\"https://github.com/vuejs.png\","
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 72,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 39
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 81,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 39
+ }
+ },
+ "value": "\"https://github.com/vitejs.png\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 39
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 119,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "]"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 120,
+ 121
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 121,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 130,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 132,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 141,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 142,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 145,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 155,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "img"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 10
+ },
+ "end": {
+ "column": 14,
+ "line": 10
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 10,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "src",
+ "start": 167,
+ "end": 170,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 16
+ },
+ "end": {
+ "line": 10,
+ "column": 19
+ }
+ },
+ "range": [
+ 167,
+ 170
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 171,
+ "end": 173,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 20
+ },
+ "end": {
+ "line": 10,
+ "column": 22
+ }
+ },
+ "range": [
+ 171,
+ 173
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "srcList",
+ "start": 174,
+ "end": 181,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 23
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "range": [
+ 174,
+ 181
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 181,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 30
+ },
+ "end": {
+ "line": 10,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "column": 32,
+ "line": 10
+ },
+ "end": {
+ "column": 33,
+ "line": 10
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 184,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 10
+ },
+ "end": {
+ "column": 36,
+ "line": 10
+ }
+ },
+ "value": "src"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 187,
+ 188
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 36
+ },
+ "end": {
+ "line": 10,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 188,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 37
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 191,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 7
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 197,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 198,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 208,
+ 209
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 209,
+ 210
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 11
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/scope.json
new file mode 100644
index 00000000..9c8001a6
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/scope.json
@@ -0,0 +1,154 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "srcList",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ }
+ },
+ "name": "srcList"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcList",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "init": true
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/source.vue
new file mode 100644
index 00000000..5a8ed1db
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/source.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/token-ranges.json
new file mode 100644
index 00000000..5550abfa
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/token-ranges.json
@@ -0,0 +1,57 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "
",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/tree.json
new file mode 100644
index 00000000..3f22d76a
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand03-with-v-for/tree.json
@@ -0,0 +1,138 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n
\n
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"src in srcList\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"src in srcList\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "src in srcList",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "srcList",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "src",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/ast.json
new file mode 100644
index 00000000..05fdd689
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/ast.json
@@ -0,0 +1,2412 @@
+{
+ "type": "Program",
+ "start": 9,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 1
+ }
+ },
+ "range": [
+ 9,
+ 167
+ ],
+ "body": [
+ {
+ "type": "ExportDefaultDeclaration",
+ "start": 9,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 1
+ }
+ },
+ "range": [
+ 9,
+ 167
+ ],
+ "declaration": {
+ "type": "ObjectExpression",
+ "start": 24,
+ "end": 167,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 1
+ }
+ },
+ "range": [
+ 24,
+ 167
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 28,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 28,
+ 165
+ ],
+ "method": true,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "range": [
+ 28,
+ 32
+ ],
+ "name": "data"
+ },
+ "value": {
+ "type": "FunctionExpression",
+ "start": 33,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 33,
+ 165
+ ],
+ "id": null,
+ "expression": false,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 36,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 36,
+ 165
+ ],
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "start": 42,
+ "end": 161,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "range": [
+ 42,
+ 161
+ ],
+ "argument": {
+ "type": "ObjectExpression",
+ "start": 49,
+ "end": 161,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "range": [
+ 49,
+ 161
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 57,
+ "end": 155,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "range": [
+ 57,
+ 155
+ ],
+ "method": false,
+ "shorthand": false,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 57,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "range": [
+ 57,
+ 64
+ ],
+ "name": "srcList"
+ },
+ "value": {
+ "type": "ArrayExpression",
+ "start": 66,
+ "end": 155,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "range": [
+ 66,
+ 155
+ ],
+ "elements": [
+ {
+ "type": "Literal",
+ "start": 76,
+ "end": 106,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 76,
+ 106
+ ],
+ "value": "https://github.com/vuejs.png",
+ "raw": "\"https://github.com/vuejs.png\""
+ },
+ {
+ "type": "Literal",
+ "start": 116,
+ "end": 147,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 39
+ }
+ },
+ "range": [
+ 116,
+ 147
+ ],
+ "value": "https://github.com/vitejs.png",
+ "raw": "\"https://github.com/vitejs.png\""
+ }
+ ]
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 179,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 179,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 189,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 192,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 17,
+ "column": 8
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 192,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 197,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 202,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 4
+ },
+ "end": {
+ "line": 16,
+ "column": 37
+ }
+ },
+ "name": "img",
+ "rawName": "img",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 202,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 4
+ },
+ "end": {
+ "line": 16,
+ "column": 37
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 207,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 16,
+ "column": 31
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 207,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 16,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 207,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 16
+ },
+ "end": {
+ "column": 14,
+ "line": 16
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 213,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 15
+ },
+ "end": {
+ "line": 16,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 214,
+ 228
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 16
+ },
+ "end": {
+ "line": 16,
+ "column": 30
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 214,
+ "end": 217,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 16
+ },
+ "end": {
+ "line": 16,
+ "column": 19
+ }
+ },
+ "range": [
+ 214,
+ 217
+ ],
+ "name": "src"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 221,
+ "end": 228,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 23
+ },
+ "end": {
+ "line": 16,
+ "column": 30
+ }
+ },
+ "range": [
+ 221,
+ 228
+ ],
+ "name": "srcList"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 221,
+ "end": 228,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 23
+ },
+ "end": {
+ "line": 16,
+ "column": 30
+ }
+ },
+ "range": [
+ 221,
+ 228
+ ],
+ "name": "srcList"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 230,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 32
+ },
+ "end": {
+ "line": 16,
+ "column": 36
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 230,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 32
+ },
+ "end": {
+ "line": 16,
+ "column": 36
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "column": 32,
+ "line": 16
+ },
+ "end": {
+ "column": 33,
+ "line": 16
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 231,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 16
+ },
+ "end": {
+ "column": 36,
+ "line": 16
+ }
+ },
+ "name": "src",
+ "rawName": "src"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 231,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 16
+ },
+ "end": {
+ "column": 36,
+ "line": 16
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 231,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 33
+ },
+ "end": {
+ "column": 36,
+ "line": 16
+ }
+ },
+ "range": [
+ 231,
+ 234
+ ],
+ "name": "src"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 231,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 33
+ },
+ "end": {
+ "column": 36,
+ "line": 16
+ }
+ },
+ "range": [
+ 231,
+ 234
+ ],
+ "name": "src"
+ },
+ "mode": "r",
+ "variable": {
+ "id": {
+ "type": "Identifier",
+ "start": 214,
+ "end": 217,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 16
+ },
+ "end": {
+ "line": 16,
+ "column": 19
+ }
+ },
+ "range": [
+ 214,
+ 217
+ ],
+ "name": "src"
+ },
+ "kind": "v-for"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 214,
+ "end": 217,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 16
+ },
+ "end": {
+ "line": 16,
+ "column": 19
+ }
+ },
+ "range": [
+ 214,
+ 217
+ ],
+ "name": "src"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 235,
+ 238
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 37
+ },
+ "end": {
+ "line": 17,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 238,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 2
+ },
+ "end": {
+ "line": 17,
+ "column": 8
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 244,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 8
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 245,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 25,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "value": "data"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": "()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 42,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 57,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": "srcList:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 16
+ }
+ },
+ "value": "["
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 76,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 39
+ }
+ },
+ "value": "\"https://github.com/vuejs.png\","
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 116,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 39
+ }
+ },
+ "value": "\"https://github.com/vitejs.png\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 39
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "value": "]"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 155,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 161,
+ 164
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 164,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 3
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 167,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 1
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 168,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 176,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 177,
+ 179
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 179,
+ 188
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 188,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 189,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 192,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 197,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 202,
+ 206
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 4
+ },
+ "end": {
+ "line": 16,
+ "column": 8
+ }
+ },
+ "value": "img"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 207,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 16
+ },
+ "end": {
+ "column": 14,
+ "line": 16
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 14
+ },
+ "end": {
+ "line": 16,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 213,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 15
+ },
+ "end": {
+ "line": 16,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "src",
+ "start": 214,
+ "end": 217,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 16
+ },
+ "end": {
+ "line": 16,
+ "column": 19
+ }
+ },
+ "range": [
+ 214,
+ 217
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 218,
+ "end": 220,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 20
+ },
+ "end": {
+ "line": 16,
+ "column": 22
+ }
+ },
+ "range": [
+ 218,
+ 220
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "srcList",
+ "start": 221,
+ "end": 228,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 23
+ },
+ "end": {
+ "line": 16,
+ "column": 30
+ }
+ },
+ "range": [
+ 221,
+ 228
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 228,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 30
+ },
+ "end": {
+ "line": 16,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "column": 32,
+ "line": 16
+ },
+ "end": {
+ "column": 33,
+ "line": 16
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 231,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "column": 33,
+ "line": 16
+ },
+ "end": {
+ "column": 36,
+ "line": 16
+ }
+ },
+ "value": "src"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 234,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 36
+ },
+ "end": {
+ "line": 16,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 235,
+ 238
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 37
+ },
+ "end": {
+ "line": 17,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 238,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 2
+ },
+ "end": {
+ "line": 17,
+ "column": 7
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 243,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 7
+ },
+ "end": {
+ "line": 17,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 244,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 8
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 245,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 255,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 10
+ },
+ "end": {
+ "line": 18,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 256,
+ 257
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 11
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json
new file mode 100644
index 00000000..66d2c7f4
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json
@@ -0,0 +1,22 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "function",
+ "variables": [
+ {
+ "name": "arguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ }
+ ],
+ "references": [],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/source.vue
new file mode 100644
index 00000000..5717a8b8
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/source.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/token-ranges.json
new file mode 100644
index 00000000..6b5b352b
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/token-ranges.json
@@ -0,0 +1,85 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "
",
+ "\n ",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/tree.json
new file mode 100644
index 00000000..3f22d76a
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/tree.json
@@ -0,0 +1,138 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n
\n
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"src in srcList\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"src in srcList\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "src in srcList",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "srcList",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":src",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "src",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "src",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/ast.json
new file mode 100644
index 00000000..1825f93e
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/ast.json
@@ -0,0 +1,1166 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 15,
+ 40
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 15,
+ 40
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 21,
+ 40
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 21,
+ 30
+ ],
+ "name": "ariaLabel"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 33,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 33,
+ 40
+ ],
+ "value": "Close",
+ "raw": "\"Close\""
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 52,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 52,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 62,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 65,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 50
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 65,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 73,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 73,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 74,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 6
+ },
+ "end": {
+ "column": 21,
+ "line": 6
+ }
+ },
+ "name": "aria-label",
+ "rawName": "aria-label"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 74,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 6
+ },
+ "end": {
+ "column": 21,
+ "line": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 74,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "column": 21,
+ "line": 6
+ }
+ },
+ "range": [
+ 74,
+ 84
+ ],
+ "name": "ariaLabel"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 74,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "column": 21,
+ "line": 6
+ }
+ },
+ "range": [
+ 74,
+ 84
+ ],
+ "name": "ariaLabel"
+ },
+ "mode": "r",
+ "variable": null
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 85,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 39
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 85,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 24
+ }
+ },
+ "name": "id",
+ "rawName": "id"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 88,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 39
+ }
+ },
+ "value": "close-button"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": "X"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 104,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 50
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 50
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 114,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "ariaLabel"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "\"Close\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 41,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 52,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 65,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 74,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 6
+ },
+ "end": {
+ "column": 21,
+ "line": 6
+ }
+ },
+ "value": "aria-label"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 85,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 24
+ }
+ },
+ "value": "id"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 24
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 88,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 39
+ }
+ },
+ "value": "close-button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": "X"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 104,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 49
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 49
+ },
+ "end": {
+ "line": 6,
+ "column": 50
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 50
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 114,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/scope.json
new file mode 100644
index 00000000..b6a55688
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/scope.json
@@ -0,0 +1,154 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "ariaLabel",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ }
+ },
+ "name": "ariaLabel"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "ariaLabel",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "init": true
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/source.vue
new file mode 100644
index 00000000..8ec33eb1
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/source.vue
@@ -0,0 +1,7 @@
+
+
+
+ X
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/token-ranges.json
new file mode 100644
index 00000000..da1ef87b
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/token-ranges.json
@@ -0,0 +1,40 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "",
+ "X",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/tree.json
new file mode 100644
index 00000000..aca3bf7e
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand05-kebab/tree.json
@@ -0,0 +1,99 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n X \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "X ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":aria-label",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":aria-label",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "aria-label",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "aria-label",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "aria-label",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "id=\"close-button\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "id",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"close-button\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "X",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/ast.json
new file mode 100644
index 00000000..2077a1b0
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/ast.json
@@ -0,0 +1,1078 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 15,
+ 36
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 15,
+ 36
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 21,
+ 36
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "range": [
+ 21,
+ 26
+ ],
+ "name": "title"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 29,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 29,
+ 36
+ ],
+ "value": "title",
+ "raw": "'title'"
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 48,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 48,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 58,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 61,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 30
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 61,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 69,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 69,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VExpressionContainer",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 11,
+ "line": 6
+ },
+ "end": {
+ "column": 18,
+ "line": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 71,
+ 76
+ ],
+ "name": "title"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 71,
+ 76
+ ],
+ "name": "title"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ "modifiers": []
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "X"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 80,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 30
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 30
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 90,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "title"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": "'title'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 37,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 48,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 58,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 61,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 6
+ },
+ "end": {
+ "column": 11,
+ "line": 6
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": "["
+ },
+ {
+ "type": "Identifier",
+ "value": "title",
+ "start": 71,
+ "end": 76,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "range": [
+ 71,
+ 76
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "]"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "X"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 80,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 29
+ },
+ "end": {
+ "line": 6,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 30
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 90,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/scope.json
new file mode 100644
index 00000000..eb7b762d
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/scope.json
@@ -0,0 +1,154 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "title",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ }
+ },
+ "name": "title"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "title",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "init": true
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/source.vue
new file mode 100644
index 00000000..9fae2ab1
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/source.vue
@@ -0,0 +1,7 @@
+
+
+
+ X
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/token-ranges.json
new file mode 100644
index 00000000..27b0500b
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/token-ranges.json
@@ -0,0 +1,39 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ "",
+ "X",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/tree.json
new file mode 100644
index 00000000..c5fdc90c
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand06-invalid/tree.json
@@ -0,0 +1,78 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n X \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "X ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":[title]",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":[title]",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "[title]",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "title",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "X",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/ast.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/ast.json
new file mode 100644
index 00000000..06d41c77
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/ast.json
@@ -0,0 +1,968 @@
+{
+ "type": "Program",
+ "start": 15,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "range": [
+ 15,
+ 60
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 15,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "range": [
+ 15,
+ 60
+ ],
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 21,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "range": [
+ 21,
+ 60
+ ],
+ "id": {
+ "type": "Identifier",
+ "start": 21,
+ "end": 27,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 21,
+ 27
+ ],
+ "name": "srcUrl"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 30,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "range": [
+ 30,
+ 60
+ ],
+ "value": "https://github.com/vuejs.png",
+ "raw": "\"https://github.com/vuejs.png\""
+ }
+ }
+ ],
+ "kind": "const"
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ }
+ ],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 72,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 72,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 82,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "name": "img",
+ "rawName": "img",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 90,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 90,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 8,
+ "line": 6
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 91,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "name": "srcurl",
+ "rawName": "srcUrl"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 91,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "range": [
+ 91,
+ 97
+ ],
+ "name": "srcUrl"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "range": [
+ 91,
+ 97
+ ],
+ "name": "srcUrl"
+ },
+ "mode": "r",
+ "variable": null
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 99,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "srcUrl"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 30,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "value": "\"https://github.com/vuejs.png\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 61,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 70,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 72,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 82,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 85,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "img"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 6
+ },
+ "end": {
+ "column": 8,
+ "line": 6
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 91,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 6
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "value": "srcUrl"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 99,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/parser-options.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/parser-options.json
new file mode 100644
index 00000000..2104ca43
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/parser-options.json
@@ -0,0 +1,3 @@
+{
+ "sourceType": "module"
+}
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/requirements.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/requirements.json
new file mode 100644
index 00000000..36659b1f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/requirements.json
@@ -0,0 +1,3 @@
+{
+ "eslint": ">=8"
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/scope.json
new file mode 100644
index 00000000..ca436a8c
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/scope.json
@@ -0,0 +1,154 @@
+{
+ "type": "global",
+ "variables": [],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "srcUrl",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ }
+ },
+ "name": "srcUrl"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "srcUrl",
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "init": true
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/source.vue b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/source.vue
new file mode 100644
index 00000000..6888a5e6
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/source.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/token-ranges.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/token-ranges.json
new file mode 100644
index 00000000..9fa6dc66
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/token-ranges.json
@@ -0,0 +1,34 @@
+[
+ "",
+ "",
+ "\n\n",
+ "
",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/tree.json b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/tree.json
new file mode 100644
index 00000000..75a9fb2c
--- /dev/null
+++ b/test/fixtures/ast/v-bind-same-name-shorthand07-camelcase/tree.json
@@ -0,0 +1,73 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " ",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":srcUrl",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":srcUrl",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "srcUrl",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "srcUrl",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "srcUrl",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-sequence-expression/ast.json b/test/fixtures/ast/v-bind-sequence-expression/ast.json
new file mode 100644
index 00000000..34ebd90b
--- /dev/null
+++ b/test/fixtures/ast/v-bind-sequence-expression/ast.json
@@ -0,0 +1,941 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "name": "a",
+ "rawName": "a"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 40,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 40,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 10,
+ "line": 3
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 11,
+ "line": 3
+ }
+ },
+ "name": "b",
+ "rawName": "b"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 43,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "expression": {
+ "type": "SequenceExpression",
+ "start": 45,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 45,
+ 50
+ ],
+ "expressions": [
+ {
+ "type": "Identifier",
+ "start": 45,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 45,
+ 47
+ ],
+ "name": "b1"
+ },
+ {
+ "type": "Identifier",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 48,
+ 50
+ ],
+ "name": "b2"
+ }
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 45,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 45,
+ 47
+ ],
+ "name": "b1"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 48,
+ 50
+ ],
+ "name": "b2"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 58,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 65,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "a1,a2"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 10,
+ "line": 3
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 11,
+ "line": 3
+ }
+ },
+ "value": "b"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 12
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 44,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 44,
+ 45
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b1",
+ "start": 45,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 45,
+ 47
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b2",
+ "start": 48,
+ "end": 50,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 48,
+ 50
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 50,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 50,
+ 51
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 5
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 58,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 65,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "Unexpected token ','.",
+ "index": 26,
+ "lineNumber": 2,
+ "column": 15
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-sequence-expression/source.vue b/test/fixtures/ast/v-bind-sequence-expression/source.vue
new file mode 100644
index 00000000..6086327b
--- /dev/null
+++ b/test/fixtures/ast/v-bind-sequence-expression/source.vue
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/fixtures/ast/v-bind-sequence-expression/token-ranges.json b/test/fixtures/ast/v-bind-sequence-expression/token-ranges.json
new file mode 100644
index 00000000..a771940f
--- /dev/null
+++ b/test/fixtures/ast/v-bind-sequence-expression/token-ranges.json
@@ -0,0 +1,27 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-sequence-expression/tree.json b/test/fixtures/ast/v-bind-sequence-expression/tree.json
new file mode 100644
index 00000000..53178f85
--- /dev/null
+++ b/test/fixtures/ast/v-bind-sequence-expression/tree.json
@@ -0,0 +1,116 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":a=\"a1,a2\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":a",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"a1,a2\"",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": ":b=\"(b1,b2)\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":b",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "b",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(b1,b2)\"",
+ "children": [
+ {
+ "type": "SequenceExpression",
+ "text": "b1,b2",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "b1",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b2",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-spread-element/ast.json b/test/fixtures/ast/v-bind-spread-element/ast.json
new file mode 100644
index 00000000..ab827027
--- /dev/null
+++ b/test/fixtures/ast/v-bind-spread-element/ast.json
@@ -0,0 +1,551 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "name": "a",
+ "rawName": "a"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 31,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 38,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 10,
+ "line": 2
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "...a1"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 38,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "Unexpected token '...'.",
+ "index": 24,
+ "lineNumber": 2,
+ "column": 13
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-spread-element/source.vue b/test/fixtures/ast/v-bind-spread-element/source.vue
new file mode 100644
index 00000000..9ef971d5
--- /dev/null
+++ b/test/fixtures/ast/v-bind-spread-element/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-bind-spread-element/token-ranges.json b/test/fixtures/ast/v-bind-spread-element/token-ranges.json
new file mode 100644
index 00000000..e6d99d75
--- /dev/null
+++ b/test/fixtures/ast/v-bind-spread-element/token-ranges.json
@@ -0,0 +1,17 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-bind-spread-element/tree.json b/test/fixtures/ast/v-bind-spread-element/tree.json
new file mode 100644
index 00000000..4fc8ad73
--- /dev/null
+++ b/test/fixtures/ast/v-bind-spread-element/tree.json
@@ -0,0 +1,72 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":a=\"...a1\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":a",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"...a1\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/ast.json b/test/fixtures/ast/v-for-directives-error-with-es5/ast.json
new file mode 100644
index 00000000..71d5f6fa
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error-with-es5/ast.json
@@ -0,0 +1,2684 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "script",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 38,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 43,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 43,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 48,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 54,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 63,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 74,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 74,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 79,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 99,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 105,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VText",
+ "range": [
+ 132,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 137,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 42
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 137,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 36
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 142,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 35
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 6
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 148,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 35
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 169,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 36
+ },
+ "end": {
+ "line": 6,
+ "column": 42
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 175,
+ 180
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 42
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 180,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 51
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 180,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 45
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 185,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 7,
+ "column": 44
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 185,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 185,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 7
+ },
+ "end": {
+ "column": 14,
+ "line": 7
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 191,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 44
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 221,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 45
+ },
+ "end": {
+ "line": 7,
+ "column": 51
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 227,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 51
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 232,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 232,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 237,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 237,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 237,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 8
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 243,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 265,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 37
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 271,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 43
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 276,
+ 309
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 37
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 276,
+ 303
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 281,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 281,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 281,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 9
+ },
+ "end": {
+ "column": 14,
+ "line": 9
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 287,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 303,
+ 309
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 37
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 309,
+ 314
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 37
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 314,
+ 358
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 48
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 314,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 42
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 319,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 41
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 319,
+ 324
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 319,
+ 324
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 10
+ },
+ "end": {
+ "column": 14,
+ "line": 10
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 325,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 10,
+ "column": 41
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 352,
+ 358
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 42
+ },
+ "end": {
+ "line": 10,
+ "column": 48
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 358,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 48
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 359,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 32,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 43,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 54,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "value": "in abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 63,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 74,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "value": "/**/ in abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 99,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 34
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 34
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 105,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 132,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 137,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 6
+ },
+ "end": {
+ "column": 14,
+ "line": 6
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 148,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 35
+ }
+ },
+ "value": "{key,name} in list"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 168,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 35
+ },
+ "end": {
+ "line": 6,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 169,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 36
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 175,
+ 180
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 42
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 180,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 185,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 7
+ },
+ "end": {
+ "column": 14,
+ "line": 7
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 14
+ },
+ "end": {
+ "line": 7,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 191,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 15
+ },
+ "end": {
+ "line": 7,
+ "column": 44
+ }
+ },
+ "value": "{key:key,name:name} in list"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 44
+ },
+ "end": {
+ "line": 7,
+ "column": 45
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 221,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 45
+ },
+ "end": {
+ "line": 7,
+ "column": 50
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 226,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 50
+ },
+ "end": {
+ "line": 7,
+ "column": 51
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 227,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 51
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 232,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 237,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 8
+ },
+ "end": {
+ "column": 14,
+ "line": 8
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 243,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 15
+ },
+ "end": {
+ "line": 8,
+ "column": 36
+ }
+ },
+ "value": "([a,,b], c) in list"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 36
+ },
+ "end": {
+ "line": 8,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 265,
+ 270
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 37
+ },
+ "end": {
+ "line": 8,
+ "column": 42
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 270,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 42
+ },
+ "end": {
+ "line": 8,
+ "column": 43
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 271,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 43
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 276,
+ 280
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 281,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 9
+ },
+ "end": {
+ "column": 14,
+ "line": 9
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 286,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 287,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "value": "[a,b] of list"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 302,
+ 303
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 303,
+ 308
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 308,
+ 309
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 36
+ },
+ "end": {
+ "line": 9,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 309,
+ 314
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 37
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 314,
+ 318
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 319,
+ 324
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 10
+ },
+ "end": {
+ "column": 14,
+ "line": 10
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 324,
+ 325
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 325,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 10,
+ "column": 41
+ }
+ },
+ "value": "{[z]:key=x,name} in list"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 41
+ },
+ "end": {
+ "line": 10,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 352,
+ 357
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 42
+ },
+ "end": {
+ "line": 10,
+ "column": 47
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 357,
+ 358
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 47
+ },
+ "end": {
+ "line": 10,
+ "column": 48
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 358,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 48
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 359,
+ 369
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 369,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 370,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "HTMLComment",
+ "range": [
+ 110,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "value": " destructuring "
+ }
+ ],
+ "errors": [
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 27,
+ "lineNumber": 2,
+ "column": 16
+ },
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 55,
+ "lineNumber": 3,
+ "column": 16
+ },
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 86,
+ "lineNumber": 4,
+ "column": 16
+ },
+ {
+ "message": "Unexpected token ,",
+ "index": 153,
+ "lineNumber": 6,
+ "column": 20
+ },
+ {
+ "message": "Unexpected token '{'.",
+ "index": 192,
+ "lineNumber": 7,
+ "column": 16
+ },
+ {
+ "message": "Unexpected token '['.",
+ "index": 245,
+ "lineNumber": 8,
+ "column": 17
+ },
+ {
+ "message": "Unexpected token '['.",
+ "index": 288,
+ "lineNumber": 9,
+ "column": 16
+ },
+ {
+ "message": "Unexpected token [",
+ "index": 327,
+ "lineNumber": 10,
+ "column": 17
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json b/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json
new file mode 100644
index 00000000..03c6610d
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "ecmaVersion": 5,
+ "sourceType": "script"
+}
diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/source.vue b/test/fixtures/ast/v-for-directives-error-with-es5/source.vue
new file mode 100644
index 00000000..a3df078d
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error-with-es5/source.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/token-ranges.json b/test/fixtures/ast/v-for-directives-error-with-es5/token-ranges.json
new file mode 100644
index 00000000..f8886fb1
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error-with-es5/token-ranges.json
@@ -0,0 +1,74 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/tree.json b/test/fixtures/ast/v-for-directives-error-with-es5/tree.json
new file mode 100644
index 00000000..eb14fbfa
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error-with-es5/tree.json
@@ -0,0 +1,380 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n
\n
\n \n
\n
\n
\n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"in abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"in abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"/**/ in abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"/**/ in abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"{key,name} in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{key,name} in list\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"{key:key,name:name} in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{key:key,name:name} in list\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"([a,,b], c) in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"([a,,b], c) in list\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"[a,b] of list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"[a,b] of list\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"{[z]:key=x,name} in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{[z]:key=x,name} in list\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error/ast.json b/test/fixtures/ast/v-for-directives-error/ast.json
new file mode 100644
index 00000000..9c9bf3fd
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error/ast.json
@@ -0,0 +1,1119 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 38,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 43,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 43,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 48,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 54,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 63,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 74,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 74,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 79,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "expression": null,
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 99,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 106,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 26,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 32,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 43,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 54,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "value": "in abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 63,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 74,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 79,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 85,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "value": "/**/ in abc"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 99,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 34
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 34
+ },
+ "end": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 106,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 27,
+ "lineNumber": 2,
+ "column": 16
+ },
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 55,
+ "lineNumber": 3,
+ "column": 16
+ },
+ {
+ "message": "Expected to be an alias, but got empty.",
+ "index": 86,
+ "lineNumber": 4,
+ "column": 16
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error/source.vue b/test/fixtures/ast/v-for-directives-error/source.vue
new file mode 100644
index 00000000..30b67ce2
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error/source.vue
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/test/fixtures/ast/v-for-directives-error/token-ranges.json b/test/fixtures/ast/v-for-directives-error/token-ranges.json
new file mode 100644
index 00000000..5426970b
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error/token-ranges.json
@@ -0,0 +1,32 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-error/tree.json b/test/fixtures/ast/v-for-directives-error/tree.json
new file mode 100644
index 00000000..35425b5e
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-error/tree.json
@@ -0,0 +1,155 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"in abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"in abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"/**/ in abc\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"/**/ in abc\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-index/ast.json b/test/fixtures/ast/v-for-directives-index/ast.json
new file mode 100644
index 00000000..df5c82af
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-index/ast.json
@@ -0,0 +1,815 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 26,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 27,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ],
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ],
+ "name": "index"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 41,
+ 45
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 41,
+ 45
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 47,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ],
+ "name": "index"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 54,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 29,
+ 30
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "index",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 38,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 38,
+ 40
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 41,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 41,
+ 45
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 47,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 54,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-index/source.vue b/test/fixtures/ast/v-for-directives-index/source.vue
new file mode 100644
index 00000000..946b61bf
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-index/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-for-directives-index/token-ranges.json b/test/fixtures/ast/v-for-directives-index/token-ranges.json
new file mode 100644
index 00000000..7bd55315
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-index/token-ranges.json
@@ -0,0 +1,24 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-index/tree.json b/test/fixtures/ast/v-for-directives-index/tree.json
new file mode 100644
index 00000000..a58a5eba
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-index/tree.json
@@ -0,0 +1,89 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"(a, index) in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(a, index) in list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "(a, index) in list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "index",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-destructuring/ast.json b/test/fixtures/ast/v-for-directives-with-destructuring/ast.json
index 67651818..b6ede250 100644
--- a/test/fixtures/ast/v-for-directives-with-destructuring/ast.json
+++ b/test/fixtures/ast/v-for-directives-with-destructuring/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
@@ -147,15 +147,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -250,7 +262,6 @@
],
"name": "key"
},
- "kind": "init",
"value": {
"type": "Identifier",
"start": 28,
@@ -270,7 +281,8 @@
31
],
"name": "key"
- }
+ },
+ "kind": "init"
},
{
"type": "Property",
@@ -313,7 +325,6 @@
],
"name": "name"
},
- "kind": "init",
"value": {
"type": "Identifier",
"start": 32,
@@ -333,7 +344,8 @@
36
],
"name": "name"
- }
+ },
+ "kind": "init"
}
]
}
@@ -543,15 +555,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 63,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -897,15 +921,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 107,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -1207,15 +1243,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 145,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 5
+ },
+ "end": {
+ "column": 14,
+ "line": 5
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -1412,7 +1460,6 @@
],
"name": "name"
},
- "kind": "init",
"value": {
"type": "Identifier",
"start": 163,
@@ -1432,7 +1479,8 @@
167
],
"name": "name"
- }
+ },
+ "kind": "init"
}
]
}
@@ -1462,69 +1510,69 @@
{
"id": {
"type": "Identifier",
- "start": 172,
- "end": 176,
+ "start": 154,
+ "end": 155,
"loc": {
"start": {
"line": 5,
- "column": 36
+ "column": 18
},
"end": {
"line": 5,
- "column": 40
+ "column": 19
}
},
"range": [
- 172,
- 176
+ 154,
+ 155
],
- "name": "list"
+ "name": "z"
},
"mode": "r"
},
{
"id": {
"type": "Identifier",
- "start": 154,
- "end": 155,
+ "start": 161,
+ "end": 162,
"loc": {
"start": {
"line": 5,
- "column": 18
+ "column": 25
},
"end": {
"line": 5,
- "column": 19
+ "column": 26
}
},
"range": [
- 154,
- 155
+ 161,
+ 162
],
- "name": "z"
+ "name": "x"
},
"mode": "r"
},
{
"id": {
"type": "Identifier",
- "start": 161,
- "end": 162,
+ "start": 172,
+ "end": 176,
"loc": {
"start": {
"line": 5,
- "column": 25
+ "column": 36
},
"end": {
"line": 5,
- "column": 26
+ "column": 40
}
},
"range": [
- 161,
- 162
+ 172,
+ 176
],
- "name": "x"
+ "name": "list"
},
"mode": "r"
}
@@ -1718,12 +1766,12 @@
],
"loc": {
"start": {
- "line": 2,
- "column": 9
+ "column": 9,
+ "line": 2
},
"end": {
- "line": 2,
- "column": 14
+ "column": 14,
+ "line": 2
}
},
"value": "v-for"
@@ -2020,12 +2068,12 @@
],
"loc": {
"start": {
- "line": 3,
- "column": 9
+ "column": 9,
+ "line": 3
},
"end": {
- "line": 3,
- "column": 14
+ "column": 14,
+ "line": 3
}
},
"value": "v-for"
@@ -2422,12 +2470,12 @@
],
"loc": {
"start": {
- "line": 4,
- "column": 9
+ "column": 9,
+ "line": 4
},
"end": {
- "line": 4,
- "column": 14
+ "column": 14,
+ "line": 4
}
},
"value": "v-for"
@@ -2724,12 +2772,12 @@
],
"loc": {
"start": {
- "line": 5,
- "column": 9
+ "column": 9,
+ "line": 5
},
"end": {
- "line": 5,
- "column": 14
+ "column": 14,
+ "line": 5
}
},
"value": "v-for"
diff --git a/test/fixtures/ast/v-for-directives-with-destructuring/tree.json b/test/fixtures/ast/v-for-directives-with-destructuring/tree.json
index b1acf785..17ba11d4 100644
--- a/test/fixtures/ast/v-for-directives-with-destructuring/tree.json
+++ b/test/fixtures/ast/v-for-directives-with-destructuring/tree.json
@@ -28,7 +28,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -116,7 +122,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -187,7 +199,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -253,7 +271,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/ast.json b/test/fixtures/ast/v-for-directives-with-es5-2/ast.json
new file mode 100644
index 00000000..242e4447
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5-2/ast.json
@@ -0,0 +1,1460 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "script",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 26,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 27,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ],
+ "name": "a"
+ },
+ null,
+ {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ],
+ "name": "b"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 37,
+ 41
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 37,
+ 41
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 43,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ],
+ "name": "b"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 49,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 54,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 54,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 59,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 59,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 59,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 65,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 66,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "a"
+ },
+ null,
+ {
+ "type": "Identifier",
+ "start": 70,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 70,
+ 71
+ ],
+ "name": "b"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 76,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 76,
+ 80
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 76,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 76,
+ 80
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 82,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 70,
+ 71
+ ],
+ "name": "b"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 38
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 89,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 28,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 28,
+ 29
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 29,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "range": [
+ 29,
+ 30
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 30,
+ 31
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 32,
+ 33
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 34,
+ 36
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 37,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 37,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 49,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 54,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 59,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 66,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 66,
+ 67
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 67,
+ "end": 68,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 67,
+ 68
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 68,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 69,
+ 70
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 70,
+ "end": 71,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 70,
+ 71
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 71,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 71,
+ 72
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "start": 73,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 73,
+ 75
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 76,
+ "end": 80,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 76,
+ 80
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 82,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 38
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json b/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json
new file mode 100644
index 00000000..03c6610d
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "ecmaVersion": 5,
+ "sourceType": "script"
+}
diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/source.vue b/test/fixtures/ast/v-for-directives-with-es5-2/source.vue
new file mode 100644
index 00000000..62baf98b
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5-2/source.vue
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/token-ranges.json b/test/fixtures/ast/v-for-directives-with-es5-2/token-ranges.json
new file mode 100644
index 00000000..08954e33
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5-2/token-ranges.json
@@ -0,0 +1,42 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/tree.json b/test/fixtures/ast/v-for-directives-with-es5-2/tree.json
new file mode 100644
index 00000000..41b74240
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5-2/tree.json
@@ -0,0 +1,155 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"(a,,b) in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(a,,b) in list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "(a,,b) in list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"(a,,b) of list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(a,,b) of list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "(a,,b) of list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-es5/ast.json b/test/fixtures/ast/v-for-directives-with-es5/ast.json
new file mode 100644
index 00000000..4672c8d4
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5/ast.json
@@ -0,0 +1,2544 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "script",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 20,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 26,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 27,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ],
+ "name": "a"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 32,
+ 36
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 32,
+ 36
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 38,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 44,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 49,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 49,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 54,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 60,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 61,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ],
+ "name": "b"
+ },
+ {
+ "type": "Identifier",
+ "start": 68,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ],
+ "name": "c"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 80,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ],
+ "name": "b"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 68,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ],
+ "name": "c"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 86,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 91,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 91,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 27
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 96,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 96,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 96,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 102,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 103,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 103,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 103,
+ 104
+ ],
+ "name": "a"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 108,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "range": [
+ 108,
+ 112
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 108,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "range": [
+ 108,
+ 112
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 114,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 103,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 103,
+ 104
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 120,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 33
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 125,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 125,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 130,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 130,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 130,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 5
+ },
+ "end": {
+ "column": 14,
+ "line": 5
+ }
+ },
+ "name": "for",
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 136,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "VForExpression",
+ "range": [
+ 137,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "left": [
+ {
+ "type": "Identifier",
+ "start": 138,
+ "end": 139,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "range": [
+ 138,
+ 139
+ ],
+ "name": "a"
+ },
+ {
+ "type": "Identifier",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ],
+ "name": "b"
+ },
+ {
+ "type": "Identifier",
+ "start": 144,
+ "end": 145,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 144,
+ 145
+ ],
+ "name": "c"
+ }
+ ],
+ "right": {
+ "type": "Identifier",
+ "start": 150,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "range": [
+ 150,
+ 154
+ ],
+ "name": "list"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 150,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "range": [
+ 150,
+ 154
+ ],
+ "name": "list"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 156,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 138,
+ "end": 139,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "range": [
+ 138,
+ 139
+ ],
+ "name": "a"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ],
+ "name": "b"
+ },
+ "kind": "v-for"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 144,
+ "end": 145,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 144,
+ 145
+ ],
+ "name": "c"
+ },
+ "kind": "v-for"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 163,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 27,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "range": [
+ 27,
+ 28
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 29,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "range": [
+ 29,
+ 31
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 32,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 32,
+ 36
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 38,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 44,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 49,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 61,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 61,
+ 62
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 63,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 63,
+ 64
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 66,
+ "end": 67,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 66,
+ 67
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "start": 68,
+ "end": 69,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 68,
+ 69
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 69,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 69,
+ 70
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "in",
+ "start": 71,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 71,
+ 73
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 80,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 40
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 86,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 91,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 96,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 103,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 103,
+ 104
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "start": 105,
+ "end": 107,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "range": [
+ 105,
+ 107
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 108,
+ "end": 112,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "range": [
+ 108,
+ 112
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 25
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 26
+ },
+ "end": {
+ "line": 4,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 114,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 119,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 120,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 33
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 125,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 130,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 5
+ },
+ "end": {
+ "column": 14,
+ "line": 5
+ }
+ },
+ "value": "v-for"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 137,
+ "end": 138,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 138,
+ "end": 139,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "range": [
+ 138,
+ 139
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 139,
+ "end": 140,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "range": [
+ 139,
+ 140
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 20
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ",",
+ "start": 142,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "range": [
+ 142,
+ 143
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "c",
+ "start": 144,
+ "end": 145,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 144,
+ 145
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 145,
+ "end": 146,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "range": [
+ 145,
+ 146
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "of",
+ "start": 147,
+ "end": 149,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "range": [
+ 147,
+ 149
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "list",
+ "start": 150,
+ "end": 154,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "range": [
+ 150,
+ 154
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 33
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 155,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 156,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 40
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 41
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 163,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 173,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-es5/parser-options.json b/test/fixtures/ast/v-for-directives-with-es5/parser-options.json
new file mode 100644
index 00000000..03c6610d
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5/parser-options.json
@@ -0,0 +1,4 @@
+{
+ "ecmaVersion": 5,
+ "sourceType": "script"
+}
diff --git a/test/fixtures/ast/v-for-directives-with-es5/source.vue b/test/fixtures/ast/v-for-directives-with-es5/source.vue
new file mode 100644
index 00000000..0a73ab28
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5/source.vue
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/test/fixtures/ast/v-for-directives-with-es5/token-ranges.json b/test/fixtures/ast/v-for-directives-with-es5/token-ranges.json
new file mode 100644
index 00000000..2a5a244b
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5/token-ranges.json
@@ -0,0 +1,68 @@
+[
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives-with-es5/tree.json b/test/fixtures/ast/v-for-directives-with-es5/tree.json
new file mode 100644
index 00000000..bcea2ca7
--- /dev/null
+++ b/test/fixtures/ast/v-for-directives-with-es5/tree.json
@@ -0,0 +1,287 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n
\n
\n
\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"a in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"a in list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "a in list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"(a, b, c) in list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(a, b, c) in list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "(a, b, c) in list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "c",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"a of list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"a of list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "a of list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-for=\"(a, b, c) of list\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-for",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"(a, b, c) of list\"",
+ "children": [
+ {
+ "type": "VForExpression",
+ "text": "(a, b, c) of list",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "b",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "c",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "list",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-for-directives/ast.json b/test/fixtures/ast/v-for-directives/ast.json
index f0fbd9d0..eb74e84d 100644
--- a/test/fixtures/ast/v-for-directives/ast.json
+++ b/test/fixtures/ast/v-for-directives/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
@@ -147,15 +147,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -393,15 +405,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -725,15 +749,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 96,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 14,
+ "line": 4
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -971,15 +1007,27 @@
"column": 14
}
},
- "name": "for",
- "argument": null,
- "modifiers": [],
- "shorthand": false,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 130,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 5
+ },
+ "end": {
+ "column": 14,
+ "line": 5
+ }
+ },
"name": "for",
- "argument": null,
- "modifiers": []
- }
+ "rawName": "for"
+ },
+ "argument": null,
+ "modifiers": []
},
"value": {
"type": "VExpressionContainer",
@@ -1333,12 +1381,12 @@
],
"loc": {
"start": {
- "line": 2,
- "column": 9
+ "column": 9,
+ "line": 2
},
"end": {
- "line": 2,
- "column": 14
+ "column": 14,
+ "line": 2
}
},
"value": "v-for"
@@ -1555,12 +1603,12 @@
],
"loc": {
"start": {
- "line": 3,
- "column": 9
+ "column": 9,
+ "line": 3
},
"end": {
- "line": 3,
- "column": 14
+ "column": 14,
+ "line": 3
}
},
"value": "v-for"
@@ -1897,12 +1945,12 @@
],
"loc": {
"start": {
- "line": 4,
- "column": 9
+ "column": 9,
+ "line": 4
},
"end": {
- "line": 4,
- "column": 14
+ "column": 14,
+ "line": 4
}
},
"value": "v-for"
@@ -2119,12 +2167,12 @@
],
"loc": {
"start": {
- "line": 5,
- "column": 9
+ "column": 9,
+ "line": 5
},
"end": {
- "line": 5,
- "column": 14
+ "column": 14,
+ "line": 5
}
},
"value": "v-for"
diff --git a/test/fixtures/ast/v-for-directives/tree.json b/test/fixtures/ast/v-for-directives/tree.json
index 740b87d0..bcea2ca7 100644
--- a/test/fixtures/ast/v-for-directives/tree.json
+++ b/test/fixtures/ast/v-for-directives/tree.json
@@ -28,7 +28,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -83,7 +89,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -148,7 +160,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
@@ -203,7 +221,13 @@
{
"type": "VDirectiveKey",
"text": "v-for",
- "children": []
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-for",
+ "children": []
+ }
+ ]
},
{
"type": "VExpressionContainer",
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json b/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json
new file mode 100644
index 00000000..e96836d7
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json
@@ -0,0 +1,770 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 31,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 31,
+ 42
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "CallExpression",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ],
+ "name": "act"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ],
+ "name": "act"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 44,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 54,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 32,
+ "end": 33,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "range": [
+ 32,
+ 33
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "start": 34,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 34,
+ 36
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "act",
+ "start": 37,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 37,
+ 40
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 44,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 54,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.1/source.vue b/test/fixtures/ast/v-on-arrow-function-expression.1/source.vue
new file mode 100644
index 00000000..6306dab3
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.1/source.vue
@@ -0,0 +1,3 @@
+
+ act()">
+
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.1/token-ranges.json b/test/fixtures/ast/v-on-arrow-function-expression.1/token-ranges.json
new file mode 100644
index 00000000..630e4ba5
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.1/token-ranges.json
@@ -0,0 +1,24 @@
+[
+ "
",
+ "\n ",
+ "",
+ "act",
+ "(",
+ ")",
+ "\"",
+ ">",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.1/tree.json b/test/fixtures/ast/v-on-arrow-function-expression.1/tree.json
new file mode 100644
index 00000000..8d3c84d3
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.1/tree.json
@@ -0,0 +1,90 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n act()\"> \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " act()\"> ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " act()\">",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"() => act()\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"() => act()\"",
+ "children": [
+ {
+ "type": "ArrowFunctionExpression",
+ "text": "() => act()",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "act",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json b/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json
new file mode 100644
index 00000000..79b19281
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json
@@ -0,0 +1,771 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 31,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 31,
+ 41
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": false,
+ "params": [
+ {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ],
+ "name": "e"
+ }
+ ],
+ "body": {
+ "type": "CallExpression",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 36,
+ 39
+ ],
+ "name": "act"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 36,
+ 39
+ ],
+ "name": "act"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 43,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 53,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "e",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "start": 33,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 33,
+ 35
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "act",
+ "start": 36,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 36,
+ 39
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 39,
+ 40
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 53,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.2/source.vue b/test/fixtures/ast/v-on-arrow-function-expression.2/source.vue
new file mode 100644
index 00000000..9b6a0735
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.2/source.vue
@@ -0,0 +1,3 @@
+
+ act()">
+
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.2/token-ranges.json b/test/fixtures/ast/v-on-arrow-function-expression.2/token-ranges.json
new file mode 100644
index 00000000..1643e5c7
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.2/token-ranges.json
@@ -0,0 +1,23 @@
+[
+ "
",
+ "\n ",
+ "",
+ "act",
+ "(",
+ ")",
+ "\"",
+ ">",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-arrow-function-expression.2/tree.json b/test/fixtures/ast/v-on-arrow-function-expression.2/tree.json
new file mode 100644
index 00000000..3329c8d7
--- /dev/null
+++ b/test/fixtures/ast/v-on-arrow-function-expression.2/tree.json
@@ -0,0 +1,95 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n act()\"> \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " act()\"> ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " act()\">",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"e => act()\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"e => act()\"",
+ "children": [
+ {
+ "type": "ArrowFunctionExpression",
+ "text": "e => act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "e",
+ "children": []
+ },
+ {
+ "type": "CallExpression",
+ "text": "act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "act",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json b/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json
new file mode 100644
index 00000000..76c9ea47
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json
@@ -0,0 +1,829 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "ArrowFunctionExpression",
+ "start": 31,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "range": [
+ 31,
+ 54
+ ],
+ "id": null,
+ "expression": true,
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "AwaitExpression",
+ "start": 43,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "range": [
+ 43,
+ 54
+ ],
+ "argument": {
+ "type": "CallExpression",
+ "start": 49,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "range": [
+ 49,
+ 54
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 49,
+ 52
+ ],
+ "name": "act"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 49,
+ 52
+ ],
+ "name": "act"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 56,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 66,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "async",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 37,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 37,
+ 38
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 38,
+ 39
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "=>",
+ "start": 40,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 40,
+ 42
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "start": 43,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 43,
+ 48
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "act",
+ "start": 49,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "range": [
+ 49,
+ 52
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 52,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "range": [
+ 52,
+ 53
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 53,
+ "end": 54,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 44
+ },
+ "end": {
+ "line": 2,
+ "column": 45
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 56,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 53
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 66,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-arrow-function-expression/source.vue b/test/fixtures/ast/v-on-async-arrow-function-expression/source.vue
new file mode 100644
index 00000000..9cdad449
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-arrow-function-expression/source.vue
@@ -0,0 +1,3 @@
+
+ await act()">
+
diff --git a/test/fixtures/ast/v-on-async-arrow-function-expression/token-ranges.json b/test/fixtures/ast/v-on-async-arrow-function-expression/token-ranges.json
new file mode 100644
index 00000000..032294ca
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-arrow-function-expression/token-ranges.json
@@ -0,0 +1,26 @@
+[
+ "
",
+ "\n ",
+ "",
+ "await",
+ "act",
+ "(",
+ ")",
+ "\"",
+ ">",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-arrow-function-expression/tree.json b/test/fixtures/ast/v-on-async-arrow-function-expression/tree.json
new file mode 100644
index 00000000..d272edfa
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-arrow-function-expression/tree.json
@@ -0,0 +1,96 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n await act()\"> \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " await act()\"> ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": " await act()\">",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"async () => await act()\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"async () => await act()\"",
+ "children": [
+ {
+ "type": "ArrowFunctionExpression",
+ "text": "async () => await act()",
+ "children": [
+ {
+ "type": "AwaitExpression",
+ "text": "await act()",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "act",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-function-expression/ast.json b/test/fixtures/ast/v-on-async-function-expression/ast.json
new file mode 100644
index 00000000..af3d12eb
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-function-expression/ast.json
@@ -0,0 +1,909 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 31,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "range": [
+ 31,
+ 63
+ ],
+ "id": null,
+ "expression": false,
+ "generator": false,
+ "async": true,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 48,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "range": [
+ 48,
+ 63
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 50,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "range": [
+ 50,
+ 61
+ ],
+ "expression": {
+ "type": "AwaitExpression",
+ "start": 50,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "range": [
+ 50,
+ 61
+ ],
+ "argument": {
+ "type": "CallExpression",
+ "start": 56,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "range": [
+ 56,
+ 61
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 48
+ }
+ },
+ "range": [
+ 56,
+ 59
+ ],
+ "name": "act"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ }
+ ]
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 56,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 48
+ }
+ },
+ "range": [
+ 56,
+ 59
+ ],
+ "name": "act"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 65,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 63
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 75,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "async",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ]
+ },
+ {
+ "type": "Keyword",
+ "value": "function",
+ "start": 37,
+ "end": 45,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "range": [
+ 37,
+ 45
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 45,
+ 46
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 46,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "range": [
+ 48,
+ 49
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "await",
+ "start": 50,
+ "end": 55,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 2,
+ "column": 44
+ }
+ },
+ "range": [
+ 50,
+ 55
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "act",
+ "start": 56,
+ "end": 59,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 45
+ },
+ "end": {
+ "line": 2,
+ "column": 48
+ }
+ },
+ "range": [
+ 56,
+ 59
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 59,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 48
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "range": [
+ 59,
+ 60
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 60,
+ "end": 61,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 49
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "range": [
+ 60,
+ 61
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 62,
+ "end": 63,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 51
+ },
+ "end": {
+ "line": 2,
+ "column": 52
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 52
+ },
+ "end": {
+ "line": 2,
+ "column": 53
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 53
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 65,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 62
+ },
+ "end": {
+ "line": 2,
+ "column": 63
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 63
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 75,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-function-expression/source.vue b/test/fixtures/ast/v-on-async-function-expression/source.vue
new file mode 100644
index 00000000..fb86873b
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-function-expression/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-async-function-expression/token-ranges.json b/test/fixtures/ast/v-on-async-function-expression/token-ranges.json
new file mode 100644
index 00000000..77fdd025
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-function-expression/token-ranges.json
@@ -0,0 +1,28 @@
+[
+ "
",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-async-function-expression/tree.json b/test/fixtures/ast/v-on-async-function-expression/tree.json
new file mode 100644
index 00000000..5fdf6e87
--- /dev/null
+++ b/test/fixtures/ast/v-on-async-function-expression/tree.json
@@ -0,0 +1,108 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"async function() { await act() }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"async function() { await act() }\"",
+ "children": [
+ {
+ "type": "FunctionExpression",
+ "text": "async function() { await act() }",
+ "children": [
+ {
+ "type": "BlockStatement",
+ "text": "{ await act() }",
+ "children": [
+ {
+ "type": "ExpressionStatement",
+ "text": "await act()",
+ "children": [
+ {
+ "type": "AwaitExpression",
+ "text": "await act()",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "act",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-function-expression/ast.json b/test/fixtures/ast/v-on-function-expression/ast.json
new file mode 100644
index 00000000..946439ac
--- /dev/null
+++ b/test/fixtures/ast/v-on-function-expression/ast.json
@@ -0,0 +1,850 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 51
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "FunctionExpression",
+ "start": 31,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 31,
+ 51
+ ],
+ "id": null,
+ "expression": false,
+ "generator": false,
+ "async": false,
+ "params": [],
+ "body": {
+ "type": "BlockStatement",
+ "start": 42,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 42,
+ 51
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 44,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "range": [
+ 44,
+ 49
+ ],
+ "expression": {
+ "type": "CallExpression",
+ "start": 44,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "range": [
+ 44,
+ 49
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "range": [
+ 44,
+ 47
+ ],
+ "name": "act"
+ },
+ "arguments": [],
+ "optional": false
+ }
+ }
+ ]
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "range": [
+ 44,
+ 47
+ ],
+ "name": "act"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 53,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 51
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 63,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Keyword",
+ "value": "function",
+ "start": 31,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 31,
+ 39
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 39,
+ 40
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ },
+ "range": [
+ 42,
+ 43
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "act",
+ "start": 44,
+ "end": 47,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "range": [
+ 44,
+ 47
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "range": [
+ 48,
+ 49
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 50,
+ "end": 51,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 2,
+ "column": 40
+ }
+ },
+ "range": [
+ 50,
+ 51
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 40
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 53,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 51
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 63,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-function-expression/source.vue b/test/fixtures/ast/v-on-function-expression/source.vue
new file mode 100644
index 00000000..32d06fd1
--- /dev/null
+++ b/test/fixtures/ast/v-on-function-expression/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-function-expression/token-ranges.json b/test/fixtures/ast/v-on-function-expression/token-ranges.json
new file mode 100644
index 00000000..f2877139
--- /dev/null
+++ b/test/fixtures/ast/v-on-function-expression/token-ranges.json
@@ -0,0 +1,26 @@
+[
+ "
",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-function-expression/tree.json b/test/fixtures/ast/v-on-function-expression/tree.json
new file mode 100644
index 00000000..36bb3bd0
--- /dev/null
+++ b/test/fixtures/ast/v-on-function-expression/tree.json
@@ -0,0 +1,102 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"function() { act() }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"function() { act() }\"",
+ "children": [
+ {
+ "type": "FunctionExpression",
+ "text": "function() { act() }",
+ "children": [
+ {
+ "type": "BlockStatement",
+ "text": "{ act() }",
+ "children": [
+ {
+ "type": "ExpressionStatement",
+ "text": "act()",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "act()",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "act",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-multiple-statements/ast.json b/test/fixtures/ast/v-on-multiple-statements/ast.json
index 0b6da07f..9b285e71 100644
--- a/test/fixtures/ast/v-on-multiple-statements/ast.json
+++ b/test/fixtures/ast/v-on-multiple-statements/ast.json
@@ -17,7 +17,7 @@
0
],
"body": [],
- "sourceType": "script",
+ "sourceType": "module",
"comments": [],
"tokens": [],
"templateBody": {
@@ -147,19 +147,65 @@
"column": 21
}
},
- "name": "on",
- "argument": "click",
- "modifiers": [
- "prevent"
- ],
- "shorthand": true,
- "raw": {
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 2
+ },
+ "end": {
+ "column": 8,
+ "line": 2
+ }
+ },
"name": "on",
- "argument": "click",
- "modifiers": [
- "prevent"
- ]
- }
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": [
+ {
+ "type": "VIdentifier",
+ "range": [
+ 25,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "column": 14,
+ "line": 2
+ },
+ "end": {
+ "column": 21,
+ "line": 2
+ }
+ },
+ "name": "prevent",
+ "rawName": "prevent"
+ }
+ ]
},
"value": {
"type": "VExpressionContainer",
@@ -272,7 +318,8 @@
"value": "DIR",
"raw": "'DIR'"
}
- ]
+ ],
+ "optional": false
}
},
{
@@ -353,7 +400,8 @@
"value": "uploadFile",
"raw": "'uploadFile'"
}
- ]
+ ],
+ "optional": false
}
}
]
@@ -747,22 +795,76 @@
"value": "a"
},
{
- "type": "HTMLIdentifier",
+ "type": "Punctuator",
"range": [
18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "column": 7,
+ "line": 2
+ },
+ "end": {
+ "column": 8,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 14,
+ "line": 2
+ }
+ },
+ "value": "."
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 25,
32
],
"loc": {
"start": {
- "line": 2,
- "column": 7
+ "column": 14,
+ "line": 2
},
"end": {
- "line": 2,
- "column": 21
+ "column": 21,
+ "line": 2
}
},
- "value": "@click.prevent"
+ "value": "prevent"
},
{
"type": "HTMLAssociation",
diff --git a/test/fixtures/ast/v-on-multiple-statements/token-ranges.json b/test/fixtures/ast/v-on-multiple-statements/token-ranges.json
index 70c0c4c1..372eb7ce 100644
--- a/test/fixtures/ast/v-on-multiple-statements/token-ranges.json
+++ b/test/fixtures/ast/v-on-multiple-statements/token-ranges.json
@@ -3,7 +3,10 @@
">",
"\n ",
"
+
+
diff --git a/test/fixtures/ast/v-on-object-expression/token-ranges.json b/test/fixtures/ast/v-on-object-expression/token-ranges.json
new file mode 100644
index 00000000..4a1bda42
--- /dev/null
+++ b/test/fixtures/ast/v-on-object-expression/token-ranges.json
@@ -0,0 +1,26 @@
+[
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-object-expression/tree.json b/test/fixtures/ast/v-on-object-expression/tree.json
new file mode 100644
index 00000000..bfedacf6
--- /dev/null
+++ b/test/fixtures/ast/v-on-object-expression/tree.json
@@ -0,0 +1,106 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-on=\"{mousedown: down, mouseup: up}\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-on",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-on",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{mousedown: down, mouseup: up}\"",
+ "children": [
+ {
+ "type": "ObjectExpression",
+ "text": "{mousedown: down, mouseup: up}",
+ "children": [
+ {
+ "type": "Property",
+ "text": "mousedown: down",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "mousedown",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "down",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "Property",
+ "text": "mouseup: up",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "mouseup",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "up",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.1/ast.json b/test/fixtures/ast/v-on-simple-path.1/ast.json
new file mode 100644
index 00000000..8a1e525d
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.1/ast.json
@@ -0,0 +1,625 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 36,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 46,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 46,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.1/source.vue b/test/fixtures/ast/v-on-simple-path.1/source.vue
new file mode 100644
index 00000000..720524e9
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.1/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-simple-path.1/token-ranges.json b/test/fixtures/ast/v-on-simple-path.1/token-ranges.json
new file mode 100644
index 00000000..9c0317c1
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.1/token-ranges.json
@@ -0,0 +1,19 @@
+[
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.1/tree.json b/test/fixtures/ast/v-on-simple-path.1/tree.json
new file mode 100644
index 00000000..cce72880
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.1/tree.json
@@ -0,0 +1,78 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"foo\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.2/ast.json b/test/fixtures/ast/v-on-simple-path.2/ast.json
new file mode 100644
index 00000000..71f7779c
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.2/ast.json
@@ -0,0 +1,706 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 31,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 31,
+ 38
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 35,
+ 38
+ ],
+ "name": "bar"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 40,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 50,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 34,
+ 35
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "bar",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 35,
+ 38
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 40,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 50,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.2/source.vue b/test/fixtures/ast/v-on-simple-path.2/source.vue
new file mode 100644
index 00000000..6ace14dc
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.2/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-simple-path.2/token-ranges.json b/test/fixtures/ast/v-on-simple-path.2/token-ranges.json
new file mode 100644
index 00000000..fee44eff
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.2/token-ranges.json
@@ -0,0 +1,21 @@
+[
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.2/tree.json b/test/fixtures/ast/v-on-simple-path.2/tree.json
new file mode 100644
index 00000000..9f0ba681
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.2/tree.json
@@ -0,0 +1,89 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"foo.bar\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo.bar\"",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "foo.bar",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "bar",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.3/ast.json b/test/fixtures/ast/v-on-simple-path.3/ast.json
new file mode 100644
index 00000000..1ac5a8d2
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.3/ast.json
@@ -0,0 +1,1075 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 31,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 31,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 3
+ },
+ "end": {
+ "column": 9,
+ "line": 3
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 32,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 38,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 39,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 39,
+ 49
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 39,
+ 42
+ ],
+ "name": "foo"
+ },
+ "property": {
+ "type": "Literal",
+ "start": 43,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 43,
+ 48
+ ],
+ "value": "bar",
+ "raw": "'bar'"
+ },
+ "computed": true,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 39,
+ 42
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 59,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 59,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 4
+ },
+ "end": {
+ "column": 9,
+ "line": 4
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 60,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 16,
+ "line": 4
+ }
+ },
+ "name": "keydown",
+ "rawName": "keydown"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 68,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 69,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "range": [
+ 69,
+ 75
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "range": [
+ 69,
+ 72
+ ],
+ "name": "foo"
+ },
+ "property": {
+ "type": "Literal",
+ "start": 73,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": 0,
+ "raw": "0"
+ },
+ "computed": true,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 69,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "range": [
+ 69,
+ 72
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 82,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 92,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 3
+ },
+ "end": {
+ "column": 9,
+ "line": 3
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 32,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 39,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 39,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 42,
+ 43
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'bar'",
+ "start": 43,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 43,
+ 48
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "start": 48,
+ "end": 49,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 48,
+ 49
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 4
+ },
+ "end": {
+ "column": 9,
+ "line": 4
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 4
+ },
+ "end": {
+ "column": 16,
+ "line": 4
+ }
+ },
+ "value": "keydown"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 67,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 69,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "range": [
+ 69,
+ 72
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "start": 72,
+ "end": 73,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "range": [
+ 72,
+ 73
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "0",
+ "start": 73,
+ "end": 74,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "start": 74,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 82,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 92,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.3/source.vue b/test/fixtures/ast/v-on-simple-path.3/source.vue
new file mode 100644
index 00000000..cc83915b
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.3/source.vue
@@ -0,0 +1,6 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-simple-path.3/token-ranges.json b/test/fixtures/ast/v-on-simple-path.3/token-ranges.json
new file mode 100644
index 00000000..015cadf2
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.3/token-ranges.json
@@ -0,0 +1,31 @@
+[
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.3/tree.json b/test/fixtures/ast/v-on-simple-path.3/tree.json
new file mode 100644
index 00000000..9123e88e
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.3/tree.json
@@ -0,0 +1,133 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"foo['bar']\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo['bar']\"",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "foo['bar']",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Literal",
+ "text": "'bar'",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "@keydown=\"foo[0]\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@keydown",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "keydown",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo[0]\"",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "foo[0]",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Literal",
+ "text": "0",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.4/ast.json b/test/fixtures/ast/v-on-simple-path.4/ast.json
new file mode 100644
index 00000000..5dd52cb6
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.4/ast.json
@@ -0,0 +1,749 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "name": "button",
+ "rawName": "button",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 23,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "name": "on",
+ "rawName": "@"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "name": "click",
+ "rawName": "click"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 30,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 31,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 31,
+ 39
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 35,
+ 38
+ ],
+ "name": "bar"
+ },
+ "computed": true,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 35,
+ 38
+ ],
+ "name": "bar"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 41,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 51,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "column": 12,
+ "line": 2
+ },
+ "end": {
+ "column": 13,
+ "line": 2
+ }
+ },
+ "value": "@"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "column": 13,
+ "line": 2
+ },
+ "end": {
+ "column": 18,
+ "line": 2
+ }
+ },
+ "value": "click"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 31,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "range": [
+ 31,
+ 34
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "start": 34,
+ "end": 35,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 34,
+ 35
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "bar",
+ "start": 35,
+ "end": 38,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "range": [
+ 35,
+ 38
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "range": [
+ 38,
+ 39
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 41,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": "button"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 51,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.4/source.vue b/test/fixtures/ast/v-on-simple-path.4/source.vue
new file mode 100644
index 00000000..561289e5
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.4/source.vue
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/fixtures/ast/v-on-simple-path.4/token-ranges.json b/test/fixtures/ast/v-on-simple-path.4/token-ranges.json
new file mode 100644
index 00000000..b4c3872f
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.4/token-ranges.json
@@ -0,0 +1,22 @@
+[
+ "",
+ "\n ",
+ "",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-on-simple-path.4/tree.json b/test/fixtures/ast/v-on-simple-path.4/tree.json
new file mode 100644
index 00000000..8f5ceab5
--- /dev/null
+++ b/test/fixtures/ast/v-on-simple-path.4/tree.json
@@ -0,0 +1,89 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "@click=\"foo[bar]\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "@click",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "@",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "click",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"foo[bar]\"",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "foo[bar]",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "bar",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-pre/ast.json b/test/fixtures/ast/v-pre/ast.json
new file mode 100644
index 00000000..04772d33
--- /dev/null
+++ b/test/fixtures/ast/v-pre/ast.json
@@ -0,0 +1,1257 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 17,
+ 18
+ ],
+ "name": "a"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 17,
+ 18
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 25,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 25,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 30,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 30,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": ":attr",
+ "rawName": ":attr"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 36,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "a"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 40,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 40,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 40,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "column": 19,
+ "line": 3
+ },
+ "end": {
+ "column": 24,
+ "line": 3
+ }
+ },
+ "name": "pre",
+ "rawName": "pre"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 46,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n {{a}}\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 69,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 69,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 23
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 74,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 74,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "name": ":attr",
+ "rawName": ":attr"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 80,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": "a"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 84,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "{{a}}"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 89,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 95,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 100,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 106,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 111,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 113,
+ "end": 114,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "range": [
+ 113,
+ 114
+ ],
+ "name": "a"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 113,
+ "end": 114,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "range": [
+ 113,
+ 114
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 117,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 15,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 17,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "range": [
+ 17,
+ 18
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 18,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 25,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 30,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": ":attr"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 36,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 40,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "column": 19,
+ "line": 3
+ },
+ "end": {
+ "column": 24,
+ "line": 3
+ }
+ },
+ "value": "v-pre"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 55,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "{{a}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 69,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 74,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 13
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": ":attr"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 80,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 83,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 5,
+ "column": 23
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 84,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "{{a}}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 33
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 95,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 100,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 106,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 111,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 6
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 113,
+ "end": 114,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 7
+ }
+ },
+ "range": [
+ 113,
+ 114
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 114,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 117,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-pre/source.vue b/test/fixtures/ast/v-pre/source.vue
new file mode 100644
index 00000000..64ee40a7
--- /dev/null
+++ b/test/fixtures/ast/v-pre/source.vue
@@ -0,0 +1,8 @@
+
+ {{a}}
+
+ {{a}}
+
diff --git a/test/fixtures/ast/v-pre/token-ranges.json b/test/fixtures/ast/v-pre/token-ranges.json
new file mode 100644
index 00000000..cb63475b
--- /dev/null
+++ b/test/fixtures/ast/v-pre/token-ranges.json
@@ -0,0 +1,37 @@
+[
+ "",
+ "\n ",
+ "{{",
+ "a",
+ "}}",
+ "\n ",
+ "",
+ "\n ",
+ "{{a}}",
+ "\n ",
+ "
",
+ "{{a}}",
+ "
",
+ "\n ",
+ "
",
+ "\n ",
+ "{{",
+ "a",
+ "}}",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-pre/tree.json b/test/fixtures/ast/v-pre/tree.json
new file mode 100644
index 00000000..d6910dc5
--- /dev/null
+++ b/test/fixtures/ast/v-pre/tree.json
@@ -0,0 +1,158 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n {{a}}\n \n {{a}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{a}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":attr=\"a\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":attr",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"a\"",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "v-pre",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-pre",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-pre",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n {{a}}\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
{{a}}
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":attr=\"a\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":attr",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"a\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "{{a}}",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{a}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "a",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default-shorthand/ast.json b/test/fixtures/ast/v-slot-default-shorthand/ast.json
new file mode 100644
index 00000000..fc107094
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default-shorthand/ast.json
@@ -0,0 +1,939 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 31,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 31,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "column": 20,
+ "line": 2
+ },
+ "end": {
+ "column": 21,
+ "line": 2
+ }
+ },
+ "name": "slot",
+ "rawName": "#"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 32,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 21,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "name": "default",
+ "rawName": "default"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 40,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 41,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 41,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 41,
+ 48
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 43,
+ 46
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 43,
+ 46
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 43,
+ 46
+ ],
+ "name": "foo"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 50,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 59,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 66,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 71,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 43,
+ 46
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 89,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "column": 20,
+ "line": 2
+ },
+ "end": {
+ "column": 21,
+ "line": 2
+ }
+ },
+ "value": "#"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 32,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "column": 21,
+ "line": 2
+ },
+ "end": {
+ "column": 28,
+ "line": 2
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 43,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 43,
+ 46
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 48,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 39
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 59,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 64,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 66,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 71,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default-shorthand/source.vue b/test/fixtures/ast/v-slot-default-shorthand/source.vue
new file mode 100644
index 00000000..89ac0ded
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default-shorthand/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{foo}}
+
+
diff --git a/test/fixtures/ast/v-slot-default-shorthand/token-ranges.json b/test/fixtures/ast/v-slot-default-shorthand/token-ranges.json
new file mode 100644
index 00000000..cb3a45d3
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default-shorthand/token-ranges.json
@@ -0,0 +1,26 @@
+[
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "foo",
+ "}}",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default-shorthand/tree.json b/test/fixtures/ast/v-slot-default-shorthand/tree.json
new file mode 100644
index 00000000..97b3b916
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default-shorthand/tree.json
@@ -0,0 +1,122 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n {{foo}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "#default=\"{ foo }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "#default",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "#",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "default",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{ foo }\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "ObjectPattern",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "Property",
+ "text": "foo",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default/ast.json b/test/fixtures/ast/v-slot-default/ast.json
new file mode 100644
index 00000000..38fcf4da
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default/ast.json
@@ -0,0 +1,903 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 31,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 31,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 31,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "column": 20,
+ "line": 2
+ },
+ "end": {
+ "column": 26,
+ "line": 2
+ }
+ },
+ "name": "slot",
+ "rawName": "slot"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 38,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 39,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 39,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 39,
+ 46
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ],
+ "name": "foo"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 48,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 57,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 59,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 59,
+ 62
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 59,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 59,
+ 62
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 69,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 87,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 31,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "column": 20,
+ "line": 2
+ },
+ "end": {
+ "column": 26,
+ "line": 2
+ }
+ },
+ "value": "v-slot"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 39,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "range": [
+ 39,
+ 40
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 41,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ },
+ "range": [
+ 41,
+ 44
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "range": [
+ 45,
+ 46
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 57,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 59,
+ "end": 62,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 59,
+ 62
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 62,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 13
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 69,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 20
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 87,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default/source.vue b/test/fixtures/ast/v-slot-default/source.vue
new file mode 100644
index 00000000..a18713c5
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default/source.vue
@@ -0,0 +1,5 @@
+
+
+ {{foo}}
+
+
diff --git a/test/fixtures/ast/v-slot-default/token-ranges.json b/test/fixtures/ast/v-slot-default/token-ranges.json
new file mode 100644
index 00000000..b62c5516
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default/token-ranges.json
@@ -0,0 +1,25 @@
+[
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "foo",
+ "}}",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-default/tree.json b/test/fixtures/ast/v-slot-default/tree.json
new file mode 100644
index 00000000..709e05b1
--- /dev/null
+++ b/test/fixtures/ast/v-slot-default/tree.json
@@ -0,0 +1,117 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n {{foo}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-slot=\"{ foo }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-slot",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-slot",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{ foo }\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "ObjectPattern",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "Property",
+ "text": "foo",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named-shorthand/ast.json b/test/fixtures/ast/v-slot-named-shorthand/ast.json
new file mode 100644
index 00000000..f7004d68
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named-shorthand/ast.json
@@ -0,0 +1,1142 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 50,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 50,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 3
+ },
+ "end": {
+ "column": 19,
+ "line": 3
+ }
+ },
+ "name": "slot",
+ "rawName": "#"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 51,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "column": 19,
+ "line": 3
+ },
+ "end": {
+ "column": 25,
+ "line": 3
+ }
+ },
+ "name": "header",
+ "rawName": "header"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 58,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 59,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 59,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 59,
+ 66
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "name": "foo"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 68,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 81,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 83,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 83,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 88,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 97,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 108,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 113,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 130,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 131,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 3
+ },
+ "end": {
+ "column": 19,
+ "line": 3
+ }
+ },
+ "value": "#"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 51,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "column": 19,
+ "line": 3
+ },
+ "end": {
+ "column": 25,
+ "line": 3
+ }
+ },
+ "value": "header"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 59,
+ "end": 60,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 59,
+ 60
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 61,
+ "end": 64,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 34
+ },
+ "end": {
+ "line": 3,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 67,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 68,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 81,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 83,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 86,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 97,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 113,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 130,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 131,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 141,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 142,
+ 143
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named-shorthand/source.vue b/test/fixtures/ast/v-slot-named-shorthand/source.vue
new file mode 100644
index 00000000..24e2f0e1
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named-shorthand/source.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{foo}}
+
+
+
diff --git a/test/fixtures/ast/v-slot-named-shorthand/token-ranges.json b/test/fixtures/ast/v-slot-named-shorthand/token-ranges.json
new file mode 100644
index 00000000..f9c02638
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named-shorthand/token-ranges.json
@@ -0,0 +1,32 @@
+[
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "foo",
+ "}}",
+ "\n ",
+ " ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named-shorthand/tree.json b/test/fixtures/ast/v-slot-named-shorthand/tree.json
new file mode 100644
index 00000000..63d06ade
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named-shorthand/tree.json
@@ -0,0 +1,148 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n \n {{foo}}\n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n {{foo}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "#header=\"{ foo }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "#header",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "#",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "header",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{ foo }\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "ObjectPattern",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "Property",
+ "text": "foo",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named/ast.json b/test/fixtures/ast/v-slot-named/ast.json
new file mode 100644
index 00000000..1c337d08
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named/ast.json
@@ -0,0 +1,1160 @@
+{
+ "type": "Program",
+ "start": 0,
+ "end": 0,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 0
+ }
+ },
+ "range": [
+ 0,
+ 0
+ ],
+ "body": [],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [],
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 0,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "name": "test-component",
+ "rawName": "test-component",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 40,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 40,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 50,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 50,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 50,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 3
+ },
+ "end": {
+ "column": 24,
+ "line": 3
+ }
+ },
+ "name": "slot",
+ "rawName": "slot"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 57,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "column": 25,
+ "line": 3
+ },
+ "end": {
+ "column": 31,
+ "line": 3
+ }
+ },
+ "name": "header",
+ "rawName": "header"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 64,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "VSlotScopeExpression",
+ "range": [
+ 65,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "params": [
+ {
+ "type": "ObjectPattern",
+ "start": 65,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "range": [
+ 65,
+ 72
+ ],
+ "properties": [
+ {
+ "type": "Property",
+ "start": 67,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 67,
+ 70
+ ],
+ "method": false,
+ "shorthand": true,
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 67,
+ 70
+ ],
+ "name": "foo"
+ },
+ "value": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 67,
+ 70
+ ],
+ "name": "foo"
+ },
+ "kind": "init"
+ }
+ ]
+ }
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 74,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 87,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 89,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "name": "foo"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 89,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "name": "foo"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 94,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 103,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 67,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 67,
+ 70
+ ],
+ "name": "foo"
+ },
+ "kind": "scope"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 114,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 119,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 137,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 40,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 50,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "column": 18,
+ "line": 3
+ },
+ "end": {
+ "column": 24,
+ "line": 3
+ }
+ },
+ "value": "v-slot"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 3
+ },
+ "end": {
+ "column": 25,
+ "line": 3
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 57,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "column": 25,
+ "line": 3
+ },
+ "end": {
+ "column": 31,
+ "line": 3
+ }
+ },
+ "value": "header"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 32
+ },
+ "end": {
+ "line": 3,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "value": "{",
+ "start": 65,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 67,
+ "end": 70,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 38
+ }
+ },
+ "range": [
+ 67,
+ 70
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "}",
+ "start": 71,
+ "end": 72,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 39
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ },
+ "range": [
+ 71,
+ 72
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 40
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 4,
+ "column": 12
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 87,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "value": "foo",
+ "start": 89,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ]
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 92,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 103,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 114,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 119,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 20
+ }
+ },
+ "value": "test-component"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 137,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named/source.vue b/test/fixtures/ast/v-slot-named/source.vue
new file mode 100644
index 00000000..4504d505
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named/source.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{foo}}
+
+
+
diff --git a/test/fixtures/ast/v-slot-named/token-ranges.json b/test/fixtures/ast/v-slot-named/token-ranges.json
new file mode 100644
index 00000000..25b7fae4
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named/token-ranges.json
@@ -0,0 +1,33 @@
+[
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "{{",
+ "foo",
+ "}}",
+ "\n ",
+ " ",
+ "\n ",
+ " ",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/v-slot-named/tree.json b/test/fixtures/ast/v-slot-named/tree.json
new file mode 100644
index 00000000..d24d671b
--- /dev/null
+++ b/test/fixtures/ast/v-slot-named/tree.json
@@ -0,0 +1,148 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n \n \n {{foo}}\n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n {{foo}}\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n {{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-slot:header=\"{ foo }\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-slot:header",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-slot",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "header",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"{ foo }\"",
+ "children": [
+ {
+ "type": "VSlotScopeExpression",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "ObjectPattern",
+ "text": "{ foo }",
+ "children": [
+ {
+ "type": "Property",
+ "text": "foo",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-1/ast.json b/test/fixtures/ast/vue3.3-generic-1/ast.json
new file mode 100644
index 00000000..6c0f8f26
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/ast.json
@@ -0,0 +1,1059 @@
+{
+ "type": "Program",
+ "range": [
+ 37,
+ 60
+ ],
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 37,
+ 48
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 48,
+ 57
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 50,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 16
+ },
+ "start": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "range": [
+ 53,
+ 55
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ }
+ },
+ "range": [
+ 50,
+ 55
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 13
+ }
+ }
+ }
+ ],
+ "range": [
+ 49,
+ 56
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 19
+ },
+ "start": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 20
+ },
+ "start": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 37,
+ 59
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 22
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 37,
+ 59
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 22
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 0
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 70,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 70,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 81,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 83,
+ 86
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 83,
+ 86
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 89,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 37,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 60,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 70,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 81,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 86,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-1/parser-options.json b/test/fixtures/ast/vue3.3-generic-1/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-1/scope.json b/test/fixtures/ast/vue3.3-generic-1/scope.json
new file mode 100644
index 00000000..cdafa028
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/scope.json
@@ -0,0 +1,1298 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "Intl",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SymbolConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Function",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Disposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySetLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Set",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Math",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseWithResolvers",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExp",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Atomics",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "String",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMemberDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadataObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadata",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMethodDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassGetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassSetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorTarget",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassFieldDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorYieldResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorReturnResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BuiltinIteratorReturn",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IArguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Map",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Promise",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKeyTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntToLocaleStringOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Error",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpMatchArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpExecArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpIndicesArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRef",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRefConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistry",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistryConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Date",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Number",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseFulfilledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseRejectedResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseSettledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpStringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Symbol",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "JSON",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FlatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGenerator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DateConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptorMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Object",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisParameterType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "OmitThisParameter",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "CallableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NewableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Boolean",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BooleanConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NumberConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TemplateStringsArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportMeta",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportCallOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAssertions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAttributes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConcatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypedPropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructorLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Awaited",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Partial",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Required",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Readonly",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Pick",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Record",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Exclude",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Extract",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Omit",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NonNullable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Parameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConstructorParameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReturnType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "InstanceType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uppercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Lowercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Capitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uncapitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NoInfer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataViewConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Generator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyHandler",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Reflect",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MethodDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ParameterDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "const",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "defineProps",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "T",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ],
+ "childScopes": [],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 18
+ },
+ "start": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-1/source.vue b/test/fixtures/ast/vue3.3-generic-1/source.vue
new file mode 100644
index 00000000..fc54be37
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/source.vue
@@ -0,0 +1,6 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-1/token-ranges.json b/test/fixtures/ast/vue3.3-generic-1/token-ranges.json
new file mode 100644
index 00000000..debb41a2
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/token-ranges.json
@@ -0,0 +1,40 @@
+[
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-1/tree.json b/test/fixtures/ast/vue3.3-generic-1/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-1/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-2/ast.json b/test/fixtures/ast/vue3.3-generic-2/ast.json
new file mode 100644
index 00000000..6eab96ca
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/ast.json
@@ -0,0 +1,2488 @@
+{
+ "type": "Program",
+ "range": [
+ 9,
+ 162
+ ],
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "declare": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnionType",
+ "types": [
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "start": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "range": [
+ 20,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 9,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 105,
+ 116
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 116,
+ 125
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 118,
+ 121
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 26
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 121,
+ 123
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ }
+ },
+ "range": [
+ 118,
+ 123
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ }
+ ],
+ "range": [
+ 117,
+ 124
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 29
+ },
+ "start": {
+ "line": 5,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 30
+ },
+ "start": {
+ "line": 5,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 105,
+ 127
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 32
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 101,
+ 127
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 32
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 95,
+ 127
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 32
+ },
+ "start": {
+ "line": 5,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 134,
+ 137
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 142,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 140,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 134,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 128,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 158,
+ 161
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "console",
+ "optional": false,
+ "range": [
+ 146,
+ 153
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "log",
+ "optional": false,
+ "range": [
+ 154,
+ 157
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 11
+ },
+ "start": {
+ "line": 7,
+ "column": 8
+ }
+ }
+ },
+ "range": [
+ 146,
+ 157
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 11
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 146,
+ 162
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 146,
+ 162
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 46,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 173,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 173,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 184,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 186,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 186,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 192,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 46
+ },
+ "end": {
+ "line": 4,
+ "column": 47
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 47
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 48
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 105,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 128,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 134,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 140,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 145,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 146,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 163,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 173,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 184,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 186,
+ 189
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 189,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 192,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-2/parser-options.json b/test/fixtures/ast/vue3.3-generic-2/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-2/scope.json b/test/fixtures/ast/vue3.3-generic-2/scope.json
new file mode 100644
index 00000000..df9d4a47
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/scope.json
@@ -0,0 +1,1799 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "Intl",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SymbolConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Function",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Disposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySetLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Set",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Math",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseWithResolvers",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExp",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Atomics",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "String",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMemberDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadataObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadata",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMethodDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassGetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassSetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorTarget",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassFieldDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorYieldResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorReturnResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BuiltinIteratorReturn",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IArguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Map",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Promise",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKeyTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntToLocaleStringOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Error",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpMatchArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpExecArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpIndicesArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRef",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRefConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistry",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistryConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Date",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Number",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseFulfilledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseRejectedResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseSettledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpStringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Symbol",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "JSON",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FlatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGenerator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DateConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptorMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Object",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisParameterType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "OmitThisParameter",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "CallableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NewableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Boolean",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BooleanConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NumberConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TemplateStringsArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportMeta",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportCallOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAssertions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAttributes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConcatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypedPropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructorLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Awaited",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Partial",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Required",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Readonly",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Pick",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Record",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Exclude",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Extract",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Omit",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NonNullable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Parameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConstructorParameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReturnType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "InstanceType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uppercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Lowercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Capitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uncapitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NoInfer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataViewConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Generator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyHandler",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Reflect",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MethodDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ParameterDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "const",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "defineProps",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "T",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "Foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Type",
+ "node": {
+ "type": "TSTypeAliasDeclaration",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "name": "Foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ },
+ {
+ "name": "p",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 32
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "name": "p"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "name": "foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ }
+ ],
+ "childScopes": [],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+ }
+ ],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-2/source.vue b/test/fixtures/ast/vue3.3-generic-2/source.vue
new file mode 100644
index 00000000..e42bea85
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-2/token-ranges.json b/test/fixtures/ast/vue3.3-generic-2/token-ranges.json
new file mode 100644
index 00000000..8c7613a8
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/token-ranges.json
@@ -0,0 +1,99 @@
+[
+ "",
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-2/tree.json b/test/fixtures/ast/vue3.3-generic-2/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-2/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-3/ast.json b/test/fixtures/ast/vue3.3-generic-3/ast.json
new file mode 100644
index 00000000..cb599c07
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/ast.json
@@ -0,0 +1,2799 @@
+{
+ "type": "Program",
+ "range": [
+ 9,
+ 183
+ ],
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "declare": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnionType",
+ "types": [
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "start": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "range": [
+ 20,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 9,
+ 35
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 118,
+ 129
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 129,
+ 146
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 131,
+ 134
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 26
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "range": [
+ 134,
+ 136
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ }
+ },
+ "range": [
+ 131,
+ 137
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 29
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "bar",
+ "optional": false,
+ "range": [
+ 138,
+ 141
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 33
+ },
+ "start": {
+ "line": 5,
+ "column": 30
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "range": [
+ 141,
+ 144
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 143,
+ 144
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 35
+ }
+ }
+ },
+ "range": [
+ 143,
+ 144
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 35
+ }
+ }
+ }
+ },
+ "range": [
+ 138,
+ 144
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 130,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 37
+ },
+ "start": {
+ "line": 5,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 38
+ },
+ "start": {
+ "line": 5,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 118,
+ 148
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 40
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 114,
+ 148
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 40
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 108,
+ 148
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 40
+ },
+ "start": {
+ "line": 5,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 163,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 161,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 155,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 149,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 179,
+ 182
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "console",
+ "optional": false,
+ "range": [
+ 167,
+ 174
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "log",
+ "optional": false,
+ "range": [
+ 175,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 11
+ },
+ "start": {
+ "line": 7,
+ "column": 8
+ }
+ }
+ },
+ "range": [
+ 167,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 11
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 167,
+ 183
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 167,
+ 183
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 46,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 61
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 16
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 194,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 194,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 205,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 207,
+ 210
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 207,
+ 210
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 213,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 47
+ },
+ "start": {
+ "line": 4,
+ "column": 46
+ }
+ },
+ "range": [
+ 92,
+ 93
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 49
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 94,
+ 95
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 57
+ },
+ "start": {
+ "line": 4,
+ "column": 50
+ }
+ },
+ "range": [
+ 96,
+ 103
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 58
+ }
+ },
+ "range": [
+ 104,
+ 105
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 59
+ },
+ "end": {
+ "line": 4,
+ "column": 60
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 60
+ },
+ "end": {
+ "line": 4,
+ "column": 61
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 61
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 108,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 142,
+ 143
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 143,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 160,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 161,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 184,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 192,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 194,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 205,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 207,
+ 210
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 210,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 213,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-3/parser-options.json b/test/fixtures/ast/vue3.3-generic-3/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-3/scope.json b/test/fixtures/ast/vue3.3-generic-3/scope.json
new file mode 100644
index 00000000..01a2cda1
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/scope.json
@@ -0,0 +1,1860 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "Intl",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SymbolConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Function",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Disposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SuppressedErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStack",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncDisposableStackConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIteratorObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySetLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Set",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlySet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Math",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ObjectConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseWithResolvers",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExp",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Atomics",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBuffer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SharedArrayBufferConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "String",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMemberDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadataObject",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DecoratorMetadata",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassMethodDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassGetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassSetterDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorTarget",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassAccessorDecoratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassFieldDecoratorContext",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorYieldResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorReturnResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IteratorResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Iterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BuiltinIteratorReturn",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "IArguments",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MapIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Map",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReadonlyMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakMapConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSet",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakSetConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Promise",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint8ClampedArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint16ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Int32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uint32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float32ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Float64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncIterableIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64Array",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKeyTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntToLocaleStringOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigIntConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigInt64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BigUint64ArrayConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Error",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateErrorConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpMatchArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpExecArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpIndicesArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AggregateError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRef",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakRefConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistry",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FinalizationRegistryConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Date",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Number",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseFulfilledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseRejectedResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseSettledResult",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpStringIterator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Symbol",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "JSON",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RegExpConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FlatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGenerator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "AsyncGeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DateConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferTypes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDescriptorMap",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Object",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "FunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisParameterType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "OmitThisParameter",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "CallableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NewableFunction",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "StringConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Boolean",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "BooleanConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NumberConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TemplateStringsArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportMeta",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportCallOptions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAssertions",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ImportAttributes",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "EvalError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "RangeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReferenceError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "SyntaxError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypeError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "URIError",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConcatArray",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "TypedPropertyDescriptor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseConstructorLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PromiseLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Awaited",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Partial",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Required",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Readonly",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Pick",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Record",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Exclude",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Extract",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Omit",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NonNullable",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Parameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ConstructorParameters",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ReturnType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "InstanceType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uppercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Lowercase",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Capitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Uncapitalize",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "NoInfer",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ThisType",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "WeakKey",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferLike",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ArrayBufferView",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "DataViewConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Generator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "GeneratorFunctionConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyHandler",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ProxyConstructor",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "Reflect",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ClassDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "PropertyDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "MethodDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "ParameterDecorator",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "const",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "defineProps",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "T",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "U",
+ "identifiers": [],
+ "defs": [],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "U",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 35
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ }
+ ]
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "Foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Type",
+ "node": {
+ "type": "TSTypeAliasDeclaration",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 26
+ },
+ "start": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ "name": "Foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "Foo",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 8
+ },
+ "start": {
+ "line": 2,
+ "column": 5
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ },
+ {
+ "name": "p",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 40
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "name": "p"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ }
+ ]
+ },
+ {
+ "name": "foo",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "node": {
+ "type": "VariableDeclarator",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 17
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "name": "foo"
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null,
+ "vueUsedInTemplate": true
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "U",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 35
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": true
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 13
+ },
+ "start": {
+ "line": 6,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "p",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 15
+ },
+ "start": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "from": "module",
+ "resolved": {
+ "type": "Identifier",
+ "name": "foo",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 9
+ },
+ "start": {
+ "line": 6,
+ "column": 6
+ }
+ }
+ },
+ "init": null
+ }
+ ],
+ "childScopes": [],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "defineProps",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "T",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 27
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "U",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 36
+ },
+ "start": {
+ "line": 5,
+ "column": 35
+ }
+ }
+ },
+ "from": "module",
+ "init": null
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+ }
+ ],
+ "through": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "console",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 7
+ },
+ "start": {
+ "line": 7,
+ "column": 0
+ }
+ }
+ },
+ "from": "module",
+ "resolved": null,
+ "init": null
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-3/source.vue b/test/fixtures/ast/vue3.3-generic-3/source.vue
new file mode 100644
index 00000000..5d3590d2
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-3/token-ranges.json b/test/fixtures/ast/vue3.3-generic-3/token-ranges.json
new file mode 100644
index 00000000..cec12a2a
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/token-ranges.json
@@ -0,0 +1,111 @@
+[
+ "",
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-3/tree.json b/test/fixtures/ast/vue3.3-generic-3/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-3/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json b/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json
new file mode 100644
index 00000000..6efed59a
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json
@@ -0,0 +1,2674 @@
+{
+ "type": "Program",
+ "range": [
+ 92,
+ 195
+ ],
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "declare": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 97,
+ 100
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 8
+ },
+ "start": {
+ "line": 8,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnionType",
+ "types": [
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 17
+ },
+ "start": {
+ "line": 8,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 112,
+ 118
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 26
+ },
+ "start": {
+ "line": 8,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "range": [
+ 103,
+ 118
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 26
+ },
+ "start": {
+ "line": 8,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 92,
+ 118
+ ],
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 26
+ },
+ "start": {
+ "line": 8,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 129,
+ 140
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 21
+ },
+ "start": {
+ "line": 9,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 140,
+ 157
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 142,
+ 145
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 26
+ },
+ "start": {
+ "line": 9,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 28
+ },
+ "start": {
+ "line": 9,
+ "column": 26
+ }
+ },
+ "range": [
+ 145,
+ 147
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 28
+ },
+ "start": {
+ "line": 9,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 28
+ },
+ "start": {
+ "line": 9,
+ "column": 27
+ }
+ }
+ }
+ },
+ "range": [
+ 142,
+ 148
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 29
+ },
+ "start": {
+ "line": 9,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "bar",
+ "optional": false,
+ "range": [
+ 149,
+ 152
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 33
+ },
+ "start": {
+ "line": 9,
+ "column": 30
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 36
+ },
+ "start": {
+ "line": 9,
+ "column": 33
+ }
+ },
+ "range": [
+ 152,
+ 155
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 36
+ },
+ "start": {
+ "line": 9,
+ "column": 35
+ }
+ }
+ },
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 36
+ },
+ "start": {
+ "line": 9,
+ "column": 35
+ }
+ }
+ }
+ },
+ "range": [
+ 149,
+ 155
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 36
+ },
+ "start": {
+ "line": 9,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 141,
+ 156
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 37
+ },
+ "start": {
+ "line": 9,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 38
+ },
+ "start": {
+ "line": 9,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 129,
+ 159
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 40
+ },
+ "start": {
+ "line": 9,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 125,
+ 159
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 40
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 119,
+ 159
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 40
+ },
+ "start": {
+ "line": 9,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 166,
+ 169
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 9
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 13
+ },
+ "start": {
+ "line": 10,
+ "column": 12
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 174,
+ 177
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 17
+ },
+ "start": {
+ "line": 10,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 172,
+ 177
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 17
+ },
+ "start": {
+ "line": 10,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 166,
+ 177
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 17
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 160,
+ 177
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 17
+ },
+ "start": {
+ "line": 10,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 190,
+ 193
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 15
+ },
+ "start": {
+ "line": 11,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "console",
+ "optional": false,
+ "range": [
+ 178,
+ 185
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 7
+ },
+ "start": {
+ "line": 11,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "log",
+ "optional": false,
+ "range": [
+ 186,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 11
+ },
+ "start": {
+ "line": 11,
+ "column": 8
+ }
+ }
+ },
+ "range": [
+ 178,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 11
+ },
+ "start": {
+ "line": 11,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 178,
+ 194
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 16
+ },
+ "start": {
+ "line": 11,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 178,
+ 194
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 16
+ },
+ "start": {
+ "line": 11,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 0
+ },
+ "start": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 205,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 205,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 216,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 218,
+ 221
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 218,
+ 221
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 224,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 42,
+ 49
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 50,
+ 53
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 11
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 75,
+ 82
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 87,
+ 88
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 92,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 97,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 5
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 8,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 112,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 118,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 119,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 153,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 34
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 154,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 35
+ },
+ "end": {
+ "line": 9,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 40
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 169,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 172,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 12
+ },
+ "end": {
+ "line": 10,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 17
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 178,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 194,
+ 195
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 195,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 205,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 214,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 216,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "range": [
+ 218,
+ 221
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 221,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 224,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 234,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 59,
+ 70
+ ],
+ "value": " Comments"
+ }
+ ],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/parser-options.json b/test/fixtures/ast/vue3.3-generic-4-with-spaces/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/source.vue b/test/fixtures/ast/vue3.3-generic-4-with-spaces/source.vue
new file mode 100644
index 00000000..7b4d167f
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/source.vue
@@ -0,0 +1,15 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/token-ranges.json b/test/fixtures/ast/vue3.3-generic-4-with-spaces/token-ranges.json
new file mode 100644
index 00000000..66951b9a
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/token-ranges.json
@@ -0,0 +1,104 @@
+[
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// Comments"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/tree.json b/test/fixtures/ast/vue3.3-generic-4-with-spaces/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json b/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json
new file mode 100644
index 00000000..b2319f0c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json
@@ -0,0 +1,2800 @@
+{
+ "type": "Program",
+ "range": [
+ 142,
+ 245
+ ],
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "declare": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 147,
+ 150
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 8
+ },
+ "start": {
+ "line": 9,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnionType",
+ "types": [
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 153,
+ 159
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 17
+ },
+ "start": {
+ "line": 9,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 162,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 26
+ },
+ "start": {
+ "line": 9,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "range": [
+ 153,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 26
+ },
+ "start": {
+ "line": 9,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 142,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 26
+ },
+ "start": {
+ "line": 9,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 179,
+ 190
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 21
+ },
+ "start": {
+ "line": 10,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 190,
+ 207
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 192,
+ 195
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 26
+ },
+ "start": {
+ "line": 10,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 28
+ },
+ "start": {
+ "line": 10,
+ "column": 26
+ }
+ },
+ "range": [
+ 195,
+ 197
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 28
+ },
+ "start": {
+ "line": 10,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 28
+ },
+ "start": {
+ "line": 10,
+ "column": 27
+ }
+ }
+ }
+ },
+ "range": [
+ 192,
+ 198
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 29
+ },
+ "start": {
+ "line": 10,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "bar",
+ "optional": false,
+ "range": [
+ 199,
+ 202
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 33
+ },
+ "start": {
+ "line": 10,
+ "column": 30
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 36
+ },
+ "start": {
+ "line": 10,
+ "column": 33
+ }
+ },
+ "range": [
+ 202,
+ 205
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 36
+ },
+ "start": {
+ "line": 10,
+ "column": 35
+ }
+ }
+ },
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 36
+ },
+ "start": {
+ "line": 10,
+ "column": 35
+ }
+ }
+ }
+ },
+ "range": [
+ 199,
+ 205
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 36
+ },
+ "start": {
+ "line": 10,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 191,
+ 206
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 37
+ },
+ "start": {
+ "line": 10,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 38
+ },
+ "start": {
+ "line": 10,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 179,
+ 209
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 40
+ },
+ "start": {
+ "line": 10,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 175,
+ 209
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 40
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 169,
+ 209
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 40
+ },
+ "start": {
+ "line": 10,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 216,
+ 219
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 9
+ },
+ "start": {
+ "line": 11,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 222,
+ 223
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 13
+ },
+ "start": {
+ "line": 11,
+ "column": 12
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 224,
+ 227
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 17
+ },
+ "start": {
+ "line": 11,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 222,
+ 227
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 17
+ },
+ "start": {
+ "line": 11,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 216,
+ 227
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 17
+ },
+ "start": {
+ "line": 11,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 210,
+ 227
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 17
+ },
+ "start": {
+ "line": 11,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 240,
+ 243
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 15
+ },
+ "start": {
+ "line": 12,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "console",
+ "optional": false,
+ "range": [
+ 228,
+ 235
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 7
+ },
+ "start": {
+ "line": 12,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "log",
+ "optional": false,
+ "range": [
+ 236,
+ 239
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 11
+ },
+ "start": {
+ "line": 12,
+ "column": 8
+ }
+ }
+ },
+ "range": [
+ 228,
+ 239
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 11
+ },
+ "start": {
+ "line": 12,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 228,
+ 244
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 16
+ },
+ "start": {
+ "line": 12,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 228,
+ 244
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 16
+ },
+ "start": {
+ "line": 12,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 13,
+ "column": 0
+ },
+ "start": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 255,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 255,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 266,
+ 273
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 268,
+ 271
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 268,
+ 271
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 273,
+ 274
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 274,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 54,
+ 61
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 62,
+ 65
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 65,
+ 66
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 106,
+ 113
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 118,
+ 124
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 124,
+ 128
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 20
+ },
+ "start": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "range": [
+ 128,
+ 134
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 21
+ },
+ "start": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "range": [
+ 134,
+ 135
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 23
+ },
+ "start": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "range": [
+ 136,
+ 137
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 141,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 142,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 147,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 151,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 152,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 153,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 162,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 168,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 169,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 176,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 178,
+ 179
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 179,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 199
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 29
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 199,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 30
+ },
+ "end": {
+ "line": 10,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 34
+ },
+ "end": {
+ "line": 10,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 204,
+ 209
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 35
+ },
+ "end": {
+ "line": 10,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 209,
+ 210
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 40
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 210,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 216,
+ 219
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 219,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 222
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 222,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 12
+ },
+ "end": {
+ "line": 11,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 227,
+ 228
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 17
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 228,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 244,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 16
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 245,
+ 253
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 253,
+ 254
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 254,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 255,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 266,
+ 268
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "range": [
+ 268,
+ 271
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 271,
+ 273
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 273,
+ 274
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 274,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 284,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 49
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 71,
+ 82
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 18
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 87,
+ 101
+ ],
+ "value": " Comments "
+ }
+ ],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/parser-options.json b/test/fixtures/ast/vue3.3-generic-5-with-spaces/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/source.vue b/test/fixtures/ast/vue3.3-generic-5-with-spaces/source.vue
new file mode 100644
index 00000000..1ce43570
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/source.vue
@@ -0,0 +1,16 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/token-ranges.json b/test/fixtures/ast/vue3.3-generic-5-with-spaces/token-ranges.json
new file mode 100644
index 00000000..1af7d0bd
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/token-ranges.json
@@ -0,0 +1,111 @@
+[
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// Comments",
+ "// Comments",
+ "/* Comments */"
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/tree.json b/test/fixtures/ast/vue3.3-generic-5-with-spaces/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json b/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json
new file mode 100644
index 00000000..df9f6fee
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json
@@ -0,0 +1,3016 @@
+{
+ "type": "Program",
+ "range": [
+ 228,
+ 331
+ ],
+ "body": [
+ {
+ "type": "TSTypeAliasDeclaration",
+ "declare": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 233,
+ 236
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 8
+ },
+ "start": {
+ "line": 14,
+ "column": 5
+ }
+ }
+ },
+ "typeAnnotation": {
+ "type": "TSUnionType",
+ "types": [
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 239,
+ 245
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 17
+ },
+ "start": {
+ "line": 14,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 248,
+ 254
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 26
+ },
+ "start": {
+ "line": 14,
+ "column": 20
+ }
+ }
+ }
+ ],
+ "range": [
+ 239,
+ 254
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 26
+ },
+ "start": {
+ "line": 14,
+ "column": 11
+ }
+ }
+ },
+ "range": [
+ 228,
+ 254
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 26
+ },
+ "start": {
+ "line": 14,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 261,
+ 262
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 7
+ },
+ "start": {
+ "line": 15,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 265,
+ 276
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 21
+ },
+ "start": {
+ "line": 15,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 276,
+ 293
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 278,
+ 281
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 26
+ },
+ "start": {
+ "line": 15,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 28
+ },
+ "start": {
+ "line": 15,
+ "column": 26
+ }
+ },
+ "range": [
+ 281,
+ 283
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 282,
+ 283
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 28
+ },
+ "start": {
+ "line": 15,
+ "column": 27
+ }
+ }
+ },
+ "range": [
+ 282,
+ 283
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 28
+ },
+ "start": {
+ "line": 15,
+ "column": 27
+ }
+ }
+ }
+ },
+ "range": [
+ 278,
+ 284
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 29
+ },
+ "start": {
+ "line": 15,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "bar",
+ "optional": false,
+ "range": [
+ 285,
+ 288
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 33
+ },
+ "start": {
+ "line": 15,
+ "column": 30
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 36
+ },
+ "start": {
+ "line": 15,
+ "column": 33
+ }
+ },
+ "range": [
+ 288,
+ 291
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 290,
+ 291
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 36
+ },
+ "start": {
+ "line": 15,
+ "column": 35
+ }
+ }
+ },
+ "range": [
+ 290,
+ 291
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 36
+ },
+ "start": {
+ "line": 15,
+ "column": 35
+ }
+ }
+ }
+ },
+ "range": [
+ 285,
+ 291
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 36
+ },
+ "start": {
+ "line": 15,
+ "column": 30
+ }
+ }
+ }
+ ],
+ "range": [
+ 277,
+ 292
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 37
+ },
+ "start": {
+ "line": 15,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 38
+ },
+ "start": {
+ "line": 15,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 265,
+ 295
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 40
+ },
+ "start": {
+ "line": 15,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 261,
+ 295
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 40
+ },
+ "start": {
+ "line": 15,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 255,
+ 295
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 40
+ },
+ "start": {
+ "line": 15,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 302,
+ 305
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 9
+ },
+ "start": {
+ "line": 16,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 308,
+ 309
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 13
+ },
+ "start": {
+ "line": 16,
+ "column": 12
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 310,
+ 313
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 17
+ },
+ "start": {
+ "line": 16,
+ "column": 14
+ }
+ }
+ },
+ "range": [
+ 308,
+ 313
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 17
+ },
+ "start": {
+ "line": 16,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 302,
+ 313
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 17
+ },
+ "start": {
+ "line": 16,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 296,
+ 313
+ ],
+ "loc": {
+ "end": {
+ "line": 16,
+ "column": 17
+ },
+ "start": {
+ "line": 16,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [
+ {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 326,
+ 329
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 15
+ },
+ "start": {
+ "line": 17,
+ "column": 12
+ }
+ }
+ }
+ ],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "console",
+ "optional": false,
+ "range": [
+ 314,
+ 321
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 7
+ },
+ "start": {
+ "line": 17,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "log",
+ "optional": false,
+ "range": [
+ 322,
+ 325
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 11
+ },
+ "start": {
+ "line": 17,
+ "column": 8
+ }
+ }
+ },
+ "range": [
+ 314,
+ 325
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 11
+ },
+ "start": {
+ "line": 17,
+ "column": 0
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 314,
+ 330
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 16
+ },
+ "start": {
+ "line": 17,
+ "column": 0
+ }
+ }
+ },
+ "range": [
+ 314,
+ 330
+ ],
+ "loc": {
+ "end": {
+ "line": 17,
+ "column": 16
+ },
+ "start": {
+ "line": 17,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 2
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 18,
+ "column": 0
+ },
+ "start": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 341,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 341,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 352,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 354,
+ 357
+ ],
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 354,
+ 357
+ ],
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 359,
+ 360
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 360,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 54,
+ 61
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 76,
+ 82
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 102,
+ 103
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 122,
+ 129
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 134,
+ 140
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 140,
+ 144
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 12
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 165,
+ 171
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 13
+ },
+ "start": {
+ "line": 9,
+ "column": 12
+ }
+ },
+ "range": [
+ 171,
+ 172
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 184,
+ 185
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 5
+ },
+ "start": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "range": [
+ 190,
+ 191
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 6
+ },
+ "start": {
+ "line": 12,
+ "column": 5
+ }
+ },
+ "range": [
+ 197,
+ 198
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 13
+ },
+ "start": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "range": [
+ 199,
+ 205
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 14
+ },
+ "start": {
+ "line": 12,
+ "column": 13
+ }
+ },
+ "range": [
+ 205,
+ 206
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 20
+ },
+ "start": {
+ "line": 12,
+ "column": 14
+ }
+ },
+ "range": [
+ 206,
+ 212
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 21
+ },
+ "start": {
+ "line": 12,
+ "column": 20
+ }
+ },
+ "range": [
+ 212,
+ 213
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 28
+ },
+ "start": {
+ "line": 12,
+ "column": 22
+ }
+ },
+ "range": [
+ 214,
+ 220
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 12,
+ "column": 28
+ }
+ },
+ "range": [
+ 220,
+ 224
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 225,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 226,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 227,
+ 228
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 228,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 232,
+ 233
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 233,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 236,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 8
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 237,
+ 238
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 238,
+ 239
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 239,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 11
+ },
+ "end": {
+ "line": 14,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 245,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 17
+ },
+ "end": {
+ "line": 14,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 246,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 18
+ },
+ "end": {
+ "line": 14,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 247,
+ 248
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 19
+ },
+ "end": {
+ "line": 14,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 248,
+ 254
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 20
+ },
+ "end": {
+ "line": 14,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 254,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 26
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 255,
+ 260
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 260,
+ 261
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 261,
+ 262
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 262,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 8
+ },
+ "end": {
+ "line": 15,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 9
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 265,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 284,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 285,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 289,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 34
+ },
+ "end": {
+ "line": 15,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 290,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 35
+ },
+ "end": {
+ "line": 15,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 295,
+ 296
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 40
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 296,
+ 301
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 301,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 5
+ },
+ "end": {
+ "line": 16,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 305
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 6
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 305,
+ 306
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 306,
+ 307
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 307,
+ 308
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 11
+ },
+ "end": {
+ "line": 16,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 308,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 12
+ },
+ "end": {
+ "line": 16,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 313,
+ 314
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 17
+ },
+ "end": {
+ "line": 17,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 314,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 0
+ },
+ "end": {
+ "line": 17,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 16
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 331,
+ 339
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 339,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 8
+ },
+ "end": {
+ "line": 18,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 340,
+ 341
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 341,
+ 350
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 350,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 352,
+ 354
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "range": [
+ 354,
+ 357
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 357,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 5
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 359,
+ 360
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 360,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 370,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 10
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 49
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 19
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 62,
+ 69
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 88,
+ 99
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 17
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 104,
+ 117
+ ],
+ "value": " extends "
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 13
+ },
+ "start": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "range": [
+ 151,
+ 158
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 18
+ },
+ "start": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "range": [
+ 173,
+ 177
+ ],
+ "value": " ="
+ }
+ ],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/parser-options.json b/test/fixtures/ast/vue3.3-generic-6-with-default/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-6-with-default/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/source.vue b/test/fixtures/ast/vue3.3-generic-6-with-default/source.vue
new file mode 100644
index 00000000..a0ad29c8
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-6-with-default/source.vue
@@ -0,0 +1,21 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/token-ranges.json b/test/fixtures/ast/vue3.3-generic-6-with-default/token-ranges.json
new file mode 100644
index 00000000..25735e17
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-6-with-default/token-ranges.json
@@ -0,0 +1,123 @@
+[
+ "",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// Comments",
+ "/* = */",
+ "// Comments",
+ "/* extends */",
+ "/* = */",
+ "// ="
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/tree.json b/test/fixtures/ast/vue3.3-generic-6-with-default/tree.json
new file mode 100644
index 00000000..eea3840c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-6-with-default/tree.json
@@ -0,0 +1,39 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json b/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json
new file mode 100644
index 00000000..f79be40c
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json
@@ -0,0 +1,2258 @@
+{
+ "type": "Program",
+ "range": [
+ 103,
+ 141
+ ],
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "definite": false,
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 7
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ },
+ "init": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "defineProps",
+ "optional": false,
+ "range": [
+ 113,
+ 124
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 21
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "optional": false,
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 124,
+ 138
+ ],
+ "params": [
+ {
+ "type": "TSTypeLiteral",
+ "members": [
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "t",
+ "optional": false,
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 24
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 27
+ },
+ "start": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "range": [
+ 127,
+ 130
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 27
+ },
+ "start": {
+ "line": 5,
+ "column": 26
+ }
+ }
+ },
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 27
+ },
+ "start": {
+ "line": 5,
+ "column": 26
+ }
+ }
+ }
+ },
+ "range": [
+ 126,
+ 131
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 28
+ },
+ "start": {
+ "line": 5,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "TSPropertySignature",
+ "computed": false,
+ "key": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "u",
+ "optional": false,
+ "range": [
+ 132,
+ 133
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 30
+ },
+ "start": {
+ "line": 5,
+ "column": 29
+ }
+ }
+ },
+ "optional": false,
+ "readonly": false,
+ "static": false,
+ "typeAnnotation": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 33
+ },
+ "start": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "range": [
+ 133,
+ 136
+ ],
+ "typeAnnotation": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 33
+ },
+ "start": {
+ "line": 5,
+ "column": 32
+ }
+ }
+ },
+ "range": [
+ 135,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 33
+ },
+ "start": {
+ "line": 5,
+ "column": 32
+ }
+ }
+ }
+ },
+ "range": [
+ 132,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 33
+ },
+ "start": {
+ "line": 5,
+ "column": 29
+ }
+ }
+ }
+ ],
+ "range": [
+ 125,
+ 137
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 34
+ },
+ "start": {
+ "line": 5,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 35
+ },
+ "start": {
+ "line": 5,
+ "column": 21
+ }
+ }
+ },
+ "range": [
+ 113,
+ 140
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 37
+ },
+ "start": {
+ "line": 5,
+ "column": 10
+ }
+ }
+ },
+ "range": [
+ 109,
+ 140
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 37
+ },
+ "start": {
+ "line": 5,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "declare": false,
+ "kind": "const",
+ "range": [
+ 103,
+ 140
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 37
+ },
+ "start": {
+ "line": 5,
+ "column": 0
+ }
+ }
+ }
+ ],
+ "comments": [],
+ "sourceType": "module",
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "range": [
+ 0,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": ""
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 0
+ },
+ "start": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "templateBody": {
+ "type": "VElement",
+ "range": [
+ 152,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 152,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 163,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "t",
+ "optional": false,
+ "range": [
+ 167,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 165,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 165,
+ 170
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 173,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "u",
+ "optional": false,
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 175,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 175,
+ 180
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 183,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 45
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "start": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "start": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "start": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 49,
+ 51
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 52,
+ 58
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "start": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 12
+ },
+ "start": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "range": [
+ 65,
+ 72
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 14
+ },
+ "start": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 18
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 76,
+ 78
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 79,
+ 85
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 27
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ],
+ "value": "="
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 29
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 88,
+ 89
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 30
+ },
+ "start": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 89,
+ 90
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 91,
+ 93
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "String",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 94,
+ 99
+ ],
+ "value": "'abc'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 113,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "defineProps<{t:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 131,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 132,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "value": "u:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 135,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 5,
+ "column": 37
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 37
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 141,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 152,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 163,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "range": [
+ 165,
+ 166
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 4
+ },
+ "start": {
+ "line": 9,
+ "column": 3
+ }
+ },
+ "range": [
+ 166,
+ 167
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "range": [
+ 167,
+ 168
+ ],
+ "value": "t"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 6
+ },
+ "start": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "range": [
+ 168,
+ 169
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 169,
+ 170
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 170,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 173,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 175,
+ 176
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 4
+ },
+ "start": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 176,
+ 177
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "range": [
+ 177,
+ 178
+ ],
+ "value": "u"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 6
+ },
+ "start": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "range": [
+ 178,
+ 179
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 179,
+ 180
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 180,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 183,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/parser-options.json b/test/fixtures/ast/vue3.3-generic-7-with-arrow/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/source.vue b/test/fixtures/ast/vue3.3-generic-7-with-arrow/source.vue
new file mode 100644
index 00000000..d1a84af7
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{p.t()}}
+{{p.u()}}
+
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/token-ranges.json b/test/fixtures/ast/vue3.3-generic-7-with-arrow/token-ranges.json
new file mode 100644
index 00000000..6ae5ff6d
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/token-ranges.json
@@ -0,0 +1,88 @@
+[
+ "",
+ "",
+ "\n\n",
+ "",
+ "\n",
+ "{{",
+ "p",
+ ".",
+ "t",
+ "(",
+ ")",
+ "}}",
+ "\n",
+ "{{",
+ "p",
+ ".",
+ "u",
+ "(",
+ ")",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/tree.json b/test/fixtures/ast/vue3.3-generic-7-with-arrow/tree.json
new file mode 100644
index 00000000..bd27ee7b
--- /dev/null
+++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/tree.json
@@ -0,0 +1,89 @@
+[
+ {
+ "type": "VElement",
+ "text": "\n{{p.t()}}\n{{p.u()}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{p.t()}}",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "p.t()",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "p.t",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "p",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "t",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{p.u()}}",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "p.u()",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "p.u",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "p",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "u",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-end-tag-in-attr/document-fragment.json b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/document-fragment.json
new file mode 100644
index 00000000..f8925217
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/document-fragment.json
@@ -0,0 +1,1530 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "name": "custom-block",
+ "rawName": "custom-block",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 14,
+ 49
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "value": "\n End Tag in Attr e.g. "
+ },
+ {
+ "type": "VText",
+ "range": [
+ 73,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 58
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": " is Invalid!\n"
+ },
+ {
+ "type": "VText",
+ "range": [
+ 101,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 103,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "name": "custom-block-html",
+ "rawName": "custom-block-html",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 103,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 122,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 122,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 23
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": "html"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 134,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": "\n End Tag in Attr e.g. "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 158,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 63
+ }
+ },
+ "name": "foo",
+ "rawName": "foo",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 158,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 57
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 163,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 55
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 163,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 32
+ }
+ },
+ "name": "attr",
+ "rawName": "attr"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 168,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 33
+ },
+ "end": {
+ "line": 6,
+ "column": 55
+ }
+ },
+ "value": ""
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 192,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 57
+ },
+ "end": {
+ "line": 6,
+ "column": 63
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 198,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 63
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": " is Invalid!\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 211,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ }
+ },
+ "variables": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "End"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 20,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "Tag"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 25,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "Attr"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "e.g."
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 38,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 52
+ },
+ "end": {
+ "line": 2,
+ "column": 57
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 57
+ },
+ "end": {
+ "line": 2,
+ "column": 58
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 58
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 74,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 59
+ },
+ "end": {
+ "line": 2,
+ "column": 61
+ }
+ },
+ "value": "is"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 61
+ },
+ "end": {
+ "line": 2,
+ "column": 62
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 77,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 62
+ },
+ "end": {
+ "line": 2,
+ "column": 70
+ }
+ },
+ "value": "Invalid!"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 70
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 86,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 103,
+ 121
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "custom-block-html"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 122,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 23
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 133,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 134,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 137,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "End"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 141,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "Tag"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 145,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 148,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 13
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "Attr"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 152,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 153,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": "e.g."
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 157,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 158,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 163,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 32
+ }
+ },
+ "value": "attr"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 167,
+ 168
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 168,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 33
+ },
+ "end": {
+ "line": 6,
+ "column": 55
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 56
+ },
+ "end": {
+ "line": 6,
+ "column": 57
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 192,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 57
+ },
+ "end": {
+ "line": 6,
+ "column": 62
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 197,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 62
+ },
+ "end": {
+ "line": 6,
+ "column": 63
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 199
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 63
+ },
+ "end": {
+ "line": 6,
+ "column": 64
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 199,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 64
+ },
+ "end": {
+ "line": 6,
+ "column": 66
+ }
+ },
+ "value": "is"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 66
+ },
+ "end": {
+ "line": 6,
+ "column": 67
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 202,
+ 210
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 67
+ },
+ "end": {
+ "line": 6,
+ "column": 75
+ }
+ },
+ "value": "Invalid!"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 210,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 75
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 211,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 19
+ }
+ },
+ "value": "custom-block-html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 19
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "x-invalid-end-tag",
+ "index": 67,
+ "lineNumber": 2,
+ "column": 52
+ },
+ {
+ "message": "x-invalid-end-tag",
+ "index": 86,
+ "lineNumber": 3,
+ "column": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-end-tag-in-attr/source.vue b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/source.vue
new file mode 100644
index 00000000..485aee43
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/source.vue
@@ -0,0 +1,7 @@
+
+ End Tag in Attr e.g. is Invalid!
+
+
+
+ End Tag in Attr e.g. is Invalid!
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-end-tag-in-attr/token-ranges.json b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/token-ranges.json
new file mode 100644
index 00000000..384e3e80
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/token-ranges.json
@@ -0,0 +1,63 @@
+[
+ "",
+ "\n ",
+ "End",
+ " ",
+ "Tag",
+ " ",
+ "in",
+ " ",
+ "Attr",
+ " ",
+ "e.g.",
+ " ",
+ "",
+ "\"",
+ " ",
+ ">",
+ " ",
+ " ",
+ "is",
+ " ",
+ "Invalid!",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n ",
+ "End",
+ " ",
+ "Tag",
+ " ",
+ "in",
+ " ",
+ "Attr",
+ " ",
+ "e.g.",
+ " ",
+ "\"",
+ ">",
+ " ",
+ " ",
+ "is",
+ " ",
+ "Invalid!",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-end-tag-in-attr/tree.json b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/tree.json
new file mode 100644
index 00000000..52b717a3
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-end-tag-in-attr/tree.json
@@ -0,0 +1,120 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n End Tag in Attr e.g. \" > is Invalid!\n \n\n\n End Tag in Attr e.g. \" > is Invalid!\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n End Tag in Attr e.g. ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n End Tag in Attr e.g. ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\" >",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": " is Invalid!\n",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n End Tag in Attr e.g. \" > is Invalid!\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "lang=\"html\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "lang",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"html\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n End Tag in Attr e.g. ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\" > ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "\" >",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "attr=\" \"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "attr",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": " is Invalid!\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-escape-like/document-fragment.json b/test/fixtures/document-fragment/custom-block-escape-like/document-fragment.json
new file mode 100644
index 00000000..96cab896
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-escape-like/document-fragment.json
@@ -0,0 +1,370 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "name": "custom-block",
+ "rawName": "custom-block",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 14,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n Do not escape <>\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 40,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "Do"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "not"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "escape"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": "<>"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 40,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-escape-like/source.vue b/test/fixtures/document-fragment/custom-block-escape-like/source.vue
new file mode 100644
index 00000000..d58f980e
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-escape-like/source.vue
@@ -0,0 +1,3 @@
+
+ Do not escape <>
+
diff --git a/test/fixtures/document-fragment/custom-block-escape-like/token-ranges.json b/test/fixtures/document-fragment/custom-block-escape-like/token-ranges.json
new file mode 100644
index 00000000..c66fb500
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-escape-like/token-ranges.json
@@ -0,0 +1,16 @@
+[
+ "",
+ "\n ",
+ "Do",
+ " ",
+ "not",
+ " ",
+ "escape",
+ " ",
+ "<>",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-escape-like/tree.json b/test/fixtures/document-fragment/custom-block-escape-like/tree.json
new file mode 100644
index 00000000..ee80eb25
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-escape-like/tree.json
@@ -0,0 +1,34 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n Do not escape <>\n \n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n Do not escape <>\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n Do not escape <>\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-html/document-fragment.json b/test/fixtures/document-fragment/custom-block-html/document-fragment.json
new file mode 100644
index 00000000..98dd0050
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-html/document-fragment.json
@@ -0,0 +1,1161 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "name": "custom-block",
+ "rawName": "custom-block",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": "html"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 26,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 29,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 65
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 29,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 34,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ },
+ "name": "h1",
+ "rawName": "h1",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 34,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 38,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "value": "lang =\"html\" parses the as HTML"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 81,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ }
+ },
+ "variables": []
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 86,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 59
+ },
+ "end": {
+ "line": 2,
+ "column": 65
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 65
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 93,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 108,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 110,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "name": "custom-block-no-html",
+ "rawName": "custom-block-no-html",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 110,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 132,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n
Is Not HTML \n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 167,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ }
+ },
+ "variables": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 29,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 34,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "h1"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 38,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 43,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": "=\"html\""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 51,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "parses"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 58,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 34
+ }
+ },
+ "value": "the"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 34
+ },
+ "end": {
+ "line": 2,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 62,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 35
+ },
+ "end": {
+ "line": 2,
+ "column": 46
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 46
+ },
+ "end": {
+ "line": 2,
+ "column": 47
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 74,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 47
+ },
+ "end": {
+ "line": 2,
+ "column": 49
+ }
+ },
+ "value": "as"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 49
+ },
+ "end": {
+ "line": 2,
+ "column": 50
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 77,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 50
+ },
+ "end": {
+ "line": 2,
+ "column": 54
+ }
+ },
+ "value": "HTML"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 81,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 54
+ },
+ "end": {
+ "line": 2,
+ "column": 58
+ }
+ },
+ "value": "h1"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 58
+ },
+ "end": {
+ "line": 2,
+ "column": 59
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 86,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 59
+ },
+ "end": {
+ "line": 2,
+ "column": 64
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 64
+ },
+ "end": {
+ "line": 2,
+ "column": 65
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 65
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 93,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 110,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "value": "custom-block-no-html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 131,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 132,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 135,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "value": "
Is"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 13
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 147,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "Not"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 151,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "value": "HTML "
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 33
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 167,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "value": "custom-block-no-html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 189,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-html/source.vue b/test/fixtures/document-fragment/custom-block-html/source.vue
new file mode 100644
index 00000000..0d0705f9
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-html/source.vue
@@ -0,0 +1,7 @@
+
+
lang ="html" parses the <tag> as HTML
+
+
+
+
Is Not HTML
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-html/token-ranges.json b/test/fixtures/document-fragment/custom-block-html/token-ranges.json
new file mode 100644
index 00000000..1acd5bf9
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-html/token-ranges.json
@@ -0,0 +1,44 @@
+[
+ "",
+ "\n ",
+ "",
+ "
",
+ "lang",
+ " ",
+ "=\"html\"",
+ " ",
+ "parses",
+ " ",
+ "the",
+ " ",
+ "<tag>",
+ " ",
+ "as",
+ " ",
+ "HTML",
+ " ",
+ "",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n ",
+ "
Is",
+ " ",
+ "Not",
+ " ",
+ "HTML ",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block-html/tree.json b/test/fixtures/document-fragment/custom-block-html/tree.json
new file mode 100644
index 00000000..303fdc8a
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block-html/tree.json
@@ -0,0 +1,114 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n
lang =\"html\" parses the <tag> as HTML \n \n\n\n
Is Not HTML \n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n
lang =\"html\" parses the <tag> as HTML \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "lang=\"html\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "lang",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"html\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
lang =\"html\" parses the <tag> as HTML ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
lang =\"html\" parses the <tag> as HTML ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "lang =\"html\" parses the <tag> as HTML",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n
Is Not HTML \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n
Is Not HTML \n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block/document-fragment.json b/test/fixtures/document-fragment/custom-block/document-fragment.json
new file mode 100644
index 00000000..71010dfb
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block/document-fragment.json
@@ -0,0 +1,370 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "name": "custom-block",
+ "rawName": "custom-block",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 14,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n This Is Custom Block\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 38,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "This"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 22,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "Is"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 25,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "Custom"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 32,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "Block"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 38,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block/source.vue b/test/fixtures/document-fragment/custom-block/source.vue
new file mode 100644
index 00000000..b112ad66
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block/source.vue
@@ -0,0 +1,3 @@
+
+ This Is Custom Block
+
diff --git a/test/fixtures/document-fragment/custom-block/token-ranges.json b/test/fixtures/document-fragment/custom-block/token-ranges.json
new file mode 100644
index 00000000..b550be13
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block/token-ranges.json
@@ -0,0 +1,16 @@
+[
+ "",
+ "\n ",
+ "This",
+ " ",
+ "Is",
+ " ",
+ "Custom",
+ " ",
+ "Block",
+ "\n",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/custom-block/tree.json b/test/fixtures/document-fragment/custom-block/tree.json
new file mode 100644
index 00000000..fdfdc48d
--- /dev/null
+++ b/test/fixtures/document-fragment/custom-block/tree.json
@@ -0,0 +1,34 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n This Is Custom Block\n \n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n This Is Custom Block\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n This Is Custom Block\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/empty-custom-block/document-fragment.json b/test/fixtures/document-fragment/empty-custom-block/document-fragment.json
new file mode 100644
index 00000000..4608184f
--- /dev/null
+++ b/test/fixtures/document-fragment/empty-custom-block/document-fragment.json
@@ -0,0 +1,189 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "name": "custom-block",
+ "rawName": "custom-block",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 14,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 14,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": "custom-block"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 28
+ },
+ "end": {
+ "line": 1,
+ "column": 29
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 29
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/empty-custom-block/source.vue b/test/fixtures/document-fragment/empty-custom-block/source.vue
new file mode 100644
index 00000000..ba4c7cd9
--- /dev/null
+++ b/test/fixtures/document-fragment/empty-custom-block/source.vue
@@ -0,0 +1 @@
+
diff --git a/test/fixtures/document-fragment/empty-custom-block/token-ranges.json b/test/fixtures/document-fragment/empty-custom-block/token-ranges.json
new file mode 100644
index 00000000..83e2b08e
--- /dev/null
+++ b/test/fixtures/document-fragment/empty-custom-block/token-ranges.json
@@ -0,0 +1,7 @@
+[
+ "",
+ " ",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/empty-custom-block/tree.json b/test/fixtures/document-fragment/empty-custom-block/tree.json
new file mode 100644
index 00000000..8daf725d
--- /dev/null
+++ b/test/fixtures/document-fragment/empty-custom-block/tree.json
@@ -0,0 +1,29 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": " \n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": " ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/html-file/document-fragment.json b/test/fixtures/document-fragment/html-file/document-fragment.json
new file mode 100644
index 00000000..293a30aa
--- /dev/null
+++ b/test/fixtures/document-fragment/html-file/document-fragment.json
@@ -0,0 +1,2223 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 7
+ }
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 16,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 7
+ }
+ },
+ "name": "html",
+ "rawName": "html",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 16,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 23,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "name": "head",
+ "rawName": "head",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 29,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 32,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 32,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 39,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 39,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "name": "type",
+ "rawName": "type"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 44,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "value": "text/css"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 25
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n a {\n color: pink;\n }\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 85,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 94,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 102,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "name": "body",
+ "rawName": "body",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 102,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 108,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 111,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 13
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 111,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 116,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 13
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 13
+ },
+ "end": {
+ "line": 12,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 125,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 125,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 59
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 133,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 32
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 133,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 14
+ }
+ },
+ "name": "type",
+ "rawName": "type"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 138,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 15
+ },
+ "end": {
+ "line": 12,
+ "column": 32
+ }
+ },
+ "value": "text/x-template"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 156,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 33
+ },
+ "end": {
+ "line": 12,
+ "column": 58
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 156,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 33
+ },
+ "end": {
+ "line": 12,
+ "column": 35
+ }
+ },
+ "name": "id",
+ "rawName": "id"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 159,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 36
+ },
+ "end": {
+ "line": 12,
+ "column": 58
+ }
+ },
+ "value": "hello-world-template"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 182,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 59
+ },
+ "end": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "value": "\n Hello hello hello
\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 214,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 223,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 11
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 226,
+ 322
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 11
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 226,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 234,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n Vue.component('hello-world', {\n template: '#hello-world-template'\n })\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 313,
+ 322
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 322,
+ 323
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 323,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 331,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 7
+ }
+ }
+ },
+ "variables": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "value": "head"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 29,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 39,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 13
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 44,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "value": "text/css"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 73,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "pink;"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 78,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 82,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 3
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 85,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 94,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": "head"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 102,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "body"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 111,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 116,
+ 121
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 12
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 121,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 12
+ },
+ "end": {
+ "line": 11,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 13
+ },
+ "end": {
+ "line": 12,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 125,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 133,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 12,
+ "column": 14
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 14
+ },
+ "end": {
+ "line": 12,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 138,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 15
+ },
+ "end": {
+ "line": 12,
+ "column": 32
+ }
+ },
+ "value": "text/x-template"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 156,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 33
+ },
+ "end": {
+ "line": 12,
+ "column": 35
+ }
+ },
+ "value": "id"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 35
+ },
+ "end": {
+ "line": 12,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 159,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 36
+ },
+ "end": {
+ "line": 12,
+ "column": 58
+ }
+ },
+ "value": "hello-world-template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 181,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 58
+ },
+ "end": {
+ "line": 12,
+ "column": 59
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 187
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 59
+ },
+ "end": {
+ "line": 13,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 187,
+ 195
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 4
+ },
+ "end": {
+ "line": 13,
+ "column": 12
+ }
+ },
+ "value": "Hello"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 195,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 12
+ },
+ "end": {
+ "line": 13,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 196,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 13
+ },
+ "end": {
+ "line": 13,
+ "column": 18
+ }
+ },
+ "value": "hello"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 18
+ },
+ "end": {
+ "line": 13,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 202,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 19
+ },
+ "end": {
+ "line": 13,
+ "column": 28
+ }
+ },
+ "value": "hello
"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 211,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 28
+ },
+ "end": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 214,
+ 222
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 222,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 223,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 11
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 226,
+ 233
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 9
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 233,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 9
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 234,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 237,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 2
+ },
+ "end": {
+ "line": 16,
+ "column": 30
+ }
+ },
+ "value": "Vue.component('hello-world',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 30
+ },
+ "end": {
+ "line": 16,
+ "column": 31
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 266,
+ 267
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 31
+ },
+ "end": {
+ "line": 16,
+ "column": 32
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 267,
+ 272
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 32
+ },
+ "end": {
+ "line": 17,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 272,
+ 281
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 4
+ },
+ "end": {
+ "line": 17,
+ "column": 13
+ }
+ },
+ "value": "template:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 281,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 13
+ },
+ "end": {
+ "line": 17,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 282,
+ 305
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 14
+ },
+ "end": {
+ "line": 17,
+ "column": 37
+ }
+ },
+ "value": "'#hello-world-template'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 305,
+ 308
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 37
+ },
+ "end": {
+ "line": 18,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 308,
+ 310
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 2
+ },
+ "end": {
+ "line": 18,
+ "column": 4
+ }
+ },
+ "value": "})"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 310,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 4
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 313,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 321,
+ 322
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 19,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 322,
+ 323
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 323,
+ 329
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 6
+ }
+ },
+ "value": "body"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 329,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 6
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 331,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 6
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 337,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 6
+ },
+ "end": {
+ "line": 21,
+ "column": 7
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "HTMLBogusComment",
+ "range": [
+ 0,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": "DOCTYPE html"
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/html-file/source.html b/test/fixtures/document-fragment/html-file/source.html
new file mode 100644
index 00000000..3d7babf3
--- /dev/null
+++ b/test/fixtures/document-fragment/html-file/source.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/html-file/token-ranges.json b/test/fixtures/document-fragment/html-file/token-ranges.json
new file mode 100644
index 00000000..2ce8d28d
--- /dev/null
+++ b/test/fixtures/document-fragment/html-file/token-ranges.json
@@ -0,0 +1,79 @@
+[
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n ",
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n ",
+ "",
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/html-file/tree.json b/test/fixtures/document-fragment/html-file/tree.json
new file mode 100644
index 00000000..8419f4af
--- /dev/null
+++ b/test/fixtures/document-fragment/html-file/tree.json
@@ -0,0 +1,235 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n \n\n\n
\n \n \n\n",
+ "children": [
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n\n \n\n\n
\n \n \n\n",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n
\n \n \n",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json b/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json
new file mode 100644
index 00000000..8616cb4e
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json
@@ -0,0 +1,1693 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 291
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 59,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": ";\n font-size: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 76,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 67
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 100,
+ "end": 109,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 39
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 100,
+ 109
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 100,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 39
+ },
+ "end": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 100,
+ 104
+ ],
+ "name": "font"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 105,
+ "end": 109,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 44
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 105,
+ 109
+ ],
+ "name": "size"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 100,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 39
+ },
+ "end": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 100,
+ 104
+ ],
+ "name": "font"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 128,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 67
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": ";\n border-color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 148,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 158,
+ "end": 173,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 43
+ }
+ },
+ "range": [
+ 158,
+ 173
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 158,
+ "end": 164,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "range": [
+ 158,
+ 164
+ ],
+ "name": "border"
+ },
+ "arguments": [
+ {
+ "type": "Literal",
+ "start": 165,
+ "end": 172,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "range": [
+ 165,
+ 172
+ ],
+ "value": "color",
+ "raw": "'color'"
+ }
+ ],
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 158,
+ "end": 164,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "range": [
+ 158,
+ 164
+ ],
+ "name": "border"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 191,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "value": ";\n background-color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 215,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 22
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 225,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 62
+ }
+ },
+ "range": [
+ 225,
+ 255
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 225,
+ "end": 235,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 42
+ }
+ },
+ "range": [
+ 225,
+ 235
+ ],
+ "name": "background"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 57
+ },
+ "end": {
+ "line": 7,
+ "column": 62
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ],
+ "name": "color"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 225,
+ "end": 235,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 42
+ }
+ },
+ "range": [
+ 225,
+ 235
+ ],
+ "name": "background"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 276,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 282,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 290,
+ 291
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 60,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 65,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 76,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 38
+ },
+ "end": {
+ "line": 4,
+ "column": 39
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "font",
+ "start": 100,
+ "end": 104,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 39
+ },
+ "end": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 100,
+ 104
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 104,
+ "end": 105,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 43
+ },
+ "end": {
+ "line": 4,
+ "column": 44
+ }
+ },
+ "range": [
+ 104,
+ 105
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "size",
+ "start": 105,
+ "end": 109,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 44
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 105,
+ 109
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 48
+ },
+ "end": {
+ "line": 4,
+ "column": 49
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 66
+ },
+ "end": {
+ "line": 4,
+ "column": 67
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 67
+ },
+ "end": {
+ "line": 4,
+ "column": 68
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 129,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 68
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 134,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "value": "border-color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 157,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 27
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "border",
+ "start": 158,
+ "end": 164,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "range": [
+ 158,
+ 164
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 164,
+ "end": 165,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "range": [
+ 164,
+ 165
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'color'",
+ "start": 165,
+ "end": 172,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "range": [
+ 165,
+ 172
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 172,
+ "end": 173,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 42
+ },
+ "end": {
+ "line": 5,
+ "column": 43
+ }
+ },
+ "range": [
+ 172,
+ 173
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 189,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 7
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 192,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 197,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "value": "background-color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 214,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 215,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 28
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 221,
+ 222
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 28
+ },
+ "end": {
+ "line": 7,
+ "column": 29
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 224,
+ 225
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 31
+ },
+ "end": {
+ "line": 7,
+ "column": 32
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "background",
+ "start": 225,
+ "end": 235,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 42
+ }
+ },
+ "range": [
+ 225,
+ 235
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 235,
+ "end": 236,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 42
+ },
+ "end": {
+ "line": 7,
+ "column": 43
+ }
+ },
+ "range": [
+ 235,
+ 236
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 57
+ },
+ "end": {
+ "line": 7,
+ "column": 62
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 269,
+ 270
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 76
+ },
+ "end": {
+ "line": 7,
+ "column": 77
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 275,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 276,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 5
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 280
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 280,
+ 281
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 281,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 3
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 282,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 289,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 290,
+ 291
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "Block",
+ "value": " comment1 ",
+ "start": 43,
+ "end": 57,
+ "range": [
+ 43,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 40
+ }
+ }
+ },
+ {
+ "type": "Block",
+ "range": [
+ 84,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 37
+ }
+ },
+ "value": " comment2 "
+ },
+ {
+ "type": "Block",
+ "range": [
+ 112,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 51
+ },
+ "end": {
+ "line": 4,
+ "column": 65
+ }
+ },
+ "value": " comment3 "
+ },
+ {
+ "type": "Line",
+ "value": " comment4",
+ "start": 173,
+ "end": 184,
+ "range": [
+ 173,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 54
+ }
+ }
+ },
+ {
+ "type": "Block",
+ "value": "comment5",
+ "start": 237,
+ "end": 249,
+ "range": [
+ 237,
+ 249
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 44
+ },
+ "end": {
+ "line": 7,
+ "column": 56
+ }
+ }
+ },
+ {
+ "type": "Block",
+ "value": "comment6",
+ "start": 256,
+ "end": 268,
+ "range": [
+ 256,
+ 268
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 63
+ },
+ "end": {
+ "line": 7,
+ "column": 75
+ }
+ }
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-edge-cases/source.vue b/test/fixtures/document-fragment/style-variables-edge-cases/source.vue
new file mode 100644
index 00000000..ed74f449
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-edge-cases/source.vue
@@ -0,0 +1,10 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-edge-cases/token-ranges.json b/test/fixtures/document-fragment/style-variables-edge-cases/token-ranges.json
new file mode 100644
index 00000000..91914c99
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-edge-cases/token-ranges.json
@@ -0,0 +1,63 @@
+[
+ "",
+ "\n",
+ "/* comment1 */",
+ "/* comment2 */",
+ "/* comment3 */",
+ "// comment4",
+ "/*comment5*/",
+ "/*comment6*/"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-edge-cases/tree.json b/test/fixtures/document-fragment/style-variables-edge-cases/tree.json
new file mode 100644
index 00000000..2f530c7e
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-edge-cases/tree.json
@@ -0,0 +1,131 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores01/document-fragment.json b/test/fixtures/document-fragment/style-variables-ignores01/document-fragment.json
new file mode 100644
index 00000000..ff952fa5
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores01/document-fragment.json
@@ -0,0 +1,1209 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 14,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n const color = 'red'\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 37,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 46,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 48,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 48,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 55,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 55,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 60,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "scss"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 67,
+ 199
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n .v-bind .color {\n color: 'v-bind(color)';\n background-color: 'v-bind(color)';\n }\n /* v-bind(color) */\n // v-bind(color)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 199,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 207,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "color"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": "'red'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 37,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 55,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 11
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 60,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 12
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "scss"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ".v-bind"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 78,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": ".color"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 86,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 91,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 98,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 27
+ }
+ },
+ "value": "'v-bind(color)';"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 114,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 27
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 119,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 21
+ }
+ },
+ "value": "background-color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 136,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 21
+ },
+ "end": {
+ "line": 8,
+ "column": 22
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 137,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 22
+ },
+ "end": {
+ "line": 8,
+ "column": 38
+ }
+ },
+ "value": "'v-bind(color)';"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 153,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 38
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 156,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 157,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 3
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 163,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 18
+ }
+ },
+ "value": "v-bind(color)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 176,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 18
+ },
+ "end": {
+ "line": 10,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 177,
+ 179
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 19
+ },
+ "end": {
+ "line": 10,
+ "column": 21
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 179,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 21
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 182,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 4
+ },
+ "end": {
+ "line": 11,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 185,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 18
+ }
+ },
+ "value": "v-bind(color)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 199
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 18
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 199,
+ 206
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 206,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 7
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 207,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores01/source.vue b/test/fixtures/document-fragment/style-variables-ignores01/source.vue
new file mode 100644
index 00000000..ac9b8e4b
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores01/source.vue
@@ -0,0 +1,12 @@
+
+
+
diff --git a/test/fixtures/document-fragment/style-variables-ignores01/token-ranges.json b/test/fixtures/document-fragment/style-variables-ignores01/token-ranges.json
new file mode 100644
index 00000000..353a19fb
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores01/token-ranges.json
@@ -0,0 +1,52 @@
+[
+ "",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores01/tree.json b/test/fixtures/document-fragment/style-variables-ignores01/tree.json
new file mode 100644
index 00000000..e64cf346
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores01/tree.json
@@ -0,0 +1,89 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json b/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json
new file mode 100644
index 00000000..06625d92
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json
@@ -0,0 +1,2178 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 365
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 364
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 7,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 7,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 12,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "scss"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 19,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 40,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 47,
+ 52
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 47,
+ 52
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 53,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ";\n }\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 79,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 87,
+ "end": 97,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "range": [
+ 87,
+ 97
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 87,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "range": [
+ 87,
+ 93
+ ],
+ "name": "colors"
+ },
+ "property": {
+ "type": "Literal",
+ "start": 94,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "range": [
+ 94,
+ 96
+ ],
+ "value": 42,
+ "raw": "42"
+ },
+ "computed": true,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 87,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "range": [
+ 87,
+ 93
+ ],
+ "name": "colors"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 99,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": ";\n }\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 125,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 133,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 133,
+ 143
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 133,
+ "end": 141,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 27
+ }
+ },
+ "range": [
+ 133,
+ 141
+ ],
+ "name": "getColor"
+ },
+ "arguments": [],
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 133,
+ "end": 141,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 27
+ }
+ },
+ "range": [
+ 133,
+ 141
+ ],
+ "name": "getColor"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 145,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 16,
+ "column": 15
+ }
+ },
+ "value": ";\n }\n .str-and-comments{\n content: \"v-bind('getColor()')\";\n content: \"v-bind('getColor()')\\\"v-bind(color)\";\n // color: v-bind(color);\n /* color: v-bind(color); */\n color: /**/"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 337,
+ 350
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 15
+ },
+ "end": {
+ "line": 16,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 344,
+ "end": 349,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 22
+ },
+ "end": {
+ "line": 16,
+ "column": 27
+ }
+ },
+ "range": [
+ 344,
+ 349
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 344,
+ "end": 349,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 22
+ },
+ "end": {
+ "line": 16,
+ "column": 27
+ }
+ },
+ "range": [
+ 344,
+ 349
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 350,
+ 356
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 28
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 356,
+ 364
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 364,
+ 365
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 7,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 11
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 11
+ },
+ "end": {
+ "line": 1,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 12,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 12
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "scss"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 33,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 39,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 40,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 47,
+ "end": 52,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 47,
+ 52
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 58,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 61,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 72,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 79,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 19
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "colors",
+ "start": 87,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 25
+ }
+ },
+ "range": [
+ 87,
+ 93
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "[",
+ "start": 93,
+ "end": 94,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 93,
+ 94
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "42",
+ "start": 94,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "range": [
+ 94,
+ 96
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "]",
+ "start": 96,
+ "end": 97,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "range": [
+ 96,
+ 97
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 29
+ },
+ "end": {
+ "line": 6,
+ "column": 30
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 30
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 31
+ },
+ "end": {
+ "line": 6,
+ "column": 32
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 3
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 107,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 125,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 131,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 132,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "getColor",
+ "start": 133,
+ "end": 141,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 27
+ }
+ },
+ "range": [
+ 133,
+ 141
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 27
+ },
+ "end": {
+ "line": 9,
+ "column": 28
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 142,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 28
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 142,
+ 143
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 143,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 31
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 145,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 32
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 146,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 32
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 3
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 153,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 20
+ }
+ },
+ "value": ".str-and-comments{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 171,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 20
+ },
+ "end": {
+ "line": 12,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 176,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 4
+ },
+ "end": {
+ "line": 12,
+ "column": 12
+ }
+ },
+ "value": "content:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 12
+ },
+ "end": {
+ "line": 12,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 185,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 13
+ },
+ "end": {
+ "line": 12,
+ "column": 36
+ }
+ },
+ "value": "\"v-bind('getColor()')\";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 208,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 36
+ },
+ "end": {
+ "line": 13,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 213,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 4
+ },
+ "end": {
+ "line": 13,
+ "column": 12
+ }
+ },
+ "value": "content:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 222
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 12
+ },
+ "end": {
+ "line": 13,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 222,
+ 260
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 13
+ },
+ "end": {
+ "line": 13,
+ "column": 51
+ }
+ },
+ "value": "\"v-bind('getColor()')\\\"v-bind(color)\";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 260,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 51
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 265,
+ 267
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 6
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 267,
+ 268
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 6
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 268,
+ 274
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 14,
+ "column": 13
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 274,
+ 275
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 13
+ },
+ "end": {
+ "line": 14,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 275,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 14
+ },
+ "end": {
+ "line": 14,
+ "column": 28
+ }
+ },
+ "value": "v-bind(color);"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 289,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 28
+ },
+ "end": {
+ "line": 15,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 294,
+ 296
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 4
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 296,
+ 297
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 297,
+ 303
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 13
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 303,
+ 304
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 13
+ },
+ "end": {
+ "line": 15,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 304,
+ 318
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 14
+ },
+ "end": {
+ "line": 15,
+ "column": 28
+ }
+ },
+ "value": "v-bind(color);"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 318,
+ 319
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 28
+ },
+ "end": {
+ "line": 15,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 319,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 31
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 321,
+ 326
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 31
+ },
+ "end": {
+ "line": 16,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 326,
+ 332
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 4
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 332,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 333,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 11
+ },
+ "end": {
+ "line": 16,
+ "column": 15
+ }
+ },
+ "value": "/**/"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 337,
+ 343
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 15
+ },
+ "end": {
+ "line": 16,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 343,
+ 344
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 21
+ },
+ "end": {
+ "line": 16,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 344,
+ "end": 349,
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 22
+ },
+ "end": {
+ "line": 16,
+ "column": 27
+ }
+ },
+ "range": [
+ 344,
+ 349
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 349,
+ 350
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 27
+ },
+ "end": {
+ "line": 16,
+ "column": 28
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 350,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 28
+ },
+ "end": {
+ "line": 16,
+ "column": 29
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 351,
+ 354
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 29
+ },
+ "end": {
+ "line": 17,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 354,
+ 355
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 2
+ },
+ "end": {
+ "line": 17,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 355,
+ 356
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 3
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 356,
+ 363
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 363,
+ 364
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 364,
+ 365
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores02/source.vue b/test/fixtures/document-fragment/style-variables-ignores02/source.vue
new file mode 100644
index 00000000..70c9f9fd
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores02/source.vue
@@ -0,0 +1,18 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-ignores02/token-ranges.json b/test/fixtures/document-fragment/style-variables-ignores02/token-ranges.json
new file mode 100644
index 00000000..2faa5238
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores02/token-ranges.json
@@ -0,0 +1,91 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-ignores02/tree.json b/test/fixtures/document-fragment/style-variables-ignores02/tree.json
new file mode 100644
index 00000000..58e58424
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-ignores02/tree.json
@@ -0,0 +1,132 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-inline-comment-like/document-fragment.json b/test/fixtures/document-fragment/style-variables-inline-comment-like/document-fragment.json
new file mode 100644
index 00000000..1abbaf33
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-inline-comment-like/document-fragment.json
@@ -0,0 +1,1037 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 14,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n const color = 'red'\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 37,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 46,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 48,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 48,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "value": "\n .v-bind .color {\n color: // "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 89,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 14
+ },
+ "end": {
+ "line": 7,
+ "column": 27
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 96,
+ "end": 101,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 96,
+ 101
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 96,
+ "end": 101,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 96,
+ 101
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 102,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 27
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 108,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "color"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 21
+ }
+ },
+ "value": "'red'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 37,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ".v-bind"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": ".color"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 79,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 86,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 13
+ }
+ },
+ "value": "//"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 89,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 14
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 96,
+ "end": 101,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "range": [
+ 96,
+ 101
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 26
+ },
+ "end": {
+ "line": 7,
+ "column": 27
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 27
+ },
+ "end": {
+ "line": 7,
+ "column": 28
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 28
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 3
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 108,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-inline-comment-like/source.vue b/test/fixtures/document-fragment/style-variables-inline-comment-like/source.vue
new file mode 100644
index 00000000..d2278e0e
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-inline-comment-like/source.vue
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/fixtures/document-fragment/style-variables-inline-comment-like/token-ranges.json b/test/fixtures/document-fragment/style-variables-inline-comment-like/token-ranges.json
new file mode 100644
index 00000000..c4a25866
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-inline-comment-like/token-ranges.json
@@ -0,0 +1,41 @@
+[
+ "",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-inline-comment-like/tree.json b/test/fixtures/document-fragment/style-variables-inline-comment-like/tree.json
new file mode 100644
index 00000000..bf090868
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-inline-comment-like/tree.json
@@ -0,0 +1,88 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-comment01/document-fragment.json b/test/fixtures/document-fragment/style-variables-with-comment01/document-fragment.json
new file mode 100644
index 00000000..d28b3506
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-comment01/document-fragment.json
@@ -0,0 +1,788 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 39,
+ 44
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 39,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 39,
+ 44
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": ";\n width: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 58,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "range": [
+ 70,
+ 75
+ ],
+ "name": "width"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 70,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "range": [
+ 70,
+ 75
+ ],
+ "name": "width"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 76,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 82,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 39,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 39,
+ 44
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 51,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": "width:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 22
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "width",
+ "start": 70,
+ "end": 75,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ },
+ "range": [
+ 70,
+ 75
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 30
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 3
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 82,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "Block",
+ "range": [
+ 34,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Block",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "value": "c"
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-comment01/source.vue b/test/fixtures/document-fragment/style-variables-with-comment01/source.vue
new file mode 100644
index 00000000..fab4f769
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-comment01/source.vue
@@ -0,0 +1,6 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-with-comment01/token-ranges.json b/test/fixtures/document-fragment/style-variables-with-comment01/token-ranges.json
new file mode 100644
index 00000000..3bc49bc8
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-comment01/token-ranges.json
@@ -0,0 +1,30 @@
+[
+ "",
+ "\n",
+ "/**/",
+ "/*c*/"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-comment01/tree.json b/test/fixtures/document-fragment/style-variables-with-comment01/tree.json
new file mode 100644
index 00000000..0aec6ad4
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-comment01/tree.json
@@ -0,0 +1,66 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression01/document-fragment.json b/test/fixtures/document-fragment/style-variables-with-complex-expression01/document-fragment.json
new file mode 100644
index 00000000..a9f80229
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression01/document-fragment.json
@@ -0,0 +1,2246 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": "\ndiv {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 23,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 30,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 30,
+ 48
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 30,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 30,
+ 41
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 31,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 31,
+ 36
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ],
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 36
+ ],
+ "name": "b"
+ }
+ },
+ "operator": "/",
+ "right": {
+ "type": "Literal",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ],
+ "value": 2,
+ "raw": "2"
+ }
+ },
+ "operator": "+",
+ "right": {
+ "type": "Literal",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 44,
+ 48
+ ],
+ "value": "px",
+ "raw": "'px'"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 36
+ ],
+ "name": "b"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 50,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ";\n}\ndiv {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 69,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 80,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 80,
+ 98
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 80,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "range": [
+ 80,
+ 91
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 81,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 81,
+ 86
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ],
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 85,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ],
+ "name": "b"
+ }
+ },
+ "operator": "/",
+ "right": {
+ "type": "Literal",
+ "start": 90,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 30
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "range": [
+ 90,
+ 91
+ ],
+ "value": 2,
+ "raw": "2"
+ }
+ },
+ "operator": "+",
+ "right": {
+ "type": "Literal",
+ "start": 94,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 94,
+ 98
+ ],
+ "value": "px",
+ "raw": "'px'"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 85,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ],
+ "name": "b"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 100,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ";\n}\np {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 117,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 124,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 16
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "range": [
+ 124,
+ 143
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 126,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 126,
+ 131
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 126,
+ "end": 127,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "range": [
+ 126,
+ 127
+ ],
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 130,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 22
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 130,
+ 131
+ ],
+ "name": "b"
+ }
+ },
+ "operator": "/",
+ "right": {
+ "type": "BinaryExpression",
+ "start": 137,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "range": [
+ 137,
+ 142
+ ],
+ "left": {
+ "type": "Literal",
+ "start": 137,
+ "end": 138,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ],
+ "value": 2,
+ "raw": "2"
+ },
+ "operator": "*",
+ "right": {
+ "type": "Identifier",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 33
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ],
+ "name": "a"
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 126,
+ "end": 127,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "range": [
+ 126,
+ 127
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 130,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 22
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 130,
+ 131
+ ],
+ "name": "b"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 33
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 144,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 36
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": ";\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 148,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 156,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 8,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 30,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "range": [
+ 30,
+ 31
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 31,
+ "end": 32,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "range": [
+ 31,
+ 32
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 33,
+ "end": 34,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 19
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 36
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 38,
+ 39
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "2",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 42,
+ "end": 43,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 42,
+ 43
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'px'",
+ "start": 44,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 44,
+ 48
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 49,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 50,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 54,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 62,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 69,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 20
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 80,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 20
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "range": [
+ 80,
+ 81
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 81,
+ "end": 82,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "range": [
+ 81,
+ 82
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 83,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 24
+ }
+ },
+ "range": [
+ 83,
+ 84
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 85,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 25
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "range": [
+ 85,
+ 86
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 86,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "start": 88,
+ "end": 89,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "range": [
+ 88,
+ 89
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "2",
+ "start": 90,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 30
+ },
+ "end": {
+ "line": 6,
+ "column": 31
+ }
+ },
+ "range": [
+ 90,
+ 91
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 92,
+ "end": 93,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "range": [
+ 92,
+ 93
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'px'",
+ "start": 94,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 94,
+ 98
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 3
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 3
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 117,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 16
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 124,
+ "end": 125,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 16
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "range": [
+ 124,
+ 125
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 125,
+ "end": 126,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "range": [
+ 125,
+ 126
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 126,
+ "end": 127,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "range": [
+ 126,
+ 127
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 128,
+ "end": 129,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "range": [
+ 128,
+ 129
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 130,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 22
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 130,
+ 131
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 131,
+ "end": 132,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 23
+ },
+ "end": {
+ "line": 9,
+ "column": 24
+ }
+ },
+ "range": [
+ 131,
+ 132
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 132,
+ "end": 133,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 24
+ },
+ "end": {
+ "line": 9,
+ "column": 25
+ }
+ },
+ "range": [
+ 132,
+ 133
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "start": 134,
+ "end": 135,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 27
+ }
+ },
+ "range": [
+ 134,
+ 135
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 136,
+ "end": 137,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 28
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "range": [
+ 136,
+ 137
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "2",
+ "start": 137,
+ "end": 138,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "range": [
+ 137,
+ 138
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "*",
+ "start": 139,
+ "end": 140,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 31
+ },
+ "end": {
+ "line": 9,
+ "column": 32
+ }
+ },
+ "range": [
+ 139,
+ 140
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 141,
+ "end": 142,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 33
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "range": [
+ 141,
+ 142
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 142,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 34
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "range": [
+ 142,
+ 143
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 143,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 35
+ },
+ "end": {
+ "line": 9,
+ "column": 36
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 36
+ },
+ "end": {
+ "line": 9,
+ "column": 37
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 145,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 37
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 146,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 1
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 148,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 155,
+ 156
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 156,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression01/source.vue b/test/fixtures/document-fragment/style-variables-with-complex-expression01/source.vue
new file mode 100644
index 00000000..bcd17837
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression01/source.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression01/token-ranges.json b/test/fixtures/document-fragment/style-variables-with-complex-expression01/token-ranges.json
new file mode 100644
index 00000000..4f1de537
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression01/token-ranges.json
@@ -0,0 +1,78 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression01/tree.json b/test/fixtures/document-fragment/style-variables-with-complex-expression01/tree.json
new file mode 100644
index 00000000..26a7fef2
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression01/tree.json
@@ -0,0 +1,181 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression02/document-fragment.json b/test/fixtures/document-fragment/style-variables-with-complex-expression02/document-fragment.json
new file mode 100644
index 00000000..dea299fb
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression02/document-fragment.json
@@ -0,0 +1,1478 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "\ndiv {\n width: calc("
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "expression": {
+ "type": "BinaryExpression",
+ "start": 35,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 35,
+ 53
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 35,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 35,
+ 46
+ ],
+ "left": {
+ "type": "BinaryExpression",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "name": "a"
+ },
+ "operator": "+",
+ "right": {
+ "type": "Identifier",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ],
+ "name": "b"
+ }
+ },
+ "operator": "/",
+ "right": {
+ "type": "Literal",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 45,
+ 46
+ ],
+ "value": 2,
+ "raw": "2"
+ }
+ },
+ "operator": "+",
+ "right": {
+ "type": "Literal",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 49,
+ 53
+ ],
+ "value": "px",
+ "raw": "'px'"
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "name": "a"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ],
+ "name": "b"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": " - 3px);\n}\np {\n /* missing close */\n width: v-bind(((a + b)) / (2 * a)\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 130,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 8,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 3
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 11,
+ 12
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 3
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 12,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "width:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 23,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "value": "calc("
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 21
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 35,
+ "end": 36,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 21
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 36
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "a",
+ "start": 36,
+ "end": 37,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 38,
+ "end": 39,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 38,
+ 39
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "b",
+ "start": 40,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 27
+ }
+ },
+ "range": [
+ 40,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 41,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 41,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "start": 43,
+ "end": 44,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "range": [
+ 43,
+ 44
+ ]
+ },
+ {
+ "type": "Numeric",
+ "value": "2",
+ "start": 45,
+ "end": 46,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 45,
+ 46
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "+",
+ "start": 47,
+ "end": 48,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 33
+ },
+ "end": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'px'",
+ "start": 49,
+ "end": 53,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 35
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "range": [
+ 49,
+ 53
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 40
+ },
+ "end": {
+ "line": 3,
+ "column": 41
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 41
+ },
+ "end": {
+ "line": 3,
+ "column": 42
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 42
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "value": "-"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 44
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 58,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 44
+ },
+ "end": {
+ "line": 3,
+ "column": 49
+ }
+ },
+ "value": "3px);"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 49
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 1
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 1
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 3
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 3
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 72,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 75,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": "missing"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 83,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 13
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "close"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 89,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 19
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 91,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 94,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 8
+ }
+ },
+ "value": "width:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 9
+ },
+ "end": {
+ "line": 7,
+ "column": 19
+ }
+ },
+ "value": "v-bind(((a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 19
+ },
+ "end": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 20
+ },
+ "end": {
+ "line": 7,
+ "column": 21
+ }
+ },
+ "value": "+"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 21
+ },
+ "end": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 114,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 22
+ },
+ "end": {
+ "line": 7,
+ "column": 25
+ }
+ },
+ "value": "b))"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 25
+ },
+ "end": {
+ "line": 7,
+ "column": 26
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 26
+ },
+ "end": {
+ "line": 7,
+ "column": 27
+ }
+ },
+ "value": "/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 119,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 27
+ },
+ "end": {
+ "line": 7,
+ "column": 28
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 120,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 28
+ },
+ "end": {
+ "line": 7,
+ "column": 30
+ }
+ },
+ "value": "(2"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 30
+ },
+ "end": {
+ "line": 7,
+ "column": 31
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 31
+ },
+ "end": {
+ "line": 7,
+ "column": 32
+ }
+ },
+ "value": "*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 33
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 125,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 33
+ },
+ "end": {
+ "line": 7,
+ "column": 35
+ }
+ },
+ "value": "a)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 35
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 130,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression02/source.vue b/test/fixtures/document-fragment/style-variables-with-complex-expression02/source.vue
new file mode 100644
index 00000000..2803c288
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression02/source.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression02/token-ranges.json b/test/fixtures/document-fragment/style-variables-with-complex-expression02/token-ranges.json
new file mode 100644
index 00000000..ff7beaf3
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression02/token-ranges.json
@@ -0,0 +1,64 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-complex-expression02/tree.json b/test/fixtures/document-fragment/style-variables-with-complex-expression02/tree.json
new file mode 100644
index 00000000..2ecb302b
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-complex-expression02/tree.json
@@ -0,0 +1,83 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-error/document-fragment.json b/test/fixtures/document-fragment/style-variables-with-error/document-fragment.json
new file mode 100644
index 00000000..64dc07d6
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-error/document-fragment.json
@@ -0,0 +1,523 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "expression": null,
+ "references": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 47,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 53,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 35,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "value": "color"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 41,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": "error"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 30
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 52,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 53,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 60,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": [
+ {
+ "message": "Unexpected token error",
+ "index": 41,
+ "lineNumber": 3,
+ "column": 24
+ }
+ ]
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-error/source.vue b/test/fixtures/document-fragment/style-variables-with-error/source.vue
new file mode 100644
index 00000000..de3885e9
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-error/source.vue
@@ -0,0 +1,5 @@
+
diff --git a/test/fixtures/document-fragment/style-variables-with-error/token-ranges.json b/test/fixtures/document-fragment/style-variables-with-error/token-ranges.json
new file mode 100644
index 00000000..6cbaa046
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-error/token-ranges.json
@@ -0,0 +1,22 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-error/tree.json b/test/fixtures/document-fragment/style-variables-with-error/tree.json
new file mode 100644
index 00000000..c71c59a5
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-error/tree.json
@@ -0,0 +1,44 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-option-false/document-fragment.json b/test/fixtures/document-fragment/style-variables-with-option-false/document-fragment.json
new file mode 100644
index 00000000..77177ca6
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-option-false/document-fragment.json
@@ -0,0 +1,3595 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 13,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 13,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 18,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "name": "class",
+ "rawName": "class"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 36,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 43,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 13,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 56,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 67,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 74,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 88,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "data()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 120,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "value": "'red',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 13
+ }
+ },
+ "value": "font:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 13
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 149,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 15
+ }
+ },
+ "value": "size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 11,
+ "column": 22
+ }
+ },
+ "value": "'2em',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 22
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 181,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 13,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 6
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 196,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 6
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 3
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 203,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 211,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 214,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 6
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 224,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 229,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 231,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 20,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 236,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 4
+ },
+ "end": {
+ "line": 20,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 243,
+ 257
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 25
+ }
+ },
+ "value": "v-bind(color);"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 257,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 4
+ }
+ },
+ "value": "\n\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 4
+ },
+ "end": {
+ "line": 22,
+ "column": 6
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 6
+ },
+ "end": {
+ "line": 22,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 266,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 7
+ },
+ "end": {
+ "line": 22,
+ "column": 18
+ }
+ },
+ "value": "expressions"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 278
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 18
+ },
+ "end": {
+ "line": 22,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 278,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 19
+ },
+ "end": {
+ "line": 22,
+ "column": 24
+ }
+ },
+ "value": "(wrap"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 283,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 24
+ },
+ "end": {
+ "line": 22,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 284,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 27
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 286,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 27
+ },
+ "end": {
+ "line": 22,
+ "column": 28
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 287,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 28
+ },
+ "end": {
+ "line": 22,
+ "column": 35
+ }
+ },
+ "value": "quotes)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 294,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 35
+ },
+ "end": {
+ "line": 22,
+ "column": 36
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 295,
+ 297
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 36
+ },
+ "end": {
+ "line": 22,
+ "column": 38
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 297,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 38
+ },
+ "end": {
+ "line": 23,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 312
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 4
+ },
+ "end": {
+ "line": 23,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 312,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 14
+ },
+ "end": {
+ "line": 23,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 313,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 15
+ },
+ "end": {
+ "line": 23,
+ "column": 35
+ }
+ },
+ "value": "v-bind('font.size');"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 35
+ },
+ "end": {
+ "line": 24,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 336,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 2
+ },
+ "end": {
+ "line": 24,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 337,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 3
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 338,
+ 345
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 345,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 7
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 56,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 56,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 64,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n export default {\n data() {\n return {\n color: 'red',\n font: {\n size: '2em',\n },\n }\n },\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 203,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 214,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 214,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 221,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": "\n .text {\n color: v-bind(color);\n\n /* expressions (wrap in quotes) */\n font-size: v-bind('font.size');\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 338,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 13,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 56,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 67,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 74,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 88,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "data()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 120,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "value": "'red',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 13
+ }
+ },
+ "value": "font:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 13
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 149,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 15
+ }
+ },
+ "value": "size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 11,
+ "column": 22
+ }
+ },
+ "value": "'2em',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 22
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 181,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 13,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 6
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 196,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 6
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 3
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 203,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 211,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 214,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 6
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 224,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 229,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 231,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 20,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 236,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 4
+ },
+ "end": {
+ "line": 20,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 243,
+ 257
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 25
+ }
+ },
+ "value": "v-bind(color);"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 257,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 4
+ }
+ },
+ "value": "\n\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 4
+ },
+ "end": {
+ "line": 22,
+ "column": 6
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 6
+ },
+ "end": {
+ "line": 22,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 266,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 7
+ },
+ "end": {
+ "line": 22,
+ "column": 18
+ }
+ },
+ "value": "expressions"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 278
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 18
+ },
+ "end": {
+ "line": 22,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 278,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 19
+ },
+ "end": {
+ "line": 22,
+ "column": 24
+ }
+ },
+ "value": "(wrap"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 283,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 24
+ },
+ "end": {
+ "line": 22,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 284,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 27
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 286,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 27
+ },
+ "end": {
+ "line": 22,
+ "column": 28
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 287,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 28
+ },
+ "end": {
+ "line": 22,
+ "column": 35
+ }
+ },
+ "value": "quotes)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 294,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 35
+ },
+ "end": {
+ "line": 22,
+ "column": 36
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 295,
+ 297
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 36
+ },
+ "end": {
+ "line": 22,
+ "column": 38
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 297,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 38
+ },
+ "end": {
+ "line": 23,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 312
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 4
+ },
+ "end": {
+ "line": 23,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 312,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 14
+ },
+ "end": {
+ "line": 23,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 313,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 15
+ },
+ "end": {
+ "line": 23,
+ "column": 35
+ }
+ },
+ "value": "v-bind('font.size');"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 35
+ },
+ "end": {
+ "line": 24,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 336,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 2
+ },
+ "end": {
+ "line": 24,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 337,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 3
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 338,
+ 345
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 345,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 7
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-option-false/parser-options.json b/test/fixtures/document-fragment/style-variables-with-option-false/parser-options.json
new file mode 100644
index 00000000..90a0eb01
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-option-false/parser-options.json
@@ -0,0 +1,5 @@
+{
+ "vueFeatures": {
+ "styleCSSVariableInjection": false
+ }
+}
diff --git a/test/fixtures/document-fragment/style-variables-with-option-false/source.vue b/test/fixtures/document-fragment/style-variables-with-option-false/source.vue
new file mode 100644
index 00000000..d151be23
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-option-false/source.vue
@@ -0,0 +1,25 @@
+
+ hello
+
+
+
+
+
diff --git a/test/fixtures/document-fragment/style-variables-with-option-false/token-ranges.json b/test/fixtures/document-fragment/style-variables-with-option-false/token-ranges.json
new file mode 100644
index 00000000..ac5d560e
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-option-false/token-ranges.json
@@ -0,0 +1,89 @@
+[
+ "",
+ "\n ",
+ "",
+ "hello",
+ "
",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables-with-option-false/tree.json b/test/fixtures/document-fragment/style-variables-with-option-false/tree.json
new file mode 100644
index 00000000..3badd1c0
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables-with-option-false/tree.json
@@ -0,0 +1,129 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n hello
\n \n\n\n\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n hello
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "hello
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "class=\"text\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "class",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"text\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "hello",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables01/document-fragment.json b/test/fixtures/document-fragment/style-variables01/document-fragment.json
new file mode 100644
index 00000000..e920516a
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables01/document-fragment.json
@@ -0,0 +1,4245 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 13,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 13,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 18,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "name": "class",
+ "rawName": "class"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 36,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 43,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 13,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 56,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 67,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 74,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 88,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "data()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 120,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "value": "'red',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 13
+ }
+ },
+ "value": "font:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 13
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 149,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 15
+ }
+ },
+ "value": "size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 11,
+ "column": 22
+ }
+ },
+ "value": "'2em',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 22
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 181,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 13,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 6
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 196,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 6
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 3
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 203,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 211,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 214,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 6
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 224,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 229,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 231,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 20,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 236,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 4
+ },
+ "end": {
+ "line": 20,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 243,
+ 249
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 249,
+ 250
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 17
+ },
+ "end": {
+ "line": 20,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 18
+ },
+ "end": {
+ "line": 20,
+ "column": 23
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 255,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 23
+ },
+ "end": {
+ "line": 20,
+ "column": 24
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 256,
+ 257
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 24
+ },
+ "end": {
+ "line": 20,
+ "column": 25
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 257,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 4
+ }
+ },
+ "value": "\n\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 4
+ },
+ "end": {
+ "line": 22,
+ "column": 6
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 6
+ },
+ "end": {
+ "line": 22,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 266,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 7
+ },
+ "end": {
+ "line": 22,
+ "column": 18
+ }
+ },
+ "value": "expressions"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 278
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 18
+ },
+ "end": {
+ "line": 22,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 278,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 19
+ },
+ "end": {
+ "line": 22,
+ "column": 24
+ }
+ },
+ "value": "(wrap"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 283,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 24
+ },
+ "end": {
+ "line": 22,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 284,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 27
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 286,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 27
+ },
+ "end": {
+ "line": 22,
+ "column": 28
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 287,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 28
+ },
+ "end": {
+ "line": 22,
+ "column": 35
+ }
+ },
+ "value": "quotes)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 294,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 35
+ },
+ "end": {
+ "line": 22,
+ "column": 36
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 295,
+ 297
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 36
+ },
+ "end": {
+ "line": 22,
+ "column": 38
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 297,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 38
+ },
+ "end": {
+ "line": 23,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 312
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 4
+ },
+ "end": {
+ "line": 23,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 312,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 14
+ },
+ "end": {
+ "line": 23,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 313,
+ 319
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 15
+ },
+ "end": {
+ "line": 23,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 319,
+ 320
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 21
+ },
+ "end": {
+ "line": 23,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 320,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 22
+ },
+ "end": {
+ "line": 23,
+ "column": 23
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "font",
+ "start": 321,
+ "end": 325,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 23
+ },
+ "end": {
+ "line": 23,
+ "column": 27
+ }
+ },
+ "range": [
+ 321,
+ 325
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 325,
+ "end": 326,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 27
+ },
+ "end": {
+ "line": 23,
+ "column": 28
+ }
+ },
+ "range": [
+ 325,
+ 326
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "size",
+ "start": 326,
+ "end": 330,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 28
+ },
+ "end": {
+ "line": 23,
+ "column": 32
+ }
+ },
+ "range": [
+ 326,
+ 330
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 32
+ },
+ "end": {
+ "line": 23,
+ "column": 33
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 331,
+ 332
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 33
+ },
+ "end": {
+ "line": 23,
+ "column": 34
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 332,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 34
+ },
+ "end": {
+ "line": 23,
+ "column": 35
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 35
+ },
+ "end": {
+ "line": 24,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 336,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 2
+ },
+ "end": {
+ "line": 24,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 337,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 3
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 338,
+ 345
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 345,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 7
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 56,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 56,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 64,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n export default {\n data() {\n return {\n color: 'red',\n font: {\n size: '2em',\n },\n }\n },\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 203,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 214,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 214,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 221,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 20,
+ "column": 11
+ }
+ },
+ "value": "\n .text {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 243,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 18
+ },
+ "end": {
+ "line": 20,
+ "column": 23
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 18
+ },
+ "end": {
+ "line": 20,
+ "column": 23
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 256,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 24
+ },
+ "end": {
+ "line": 23,
+ "column": 15
+ }
+ },
+ "value": ";\n\n /* expressions (wrap in quotes) */\n font-size: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 313,
+ 332
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 15
+ },
+ "end": {
+ "line": 23,
+ "column": 34
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 321,
+ "end": 330,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 23
+ },
+ "end": {
+ "line": 23,
+ "column": 32
+ }
+ },
+ "range": [
+ 321,
+ 330
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 321,
+ "end": 325,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 23
+ },
+ "end": {
+ "line": 23,
+ "column": 27
+ }
+ },
+ "range": [
+ 321,
+ 325
+ ],
+ "name": "font"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 326,
+ "end": 330,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 28
+ },
+ "end": {
+ "line": 23,
+ "column": 32
+ }
+ },
+ "range": [
+ 326,
+ 330
+ ],
+ "name": "size"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 321,
+ "end": 325,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 23
+ },
+ "end": {
+ "line": 23,
+ "column": 27
+ }
+ },
+ "range": [
+ 321,
+ 325
+ ],
+ "name": "font"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 332,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 34
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 338,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 13,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 23,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 24,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "text"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 31,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": "hello"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 30
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 30
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 43,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 56,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 67,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 74,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 88,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "data()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 6
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": "return"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 13
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 13
+ },
+ "end": {
+ "line": 8,
+ "column": 14
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 120,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 15
+ },
+ "end": {
+ "line": 9,
+ "column": 21
+ }
+ },
+ "value": "'red',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 21
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 142,
+ 147
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 13
+ }
+ },
+ "value": "font:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 13
+ },
+ "end": {
+ "line": 10,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 14
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 149,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 15
+ }
+ },
+ "value": "size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 15
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 11,
+ "column": 22
+ }
+ },
+ "value": "'2em',"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 181
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 22
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 181,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 10
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 10
+ },
+ "end": {
+ "line": 13,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 6
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 196,
+ 198
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 6
+ }
+ },
+ "value": "},"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 198,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 2
+ },
+ "end": {
+ "line": 15,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 3
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 203,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 211,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 8
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 214,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 220,
+ 221
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 6
+ },
+ "end": {
+ "line": 18,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 221,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 224,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 2
+ },
+ "end": {
+ "line": 19,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 229,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 7
+ },
+ "end": {
+ "line": 19,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 8
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 231,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 20,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 236,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 4
+ },
+ "end": {
+ "line": 20,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 243,
+ 249
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 11
+ },
+ "end": {
+ "line": 20,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 249,
+ 250
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 17
+ },
+ "end": {
+ "line": 20,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 250,
+ "end": 255,
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 18
+ },
+ "end": {
+ "line": 20,
+ "column": 23
+ }
+ },
+ "range": [
+ 250,
+ 255
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 255,
+ 256
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 23
+ },
+ "end": {
+ "line": 20,
+ "column": 24
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 256,
+ 257
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 24
+ },
+ "end": {
+ "line": 20,
+ "column": 25
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 257,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 4
+ }
+ },
+ "value": "\n\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 4
+ },
+ "end": {
+ "line": 22,
+ "column": 6
+ }
+ },
+ "value": "/*"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 6
+ },
+ "end": {
+ "line": 22,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 266,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 7
+ },
+ "end": {
+ "line": 22,
+ "column": 18
+ }
+ },
+ "value": "expressions"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 278
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 18
+ },
+ "end": {
+ "line": 22,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 278,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 19
+ },
+ "end": {
+ "line": 22,
+ "column": 24
+ }
+ },
+ "value": "(wrap"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 283,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 24
+ },
+ "end": {
+ "line": 22,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 284,
+ 286
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 25
+ },
+ "end": {
+ "line": 22,
+ "column": 27
+ }
+ },
+ "value": "in"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 286,
+ 287
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 27
+ },
+ "end": {
+ "line": 22,
+ "column": 28
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 287,
+ 294
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 28
+ },
+ "end": {
+ "line": 22,
+ "column": 35
+ }
+ },
+ "value": "quotes)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 294,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 35
+ },
+ "end": {
+ "line": 22,
+ "column": 36
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 295,
+ 297
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 36
+ },
+ "end": {
+ "line": 22,
+ "column": 38
+ }
+ },
+ "value": "*/"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 297,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 22,
+ "column": 38
+ },
+ "end": {
+ "line": 23,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 312
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 4
+ },
+ "end": {
+ "line": 23,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 312,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 14
+ },
+ "end": {
+ "line": 23,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 313,
+ 319
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 15
+ },
+ "end": {
+ "line": 23,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 319,
+ 320
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 21
+ },
+ "end": {
+ "line": 23,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 320,
+ 321
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 22
+ },
+ "end": {
+ "line": 23,
+ "column": 23
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "font",
+ "start": 321,
+ "end": 325,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 23
+ },
+ "end": {
+ "line": 23,
+ "column": 27
+ }
+ },
+ "range": [
+ 321,
+ 325
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 325,
+ "end": 326,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 27
+ },
+ "end": {
+ "line": 23,
+ "column": 28
+ }
+ },
+ "range": [
+ 325,
+ 326
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "size",
+ "start": 326,
+ "end": 330,
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 28
+ },
+ "end": {
+ "line": 23,
+ "column": 32
+ }
+ },
+ "range": [
+ 326,
+ 330
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 32
+ },
+ "end": {
+ "line": 23,
+ "column": 33
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 331,
+ 332
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 33
+ },
+ "end": {
+ "line": 23,
+ "column": 34
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 332,
+ 333
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 34
+ },
+ "end": {
+ "line": 23,
+ "column": 35
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 333,
+ 336
+ ],
+ "loc": {
+ "start": {
+ "line": 23,
+ "column": 35
+ },
+ "end": {
+ "line": 24,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 336,
+ 337
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 2
+ },
+ "end": {
+ "line": 24,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 337,
+ 338
+ ],
+ "loc": {
+ "start": {
+ "line": 24,
+ "column": 3
+ },
+ "end": {
+ "line": 25,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 338,
+ 345
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 0
+ },
+ "end": {
+ "line": 25,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 345,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 7
+ },
+ "end": {
+ "line": 25,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 25,
+ "column": 8
+ },
+ "end": {
+ "line": 26,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables01/source.vue b/test/fixtures/document-fragment/style-variables01/source.vue
new file mode 100644
index 00000000..d151be23
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables01/source.vue
@@ -0,0 +1,25 @@
+
+ hello
+
+
+
+
+
diff --git a/test/fixtures/document-fragment/style-variables01/token-ranges.json b/test/fixtures/document-fragment/style-variables01/token-ranges.json
new file mode 100644
index 00000000..413e4922
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables01/token-ranges.json
@@ -0,0 +1,101 @@
+[
+ "",
+ "\n ",
+ "",
+ "hello",
+ "
",
+ "\n",
+ " ",
+ "\n\n",
+ "",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables01/tree.json b/test/fixtures/document-fragment/style-variables01/tree.json
new file mode 100644
index 00000000..0e52c1c6
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables01/tree.json
@@ -0,0 +1,172 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n hello
\n \n\n\n\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n hello
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "hello
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "class=\"text\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "class",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"text\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "hello",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables02/document-fragment.json b/test/fixtures/document-fragment/style-variables02/document-fragment.json
new file mode 100644
index 00000000..10654bb7
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables02/document-fragment.json
@@ -0,0 +1,1093 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 29,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 42,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "value": ";\n }\n .text {\n font-size: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 73,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 81,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 81,
+ 96
+ ],
+ "object": {
+ "type": "MemberExpression",
+ "start": 81,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "range": [
+ 81,
+ 91
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "range": [
+ 81,
+ 86
+ ],
+ "name": "theme"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 87,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 29
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "range": [
+ 87,
+ 91
+ ],
+ "name": "font"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 92,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 92,
+ 96
+ ],
+ "name": "size"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 81,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "range": [
+ 81,
+ 86
+ ],
+ "name": "theme"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 98,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 104,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 36,
+ "end": 41,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 18
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "range": [
+ 36,
+ 41
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 43,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 25
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 47,
+ 50
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 50,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 56
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 56,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 57,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 62,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 14
+ },
+ "end": {
+ "line": 6,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 73,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 15
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "theme",
+ "start": 81,
+ "end": 86,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "range": [
+ 81,
+ 86
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 86,
+ "end": 87,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "font",
+ "start": 87,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 29
+ },
+ "end": {
+ "line": 6,
+ "column": 33
+ }
+ },
+ "range": [
+ 87,
+ 91
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 91,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 33
+ },
+ "end": {
+ "line": 6,
+ "column": 34
+ }
+ },
+ "range": [
+ 91,
+ 92
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "size",
+ "start": 92,
+ "end": 96,
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 34
+ },
+ "end": {
+ "line": 6,
+ "column": 38
+ }
+ },
+ "range": [
+ 92,
+ 96
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 96,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 38
+ },
+ "end": {
+ "line": 6,
+ "column": 39
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 97,
+ 98
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 39
+ },
+ "end": {
+ "line": 6,
+ "column": 40
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 41
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 99,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 41
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 3
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 104,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables02/source.vue b/test/fixtures/document-fragment/style-variables02/source.vue
new file mode 100644
index 00000000..f8bce52f
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables02/source.vue
@@ -0,0 +1,8 @@
+
diff --git a/test/fixtures/document-fragment/style-variables02/token-ranges.json b/test/fixtures/document-fragment/style-variables02/token-ranges.json
new file mode 100644
index 00000000..eafcce25
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables02/token-ranges.json
@@ -0,0 +1,42 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables02/tree.json b/test/fixtures/document-fragment/style-variables02/tree.json
new file mode 100644
index 00000000..2a7d9e06
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables02/tree.json
@@ -0,0 +1,88 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables03/document-fragment.json b/test/fixtures/document-fragment/style-variables03/document-fragment.json
new file mode 100644
index 00000000..46bc7e8f
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables03/document-fragment.json
@@ -0,0 +1,1066 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "\n .text {\n color:"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 40
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 40
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 41,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 47,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 57,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 57,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 64,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 64,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 13
+ }
+ },
+ "name": "scoped",
+ "rawName": "scoped"
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 71,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 14
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": "\n .text {\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 93,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 24
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 100,
+ "end": 105,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 100,
+ 105
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 100,
+ "end": 105,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 100,
+ 105
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 106,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 24
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": ";}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 109,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 15,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 16,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 22,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 35,
+ "end": 40,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 22
+ }
+ },
+ "range": [
+ 35,
+ 40
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 23
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 4,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 3
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 47,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 57,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 64,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 7
+ },
+ "end": {
+ "line": 7,
+ "column": 13
+ }
+ },
+ "value": "scoped"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 71,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 14
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 74,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "value": ".text"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 86,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 93,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 100,
+ "end": 105,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 23
+ }
+ },
+ "range": [
+ 100,
+ 105
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 23
+ },
+ "end": {
+ "line": 9,
+ "column": 24
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 106,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 24
+ },
+ "end": {
+ "line": 9,
+ "column": 26
+ }
+ },
+ "value": ";}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 109,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables03/source.vue b/test/fixtures/document-fragment/style-variables03/source.vue
new file mode 100644
index 00000000..2ed3c09d
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables03/source.vue
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables03/token-ranges.json b/test/fixtures/document-fragment/style-variables03/token-ranges.json
new file mode 100644
index 00000000..40e5942a
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables03/token-ranges.json
@@ -0,0 +1,39 @@
+[
+ "",
+ "\n\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables03/tree.json b/test/fixtures/document-fragment/style-variables03/tree.json
new file mode 100644
index 00000000..83907c09
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables03/tree.json
@@ -0,0 +1,99 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables04/document-fragment.json b/test/fixtures/document-fragment/style-variables04/document-fragment.json
new file mode 100644
index 00000000..9ac5a074
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables04/document-fragment.json
@@ -0,0 +1,399 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ".text{color:"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 19,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "range": [
+ 26,
+ 31
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "range": [
+ 26,
+ 31
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 32,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": ";}"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 34,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 7,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ".text{color:"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 19,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 25
+ },
+ "end": {
+ "line": 1,
+ "column": 26
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 26,
+ "end": 31,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "range": [
+ 26,
+ 31
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 32,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "value": ";}"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 34,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 41
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 41
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables04/source.vue b/test/fixtures/document-fragment/style-variables04/source.vue
new file mode 100644
index 00000000..71127427
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables04/source.vue
@@ -0,0 +1 @@
+
diff --git a/test/fixtures/document-fragment/style-variables04/token-ranges.json b/test/fixtures/document-fragment/style-variables04/token-ranges.json
new file mode 100644
index 00000000..9068022d
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables04/token-ranges.json
@@ -0,0 +1,13 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables04/tree.json b/test/fixtures/document-fragment/style-variables04/tree.json
new file mode 100644
index 00000000..de0f73bd
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables04/tree.json
@@ -0,0 +1,50 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables05/document-fragment.json b/test/fixtures/document-fragment/style-variables05/document-fragment.json
new file mode 100644
index 00000000..6c733b31
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables05/document-fragment.json
@@ -0,0 +1,1558 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 7,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": "\n .text{\n color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 28,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "name": "color"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ],
+ "name": "color"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": ";\n font-size: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 62,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 74,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 36
+ }
+ },
+ "range": [
+ 74,
+ 83
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 31
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ],
+ "name": "font"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 79,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 36
+ }
+ },
+ "range": [
+ 79,
+ 83
+ ],
+ "name": "size"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 31
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ],
+ "name": "font"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 89,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 42
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": ";\n border-color: /**/"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 113,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 5,
+ "column": 57
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "start": 125,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 52
+ }
+ },
+ "range": [
+ 125,
+ 143
+ ],
+ "callee": {
+ "type": "Identifier",
+ "start": 125,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "range": [
+ 125,
+ 131
+ ],
+ "name": "border"
+ },
+ "arguments": [
+ {
+ "type": "Literal",
+ "start": 134,
+ "end": 141,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 50
+ }
+ },
+ "range": [
+ 134,
+ 141
+ ],
+ "value": "color",
+ "raw": "'color'"
+ }
+ ],
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 125,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "range": [
+ 125,
+ 131
+ ],
+ "name": "border"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 148,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 57
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": ";;\n background-color: "
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 173,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "expression": {
+ "type": "MemberExpression",
+ "start": 191,
+ "end": 225,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 13
+ }
+ },
+ "range": [
+ 191,
+ 225
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ],
+ "name": "background"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 220,
+ "end": 225,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 13
+ }
+ },
+ "range": [
+ 220,
+ 225
+ ],
+ "name": "color"
+ },
+ "computed": false,
+ "optional": false
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ],
+ "name": "background"
+ },
+ "mode": "r"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 231,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": ";\n }\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 237,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ },
+ {
+ "type": "VText",
+ "range": [
+ 245,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 6,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 7,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 10,
+ 16
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": ".text{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 16,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 21,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 28,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 3,
+ "column": 17
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 17
+ },
+ "end": {
+ "line": 3,
+ "column": 18
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 37,
+ "end": 42,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 20
+ },
+ "end": {
+ "line": 3,
+ "column": 25
+ }
+ },
+ "range": [
+ 37,
+ 42
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 28
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 51,
+ 61
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 4
+ },
+ "end": {
+ "line": 4,
+ "column": 14
+ }
+ },
+ "value": "font-size:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 61,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 62,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 15
+ },
+ "end": {
+ "line": 4,
+ "column": 21
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 21
+ },
+ "end": {
+ "line": 4,
+ "column": 22
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 71,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Identifier",
+ "value": "font",
+ "start": 74,
+ "end": 78,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 31
+ }
+ },
+ "range": [
+ 74,
+ 78
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 78,
+ "end": 79,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "range": [
+ 78,
+ 79
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "size",
+ "start": 79,
+ "end": 83,
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 36
+ }
+ },
+ "range": [
+ 79,
+ 83
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 38
+ },
+ "end": {
+ "line": 4,
+ "column": 39
+ }
+ },
+ "value": "'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 41
+ },
+ "end": {
+ "line": 4,
+ "column": 42
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 42
+ },
+ "end": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 90,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 4
+ },
+ "end": {
+ "line": 5,
+ "column": 17
+ }
+ },
+ "value": "border-color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 17
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": "/**/"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 113,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 119,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "border",
+ "start": 125,
+ "end": 131,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "range": [
+ 125,
+ 131
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "(",
+ "start": 132,
+ "end": 133,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 41
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "range": [
+ 132,
+ 133
+ ]
+ },
+ {
+ "type": "String",
+ "value": "'color'",
+ "start": 134,
+ "end": 141,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 50
+ }
+ },
+ "range": [
+ 134,
+ 141
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ")",
+ "start": 142,
+ "end": 143,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 51
+ },
+ "end": {
+ "line": 5,
+ "column": 52
+ }
+ },
+ "range": [
+ 142,
+ 143
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 53
+ },
+ "end": {
+ "line": 5,
+ "column": 54
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 147,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 56
+ },
+ "end": {
+ "line": 5,
+ "column": 57
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 148,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 57
+ },
+ "end": {
+ "line": 5,
+ "column": 59
+ }
+ },
+ "value": ";;"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 59
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 155,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 21
+ }
+ },
+ "value": "background-color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 21
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 173,
+ 179
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 28
+ }
+ },
+ "value": "v-bind"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 179,
+ 180
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 28
+ },
+ "end": {
+ "line": 6,
+ "column": 29
+ }
+ },
+ "value": "("
+ },
+ {
+ "type": "Identifier",
+ "value": "background",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 8
+ },
+ "end": {
+ "line": 7,
+ "column": 18
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 210,
+ "end": 211,
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "range": [
+ 210,
+ 211
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "start": 220,
+ "end": 225,
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 13
+ }
+ },
+ "range": [
+ 220,
+ 225
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 230,
+ 231
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 4
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": ")"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 231,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": ";"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 232,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 235,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 2
+ },
+ "end": {
+ "line": 11,
+ "column": 3
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 236,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 3
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 237,
+ 244
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 244,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 7
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 245,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables05/source.vue b/test/fixtures/document-fragment/style-variables05/source.vue
new file mode 100644
index 00000000..c62a7b36
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables05/source.vue
@@ -0,0 +1,12 @@
+
diff --git a/test/fixtures/document-fragment/style-variables05/token-ranges.json b/test/fixtures/document-fragment/style-variables05/token-ranges.json
new file mode 100644
index 00000000..c61ec5cd
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables05/token-ranges.json
@@ -0,0 +1,56 @@
+[
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/style-variables05/tree.json b/test/fixtures/document-fragment/style-variables05/tree.json
new file mode 100644
index 00000000..1fbd3b38
--- /dev/null
+++ b/test/fixtures/document-fragment/style-variables05/tree.json
@@ -0,0 +1,131 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-absent/document-fragment.json b/test/fixtures/document-fragment/template-tag-is-absent/document-fragment.json
new file mode 100644
index 00000000..f51aedc7
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-absent/document-fragment.json
@@ -0,0 +1,1955 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 15,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 15,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 27,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 27,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 39,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 55,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 16
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "name:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 75,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "'test'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 84,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 94,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 1
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 105,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 3
+ },
+ "end": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 4
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 117,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "pink;"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 125,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 132,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 39,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 39,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 47,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\nexport default {\n name: 'test'\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 84,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 94,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 94,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 101,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\na {\n color: pink;\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 125,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 15,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 20,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 27,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 37,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 39,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 55,
+ 62
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 63,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 16
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 69,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "name:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 75,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "'test'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 82,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 84,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 94,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 1
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 105,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 3
+ },
+ "end": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 4
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 117,
+ 122
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "pink;"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 122,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 123,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 125,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 132,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-absent/source.vue b/test/fixtures/document-fragment/template-tag-is-absent/source.vue
new file mode 100644
index 00000000..f294de9c
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-absent/source.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-absent/token-ranges.json b/test/fixtures/document-fragment/template-tag-is-absent/token-ranges.json
new file mode 100644
index 00000000..9cb40b9c
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-absent/token-ranges.json
@@ -0,0 +1,46 @@
+[
+ "",
+ "\n ",
+ "",
+ "
",
+ "\n",
+ " ",
+ "\n",
+ "",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-absent/tree.json b/test/fixtures/document-fragment/template-tag-is-absent/tree.json
new file mode 100644
index 00000000..a1131305
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-absent/tree.json
@@ -0,0 +1,102 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n
\n \n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n
\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "
",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-present/document-fragment.json b/test/fixtures/document-fragment/template-tag-is-present/document-fragment.json
new file mode 100644
index 00000000..6a148a10
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-present/document-fragment.json
@@ -0,0 +1,1029 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "name": "docs",
+ "rawName": "docs",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 6,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n doc\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 15,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 23,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 23,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 31,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\nexport default {\n name: 'test'\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 68,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 78,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "name": "style",
+ "rawName": "style",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 78,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 85,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\na {\n color: pink;\n}\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 109,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ }
+ },
+ "variables": [],
+ "style": true
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 5
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 5
+ }
+ },
+ "value": "docs"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 5,
+ 6
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 5
+ },
+ "end": {
+ "line": 1,
+ "column": 6
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 6,
+ 11
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 11,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": "doc"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 15,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 6
+ }
+ },
+ "value": "docs"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 6
+ },
+ "end": {
+ "line": 3,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 7
+ },
+ "end": {
+ "line": 4,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 32,
+ 38
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": "export"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 38,
+ 39
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 39,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": "default"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 16
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 53,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 4
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "name:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 58,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 59,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "'test'"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 65,
+ 66
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 66,
+ 67
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 67,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 68,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 78,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 85,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 86,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 1
+ }
+ },
+ "value": "a"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 1
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 2
+ },
+ "end": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "value": "{"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 89,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 3
+ },
+ "end": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 94,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 4
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "color:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "pink;"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 1
+ }
+ },
+ "value": "}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 109,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 7
+ }
+ },
+ "value": "style"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 7
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-present/source.vue b/test/fixtures/document-fragment/template-tag-is-present/source.vue
new file mode 100644
index 00000000..79e954a8
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-present/source.vue
@@ -0,0 +1,13 @@
+
+ doc
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-present/token-ranges.json b/test/fixtures/document-fragment/template-tag-is-present/token-ranges.json
new file mode 100644
index 00000000..37f86b4a
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-present/token-ranges.json
@@ -0,0 +1,43 @@
+[
+ "",
+ "\n ",
+ "doc",
+ "\n",
+ " ",
+ "\n",
+ "",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/template-tag-is-present/tree.json b/test/fixtures/document-fragment/template-tag-is-present/tree.json
new file mode 100644
index 00000000..6743799a
--- /dev/null
+++ b/test/fixtures/document-fragment/template-tag-is-present/tree.json
@@ -0,0 +1,81 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n doc\n \n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "\n doc\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n doc\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-custom-block/document-fragment.json b/test/fixtures/document-fragment/textarea-custom-block/document-fragment.json
new file mode 100644
index 00000000..a03221b9
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-custom-block/document-fragment.json
@@ -0,0 +1,977 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "textarea",
+ "rawName": "textarea",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 10,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n < custom block > \n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 41,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 52,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 54,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "textarea",
+ "rawName": "textarea",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 54,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 64,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 64,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 69,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "value": "html"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 76,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": "\n < not RCDATA > "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 100,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "name": "br",
+ "rawName": "br",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 100,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 105,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 9,
+ 10
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 9
+ },
+ "end": {
+ "line": 1,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 10,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 13,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "<"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "custom"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 24,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 25,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "block"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 31,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "value": ">"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 24
+ },
+ "end": {
+ "line": 2,
+ "column": 25
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 36,
+ 40
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 25
+ },
+ "end": {
+ "line": 2,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 40,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 29
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 41,
+ 51
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 51,
+ 52
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 52,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 54,
+ 63
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 64,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 14
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 69,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 15
+ },
+ "end": {
+ "line": 5,
+ "column": 21
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 21
+ },
+ "end": {
+ "line": 5,
+ "column": 22
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 76,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 79,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "<"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 83,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 84,
+ 87
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "not"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 88,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "RCDATA"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 6,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLText",
+ "range": [
+ 95,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 18
+ },
+ "end": {
+ "line": 6,
+ "column": 22
+ }
+ },
+ "value": ">"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 22
+ },
+ "end": {
+ "line": 6,
+ "column": 23
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 100,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 23
+ },
+ "end": {
+ "line": 6,
+ "column": 26
+ }
+ },
+ "value": "br"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 26
+ },
+ "end": {
+ "line": 6,
+ "column": 27
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 27
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 105,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-custom-block/source.vue b/test/fixtures/document-fragment/textarea-custom-block/source.vue
new file mode 100644
index 00000000..66a4da98
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-custom-block/source.vue
@@ -0,0 +1,7 @@
+
+
+
diff --git a/test/fixtures/document-fragment/textarea-custom-block/token-ranges.json b/test/fixtures/document-fragment/textarea-custom-block/token-ranges.json
new file mode 100644
index 00000000..cefee57b
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-custom-block/token-ranges.json
@@ -0,0 +1,38 @@
+[
+ "",
+ "\n\n",
+ "",
+ "\n"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-custom-block/tree.json b/test/fixtures/document-fragment/textarea-custom-block/tree.json
new file mode 100644
index 00000000..b69d234f
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-custom-block/tree.json
@@ -0,0 +1,93 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-in-html/document-fragment.json b/test/fixtures/document-fragment/textarea-in-html/document-fragment.json
new file mode 100644
index 00000000..e87cf382
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-in-html/document-fragment.json
@@ -0,0 +1,444 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "name": "textarea",
+ "rawName": "textarea",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 10,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 10,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 15,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": "html"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 22,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n < RCDATA > \n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 47,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 9
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 10,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 10
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 14,
+ 15
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 15,
+ 21
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 15
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "value": "html"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 21,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 21
+ },
+ "end": {
+ "line": 1,
+ "column": 22
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 22,
+ 25
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLRCDataText",
+ "range": [
+ 25,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 6
+ }
+ },
+ "value": "<"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRCDataText",
+ "range": [
+ 30,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "value": "RCDATA"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 14
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRCDataText",
+ "range": [
+ 37,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": ">"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRCDataText",
+ "range": [
+ 42,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 46,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 47,
+ 57
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "textarea"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 57,
+ 58
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-in-html/source.html b/test/fixtures/document-fragment/textarea-in-html/source.html
new file mode 100644
index 00000000..cbad1a36
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-in-html/source.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-in-html/token-ranges.json b/test/fixtures/document-fragment/textarea-in-html/token-ranges.json
new file mode 100644
index 00000000..762c1a1b
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-in-html/token-ranges.json
@@ -0,0 +1,18 @@
+[
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/textarea-in-html/tree.json b/test/fixtures/document-fragment/textarea-in-html/tree.json
new file mode 100644
index 00000000..ab6b3002
--- /dev/null
+++ b/test/fixtures/document-fragment/textarea-in-html/tree.json
@@ -0,0 +1,46 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json
new file mode 100644
index 00000000..13c2a968
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json
@@ -0,0 +1,1471 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 24,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 32,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 33
+ },
+ "end": {
+ "line": 1,
+ "column": 34
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T"
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 36,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\ndefineProps<{foo:T}>()\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 70,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 70,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 81,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 83,
+ 86
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 83,
+ 86
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 89,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 37,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 60,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 70,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 81,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 86,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 1,
+ "column": 34
+ },
+ "start": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "range": [
+ 33,
+ 34
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 34
+ },
+ "end": {
+ "line": 1,
+ "column": 35
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 35
+ },
+ "end": {
+ "line": 1,
+ "column": 36
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 37,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 60,
+ 68
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 68,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 70,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 81,
+ 83
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 83,
+ 86
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 86,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 89,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 99,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-1/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-1/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/source.vue b/test/fixtures/document-fragment/vue3.3-generic-1/source.vue
new file mode 100644
index 00000000..fc54be37
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-1/source.vue
@@ -0,0 +1,6 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-1/token-ranges.json
new file mode 100644
index 00000000..80b1a7d7
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-1/token-ranges.json
@@ -0,0 +1,28 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/tree.json b/test/fixtures/document-fragment/vue3.3-generic-1/tree.json
new file mode 100644
index 00000000..0c0a767a
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-1/tree.json
@@ -0,0 +1,139 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json
new file mode 100644
index 00000000..370d495c
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json
@@ -0,0 +1,2925 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 8,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\ntype Foo = number | string\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 36,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 46,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 46,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 70,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 47
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 78,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 47
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 79,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 33
+ },
+ "end": {
+ "line": 4,
+ "column": 46
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 79,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T extends Foo"
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": false,
+ "isTypeReference": true
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 94,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 48
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\nconst p = defineProps<{foo:T}>()\nconst foo = p.foo\nconsole.log(foo)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 163,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 173,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 173,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 184,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 186,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 186,
+ 189
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 192,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 46
+ },
+ "end": {
+ "line": 4,
+ "column": 47
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 47
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 48
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 105,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 128,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 134,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 140,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 145,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 146,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 163,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 173,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 184,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 186,
+ 189
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 189,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 192,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 92,
+ 93
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 46
+ },
+ "end": {
+ "line": 4,
+ "column": 47
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 93,
+ 94
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 47
+ },
+ "end": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 48
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 95,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 104
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 105,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": "defineProps<{foo:T}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 128,
+ 133
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 133,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 134,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 140,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 145,
+ 146
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 146,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 163,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 173,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 184,
+ 186
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 186,
+ 189
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 189,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 191,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 192,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 202,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-2/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-2/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/source.vue b/test/fixtures/document-fragment/vue3.3-generic-2/source.vue
new file mode 100644
index 00000000..e42bea85
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-2/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-2/token-ranges.json
new file mode 100644
index 00000000..0f21efc8
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-2/token-ranges.json
@@ -0,0 +1,64 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/tree.json b/test/fixtures/document-fragment/vue3.3-generic-2/tree.json
new file mode 100644
index 00000000..02563812
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-2/tree.json
@@ -0,0 +1,176 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json
new file mode 100644
index 00000000..352fa378
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json
@@ -0,0 +1,3314 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 8,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\ntype Foo = number | string\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 36,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 46,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 46,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 61
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 70,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 60
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 78,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 60
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 79,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 33
+ },
+ "end": {
+ "line": 4,
+ "column": 59
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 79,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 58
+ }
+ }
+ },
+ "range": [
+ 104,
+ 105
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 58
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 49
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 94,
+ 105
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T extends Foo",
+ "U extends T"
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 89,
+ 92
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": false,
+ "isTypeReference": true
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 107,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 61
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\nconst p = defineProps<{foo:T, bar: U}>()\nconst foo = p.foo\nconsole.log(foo)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 184,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ "kind": "generic"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 94,
+ 95
+ ],
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 49
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 194,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 194,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 205,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 207,
+ 210
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 207,
+ 210
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 213,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 47
+ },
+ "start": {
+ "line": 4,
+ "column": 46
+ }
+ },
+ "range": [
+ 92,
+ 93
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 49
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 94,
+ 95
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 57
+ },
+ "start": {
+ "line": 4,
+ "column": 50
+ }
+ },
+ "range": [
+ 96,
+ 103
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 58
+ }
+ },
+ "range": [
+ 104,
+ 105
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 59
+ },
+ "end": {
+ "line": 4,
+ "column": 60
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 60
+ },
+ "end": {
+ "line": 4,
+ "column": 61
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 61
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 108,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 142,
+ 143
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 143,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 160,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 161,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 184,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 192,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 194,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 205,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 207,
+ 210
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 210,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 213,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 8,
+ 9
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 9,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 13,
+ 14
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 14,
+ 17
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 9
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 20,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 27,
+ 28
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 28,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 19
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 29,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 20
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 35,
+ 36
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 36,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 44,
+ 45
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 45,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 46,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 8
+ },
+ "end": {
+ "line": 4,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 60,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 14
+ },
+ "end": {
+ "line": 4,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 64,
+ 65
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 18
+ },
+ "end": {
+ "line": 4,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 19
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 4
+ },
+ "end": {
+ "column": 31,
+ "line": 4
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 77,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 31
+ },
+ "end": {
+ "line": 4,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 78,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 34
+ },
+ "start": {
+ "line": 4,
+ "column": 33
+ }
+ },
+ "range": [
+ 79,
+ 80
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 42
+ },
+ "start": {
+ "line": 4,
+ "column": 35
+ }
+ },
+ "range": [
+ 81,
+ 88
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 46
+ },
+ "start": {
+ "line": 4,
+ "column": 43
+ }
+ },
+ "range": [
+ 89,
+ 92
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 47
+ },
+ "start": {
+ "line": 4,
+ "column": 46
+ }
+ },
+ "range": [
+ 92,
+ 93
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 49
+ },
+ "start": {
+ "line": 4,
+ "column": 48
+ }
+ },
+ "range": [
+ 94,
+ 95
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 57
+ },
+ "start": {
+ "line": 4,
+ "column": 50
+ }
+ },
+ "range": [
+ 96,
+ 103
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 59
+ },
+ "start": {
+ "line": 4,
+ "column": 58
+ }
+ },
+ "range": [
+ 104,
+ 105
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 59
+ },
+ "end": {
+ "line": 4,
+ "column": 60
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 60
+ },
+ "end": {
+ "line": 4,
+ "column": 61
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 61
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 108,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 114
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 114,
+ 115
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 115,
+ 116
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 116,
+ 117
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 117,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 118,
+ 137
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 138,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 142,
+ 143
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 34
+ },
+ "end": {
+ "line": 5,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 143,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 35
+ },
+ "end": {
+ "line": 5,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 40
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 154,
+ 155
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 5
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 155,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 6,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 10
+ },
+ "end": {
+ "line": 6,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 160,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 11
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 161,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 183,
+ 184
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 16
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 184,
+ 192
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 192,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 194,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 205,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 207,
+ 210
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 210,
+ 212
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 212,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 213,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-3/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-3/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/source.vue b/test/fixtures/document-fragment/vue3.3-generic-3/source.vue
new file mode 100644
index 00000000..5d3590d2
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-3/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-3/token-ranges.json
new file mode 100644
index 00000000..2c199c64
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-3/token-ranges.json
@@ -0,0 +1,72 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/tree.json b/test/fixtures/document-fragment/vue3.3-generic-3/tree.json
new file mode 100644
index 00000000..098b5927
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-3/tree.json
@@ -0,0 +1,198 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json
new file mode 100644
index 00000000..fd104f1b
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json
@@ -0,0 +1,3041 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 24,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 32,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 36,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 5
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 50,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 50,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 36,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 87,
+ 88
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 73,
+ 88
+ ],
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T\n extends Foo",
+ "U extends\n T"
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 50,
+ 53
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": false,
+ "isTypeReference": true
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 91,
+ 195
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\ntype Foo = number | string\nconst p = defineProps<{foo:T, bar: U}>()\nconst foo = p.foo\nconsole.log(foo)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 195,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 73,
+ 74
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 205,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 205,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 216,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 218,
+ 221
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 218,
+ 221
+ ],
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 224,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 42,
+ 49
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 50,
+ 53
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 11
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 75,
+ 82
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 87,
+ 88
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 92,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 97,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 5
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 8,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 112,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 118,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 119,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 153,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 34
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 154,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 35
+ },
+ "end": {
+ "line": 9,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 40
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 169,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 172,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 12
+ },
+ "end": {
+ "line": 10,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 17
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 178,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 194,
+ 195
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 195,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 205,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 214,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 216,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "range": [
+ 218,
+ 221
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 221,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 224,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 234,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 59,
+ 70
+ ],
+ "value": " Comments"
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 42,
+ 49
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 50,
+ 53
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 53,
+ 54
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 11
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 75,
+ 82
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 5
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 87,
+ 88
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 89,
+ 90
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 0
+ },
+ "end": {
+ "line": 7,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 90,
+ 91
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 1
+ },
+ "end": {
+ "line": 7,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 91,
+ 92
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 92,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 96,
+ 97
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 97,
+ 100
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 5
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 17
+ },
+ "end": {
+ "line": 8,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 18
+ },
+ "end": {
+ "line": 8,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 19
+ },
+ "end": {
+ "line": 8,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 112,
+ 118
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 20
+ },
+ "end": {
+ "line": 8,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 118,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 26
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 119,
+ 124
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 124,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 125,
+ 126
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 6
+ },
+ "end": {
+ "line": 9,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 126,
+ 127
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 127,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 29
+ },
+ "end": {
+ "line": 9,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 153
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 30
+ },
+ "end": {
+ "line": 9,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 153,
+ 154
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 34
+ },
+ "end": {
+ "line": 9,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 154,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 35
+ },
+ "end": {
+ "line": 9,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 40
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 166,
+ 169
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 169,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 172,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 12
+ },
+ "end": {
+ "line": 10,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 17
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 178,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 194,
+ 195
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 16
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 195,
+ 203
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 203,
+ 204
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 8
+ },
+ "end": {
+ "line": 12,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 204,
+ 205
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 205,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 214,
+ 215
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 13,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 215,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 216,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 14,
+ "column": 5
+ },
+ "start": {
+ "line": 14,
+ "column": 2
+ }
+ },
+ "range": [
+ 218,
+ 221
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 221,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 223,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 224,
+ 234
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 234,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 59,
+ 70
+ ],
+ "value": " Comments"
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/source.vue b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/source.vue
new file mode 100644
index 00000000..7b4d167f
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/source.vue
@@ -0,0 +1,15 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/token-ranges.json
new file mode 100644
index 00000000..37ed0210
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/token-ranges.json
@@ -0,0 +1,67 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// Comments"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json
new file mode 100644
index 00000000..8ccbd3bd
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json
@@ -0,0 +1,172 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json
new file mode 100644
index 00000000..6ead8821
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json
@@ -0,0 +1,3366 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 24,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 32,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 36,
+ 136
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 7,
+ "column": 24
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 61,
+ 64
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 36,
+ 64
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 122,
+ 136
+ ],
+ "params": [
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 126,
+ 132
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 20
+ },
+ "start": {
+ "line": 7,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 23
+ },
+ "start": {
+ "line": 7,
+ "column": 22
+ }
+ }
+ },
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 23
+ },
+ "start": {
+ "line": 7,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Record",
+ "optional": false,
+ "range": [
+ 116,
+ 122
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 116,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 84,
+ 136
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T // extends\n extends Foo",
+ "U /* extends */\n extends\n Record"
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 61,
+ 64
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": false,
+ "isTypeReference": true
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 139,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\ntype Foo = number | string\nconst p = defineProps<{foo:T, bar: U}>()\nconst foo = p.foo\nconsole.log(foo)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 243,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 252,
+ 253
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 253,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 253,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 264,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 266,
+ 269
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 266,
+ 269
+ ],
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 271,
+ 272
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 272,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 53,
+ 60
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 64,
+ 65
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 84,
+ 85
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 104,
+ 111
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 116,
+ 122
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 122,
+ 126
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 20
+ },
+ "start": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "range": [
+ 126,
+ 132
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 21
+ },
+ "start": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "range": [
+ 132,
+ 133
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 23
+ },
+ "start": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "range": [
+ 134,
+ 135
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "range": [
+ 135,
+ 136
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 140,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 145,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 151,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 157,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 173,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 176,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 177,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 29
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 197,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 30
+ },
+ "end": {
+ "line": 10,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 34
+ },
+ "end": {
+ "line": 10,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 202,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 35
+ },
+ "end": {
+ "line": 10,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 207,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 40
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 208,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 213,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 214,
+ 217
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 217,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 218,
+ 219
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 219,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 220,
+ 225
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 12
+ },
+ "end": {
+ "line": 11,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 225,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 17
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 226,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 16
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 243,
+ 251
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 251,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 252,
+ 253
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 253,
+ 262
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 262,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 264,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "range": [
+ 266,
+ 269
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 269,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 271,
+ 272
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 272,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 282,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 48
+ ],
+ "value": " extends"
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 70,
+ 81
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 17
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 86,
+ 99
+ ],
+ "value": " extends "
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 53,
+ 60
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 61,
+ 64
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 16
+ },
+ "start": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "range": [
+ 64,
+ 65
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 84,
+ 85
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 104,
+ 111
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 116,
+ 122
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 122,
+ 126
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 20
+ },
+ "start": {
+ "line": 7,
+ "column": 14
+ }
+ },
+ "range": [
+ 126,
+ 132
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 21
+ },
+ "start": {
+ "line": 7,
+ "column": 20
+ }
+ },
+ "range": [
+ 132,
+ 133
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 23
+ },
+ "start": {
+ "line": 7,
+ "column": 22
+ }
+ },
+ "range": [
+ 134,
+ 135
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 24
+ },
+ "start": {
+ "line": 7,
+ "column": 23
+ }
+ },
+ "range": [
+ 135,
+ 136
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 137,
+ 138
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 138,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 1
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 140,
+ 144
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 144,
+ 145
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 4
+ },
+ "end": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 145,
+ 148
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 5
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 148,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 151
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 151,
+ 157
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 9,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 157,
+ 158
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 17
+ },
+ "end": {
+ "line": 9,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 158,
+ 159
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 18
+ },
+ "end": {
+ "line": 9,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 159,
+ 160
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 19
+ },
+ "end": {
+ "line": 9,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 160,
+ 166
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 20
+ },
+ "end": {
+ "line": 9,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 166,
+ 167
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 26
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 167,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 5
+ },
+ "end": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 173,
+ 174
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 6
+ },
+ "end": {
+ "line": 10,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 174,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 8
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 176,
+ 177
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 177,
+ 196
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 196,
+ 197
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 29
+ },
+ "end": {
+ "line": 10,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 197,
+ 201
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 30
+ },
+ "end": {
+ "line": 10,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 34
+ },
+ "end": {
+ "line": 10,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 202,
+ 207
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 35
+ },
+ "end": {
+ "line": 10,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 207,
+ 208
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 40
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 208,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 213,
+ 214
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 5
+ },
+ "end": {
+ "line": 11,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 214,
+ 217
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 6
+ },
+ "end": {
+ "line": 11,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 217,
+ 218
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 218,
+ 219
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 219,
+ 220
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 220,
+ 225
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 12
+ },
+ "end": {
+ "line": 11,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 225,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 17
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 226,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 0
+ },
+ "end": {
+ "line": 12,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 243
+ ],
+ "loc": {
+ "start": {
+ "line": 12,
+ "column": 16
+ },
+ "end": {
+ "line": 13,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 243,
+ 251
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 251,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 8
+ },
+ "end": {
+ "line": 13,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 252,
+ 253
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 253,
+ 262
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 262,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 264,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 15,
+ "column": 5
+ },
+ "start": {
+ "line": 15,
+ "column": 2
+ }
+ },
+ "range": [
+ 266,
+ 269
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 269,
+ 271
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 271,
+ 272
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 272,
+ 282
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 282,
+ 283
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 48
+ ],
+ "value": " extends"
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 70,
+ 81
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 17
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 86,
+ 99
+ ],
+ "value": " extends "
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/source.vue b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/source.vue
new file mode 100644
index 00000000..a5a1b5eb
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/source.vue
@@ -0,0 +1,16 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/token-ranges.json
new file mode 100644
index 00000000..a58b113b
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/token-ranges.json
@@ -0,0 +1,74 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// extends",
+ "// Comments",
+ "/* extends */"
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json
new file mode 100644
index 00000000..eb531362
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json
@@ -0,0 +1,194 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json
new file mode 100644
index 00000000..36290861
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json
@@ -0,0 +1,3905 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 2
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 24,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 13,
+ "column": 1
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 32,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 13,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 36,
+ 224
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 12,
+ "column": 32
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 70,
+ 73
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ },
+ "default": {
+ "type": "TSNumberKeyword",
+ "range": [
+ 76,
+ 82
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 36,
+ 82
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSTypeReference",
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 140,
+ 191
+ ],
+ "params": [
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 165,
+ 171
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 12
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ }
+ },
+ {
+ "type": "TSTypeReference",
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ },
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 5
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Record",
+ "optional": false,
+ "range": [
+ 134,
+ 140
+ ],
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 134,
+ 191
+ ],
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 5
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ }
+ },
+ "default": {
+ "type": "TSTypeReference",
+ "typeArguments": {
+ "type": "TSTypeParameterInstantiation",
+ "range": [
+ 205,
+ 224
+ ],
+ "params": [
+ {
+ "type": "TSStringKeyword",
+ "range": [
+ 206,
+ 212
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 20
+ },
+ "start": {
+ "line": 12,
+ "column": 14
+ }
+ }
+ },
+ {
+ "type": "TSNumberKeyword",
+ "range": [
+ 214,
+ 220
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 28
+ },
+ "start": {
+ "line": 12,
+ "column": 22
+ }
+ }
+ }
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 12,
+ "column": 13
+ }
+ }
+ },
+ "typeName": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Record",
+ "optional": false,
+ "range": [
+ 199,
+ 205
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 13
+ },
+ "start": {
+ "line": 12,
+ "column": 7
+ }
+ }
+ },
+ "range": [
+ 199,
+ 224
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 12,
+ "column": 7
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 102,
+ 224
+ ],
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T // Comments\n extends /* = */ Foo = number",
+ "U /* extends */\n extends\n Record<\n /* = */\n string, // =\n T\n >\n = Record"
+ ]
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "Foo",
+ "optional": false,
+ "range": [
+ 70,
+ 73
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": false,
+ "isTypeReference": true
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 227,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 2
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\ntype Foo = number | string\nconst p = defineProps<{foo:T, bar: U}>()\nconst foo = p.foo\nconsole.log(foo)\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 331,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 340,
+ 341
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 341,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 341,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 352,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 354,
+ 357
+ ],
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "foo",
+ "optional": false,
+ "range": [
+ 354,
+ 357
+ ],
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 359,
+ 360
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 360,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 54,
+ 61
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 76,
+ 82
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 102,
+ 103
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 122,
+ 129
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 134,
+ 140
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 140,
+ 144
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 12
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 165,
+ 171
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 13
+ },
+ "start": {
+ "line": 9,
+ "column": 12
+ }
+ },
+ "range": [
+ 171,
+ 172
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 184,
+ 185
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 5
+ },
+ "start": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "range": [
+ 190,
+ 191
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 6
+ },
+ "start": {
+ "line": 12,
+ "column": 5
+ }
+ },
+ "range": [
+ 197,
+ 198
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 13
+ },
+ "start": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "range": [
+ 199,
+ 205
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 14
+ },
+ "start": {
+ "line": 12,
+ "column": 13
+ }
+ },
+ "range": [
+ 205,
+ 206
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 20
+ },
+ "start": {
+ "line": 12,
+ "column": 14
+ }
+ },
+ "range": [
+ 206,
+ 212
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 21
+ },
+ "start": {
+ "line": 12,
+ "column": 20
+ }
+ },
+ "range": [
+ 212,
+ 213
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 28
+ },
+ "start": {
+ "line": 12,
+ "column": 22
+ }
+ },
+ "range": [
+ 214,
+ 220
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 12,
+ "column": 28
+ }
+ },
+ "range": [
+ 220,
+ 224
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 225,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 226,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 227,
+ 228
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 228,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 232,
+ 233
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 233,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 236,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 8
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 237,
+ 238
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 238,
+ 239
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 239,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 11
+ },
+ "end": {
+ "line": 14,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 245,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 17
+ },
+ "end": {
+ "line": 14,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 246,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 18
+ },
+ "end": {
+ "line": 14,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 247,
+ 248
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 19
+ },
+ "end": {
+ "line": 14,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 248,
+ 254
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 20
+ },
+ "end": {
+ "line": 14,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 254,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 26
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 255,
+ 260
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 260,
+ 261
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 261,
+ 262
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 262,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 8
+ },
+ "end": {
+ "line": 15,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 9
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 265,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 284,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 285,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 289,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 34
+ },
+ "end": {
+ "line": 15,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 290,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 35
+ },
+ "end": {
+ "line": 15,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 295,
+ 296
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 40
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 296,
+ 301
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 301,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 5
+ },
+ "end": {
+ "line": 16,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 305
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 6
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 305,
+ 306
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 306,
+ 307
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 307,
+ 308
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 11
+ },
+ "end": {
+ "line": 16,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 308,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 12
+ },
+ "end": {
+ "line": 16,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 313,
+ 314
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 17
+ },
+ "end": {
+ "line": 17,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 314,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 0
+ },
+ "end": {
+ "line": 17,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 16
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 331,
+ 339
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 339,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 8
+ },
+ "end": {
+ "line": 18,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 340,
+ 341
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 341,
+ 350
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 350,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 352,
+ 354
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "range": [
+ 354,
+ 357
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 357,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 5
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 359,
+ 360
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 360,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 370,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 10
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 49
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 19
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 62,
+ 69
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 88,
+ 99
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 17
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 104,
+ 117
+ ],
+ "value": " extends "
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 13
+ },
+ "start": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "range": [
+ 151,
+ 158
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 18
+ },
+ "start": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "range": [
+ 173,
+ 177
+ ],
+ "value": " ="
+ }
+ ],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 11
+ },
+ "start": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "range": [
+ 54,
+ 61
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 23
+ },
+ "start": {
+ "line": 3,
+ "column": 20
+ }
+ },
+ "range": [
+ 70,
+ 73
+ ],
+ "value": "Foo"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 24
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 32
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 76,
+ 82
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 32
+ }
+ },
+ "range": [
+ 82,
+ 83
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 3
+ },
+ "start": {
+ "line": 5,
+ "column": 2
+ }
+ },
+ "range": [
+ 102,
+ 103
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 6,
+ "column": 11
+ },
+ "start": {
+ "line": 6,
+ "column": 4
+ }
+ },
+ "range": [
+ 122,
+ 129
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 10
+ },
+ "start": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "range": [
+ 134,
+ 140
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 7,
+ "column": 14
+ },
+ "start": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "range": [
+ 140,
+ 144
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 12
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 165,
+ 171
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 13
+ },
+ "start": {
+ "line": 9,
+ "column": 12
+ }
+ },
+ "range": [
+ 171,
+ 172
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 184,
+ 185
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 11,
+ "column": 5
+ },
+ "start": {
+ "line": 11,
+ "column": 4
+ }
+ },
+ "range": [
+ 190,
+ 191
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 6
+ },
+ "start": {
+ "line": 12,
+ "column": 5
+ }
+ },
+ "range": [
+ 197,
+ 198
+ ],
+ "value": "="
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 13
+ },
+ "start": {
+ "line": 12,
+ "column": 7
+ }
+ },
+ "range": [
+ 199,
+ 205
+ ],
+ "value": "Record"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 14
+ },
+ "start": {
+ "line": 12,
+ "column": 13
+ }
+ },
+ "range": [
+ 205,
+ 206
+ ],
+ "value": "<"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 20
+ },
+ "start": {
+ "line": 12,
+ "column": 14
+ }
+ },
+ "range": [
+ 206,
+ 212
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 21
+ },
+ "start": {
+ "line": 12,
+ "column": 20
+ }
+ },
+ "range": [
+ 212,
+ 213
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 28
+ },
+ "start": {
+ "line": 12,
+ "column": 22
+ }
+ },
+ "range": [
+ 214,
+ 220
+ ],
+ "value": "number"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 12,
+ "column": 32
+ },
+ "start": {
+ "line": 12,
+ "column": 28
+ }
+ },
+ "range": [
+ 220,
+ 224
+ ],
+ "value": ">"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 225,
+ 226
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 0
+ },
+ "end": {
+ "line": 13,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 226,
+ 227
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 1
+ },
+ "end": {
+ "line": 13,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 227,
+ 228
+ ],
+ "loc": {
+ "start": {
+ "line": 13,
+ "column": 2
+ },
+ "end": {
+ "line": 14,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 228,
+ 232
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 0
+ },
+ "end": {
+ "line": 14,
+ "column": 4
+ }
+ },
+ "value": "type"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 232,
+ 233
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 4
+ },
+ "end": {
+ "line": 14,
+ "column": 5
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 233,
+ 236
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 5
+ },
+ "end": {
+ "line": 14,
+ "column": 8
+ }
+ },
+ "value": "Foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 236,
+ 237
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 8
+ },
+ "end": {
+ "line": 14,
+ "column": 9
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 237,
+ 238
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 9
+ },
+ "end": {
+ "line": 14,
+ "column": 10
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 238,
+ 239
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 10
+ },
+ "end": {
+ "line": 14,
+ "column": 11
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 239,
+ 245
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 11
+ },
+ "end": {
+ "line": 14,
+ "column": 17
+ }
+ },
+ "value": "number"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 245,
+ 246
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 17
+ },
+ "end": {
+ "line": 14,
+ "column": 18
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 246,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 18
+ },
+ "end": {
+ "line": 14,
+ "column": 19
+ }
+ },
+ "value": "|"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 247,
+ 248
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 19
+ },
+ "end": {
+ "line": 14,
+ "column": 20
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 248,
+ 254
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 20
+ },
+ "end": {
+ "line": 14,
+ "column": 26
+ }
+ },
+ "value": "string"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 254,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 14,
+ "column": 26
+ },
+ "end": {
+ "line": 15,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 255,
+ 260
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 0
+ },
+ "end": {
+ "line": 15,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 260,
+ 261
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 5
+ },
+ "end": {
+ "line": 15,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 261,
+ 262
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 6
+ },
+ "end": {
+ "line": 15,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 262,
+ 263
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 7
+ },
+ "end": {
+ "line": 15,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 263,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 8
+ },
+ "end": {
+ "line": 15,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 9
+ },
+ "end": {
+ "line": 15,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 265,
+ 284
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 10
+ },
+ "end": {
+ "line": 15,
+ "column": 29
+ }
+ },
+ "value": "defineProps<{foo:T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 284,
+ 285
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 29
+ },
+ "end": {
+ "line": 15,
+ "column": 30
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 285,
+ 289
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 30
+ },
+ "end": {
+ "line": 15,
+ "column": 34
+ }
+ },
+ "value": "bar:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 289,
+ 290
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 34
+ },
+ "end": {
+ "line": 15,
+ "column": 35
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 290,
+ 295
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 35
+ },
+ "end": {
+ "line": 15,
+ "column": 40
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 295,
+ 296
+ ],
+ "loc": {
+ "start": {
+ "line": 15,
+ "column": 40
+ },
+ "end": {
+ "line": 16,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 296,
+ 301
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 0
+ },
+ "end": {
+ "line": 16,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 301,
+ 302
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 5
+ },
+ "end": {
+ "line": 16,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 302,
+ 305
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 6
+ },
+ "end": {
+ "line": 16,
+ "column": 9
+ }
+ },
+ "value": "foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 305,
+ 306
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 9
+ },
+ "end": {
+ "line": 16,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 306,
+ 307
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 10
+ },
+ "end": {
+ "line": 16,
+ "column": 11
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 307,
+ 308
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 11
+ },
+ "end": {
+ "line": 16,
+ "column": 12
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 308,
+ 313
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 12
+ },
+ "end": {
+ "line": 16,
+ "column": 17
+ }
+ },
+ "value": "p.foo"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 313,
+ 314
+ ],
+ "loc": {
+ "start": {
+ "line": 16,
+ "column": 17
+ },
+ "end": {
+ "line": 17,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 314,
+ 330
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 0
+ },
+ "end": {
+ "line": 17,
+ "column": 16
+ }
+ },
+ "value": "console.log(foo)"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 330,
+ 331
+ ],
+ "loc": {
+ "start": {
+ "line": 17,
+ "column": 16
+ },
+ "end": {
+ "line": 18,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 331,
+ 339
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 0
+ },
+ "end": {
+ "line": 18,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 339,
+ 340
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 8
+ },
+ "end": {
+ "line": 18,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 340,
+ 341
+ ],
+ "loc": {
+ "start": {
+ "line": 18,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 341,
+ 350
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 0
+ },
+ "end": {
+ "line": 19,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 350,
+ 351
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 9
+ },
+ "end": {
+ "line": 19,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 351,
+ 352
+ ],
+ "loc": {
+ "start": {
+ "line": 19,
+ "column": 10
+ },
+ "end": {
+ "line": 20,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 352,
+ 354
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 0
+ },
+ "end": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 20,
+ "column": 5
+ },
+ "start": {
+ "line": 20,
+ "column": 2
+ }
+ },
+ "range": [
+ 354,
+ 357
+ ],
+ "value": "foo"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 357,
+ 359
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 5
+ },
+ "end": {
+ "line": 20,
+ "column": 7
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 359,
+ 360
+ ],
+ "loc": {
+ "start": {
+ "line": 20,
+ "column": 7
+ },
+ "end": {
+ "line": 21,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 360,
+ 370
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 0
+ },
+ "end": {
+ "line": 21,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 370,
+ 371
+ ],
+ "loc": {
+ "start": {
+ "line": 21,
+ "column": 10
+ },
+ "end": {
+ "line": 21,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 15
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 49
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 19
+ },
+ "start": {
+ "line": 3,
+ "column": 12
+ }
+ },
+ "range": [
+ 62,
+ 69
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 4,
+ "column": 15
+ },
+ "start": {
+ "line": 4,
+ "column": 4
+ }
+ },
+ "range": [
+ 88,
+ 99
+ ],
+ "value": " Comments"
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 5,
+ "column": 17
+ },
+ "start": {
+ "line": 5,
+ "column": 4
+ }
+ },
+ "range": [
+ 104,
+ 117
+ ],
+ "value": " extends "
+ },
+ {
+ "type": "Block",
+ "loc": {
+ "end": {
+ "line": 8,
+ "column": 13
+ },
+ "start": {
+ "line": 8,
+ "column": 6
+ }
+ },
+ "range": [
+ 151,
+ 158
+ ],
+ "value": " = "
+ },
+ {
+ "type": "Line",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 18
+ },
+ "start": {
+ "line": 9,
+ "column": 14
+ }
+ },
+ "range": [
+ 173,
+ 177
+ ],
+ "value": " ="
+ }
+ ],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/source.vue b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/source.vue
new file mode 100644
index 00000000..a0ad29c8
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/source.vue
@@ -0,0 +1,21 @@
+
+
+{{foo}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/token-ranges.json
new file mode 100644
index 00000000..38d59219
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/token-ranges.json
@@ -0,0 +1,86 @@
+[
+ "",
+ "\n",
+ "",
+ "\n",
+ "{{",
+ "foo",
+ "}}",
+ "\n",
+ " ",
+ "// Comments",
+ "/* = */",
+ "// Comments",
+ "/* extends */",
+ "/* = */",
+ "// ="
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json
new file mode 100644
index 00000000..ab3eb2d9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json
@@ -0,0 +1,226 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{foo}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{foo}}",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "foo",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/document-fragment.json
new file mode 100644
index 00000000..15d9ad50
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/document-fragment.json
@@ -0,0 +1,3384 @@
+{
+ "type": "VDocumentFragment",
+ "range": [
+ 0,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "children": [
+ {
+ "type": "VElement",
+ "range": [
+ 0,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "name": "script",
+ "rawName": "script",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 0,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "name": "setup",
+ "rawName": "setup"
+ },
+ "value": null
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 14,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "name": "lang",
+ "rawName": "lang"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 24,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 24
+ },
+ "end": {
+ "line": 1,
+ "column": 31
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "name": "generic",
+ "rawName": "generic"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 32,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "expression": {
+ "type": "VGenericExpression",
+ "range": [
+ 36,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 39
+ }
+ },
+ "params": [
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSFunctionType",
+ "params": [],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 49,
+ 58
+ ],
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "range": [
+ 52,
+ 58
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 18
+ }
+ }
+ }
+ },
+ "range": [
+ 46,
+ 58
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 12
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 36,
+ 58
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "TSTypeParameter",
+ "const": false,
+ "constraint": {
+ "type": "TSFunctionType",
+ "params": [],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 76,
+ 85
+ ],
+ "typeAnnotation": {
+ "type": "TSStringKeyword",
+ "range": [
+ 79,
+ 85
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 19
+ }
+ }
+ }
+ },
+ "range": [
+ 73,
+ 85
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 13
+ }
+ }
+ },
+ "default": {
+ "type": "TSFunctionType",
+ "params": [],
+ "returnType": {
+ "type": "TSTypeAnnotation",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 91,
+ 99
+ ],
+ "typeAnnotation": {
+ "type": "TSLiteralType",
+ "literal": {
+ "type": "Literal",
+ "raw": "'abc'",
+ "value": "abc",
+ "range": [
+ 94,
+ 99
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ }
+ },
+ "range": [
+ 94,
+ 99
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ }
+ }
+ },
+ "range": [
+ 88,
+ 99
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ }
+ },
+ "in": false,
+ "name": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ }
+ },
+ "out": false,
+ "range": [
+ 62,
+ 99
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ }
+ }
+ ],
+ "rawParams": [
+ "T extends () => string",
+ "U extends () => string = () => 'abc'"
+ ]
+ },
+ "references": []
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 102,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\nconst p = defineProps<{t: T, u: U}>()\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 141,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ }
+ },
+ "variables": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "T",
+ "optional": false,
+ "range": [
+ 36,
+ 37
+ ],
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "U",
+ "optional": false,
+ "range": [
+ 62,
+ 63
+ ],
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ }
+ },
+ "kind": "generic"
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 150,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 152,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 152,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 163,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "t",
+ "optional": false,
+ "range": [
+ 167,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 165,
+ 168
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 165,
+ 170
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 165,
+ 166
+ ],
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionContainer",
+ "range": [
+ 173,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "expression": {
+ "type": "CallExpression",
+ "arguments": [],
+ "callee": {
+ "type": "MemberExpression",
+ "computed": false,
+ "object": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "property": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "u",
+ "optional": false,
+ "range": [
+ 177,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 4
+ }
+ }
+ },
+ "range": [
+ 175,
+ 178
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "optional": false,
+ "range": [
+ 175,
+ 180
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "decorators": [],
+ "name": "p",
+ "optional": false,
+ "range": [
+ 175,
+ 176
+ ],
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ }
+ },
+ "mode": "r",
+ "isValueReference": true,
+ "isTypeReference": false
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 183,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ }
+ },
+ "variables": [],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 45
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "start": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "start": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "start": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 49,
+ 51
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 52,
+ 58
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "start": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 12
+ },
+ "start": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "range": [
+ 65,
+ 72
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 14
+ },
+ "start": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 18
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 76,
+ 78
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 79,
+ 85
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 27
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ],
+ "value": "="
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 29
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 88,
+ 89
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 30
+ },
+ "start": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 89,
+ 90
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 91,
+ 93
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "String",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 94,
+ 99
+ ],
+ "value": "'abc'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 113,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "defineProps<{t:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 131,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 132,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "value": "u:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 135,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 5,
+ "column": 37
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 37
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 141,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 152,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 163,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "range": [
+ 165,
+ 166
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 4
+ },
+ "start": {
+ "line": 9,
+ "column": 3
+ }
+ },
+ "range": [
+ 166,
+ 167
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "range": [
+ 167,
+ 168
+ ],
+ "value": "t"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 6
+ },
+ "start": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "range": [
+ 168,
+ 169
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 169,
+ 170
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 170,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 173,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 175,
+ 176
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 4
+ },
+ "start": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 176,
+ 177
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "range": [
+ 177,
+ 178
+ ],
+ "value": "u"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 6
+ },
+ "start": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "range": [
+ 178,
+ 179
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 179,
+ 180
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 180,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 183,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+ }
+ ],
+ "tokens": [
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 0,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 8,
+ 13
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 8
+ },
+ "end": {
+ "line": 1,
+ "column": 13
+ }
+ },
+ "value": "setup"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 14,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 14
+ },
+ "end": {
+ "line": 1,
+ "column": 18
+ }
+ },
+ "value": "lang"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 18,
+ 19
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 19,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 19
+ },
+ "end": {
+ "line": 1,
+ "column": 23
+ }
+ },
+ "value": "ts"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 24,
+ 31
+ ],
+ "loc": {
+ "start": {
+ "column": 24,
+ "line": 1
+ },
+ "end": {
+ "column": 31,
+ "line": 1
+ }
+ },
+ "value": "generic"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 31,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 31
+ },
+ "end": {
+ "line": 1,
+ "column": 32
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 32,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 32
+ },
+ "end": {
+ "line": 1,
+ "column": 33
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 3
+ },
+ "start": {
+ "line": 2,
+ "column": 2
+ }
+ },
+ "range": [
+ 36,
+ 37
+ ],
+ "value": "T"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 11
+ },
+ "start": {
+ "line": 2,
+ "column": 4
+ }
+ },
+ "range": [
+ 38,
+ 45
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 13
+ },
+ "start": {
+ "line": 2,
+ "column": 12
+ }
+ },
+ "range": [
+ 46,
+ 47
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 14
+ },
+ "start": {
+ "line": 2,
+ "column": 13
+ }
+ },
+ "range": [
+ 47,
+ 48
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 17
+ },
+ "start": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 49,
+ 51
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 24
+ },
+ "start": {
+ "line": 2,
+ "column": 18
+ }
+ },
+ "range": [
+ 52,
+ 58
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 2,
+ "column": 25
+ },
+ "start": {
+ "line": 2,
+ "column": 24
+ }
+ },
+ "range": [
+ 58,
+ 59
+ ],
+ "value": ","
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 3
+ },
+ "start": {
+ "line": 3,
+ "column": 2
+ }
+ },
+ "range": [
+ 62,
+ 63
+ ],
+ "value": "U"
+ },
+ {
+ "type": "Keyword",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 12
+ },
+ "start": {
+ "line": 3,
+ "column": 5
+ }
+ },
+ "range": [
+ 65,
+ 72
+ ],
+ "value": "extends"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 14
+ },
+ "start": {
+ "line": 3,
+ "column": 13
+ }
+ },
+ "range": [
+ 73,
+ 74
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 15
+ },
+ "start": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "range": [
+ 74,
+ 75
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 18
+ },
+ "start": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "range": [
+ 76,
+ 78
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 25
+ },
+ "start": {
+ "line": 3,
+ "column": 19
+ }
+ },
+ "range": [
+ 79,
+ 85
+ ],
+ "value": "string"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 27
+ },
+ "start": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 86,
+ 87
+ ],
+ "value": "="
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 29
+ },
+ "start": {
+ "line": 3,
+ "column": 28
+ }
+ },
+ "range": [
+ 88,
+ 89
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 30
+ },
+ "start": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 89,
+ 90
+ ],
+ "value": ")"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 33
+ },
+ "start": {
+ "line": 3,
+ "column": 31
+ }
+ },
+ "range": [
+ 91,
+ 93
+ ],
+ "value": "=>"
+ },
+ {
+ "type": "String",
+ "loc": {
+ "end": {
+ "line": 3,
+ "column": 39
+ },
+ "start": {
+ "line": 3,
+ "column": 34
+ }
+ },
+ "range": [
+ 94,
+ 99
+ ],
+ "value": "'abc'"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 100,
+ 101
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 101,
+ 102
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 4,
+ "column": 2
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 102,
+ 103
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 2
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 103,
+ 108
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 5
+ }
+ },
+ "value": "const"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 108,
+ 109
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 5
+ },
+ "end": {
+ "line": 5,
+ "column": 6
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 109,
+ 110
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 6
+ },
+ "end": {
+ "line": 5,
+ "column": 7
+ }
+ },
+ "value": "p"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 110,
+ 111
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 7
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 111,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 9
+ }
+ },
+ "value": "="
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 9
+ },
+ "end": {
+ "line": 5,
+ "column": 10
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 113,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 10
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "defineProps<{t:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 129,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 28
+ }
+ },
+ "value": "T,"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 131,
+ 132
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 28
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 132,
+ 134
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "value": "u:"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 134,
+ 135
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": " "
+ },
+ {
+ "type": "HTMLRawText",
+ "range": [
+ 135,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 5,
+ "column": 37
+ }
+ },
+ "value": "U}>()"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 37
+ },
+ "end": {
+ "line": 6,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 141,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 0
+ },
+ "end": {
+ "line": 6,
+ "column": 8
+ }
+ },
+ "value": "script"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 149,
+ 150
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 8
+ },
+ "end": {
+ "line": 6,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 150,
+ 152
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 0
+ }
+ },
+ "value": "\n\n"
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 152,
+ 161
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 0
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 161,
+ 162
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 9
+ },
+ "end": {
+ "line": 8,
+ "column": 10
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 162,
+ 163
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 163,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 3
+ },
+ "start": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "range": [
+ 165,
+ 166
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 4
+ },
+ "start": {
+ "line": 9,
+ "column": 3
+ }
+ },
+ "range": [
+ 166,
+ 167
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 5
+ },
+ "start": {
+ "line": 9,
+ "column": 4
+ }
+ },
+ "range": [
+ 167,
+ 168
+ ],
+ "value": "t"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 6
+ },
+ "start": {
+ "line": 9,
+ "column": 5
+ }
+ },
+ "range": [
+ 168,
+ 169
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 9,
+ "column": 7
+ },
+ "start": {
+ "line": 9,
+ "column": 6
+ }
+ },
+ "range": [
+ 169,
+ 170
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 170,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 7
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 172,
+ 173
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "VExpressionStart",
+ "range": [
+ 173,
+ 175
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "value": "{{"
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 3
+ },
+ "start": {
+ "line": 10,
+ "column": 2
+ }
+ },
+ "range": [
+ 175,
+ 176
+ ],
+ "value": "p"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 4
+ },
+ "start": {
+ "line": 10,
+ "column": 3
+ }
+ },
+ "range": [
+ 176,
+ 177
+ ],
+ "value": "."
+ },
+ {
+ "type": "Identifier",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 5
+ },
+ "start": {
+ "line": 10,
+ "column": 4
+ }
+ },
+ "range": [
+ 177,
+ 178
+ ],
+ "value": "u"
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 6
+ },
+ "start": {
+ "line": 10,
+ "column": 5
+ }
+ },
+ "range": [
+ 178,
+ 179
+ ],
+ "value": "("
+ },
+ {
+ "type": "Punctuator",
+ "loc": {
+ "end": {
+ "line": 10,
+ "column": 7
+ },
+ "start": {
+ "line": 10,
+ "column": 6
+ }
+ },
+ "range": [
+ 179,
+ 180
+ ],
+ "value": ")"
+ },
+ {
+ "type": "VExpressionEnd",
+ "range": [
+ 180,
+ 182
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 7
+ },
+ "end": {
+ "line": 10,
+ "column": 9
+ }
+ },
+ "value": "}}"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 9
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 183,
+ 193
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 193,
+ 194
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 10
+ },
+ "end": {
+ "line": 11,
+ "column": 11
+ }
+ },
+ "value": ""
+ }
+ ],
+ "comments": [],
+ "errors": []
+}
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/parser-options.json b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/parser-options.json
new file mode 100644
index 00000000..0ead30e9
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/parser-options.json
@@ -0,0 +1,6 @@
+{
+ "sourceType": "module",
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ }
+}
diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/source.vue b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/source.vue
new file mode 100644
index 00000000..d1a84af7
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/source.vue
@@ -0,0 +1,11 @@
+
+
+
+{{p.t()}}
+{{p.u()}}
+
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/token-ranges.json b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/token-ranges.json
new file mode 100644
index 00000000..19b7461d
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/token-ranges.json
@@ -0,0 +1,69 @@
+[
+ "",
+ "\n\n",
+ "",
+ "\n",
+ "{{",
+ "p",
+ ".",
+ "t",
+ "(",
+ ")",
+ "}}",
+ "\n",
+ "{{",
+ "p",
+ ".",
+ "u",
+ "(",
+ ")",
+ "}}",
+ "\n",
+ " "
+]
\ No newline at end of file
diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json
new file mode 100644
index 00000000..64d30e2d
--- /dev/null
+++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json
@@ -0,0 +1,257 @@
+[
+ {
+ "type": "VDocumentFragment",
+ "text": "\n\n\n{{p.t()}}\n{{p.u()}}\n ",
+ "children": [
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n\n",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n{{p.t()}}\n{{p.u()}}\n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{p.t()}}",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "p.t()",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "p.t",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "p",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "t",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "{{p.u()}}",
+ "children": [
+ {
+ "type": "CallExpression",
+ "text": "p.u()",
+ "children": [
+ {
+ "type": "MemberExpression",
+ "text": "p.u",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "p",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "u",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": " ",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/eslint b/test/fixtures/eslint
deleted file mode 160000
index 421aab44..00000000
--- a/test/fixtures/eslint
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 421aab44a9c167c82210bed52f68cf990b7edbea
diff --git a/test/fixtures/espree-v8/.npmrc b/test/fixtures/espree-v8/.npmrc
new file mode 100644
index 00000000..c1ca392f
--- /dev/null
+++ b/test/fixtures/espree-v8/.npmrc
@@ -0,0 +1 @@
+package-lock = false
diff --git a/test/fixtures/espree-v8/package.json b/test/fixtures/espree-v8/package.json
new file mode 100644
index 00000000..3091a7ab
--- /dev/null
+++ b/test/fixtures/espree-v8/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "espree-v8-test",
+ "private": true,
+ "version": "1.0.0",
+ "dependencies": {
+ "espree": "^8.0.0"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/.eslintrc.js b/test/fixtures/integrations/script-setup-with-typescript-eslint/.eslintrc.js
new file mode 100644
index 00000000..ef47614d
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/.eslintrc.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = {
+ root: true,
+ parser: require.resolve("../../../../src/index.ts"),
+ parserOptions: {
+ ecmaVersion: 2020,
+ sourceType: "module",
+ parser: "@typescript-eslint/parser",
+ project: require.resolve("./tsconfig.test.json"),
+ extraFileExtensions: ['.vue']
+ },
+ plugins: ["@typescript-eslint"],
+};
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/.npmrc b/test/fixtures/integrations/script-setup-with-typescript-eslint/.npmrc
new file mode 100644
index 00000000..c1ca392f
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/.npmrc
@@ -0,0 +1 @@
+package-lock = false
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/.eslintrc.json
new file mode 100644
index 00000000..a884ca94
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "@typescript-eslint/consistent-type-imports": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue
new file mode 100644
index 00000000..c1c451fc
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid.vue
new file mode 100644
index 00000000..cee3d088
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/.eslintrc.json
new file mode 100644
index 00000000..0fe9a184
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "no-obj-calls": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/valid.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/valid.vue
new file mode 100644
index 00000000..32aa1772
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-obj-calls/valid.vue
@@ -0,0 +1,8 @@
+
+
+ {{ JSON.stringify({ test: 'test'}) }}
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json
new file mode 100644
index 00000000..f21f62ca
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "no-undef": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/generic.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/generic.vue
new file mode 100644
index 00000000..f5752f73
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/generic.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue
new file mode 100644
index 00000000..7496058b
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue
@@ -0,0 +1,13 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic-with-spaces.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic-with-spaces.vue
new file mode 100644
index 00000000..8eecb84d
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic-with-spaces.vue
@@ -0,0 +1,13 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic.vue
new file mode 100644
index 00000000..fce7db53
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic.vue
@@ -0,0 +1,10 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic2.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic2.vue
new file mode 100644
index 00000000..7d10afcf
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/generic2.vue
@@ -0,0 +1,13 @@
+
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue
new file mode 100644
index 00000000..6e2bd254
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/.eslintrc.json
new file mode 100644
index 00000000..7592b0b5
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "@typescript-eslint/no-unused-vars": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/valid/type-def.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/valid/type-def.vue
new file mode 100644
index 00000000..ba631bff
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-unused-vars/valid/type-def.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json
new file mode 100644
index 00000000..af72fcf4
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json
@@ -0,0 +1,37 @@
+[
+ {
+ "filePath": "/no-undef/invalid/generic.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 6,
+ "message": "'U' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-undef/invalid/with-defaults.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 8,
+ "message": "'withDefaults' is not defined."
+ },
+ {
+ "ruleId": "no-undef",
+ "line": 8,
+ "message": "'defineProps' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/ts-no-unused-vars/invalid/generic.vue",
+ "messages": [
+ {
+ "ruleId": "@typescript-eslint/no-unused-vars",
+ "line": 4,
+ "message": "'Baz' is defined but never used."
+ }
+ ]
+ }
+]
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json
new file mode 100644
index 00000000..d9d36dfe
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json
@@ -0,0 +1,9 @@
+{
+ "devDependencies": {
+ "eslint": "^8.8.0",
+ "@typescript-eslint/parser": "^5.57.0",
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
+ "vue": "^3.4.0",
+ "typescript": "^5.0.2"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/.eslintrc.json
new file mode 100644
index 00000000..3b7392e3
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "@typescript-eslint/no-unsafe-assignment": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic1.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic1.vue
new file mode 100644
index 00000000..1f064003
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic1.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic2.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic2.vue
new file mode 100644
index 00000000..0937cd44
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic2.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic3.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic3.vue
new file mode 100644
index 00000000..d440fe0c
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unsafe-assignment/valid-generic3.vue
@@ -0,0 +1,12 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/.eslintrc.json
new file mode 100644
index 00000000..7592b0b5
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "@typescript-eslint/no-unused-vars": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/invalid/generic.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/invalid/generic.vue
new file mode 100644
index 00000000..5449949b
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/invalid/generic.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/valid/generic.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/valid/generic.vue
new file mode 100644
index 00000000..fce7db53
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/ts-no-unused-vars/valid/generic.vue
@@ -0,0 +1,10 @@
+
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/tsconfig.test.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/tsconfig.test.json
new file mode 100644
index 00000000..eed31ea8
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/tsconfig.test.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "useDefineForClassFields": true,
+ "module": "ESNext",
+ "moduleResolution": "Node",
+ "strict": true,
+ "jsx": "preserve",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "lib": ["ESNext", "DOM"],
+ "skipLibCheck": true,
+ "noEmit": true,
+ "checkJs": true,
+ "allowJs": true
+ },
+ "include": ["./vue.d.ts", "**/*.ts", "**/*.vue"]
+}
diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/vue.d.ts b/test/fixtures/integrations/script-setup-with-typescript-eslint/vue.d.ts
new file mode 100644
index 00000000..cf5931b6
--- /dev/null
+++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/vue.d.ts
@@ -0,0 +1 @@
+///
\ No newline at end of file
diff --git a/test/fixtures/integrations/script-setup/.eslintrc.json b/test/fixtures/integrations/script-setup/.eslintrc.json
new file mode 100644
index 00000000..7815413c
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/.eslintrc.json
@@ -0,0 +1,11 @@
+{
+ "root": true,
+ "parser": "../../../../src/index.ts",
+ "parserOptions": {
+ "ecmaVersion": 2022,
+ "sourceType": "module"
+ },
+ "env": {
+ "browser": true
+ }
+}
diff --git a/test/fixtures/integrations/script-setup/.npmrc b/test/fixtures/integrations/script-setup/.npmrc
new file mode 100644
index 00000000..c1ca392f
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/.npmrc
@@ -0,0 +1 @@
+package-lock = false
diff --git a/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json b/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json
new file mode 100644
index 00000000..8ac40848
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json
@@ -0,0 +1,13 @@
+{
+ "rules": {
+ "no-undef": "error"
+ },
+ "parserOptions": {
+ "parser": {
+ "ts": "@typescript-eslint/parser"
+ },
+ "vueFeatures": {
+ "customMacros": ["userMacro"]
+ }
+ }
+}
diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue
new file mode 100644
index 00000000..aa6d6193
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue
@@ -0,0 +1,13 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-options.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-options.vue
new file mode 100644
index 00000000..65c75093
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-options.vue
@@ -0,0 +1,10 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue
new file mode 100644
index 00000000..c94cc8dc
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-slots.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-slots.vue
new file mode 100644
index 00000000..900e01c6
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-slots.vue
@@ -0,0 +1,7 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/user-macro.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/user-macro.vue
new file mode 100644
index 00000000..ad8d3f30
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/invalid/user-macro.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue
new file mode 100644
index 00000000..9a34c335
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue
@@ -0,0 +1,11 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-options.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-options.vue
new file mode 100644
index 00000000..39ae2bbf
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-options.vue
@@ -0,0 +1,8 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue
new file mode 100644
index 00000000..526aa2a7
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue
@@ -0,0 +1,9 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue
new file mode 100644
index 00000000..d436665f
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue
@@ -0,0 +1,8 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-slots-wthout-ts.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-slots-wthout-ts.vue
new file mode 100644
index 00000000..6b367c16
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-slots-wthout-ts.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-slots.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-slots.vue
new file mode 100644
index 00000000..b28db98b
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-slots.vue
@@ -0,0 +1,5 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/user-macro.vue b/test/fixtures/integrations/script-setup/no-undef/valid/user-macro.vue
new file mode 100644
index 00000000..9990d5a3
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-undef/valid/user-macro.vue
@@ -0,0 +1,3 @@
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json b/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json
new file mode 100644
index 00000000..da817b4c
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "no-unused-vars": "error"
+ }
+}
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue
new file mode 100644
index 00000000..63792e58
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue
new file mode 100644
index 00000000..43f25387
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue
@@ -0,0 +1,12 @@
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue
new file mode 100644
index 00000000..2943f78c
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue
@@ -0,0 +1,9 @@
+
+
+
+ {{ msg }}
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue
new file mode 100644
index 00000000..92024d49
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue
new file mode 100644
index 00000000..213f418b
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue
@@ -0,0 +1,8 @@
+
+
+
+ {{ i }}
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue
new file mode 100644
index 00000000..bb67fbb1
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{ msg }}
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue
new file mode 100644
index 00000000..a08343d2
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue
new file mode 100644
index 00000000..26196fd1
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue
new file mode 100644
index 00000000..a75da9e9
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue
new file mode 100644
index 00000000..822b035c
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue
new file mode 100644
index 00000000..bff5a052
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue
new file mode 100644
index 00000000..b4d26cd4
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue
new file mode 100644
index 00000000..c7c27a17
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{ msg }}
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue
new file mode 100644
index 00000000..84fcdcac
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue
@@ -0,0 +1,9 @@
+
+
+
+
+ label
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue
new file mode 100644
index 00000000..b2a58120
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue
new file mode 100644
index 00000000..7c5b2f53
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue
new file mode 100644
index 00000000..be6f803a
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue
@@ -0,0 +1,7 @@
+
+
+
+ {{post}}
+
diff --git a/test/fixtures/integrations/script-setup/output.json b/test/fixtures/integrations/script-setup/output.json
new file mode 100644
index 00000000..ab872a06
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/output.json
@@ -0,0 +1,122 @@
+[
+ {
+ "filePath": "/no-undef/invalid/define-expose.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 8,
+ "message": "'defineExpose' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-undef/invalid/define-options.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 3,
+ "message": "'defineOptions' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-undef/invalid/define-props-and-emits.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 3,
+ "message": "'defineProps' is not defined."
+ },
+ {
+ "ruleId": "no-undef",
+ "line": 7,
+ "message": "'defineEmits' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-undef/invalid/define-slots.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 3,
+ "message": "'defineSlots' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-undef/invalid/user-macro.vue",
+ "messages": [
+ {
+ "ruleId": "no-undef",
+ "line": 2,
+ "message": "'unknown' is not defined."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/component-names.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 2,
+ "message": "'camelCase' is defined but never used."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/css-v-bind.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 2,
+ "message": "'color' is assigned a value but never used."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/invalid-scope.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 3,
+ "message": "'msg' is assigned a value but never used."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/sample.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 4,
+ "message": "'Bar' is defined but never used."
+ },
+ {
+ "ruleId": "no-unused-vars",
+ "line": 17,
+ "message": "'baz' is assigned a value but never used."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/with-v-for.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 2,
+ "message": "'i' is assigned a value but never used."
+ }
+ ]
+ },
+ {
+ "filePath": "/no-unused-vars/invalid/without-script-setup.vue",
+ "messages": [
+ {
+ "ruleId": "no-unused-vars",
+ "line": 2,
+ "message": "'msg' is assigned a value but never used."
+ }
+ ]
+ }
+]
diff --git a/test/fixtures/integrations/script-setup/package.json b/test/fixtures/integrations/script-setup/package.json
new file mode 100644
index 00000000..75604bef
--- /dev/null
+++ b/test/fixtures/integrations/script-setup/package.json
@@ -0,0 +1,5 @@
+{
+ "devDependencies": {
+ "eslint": "^8.8.0"
+ }
+}
diff --git a/test/fixtures/issue21.vue b/test/fixtures/issue21.vue
new file mode 100644
index 00000000..7e240d20
--- /dev/null
+++ b/test/fixtures/issue21.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/test/fixtures/lines-around-directive-always.vue.fixed b/test/fixtures/lines-around-directive-always.vue.fixed
deleted file mode 100644
index a9361534..00000000
--- a/test/fixtures/lines-around-directive-always.vue.fixed
+++ /dev/null
@@ -1,15 +0,0 @@
-
- {{ greeting }} World!
-
-
-
-
-
diff --git a/test/fixtures/lines-around-directive.vue b/test/fixtures/lines-around-directive.vue
deleted file mode 100644
index 33739d7c..00000000
--- a/test/fixtures/lines-around-directive.vue
+++ /dev/null
@@ -1,14 +0,0 @@
-
- {{ greeting }} World!
-
-
-
-
-
diff --git a/test/fixtures/location-issue-with-babel-eslint.vue b/test/fixtures/location-issue-with-babel-eslint.vue
new file mode 100644
index 00000000..aeef2e29
--- /dev/null
+++ b/test/fixtures/location-issue-with-babel-eslint.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/template-ast/svg-attrs-camel-case.tokens.json b/test/fixtures/template-ast/svg-attrs-camel-case.tokens.json
deleted file mode 100644
index a324e6a5..00000000
--- a/test/fixtures/template-ast/svg-attrs-camel-case.tokens.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "div"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "svg"
- ],
- [
- "VIdentifier",
- "viewBox"
- ],
- [
- "Punctuator",
- "="
- ],
- [
- "VAttributeValue",
- "\"0 0 40 40\""
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "svg"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "div"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n"
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-camel-case.traversal.json b/test/fixtures/template-ast/svg-attrs-camel-case.traversal.json
deleted file mode 100644
index 6b633381..00000000
--- a/test/fixtures/template-ast/svg-attrs-camel-case.traversal.json
+++ /dev/null
@@ -1,222 +0,0 @@
-[
- [
- "enter",
- "VElement",
- "\n \n \n
\n "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- "\n \n
"
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "div"
- ],
- [
- "leave",
- "VIdentifier",
- "div"
- ],
- [
- "leave",
- "VStartTag",
- "
"
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- " "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VIdentifier",
- "svg"
- ],
- [
- "enter",
- "VAttribute",
- "viewBox=\"0 0 40 40\""
- ],
- [
- "enter",
- "VIdentifier",
- "viewBox"
- ],
- [
- "leave",
- "VIdentifier",
- "viewBox"
- ],
- [
- "enter",
- "VAttributeValue",
- "\"0 0 40 40\""
- ],
- [
- "leave",
- "VAttributeValue",
- "\"0 0 40 40\""
- ],
- [
- "leave",
- "VAttribute",
- "viewBox=\"0 0 40 40\""
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- " "
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VEndTag",
- "
"
- ],
- [
- "enter",
- "VIdentifier",
- "div"
- ],
- [
- "leave",
- "VIdentifier",
- "div"
- ],
- [
- "leave",
- "VEndTag",
- "
"
- ],
- [
- "leave",
- "VElement",
- "\n \n
"
- ],
- [
- "enter",
- "VText",
- "\n"
- ],
- [
- "leave",
- "VText",
- "\n"
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- "\n \n \n
\n "
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-colon.tokens.json b/test/fixtures/template-ast/svg-attrs-colon.tokens.json
deleted file mode 100644
index c893ffa6..00000000
--- a/test/fixtures/template-ast/svg-attrs-colon.tokens.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "svg"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "use"
- ],
- [
- "VIdentifier",
- "xlink:href"
- ],
- [
- "Punctuator",
- "="
- ],
- [
- "VAttributeValue",
- "\"#test\""
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "use"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "svg"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n"
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/svg-attrs-colon.traversal.json b/test/fixtures/template-ast/svg-attrs-colon.traversal.json
deleted file mode 100644
index c1e5e9b9..00000000
--- a/test/fixtures/template-ast/svg-attrs-colon.traversal.json
+++ /dev/null
@@ -1,222 +0,0 @@
-[
- [
- "enter",
- "VElement",
- "\n \n \n \n "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- "\n \n "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- " "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "use"
- ],
- [
- "leave",
- "VIdentifier",
- "use"
- ],
- [
- "enter",
- "VAttribute",
- "xlink:href=\"#test\""
- ],
- [
- "enter",
- "VIdentifier",
- "xlink:href"
- ],
- [
- "leave",
- "VIdentifier",
- "xlink:href"
- ],
- [
- "enter",
- "VAttributeValue",
- "\"#test\""
- ],
- [
- "leave",
- "VAttributeValue",
- "\"#test\""
- ],
- [
- "leave",
- "VAttribute",
- "xlink:href=\"#test\""
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "use"
- ],
- [
- "leave",
- "VIdentifier",
- "use"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- " "
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VIdentifier",
- "svg"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- "\n \n "
- ],
- [
- "enter",
- "VText",
- "\n"
- ],
- [
- "leave",
- "VText",
- "\n"
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- "\n \n \n \n "
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/table.tokens.json b/test/fixtures/template-ast/table.tokens.json
deleted file mode 100644
index a32af958..00000000
--- a/test/fixtures/template-ast/table.tokens.json
+++ /dev/null
@@ -1,94 +0,0 @@
-[
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "table"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "tr"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n "
- ],
- [
- "Punctuator",
- "<"
- ],
- [
- "VIdentifier",
- "td"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "hello\n "
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "table"
- ],
- [
- "Punctuator",
- ">"
- ],
- [
- "VText",
- "\n"
- ],
- [
- "Punctuator",
- ""
- ],
- [
- "VIdentifier",
- "template"
- ],
- [
- "Punctuator",
- ">"
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/template-ast/table.traversal.json b/test/fixtures/template-ast/table.traversal.json
deleted file mode 100644
index 4fefad16..00000000
--- a/test/fixtures/template-ast/table.traversal.json
+++ /dev/null
@@ -1,212 +0,0 @@
-[
- [
- "enter",
- "VElement",
- "\n \n "
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- ""
- ],
- [
- "enter",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VIdentifier",
- "table"
- ],
- [
- "leave",
- "VIdentifier",
- "table"
- ],
- [
- "leave",
- "VStartTag",
- ""
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- "\n hello\n "
- ],
- [
- "enter",
- "VStartTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "tr"
- ],
- [
- "leave",
- "VIdentifier",
- "tr"
- ],
- [
- "leave",
- "VStartTag",
- " "
- ],
- [
- "enter",
- "VText",
- "\n "
- ],
- [
- "leave",
- "VText",
- "\n "
- ],
- [
- "enter",
- "VElement",
- "hello\n "
- ],
- [
- "enter",
- "VStartTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "td"
- ],
- [
- "leave",
- "VIdentifier",
- "td"
- ],
- [
- "leave",
- "VStartTag",
- " "
- ],
- [
- "enter",
- "VText",
- "hello\n "
- ],
- [
- "leave",
- "VText",
- "hello\n "
- ],
- [
- "leave",
- "VElement",
- " hello\n "
- ],
- [
- "leave",
- "VElement",
- " \n hello\n "
- ],
- [
- "enter",
- "VEndTag",
- "
"
- ],
- [
- "enter",
- "VIdentifier",
- "table"
- ],
- [
- "leave",
- "VIdentifier",
- "table"
- ],
- [
- "leave",
- "VEndTag",
- "
"
- ],
- [
- "leave",
- "VElement",
- ""
- ],
- [
- "enter",
- "VText",
- "\n"
- ],
- [
- "leave",
- "VText",
- "\n"
- ],
- [
- "enter",
- "VEndTag",
- " "
- ],
- [
- "enter",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VIdentifier",
- "template"
- ],
- [
- "leave",
- "VEndTag",
- " "
- ],
- [
- "leave",
- "VElement",
- "\n \n "
- ]
-]
\ No newline at end of file
diff --git a/test/fixtures/ts-scope-manager.vue b/test/fixtures/ts-scope-manager.vue
new file mode 100644
index 00000000..f3685675
--- /dev/null
+++ b/test/fixtures/ts-scope-manager.vue
@@ -0,0 +1,11 @@
+
+ Hello World!
+
+
+
diff --git a/test/fixtures/typed.js b/test/fixtures/typed.js
new file mode 100644
index 00000000..0e3e9712
--- /dev/null
+++ b/test/fixtures/typed.js
@@ -0,0 +1,9 @@
+interface Data {
+ greeting: string
+}
+
+export default {
+ data(): Data {
+ return {greeting: "Hello"}
+ },
+}
diff --git a/test/fixtures/typed.ts b/test/fixtures/typed.ts
new file mode 100644
index 00000000..0e3e9712
--- /dev/null
+++ b/test/fixtures/typed.ts
@@ -0,0 +1,9 @@
+interface Data {
+ greeting: string
+}
+
+export default {
+ data(): Data {
+ return {greeting: "Hello"}
+ },
+}
diff --git a/test/fixtures/typed.tsx b/test/fixtures/typed.tsx
new file mode 100644
index 00000000..0e3e9712
--- /dev/null
+++ b/test/fixtures/typed.tsx
@@ -0,0 +1,9 @@
+interface Data {
+ greeting: string
+}
+
+export default {
+ data(): Data {
+ return {greeting: "Hello"}
+ },
+}
diff --git a/test/index.js b/test/index.js
index 8fa1bf7a..e4d898b3 100644
--- a/test/index.js
+++ b/test/index.js
@@ -12,8 +12,9 @@
const assert = require("assert")
const path = require("path")
const fs = require("fs-extra")
-const parse = require("..").parse
-const CLIEngine = require("./fixtures/eslint").CLIEngine
+const parse = require("../src").parse
+const parseForESLint = require("../src").parseForESLint
+const eslint = require("eslint")
//------------------------------------------------------------------------------
// Helpers
@@ -21,13 +22,34 @@ const CLIEngine = require("./fixtures/eslint").CLIEngine
const ORIGINAL_FIXTURE_DIR = path.join(__dirname, "fixtures")
const FIXTURE_DIR = path.join(__dirname, "temp")
-const PARSER_PATH = path.resolve(__dirname, "../index.js")
-
+const parser = require("../src/index.ts")
+
+const BABEL_PARSER_OPTIONS = {
+ parser: "@babel/eslint-parser",
+ requireConfigFile: false,
+ babelOptions: {
+ plugins: [
+ "@babel/plugin-syntax-typescript",
+ [
+ "@babel/plugin-syntax-decorators",
+ {
+ decoratorsBeforeExport: true,
+ },
+ ],
+ ],
+ },
+}
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
-describe("Basic tests", () => {
+describe("Basic tests", async () => {
+ const ESLint = await eslint.loadESLint({ useFlatConfig: true })
+ const Linter = class extends eslint.Linter {
+ constructor() {
+ super({ configType: "flat" })
+ }
+ }
beforeEach(() => {
fs.emptyDirSync(FIXTURE_DIR)
for (const fileName of fs.readdirSync(ORIGINAL_FIXTURE_DIR)) {
@@ -44,317 +66,535 @@ describe("Basic tests", () => {
})
describe("About fixtures/hello.vue", () => {
- it("should notify 2 'semi' errors", () => {
- const cli = new CLIEngine({
+ it("should notify 2 'semi' errors", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["hello.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["hello.vue"])
+ const messages = report[0].messages
assert(messages.length === 2)
assert(messages[0].ruleId === "semi")
assert(messages[0].line === 8)
assert(messages[0].column === 35)
- assert(messages[0].source === " return {greeting: \"Hello\"}")
assert(messages[1].ruleId === "semi")
assert(messages[1].line === 10)
assert(messages[1].column === 2)
- assert(messages[1].source === "}")
})
- it("should fix 2 'semi' errors with --fix option", () => {
- const cli = new CLIEngine({
+ it("should fix 2 'semi' errors with --fix option", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
fix: true,
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- CLIEngine.outputFixes(cli.executeOnFiles(["hello.vue"]))
+ await ESLint.outputFixes(await cli.lintFiles(["hello.vue"]))
- const actual = fs.readFileSync(path.join(FIXTURE_DIR, "hello.vue"), "utf8")
- const expected = fs.readFileSync(path.join(FIXTURE_DIR, "hello.vue.fixed"), "utf8")
+ const actual = fs.readFileSync(
+ path.join(FIXTURE_DIR, "hello.vue"),
+ "utf8",
+ )
+ const expected = fs.readFileSync(
+ path.join(FIXTURE_DIR, "hello.vue.fixed"),
+ "utf8",
+ )
assert(actual === expected)
})
})
describe("About fixtures/empty.vue", () => {
- it("should notify no error", () => {
- const cli = new CLIEngine({
+ it("should notify no error", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["empty.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["empty.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
})
describe("About fixtures/no-script.vue", () => {
- it("should notify no error", () => {
- const cli = new CLIEngine({
+ it("should notify no error", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["no-script.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["no-script.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
})
describe("About fixtures/empty-script.vue", () => {
- it("should notify no error", () => {
- const cli = new CLIEngine({
+ it("should notify no error", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["empty-script.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["empty-script.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
})
describe("About fixtures/no-end-script-tag.vue", () => {
- it("should notify no error", () => {
- const cli = new CLIEngine({
+ it("should notify no error", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["no-end-script-tag.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["no-end-script-tag.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
})
describe("About fixtures/notvue.js", () => {
- it("should notify a 'semi' error", () => {
- const cli = new CLIEngine({
+ it("should notify a 'semi' error", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.js"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["notvue.js"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["notvue.js"])
+ const messages = report[0].messages
assert(messages.length === 1)
assert(messages[0].ruleId === "semi")
assert(messages[0].line === 1)
assert(messages[0].column === 21)
- assert(messages[0].source === "console.log(\"hello\")")
})
- it("should fix a 'semi' error with --fix option", () => {
- const cli = new CLIEngine({
+ it("should fix a 'semi' error with --fix option", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
fix: true,
- parser: PARSER_PATH,
- rules: {semi: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.js"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { semi: "error" },
+ },
+ overrideConfigFile: true,
})
- CLIEngine.outputFixes(cli.executeOnFiles(["notvue.js"]))
+ await ESLint.outputFixes(await cli.lintFiles(["notvue.js"]))
+
+ const actual = fs.readFileSync(
+ path.join(FIXTURE_DIR, "notvue.js"),
+ "utf8",
+ )
+ const expected = fs.readFileSync(
+ path.join(FIXTURE_DIR, "notvue.js.fixed"),
+ "utf8",
+ )
+
+ assert.strictEqual(actual, expected)
+ })
+ })
- const actual = fs.readFileSync(path.join(FIXTURE_DIR, "notvue.js"), "utf8")
- const expected = fs.readFileSync(path.join(FIXTURE_DIR, "notvue.js.fixed"), "utf8")
+ describe("About fixtures/crlf.vue", () => {
+ it("should notify no 'indent' error", async () => {
+ const cli = new ESLint({
+ cwd: FIXTURE_DIR,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ rules: { indent: "error" },
+ },
+ overrideConfigFile: true,
+ })
+ const report = await cli.lintFiles(["crlf.vue"])
+ const messages = report[0].messages
- assert(actual === expected)
+ assert.deepStrictEqual(messages, [])
})
})
- describe("About fixtures/lines-around-directive.vue", () => {
- it("should notify no 'lines-around-directive' error (never)", () => {
- const cli = new CLIEngine({
+ describe("About fixtures/typed.js", () => {
+ it("should notify no error with '@babel/eslint-parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {"lines-around-directive": ["error", "never"]},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.js"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ ...BABEL_PARSER_OPTIONS,
+ sourceType: "module",
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["lines-around-directive.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["typed.js"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
- it("should notify a 'lines-around-directive' error (always)", () => {
- const cli = new CLIEngine({
+ it("should notify no error with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {"lines-around-directive": ["error", "always"]},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.js"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: "@typescript-eslint/parser",
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["lines-around-directive.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["typed.js"])
+ const messages = report[0].messages
- assert(messages.length === 1)
- assert(messages[0].ruleId === "lines-around-directive")
- assert(messages[0].line === 6)
- assert(messages[0].column === 1)
- assert(messages[0].source === "\"use strict\"")
+ assert.deepStrictEqual(messages, [])
})
- it("should fix 'lines-around-directive' errors with --fix option", () => {
- const cli = new CLIEngine({
+ it("should notify no error with multiple parser with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- fix: true,
- parser: PARSER_PATH,
- rules: {"lines-around-directive": ["error", "always"]},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.ts", "*.tsx"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: {
+ ts: "@typescript-eslint/parser",
+ },
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
})
- CLIEngine.outputFixes(cli.executeOnFiles(["lines-around-directive.vue"]))
+ const report = await cli.lintFiles(["typed.ts", "typed.tsx"])
- const actual = fs.readFileSync(path.join(FIXTURE_DIR, "lines-around-directive.vue"), "utf8")
- const expected = fs.readFileSync(path.join(FIXTURE_DIR, "lines-around-directive-always.vue.fixed"), "utf8")
+ assert.deepStrictEqual(report[0].messages, [])
+ assert.deepStrictEqual(report[1].messages, [])
+ })
- assert(actual === expected)
+ it("should notify no error with parser object with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
+ cwd: FIXTURE_DIR,
+ overrideConfig: {
+ files: ["*.js"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: require("@typescript-eslint/parser"),
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
+ })
+ const report = await cli.lintFiles(["typed.js"])
+ const messages = report[0].messages
+
+ assert.deepStrictEqual(messages, [])
})
- })
- describe("About fixtures/crlf.vue", () => {
- it("should notify no 'indent' error", () => {
- const cli = new CLIEngine({
+ it("should notify no error with multiple parser object with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- rules: {indent: "error"},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.ts", "*.tsx"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: {
+ ts: require("@typescript-eslint/parser"),
+ },
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["crlf.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["typed.ts", "typed.tsx"])
- assert(messages.length === 0)
+ assert.deepStrictEqual(report[0].messages, [])
+ assert.deepStrictEqual(report[1].messages, [])
})
})
describe("About fixtures/typed.vue", () => {
- it("should notify no error with 'babel-eslint'", () => {
- const cli = new CLIEngine({
+ it("should notify no error with '@babel/eslint-parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- parserOptions: {
- parser: "babel-eslint",
- sourceType: "module",
- },
- rules: {semi: ["error", "never"]},
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ ...BABEL_PARSER_OPTIONS,
+ },
+ },
+ rules: { semi: ["error", "never"] },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["typed.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["typed.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
- it("should notify no error with 'typescript-eslint-parser'", () => {
- const cli = new CLIEngine({
+ it("should notify no error with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- parserOptions: { //
- parser: "typescript-eslint-parser",
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: "@typescript-eslint/parser",
+ },
+ },
+ rules: { semi: ["error", "never"] },
},
- rules: {semi: ["error", "never"]},
- useEslintrc: false,
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["typed.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["typed.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
- it("should fix 'semi' errors with --fix option with 'babel-eslint'", () => {
- const cli = new CLIEngine({
+ it("should fix 'semi' errors with --fix option with '@babel/eslint-parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
fix: true,
- parser: PARSER_PATH,
- parserOptions: {
- parser: "babel-eslint",
- sourceType: "module",
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ ...BABEL_PARSER_OPTIONS,
+ },
+ },
+ rules: { semi: ["error", "always"] },
},
- rules: {semi: ["error", "always"]},
- useEslintrc: false,
+ overrideConfigFile: true,
})
- CLIEngine.outputFixes(cli.executeOnFiles(["typed.vue"]))
+ await ESLint.outputFixes(await cli.lintFiles(["typed.vue"]))
- const actual = fs.readFileSync(path.join(FIXTURE_DIR, "typed.vue"), "utf8")
- const expected = fs.readFileSync(path.join(FIXTURE_DIR, "typed.vue.fixed"), "utf8")
+ const actual = fs.readFileSync(
+ path.join(FIXTURE_DIR, "typed.vue"),
+ "utf8",
+ )
+ const expected = fs.readFileSync(
+ path.join(FIXTURE_DIR, "typed.vue.fixed"),
+ "utf8",
+ )
assert(actual === expected)
})
- it("should fix 'semi' errors with --fix option with 'typescript-eslint-parser'", () => {
- const cli = new CLIEngine({
+ it("should fix 'semi' errors with --fix option with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
fix: true,
- parser: PARSER_PATH,
- parserOptions: { //
- parser: "typescript-eslint-parser",
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: "@typescript-eslint/parser",
+ },
+ },
+ rules: { semi: ["error", "always"] },
},
- rules: {semi: ["error", "always"]},
- useEslintrc: false,
+ overrideConfigFile: true,
})
- CLIEngine.outputFixes(cli.executeOnFiles(["typed.vue"]))
-
- const actual = fs.readFileSync(path.join(FIXTURE_DIR, "typed.vue"), "utf8")
- const expected = fs.readFileSync(path.join(FIXTURE_DIR, "typed.vue.fixed"), "utf8")
+ await ESLint.outputFixes(await cli.lintFiles(["typed.vue"]))
+
+ const actual = fs.readFileSync(
+ path.join(FIXTURE_DIR, "typed.vue"),
+ "utf8",
+ )
+ const expected = fs.readFileSync(
+ path.join(FIXTURE_DIR, "typed.vue.fixed"),
+ "utf8",
+ )
+
+ assert.strictEqual(actual, expected)
+ })
+ })
- assert(actual === expected)
+ describe("About fixtures/ts-scope-manager.vue", () => {
+ it("should calculate the correct location with '@typescript-eslint/parser'", async () => {
+ const cli = new ESLint({
+ cwd: FIXTURE_DIR,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ parserOptions: {
+ parser: "@typescript-eslint/parser",
+ },
+ },
+ rules: { "no-unused-vars": ["error"] },
+ },
+ overrideConfigFile: true,
+ })
+ const report = await cli.lintFiles(["ts-scope-manager.vue"])
+ const messages = report[0].messages
+
+ assert.strictEqual(messages.length, 1)
+ assert.deepStrictEqual(messages[0].line, 8)
+ assert.deepStrictEqual(messages[0].column, 8)
+ assert.deepStrictEqual(messages[0].endLine, 8)
+ assert.deepStrictEqual(messages[0].endColumn, 14)
})
})
describe("About fixtures/svg-attrs.vue", () => {
- it("parses attributes with colons", () => {
- const cli = new CLIEngine({
+ it("parses attributes with colons", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["svg-attrs-colon.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["svg-attrs-colon.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
})
- it("parses camelCased attributes", () => {
- const cli = new CLIEngine({
+ it("parses camelCased attributes", async () => {
+ const cli = new ESLint({
cwd: FIXTURE_DIR,
- envs: ["es6", "node"],
- parser: PARSER_PATH,
- useEslintrc: false,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ globals: {},
+ },
+ },
+ overrideConfigFile: true,
})
- const report = cli.executeOnFiles(["svg-attrs-camel-case.vue"])
- const messages = report.results[0].messages
+ const report = await cli.lintFiles(["svg-attrs-camel-case.vue"])
+ const messages = report[0].messages
- assert(messages.length === 0)
+ assert.deepStrictEqual(messages, [])
+ })
+ })
+
+ describe("About fixtures/location-issue-with-babel-eslint.vue", () => {
+ it("Identifiers in import declarations should has correct location.", async () => {
+ const cli = new ESLint({
+ cwd: FIXTURE_DIR,
+ overrideConfig: {
+ files: ["*.vue"],
+ languageOptions: {
+ parser,
+ parserOptions: {
+ ...BABEL_PARSER_OPTIONS,
+ sourceType: "module",
+ ecmaVersion: "latest",
+ },
+ globals: {},
+ },
+ rules: {
+ "no-use-before-define": "error",
+ },
+ },
+ overrideConfigFile: true,
+ })
+ const report = await cli.lintFiles([
+ "location-issue-with-babel-eslint.vue",
+ ])
+ const messages = report[0].messages
+
+ assert.deepStrictEqual(messages, [])
})
})
@@ -364,19 +604,21 @@ describe("Basic tests", () => {
const text = ast.templateBody.children[0]
const errors = ast.templateBody.errors
- assert.equal(text.value, "\u0000")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(text.value, "\u0000")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in RCDATA state.", () => {
- const ast = parse(" ")
+ const ast = parse(
+ " ",
+ )
const text = ast.templateBody.children[0].children[0]
const errors = ast.templateBody.errors
- assert.equal(text.value, "\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(text.value, "\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in RAWTEXT state.", () => {
@@ -384,9 +626,9 @@ describe("Basic tests", () => {
const text = ast.templateBody.children[0].children[0]
const errors = ast.templateBody.errors
- assert.equal(text.value, "\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(text.value, "\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in TAG_NAME state.", () => {
@@ -394,49 +636,53 @@ describe("Basic tests", () => {
const element = ast.templateBody.children[0]
const errors = ast.templateBody.errors
- assert.equal(element.name, "test\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(element.name, "test\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_NAME state.", () => {
const ast = parse("
")
- const attribute = ast.templateBody.children[0].startTag.attributes[0]
+ const attribute =
+ ast.templateBody.children[0].startTag.attributes[0]
const errors = ast.templateBody.errors
- assert.equal(attribute.key.name, "a\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(attribute.key.name, "a\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_DOUBLE_QUOTED state.", () => {
- const ast = parse("
")
- const attribute = ast.templateBody.children[0].startTag.attributes[0]
+ const ast = parse('
')
+ const attribute =
+ ast.templateBody.children[0].startTag.attributes[0]
const errors = ast.templateBody.errors
- assert.equal(attribute.value.value, "\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(attribute.value.value, "\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_SINGLE_QUOTED state.", () => {
const ast = parse("
")
- const attribute = ast.templateBody.children[0].startTag.attributes[0]
+ const attribute =
+ ast.templateBody.children[0].startTag.attributes[0]
const errors = ast.templateBody.errors
- assert.equal(attribute.value.value, "\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(attribute.value.value, "\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_UNQUOTED state.", () => {
const ast = parse("
")
- const attribute = ast.templateBody.children[0].startTag.attributes[0]
+ const attribute =
+ ast.templateBody.children[0].startTag.attributes[0]
const errors = ast.templateBody.errors
- assert.equal(attribute.value.value, "\uFFFD")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(attribute.value.value, "\uFFFD")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in COMMENT state.", () => {
@@ -444,9 +690,9 @@ describe("Basic tests", () => {
const comment = ast.templateBody.comments[0]
const errors = ast.templateBody.errors
- assert.equal(comment.value, " \uFFFD ")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-null-character")
+ assert.strictEqual(comment.value, " \uFFFD ")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(errors[0].code, "unexpected-null-character")
})
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in BOGUS_COMMENT state.", () => {
@@ -454,9 +700,12 @@ describe("Basic tests", () => {
const comment = ast.templateBody.comments[0]
const errors = ast.templateBody.errors
- assert.equal(comment.value, "? \uFFFD ?")
- assert.equal(errors.length, 1)
- assert.equal(errors[0].code, "unexpected-question-mark-instead-of-tag-name")
+ assert.strictEqual(comment.value, "? \uFFFD ?")
+ assert.strictEqual(errors.length, 1)
+ assert.strictEqual(
+ errors[0].code,
+ "unexpected-question-mark-instead-of-tag-name",
+ )
})
it("should not error in CDATA section state.", () => {
@@ -464,8 +713,198 @@ describe("Basic tests", () => {
const cdata = ast.templateBody.children[0].children[0]
const errors = ast.templateBody.errors
- assert.equal(cdata.value, "\u0000")
- assert.equal(errors.length, 0)
+ assert.strictEqual(cdata.value, "\u0000")
+ assert.strictEqual(errors.length, 0)
+ })
+ })
+
+ describe("About parserServices", () => {
+ it("should exist if the source code is a Vue SFC file.", () => {
+ assert.notStrictEqual(
+ parseForESLint("test", { filePath: "test.vue" }).services,
+ undefined,
+ )
+ })
+
+ it("should exist even if the source code is not Vue SFC file.", () => {
+ assert.notStrictEqual(
+ parseForESLint("test", { filePath: "test.js" }).services,
+ undefined,
+ )
+ })
+ })
+
+ describe("https://github.com/vuejs/vue-eslint-parser/issues/21", () => {
+ it("should make the correct location of decorators", () => {
+ const code = fs.readFileSync(
+ path.join(FIXTURE_DIR, "issue21.vue"),
+ "utf8",
+ )
+ const indexOfDecorator = code.indexOf("@Component")
+ const ast = parse(code, {
+ ...BABEL_PARSER_OPTIONS,
+ ecmaVersion: "latest",
+ sourceType: "module",
+
+ // Implicit parserOptions to detect whether the current ESLint supports `result.scopeManager` and `result.visitorKeys`.
+ eslintScopeManager: true,
+ eslintVisitorKeys: true,
+ })
+
+ assert.strictEqual(ast.body[2].range[0], indexOfDecorator)
+ assert.strictEqual(
+ ast.body[2].decorators[0].range[0],
+ indexOfDecorator,
+ )
+ })
+ })
+
+ describe("parserServices.defineTemplateBodyVisitor", () => {
+ it("should work even if AST object was reused.", () => {
+ const code = "
"
+ const config = {
+ languageOptions: {
+ parser,
+ },
+ plugins: buildPlugins({
+ create(context) {
+ return context.sourceCode.parserServices.defineTemplateBodyVisitor(
+ {
+ "VElement[name='div']"(node) {
+ context.report({ node, message: "OK" })
+ },
+ },
+ )
+ },
+ }),
+ rules: {
+ "test/test-rule": "error",
+ },
+ }
+ const linter = new Linter()
+ const messages1 = linter.verify(code, config)
+ const messages2 = linter.verify(linter.getSourceCode(), config)
+
+ assert.strictEqual(messages1.length, 1)
+ assert.strictEqual(messages1[0].message, "OK")
+ assert.strictEqual(messages2.length, 1)
+ assert.strictEqual(messages2[0].message, "OK")
+ })
+
+ it("should work even if used sibling selector.", () => {
+ const code = "
"
+ const config = {
+ languageOptions: {
+ parser,
+ },
+ plugins: buildPlugins({
+ create(context) {
+ return context.sourceCode.parserServices.defineTemplateBodyVisitor(
+ {
+ "* ~ *"(node) {
+ context.report({
+ node,
+ message: "OK",
+ })
+ },
+ },
+ )
+ },
+ }),
+ rules: {
+ "test/test-rule": "error",
+ },
+ }
+ const linter = new Linter()
+ const messages1 = linter.verify(code, config)
+ const messages2 = linter.verify(linter.getSourceCode(), config)
+
+ assert.strictEqual(messages1.length, 1)
+ assert.strictEqual(messages1[0].message, "OK")
+ assert.strictEqual(messages2.length, 1)
+ assert.strictEqual(messages2[0].message, "OK")
+ })
+ })
+
+ describe("Multiple '
+ const config = {
+ languageOptions: {
+ parser,
+ },
+ }
+ const linter = new Linter()
+ const messages = linter.verify(code, config)
+
+ assert.strictEqual(messages.length, 1)
+ // assert.strictEqual(
+ // messages[0].message,
+ // "Parsing error: Unterminated comment"
+ // )
+ })
+ it("should notify parsing error #2", () => {
+ const code = ""
+ const config = {
+ languageOptions: {
+ parser,
+ parserOptions: {
+ ecmaVersion: "latest",
+ },
+ },
+ }
+ const linter = new Linter()
+ const messages = linter.verify(code, config)
+
+ assert.strictEqual(messages.length, 1)
+ assert.strictEqual(
+ messages[0].message,
+ "Parsing error: Unterminated template literal",
+ )
+ })
+ it("should notify parsing error #3", () => {
+ const code = ''
+ const config = {
+ languageOptions: {
+ parser,
+ },
+ }
+ const linter = new Linter()
+ const messages = linter.verify(code, config)
+
+ assert.strictEqual(messages.length, 1)
+ assert.strictEqual(
+ messages[0].message,
+ "Parsing error: Unterminated string constant",
+ )
+ })
+ it("should notify 1 no-undef error", () => {
+ const code =
+ ""
+ const config = {
+ languageOptions: {
+ parser,
+ },
+ rules: {
+ "no-undef": "error",
+ },
+ }
+ const linter = new Linter()
+ const messages = linter.verify(code, config)
+
+ assert.strictEqual(messages.length, 1)
+ assert.strictEqual(messages[0].message, "'c' is not defined.")
})
})
})
+
+function buildPlugins(rule) {
+ return {
+ test: {
+ rules: {
+ "test-rule": rule,
+ },
+ },
+ }
+}
diff --git a/test/integrations.js b/test/integrations.js
new file mode 100644
index 00000000..88e9c501
--- /dev/null
+++ b/test/integrations.js
@@ -0,0 +1,101 @@
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const assert = require("assert")
+const path = require("path")
+const fs = require("fs-extra")
+const cp = require("child_process")
+const eslintCompat = require("./lib/eslint-compat")
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const FIXTURE_DIR = path.join(__dirname, "fixtures/integrations")
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+describe("Integration tests", () => {
+ for (const target of fs.readdirSync(FIXTURE_DIR)) {
+ it(target, async () => {
+ let ESLint = eslintCompat(require("eslint")).ESLint
+ if (fs.existsSync(path.join(FIXTURE_DIR, target, "package.json"))) {
+ const originalCwd = process.cwd()
+ try {
+ process.chdir(path.join(FIXTURE_DIR, target))
+ cp.execSync("npm i", { stdio: "inherit" })
+ ESLint = eslintCompat(
+ require(
+ path.join(
+ FIXTURE_DIR,
+ target,
+ "node_modules/eslint",
+ ),
+ ),
+ ).ESLint
+ } finally {
+ process.chdir(originalCwd)
+ }
+ }
+ const cwd = path.join(FIXTURE_DIR, target)
+ const cli = new ESLint({
+ cwd,
+ })
+ const report = await cli.lintFiles(["**/*.vue"])
+
+ const outputPath = path.join(FIXTURE_DIR, target, `output.json`)
+ const expected = JSON.parse(fs.readFileSync(outputPath, "utf8"))
+ try {
+ assert.deepStrictEqual(
+ normalizeReport(report, { withoutMessage: true }),
+ normalizeReport(expected, {
+ withoutMessage: true,
+ }),
+ )
+ } catch (e) {
+ const actualPath = path.join(
+ FIXTURE_DIR,
+ target,
+ `_actual.json`,
+ )
+ fs.writeFileSync(
+ actualPath,
+ JSON.stringify(normalizeReport(report), null, 4),
+ "utf8",
+ )
+ throw e
+ }
+
+ function normalizeReport(report, option = {}) {
+ return report
+ .filter((res) => res.messages.length)
+ .map((res) => {
+ return {
+ filePath: res.filePath
+ .replace(cwd, "")
+ .replace(/\\/gu, "/"),
+ messages: res.messages.map((msg) => {
+ return {
+ ruleId: msg.ruleId,
+ line: msg.line,
+ ...(option.withoutMessage
+ ? {}
+ : { message: msg.message }),
+ }
+ }),
+ }
+ })
+ .sort((a, b) =>
+ a.filePath < b.filePath
+ ? -1
+ : a.filePath < b.filePath
+ ? 1
+ : 0,
+ )
+ }
+ })
+ }
+})
diff --git a/test/lib/eslint-compat.js b/test/lib/eslint-compat.js
new file mode 100644
index 00000000..9077ec55
--- /dev/null
+++ b/test/lib/eslint-compat.js
@@ -0,0 +1,116 @@
+"use strict"
+
+/**
+ * @typedef {import('eslint')} eslint
+ */
+
+/** @param {eslint} eslint */
+module.exports = function compat(eslint) {
+ return {
+ ESLint: eslint.ESLint || getESLintClassForV6(eslint),
+ RuleTester: eslint.RuleTester,
+ Linter: eslint.Linter,
+ }
+}
+
+/** @returns {typeof eslint.ESLint} */
+function getESLintClassForV6(eslint) {
+ class ESLintForV6 {
+ static get version() {
+ return eslint.CLIEngine.version
+ }
+
+ /** @param {eslint.ESLint.Options} options */
+ constructor(options) {
+ const {
+ overrideConfig: {
+ plugins,
+ globals,
+ rules,
+ env,
+ ...overrideConfig
+ } = {
+ plugins: [],
+ globals: {},
+ rules: {},
+ },
+ overrideConfigFile,
+ fix,
+ reportUnusedDisableDirectives,
+ plugins: pluginsMap,
+ ...otherOptions
+ } = options || {}
+ /** @type {eslint.CLIEngine.Options} */
+ const newOptions = {
+ fix: Boolean(fix),
+ reportUnusedDisableDirectives: reportUnusedDisableDirectives
+ ? reportUnusedDisableDirectives !== "off"
+ : undefined,
+ configFile: overrideConfigFile,
+ ...otherOptions,
+
+ envs: Object.entries(env)
+ .filter(([, v]) => v)
+ .map(([k]) => k),
+ globals: globals
+ ? Object.keys(globals).filter((n) => globals[n])
+ : undefined,
+ plugins: plugins || [],
+ rules: rules
+ ? Object.entries(rules).reduce(
+ (o, [ruleId, opt]) => {
+ if (opt) {
+ o[ruleId] = opt
+ }
+ return o
+ },
+ /** @type {NonNullable} */ {},
+ )
+ : undefined,
+ ...overrideConfig,
+ }
+ this.engine = new eslint.CLIEngine(newOptions)
+
+ for (const [name, plugin] of Object.entries(pluginsMap || {})) {
+ this.engine.addPlugin(name, plugin)
+ }
+ }
+
+ /**
+ * @param {Parameters} params
+ * @returns {ReturnType}
+ */
+ async lintText(...params) {
+ const result = this.engine.executeOnText(
+ params[0],
+ params[1].filePath,
+ )
+ return result.results
+ }
+
+ /**
+ * @param {Parameters} params
+ * @returns {ReturnType}
+ */
+ async lintFiles(...params) {
+ const result = this.engine.executeOnFiles(
+ Array.isArray(params[0]) ? params[0] : [params[0]],
+ )
+ return result.results
+ }
+
+ /**
+ * @param {Parameters} params
+ * @returns {ReturnType}
+ */
+ static async outputFixes(...params) {
+ return eslint.CLIEngine.outputFixes({
+ results: params[0],
+ })
+ }
+ }
+
+ /** @type {typeof eslint.ESLint} */
+ const eslintClass = /** @type {any} */ ESLintForV6
+ return eslintClass
+}
diff --git a/test/parser-options-project.js b/test/parser-options-project.js
new file mode 100644
index 00000000..1fc3b12a
--- /dev/null
+++ b/test/parser-options-project.js
@@ -0,0 +1,134 @@
+"use strict"
+
+const assert = require("assert")
+const { parseForESLint } = require("../src")
+const espree = require("espree")
+
+describe("use `project: undefined` when parsing template script-let", () => {
+ it("should be the project option is defined only once in Simple SFC.", () => {
+ let projectCount = 0
+ parseForESLint(
+ `
+
+
+ {{ 'str' }}
+
+
+
+
+ A
+
+
+
+
+
+ `,
+ {
+ project: true,
+ sourceType: "module",
+ ecmaVersion: "latest",
+ parser: {
+ parseForESLint(code, options) {
+ if (options.project) {
+ projectCount++
+ }
+
+ return {
+ ast: espree.parse(code, options),
+ }
+ },
+ },
+ },
+ )
+ assert.strictEqual(projectCount, 1)
+ })
+ it("should be the project option is defined only once in
+
+
+
+ {{ 'str' }}
+
+
+
+
+ A
+
+
+
+
+
+ `,
+ {
+ project: true,
+ sourceType: "module",
+ ecmaVersion: "latest",
+ parser: {
+ parseForESLint(code, options) {
+ if (options.project) {
+ projectCount++
+ }
+
+ return {
+ ast: espree.parse(code, options),
+ }
+ },
+ },
+ },
+ )
+ assert.strictEqual(projectCount, 1)
+ })
+
+ it("should be the project option is defined only once in
+
+
+
+
+ {{ 'str' }}
+
+
+
+
+ A
+
+
+
+
+ `,
+ {
+ project: true,
+ sourceType: "module",
+ ecmaVersion: "latest",
+ parser: {
+ parseForESLint(code, options) {
+ if (options.project) {
+ projectCount++
+ }
+
+ return {
+ ast: espree.parse(code, options),
+ }
+ },
+ },
+ },
+ )
+ assert.strictEqual(projectCount, 1)
+ })
+})
diff --git a/test/parser-options.js b/test/parser-options.js
new file mode 100644
index 00000000..3c7e4e1b
--- /dev/null
+++ b/test/parser-options.js
@@ -0,0 +1,78 @@
+/**
+ * @author Toru Nagashima
+ * See LICENSE file in root directory for full license.
+ */
+"use strict"
+
+const assert = require("assert")
+const { parseForESLint } = require("../src")
+const eslint = require("eslint")
+const Linter = eslint.Linter
+
+describe("parserOptions", () => {
+ describe("parser", () => {
+ const linter = new Linter({ configType: "flat" })
+ const parser = { parseForESLint }
+ const plugin = {
+ rules: {
+ "template-test": {
+ create(context) {
+ return {
+ Program(node) {
+ const element = node.templateBody
+ if (element != null) {
+ context.report({ node, message: "test" })
+ }
+ },
+ }
+ },
+ },
+ },
+ }
+
+ it("false then skip parsing '`
+ const config = {
+ files: ["*.vue"],
+ plugins: {
+ vue: plugin,
+ },
+ languageOptions: {
+ parser,
+ parserOptions: {
+ parser: false,
+ },
+ },
+ rules: {
+ "vue/template-test": "error",
+ },
+ }
+ const messages = linter.verify(code, config, "test.vue")
+
+ assert.strictEqual(messages.length, 1)
+ assert.strictEqual(messages[0].ruleId, "vue/template-test")
+ })
+
+ it("Fail in `
+ const config = {
+ files: ["*.vue"],
+ plugins: {
+ vue: plugin,
+ },
+ languageOptions: {
+ parser,
+ sourceType: "script",
+ parserOptions: {},
+ },
+ rules: {},
+ }
+ const messages = linter.verify(code, config, "test.vue")
+
+ assert.strictEqual(messages.length, 1)
+ assert.strictEqual(messages[0].fatal, true)
+ })
+ })
+})
diff --git a/test/test-utils.js b/test/test-utils.js
new file mode 100644
index 00000000..8ea0b760
--- /dev/null
+++ b/test/test-utils.js
@@ -0,0 +1,140 @@
+const escope = require("eslint-scope")
+
+module.exports = { replacer, getAllTokens, scopeToJSON, analyze }
+
+/**
+ * Remove `parent` properties from the given AST.
+ * @param {string} key The key.
+ * @param {any} value The value of the key.
+ * @returns {any} The value of the key to output.
+ */
+function replacer(key, value) {
+ if (key === "parent") {
+ return undefined
+ }
+ if (key === "errors" && Array.isArray(value)) {
+ return value.map((e) => ({
+ message: e.message,
+ index: e.index,
+ lineNumber: e.lineNumber,
+ column: e.column,
+ }))
+ }
+ return value
+}
+
+/**
+ * Get all tokens of the given AST.
+ * @param {ASTNode} ast The root node of AST.
+ * @returns {Token[]} Tokens.
+ */
+function getAllTokens(ast) {
+ const tokenArrays = [ast.tokens, ast.comments]
+ if (ast.templateBody != null) {
+ tokenArrays.push(ast.templateBody.tokens, ast.templateBody.comments)
+ }
+ return Array.prototype.concat.apply([], tokenArrays)
+}
+
+function scopeToJSON(scopeManager) {
+ return JSON.stringify(normalizeScope(scopeManager.globalScope), replacer, 4)
+
+ function normalizeScope(scope) {
+ return {
+ type: scope.type,
+ variables: scope.variables.map(normalizeVar),
+ references: scope.references.map(normalizeReference),
+ childScopes: scope.childScopes.map(normalizeScope),
+ through: scope.through.map(normalizeReference),
+ }
+ }
+
+ function normalizeVar(v) {
+ return {
+ name: v.name,
+ identifiers: v.identifiers.map(normalizeId),
+ defs: v.defs.map(normalizeDef),
+ references: v.references.map(normalizeReference),
+ }
+ }
+
+ function normalizeReference(reference) {
+ return {
+ identifier: normalizeId(reference.identifier),
+ from: reference.from.type,
+ resolved: normalizeId(
+ reference.resolved &&
+ reference.resolved.defs &&
+ reference.resolved.defs[0] &&
+ reference.resolved.defs[0].name,
+ ),
+ init: reference.init ?? null,
+ vueUsedInTemplate: reference.vueUsedInTemplate
+ ? reference.vueUsedInTemplate
+ : undefined,
+ }
+ }
+
+ function normalizeDef(def) {
+ return {
+ type: def.type,
+ node: normalizeDefNode(def.node),
+ name: def.name.name,
+ }
+ }
+
+ function normalizeId(identifier) {
+ return (
+ identifier && {
+ type: identifier.type,
+ name: identifier.name,
+ loc: identifier.loc,
+ }
+ )
+ }
+
+ function normalizeDefNode(node) {
+ return {
+ type: node.type,
+ loc: node.loc,
+ }
+ }
+}
+
+/**
+ * Analyze scope
+ */
+function analyze(ast, parserOptions) {
+ const ecmaVersion = parserOptions.ecmaVersion ?? 2022
+ const ecmaFeatures = parserOptions.ecmaFeatures ?? {}
+ const sourceType = parserOptions.sourceType ?? "script"
+ const result = escope.analyze(ast, {
+ ignoreEval: true,
+ nodejsScope: false,
+ impliedStrict: ecmaFeatures.impliedStrict,
+ ecmaVersion,
+ sourceType,
+ fallback: getFallbackKeys,
+ })
+
+ return result
+
+ function getFallbackKeys(node) {
+ return Object.keys(node).filter(fallbackKeysFilter, node)
+ }
+
+ function fallbackKeysFilter(key) {
+ const value = null
+ return (
+ key !== "comments" &&
+ key !== "leadingComments" &&
+ key !== "loc" &&
+ key !== "parent" &&
+ key !== "range" &&
+ key !== "tokens" &&
+ key !== "trailingComments" &&
+ typeof value === "object" &&
+ (typeof value.type === "string" || Array.isArray(value))
+ )
+ }
+}
diff --git a/test/tokens.js b/test/tokens.js
index 5da4aae4..de370298 100644
--- a/test/tokens.js
+++ b/test/tokens.js
@@ -10,7 +10,7 @@
//------------------------------------------------------------------------------
const assert = require("assert")
-const parse = require("..").parseForESLint
+const parse = require("../src").parseForESLint
//------------------------------------------------------------------------------
// Helpers
@@ -52,7 +52,7 @@ describe("services.getTemplateBodyTokenStore", () => {
let tokens = null
before(() => {
- const result = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS))
+ const result = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS })
ast = result.ast
tokens = result.services.getTemplateBodyTokenStore()
})
@@ -61,19 +61,77 @@ describe("services.getTemplateBodyTokenStore", () => {
it("should return all tokens (except comments) in the template.", () => {
const actual = tokens.getTokens(ast.templateBody).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["template", ">", "\n ", "\n ", "div", "a", "=", "b", "v-show", "=", "\"", "c", "<", "3", "&&", "ok", "==", "\"ok\"", "\"", ">", "{{", "message", "}}", "div", ">", "\n", "template", ">"]
- )
+ assert.deepStrictEqual(actual, [
+ "template",
+ ">",
+ "\n ",
+ "\n ",
+ "div",
+ "a",
+ "=",
+ "b",
+ "v-show",
+ "=",
+ '"',
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ '"',
+ ">",
+ "{{",
+ "message",
+ "}}",
+ "div",
+ ">",
+ "\n",
+ "template",
+ ">",
+ ])
})
it("should return all tokens (include comments) in the template if you give {includeComments: true} option.", () => {
- const actual = tokens.getTokens(ast.templateBody, {includeComments: true}).map(toValue)
-
- assert.deepStrictEqual(
- actual,
- ["template", ">", "\n ", "comment1", "\n ", "div", "a", "=", "b", "v-show", "=", "\"", "c", "<", "3", "&&", "ok", "==", "\"ok\"", "\"", ">", "comment2", "{{", "message", "comment3", "}}", "comment4", "div", ">", "\n", "template", ">"]
- )
+ const actual = tokens
+ .getTokens(ast.templateBody, { includeComments: true })
+ .map(toValue)
+
+ assert.deepStrictEqual(actual, [
+ "template",
+ ">",
+ "\n ",
+ "comment1",
+ "\n ",
+ "div",
+ "a",
+ "=",
+ "b",
+ "v-show",
+ "=",
+ '"',
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ '"',
+ ">",
+ "comment2",
+ "{{",
+ "message",
+ "comment3",
+ "}}",
+ "comment4",
+ "div",
+ ">",
+ "\n",
+ "template",
+ ">",
+ ])
})
})
@@ -82,10 +140,7 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[0]
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["\n "]
- )
+ assert.deepStrictEqual(actual, ["\n "])
})
})
@@ -94,10 +149,29 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2]
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["div", "a", "=", "b", "v-show", "=", "\"", "c", "<", "3", "&&", "ok", "==", "\"ok\"", "\"", ">", "{{", "message", "}}", "div", ">"]
- )
+ assert.deepStrictEqual(actual, [
+ "div",
+ "a",
+ "=",
+ "b",
+ "v-show",
+ "=",
+ '"',
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ '"',
+ ">",
+ "{{",
+ "message",
+ "}}",
+ "div",
+ ">",
+ ])
})
})
@@ -106,10 +180,24 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2].startTag
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["div", "a", "=", "b", "v-show", "=", "\"", "c", "<", "3", "&&", "ok", "==", "\"ok\"", "\"", ">"]
- )
+ assert.deepStrictEqual(actual, [
+ "div",
+ "a",
+ "=",
+ "b",
+ "v-show",
+ "=",
+ '"',
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ '"',
+ ">",
+ ])
})
})
@@ -118,10 +206,7 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2].startTag.attributes[0]
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["a", "=", "b"]
- )
+ assert.deepStrictEqual(actual, ["a", "=", "b"])
})
})
@@ -130,22 +215,17 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2].startTag.attributes[0].key
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["a"]
- )
+ assert.deepStrictEqual(actual, ["a"])
})
})
describe("ast.templateBody.children[2].startTag.attributes[0].value (VAttributeValue)", () => {
it("should return the value token.", () => {
- const node = ast.templateBody.children[2].startTag.attributes[0].value
+ const node =
+ ast.templateBody.children[2].startTag.attributes[0].value
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["b"]
- )
+ assert.deepStrictEqual(actual, ["b"])
})
})
@@ -154,34 +234,46 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2].startTag.attributes[1].key
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["v-show"]
- )
+ assert.deepStrictEqual(actual, ["v-show"])
})
})
describe("ast.templateBody.children[2].startTag.attributes[1].value (VExpressionContainer)", () => {
it("should return all tokens in the value.", () => {
- const node = ast.templateBody.children[2].startTag.attributes[1].value
+ const node =
+ ast.templateBody.children[2].startTag.attributes[1].value
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["\"", "c", "<", "3", "&&", "ok", "==", "\"ok\"", "\""]
- )
+ assert.deepStrictEqual(actual, [
+ '"',
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ '"',
+ ])
})
})
describe("ast.templateBody.children[2].startTag.attributes[1].value.expression (BinaryExpression)", () => {
it("should return all tokens in the expression.", () => {
- const node = ast.templateBody.children[2].startTag.attributes[1].value.expression
+ const node =
+ ast.templateBody.children[2].startTag.attributes[1].value
+ .expression
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["c", "<", "3", "&&", "ok", "==", "\"ok\""]
- )
+ assert.deepStrictEqual(actual, [
+ "c",
+ "<",
+ "3",
+ "&&",
+ "ok",
+ "==",
+ '"ok"',
+ ])
})
})
@@ -190,10 +282,22 @@ describe("services.getTemplateBodyTokenStore", () => {
const node = ast.templateBody.children[2].endTag
const actual = tokens.getTokens(node).map(toValue)
- assert.deepStrictEqual(
- actual,
- ["div", ">"]
- )
+ assert.deepStrictEqual(actual, ["div", ">"])
+ })
+ })
+
+ describe("TokenStore#get{Range,Loc}()", () => {
+ it("should return loc and range.", () => {
+ const {
+ templateBody: {
+ children: [node],
+ tokens: [token],
+ },
+ } = ast
+ assert.equal(typeof tokens.getRange(node)[0], "number")
+ assert.equal(typeof tokens.getRange(token)[1], "number")
+ assert.equal(typeof tokens.getLoc(node).start.line, "number")
+ assert.equal(typeof tokens.getLoc(node).end.column, "number")
})
})
})
diff --git a/test/tools/.eslintrc.json b/test/tools/.eslintrc.json
deleted file mode 100644
index 07b54ecf..00000000
--- a/test/tools/.eslintrc.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "extends": ["mysticatea", "mysticatea/node"],
- "rules": {
- "no-console": "off"
- }
-}
diff --git a/test/variables-references.js b/test/variables-references.js
index 2bca4817..4e6a590b 100644
--- a/test/variables-references.js
+++ b/test/variables-references.js
@@ -10,7 +10,7 @@
//------------------------------------------------------------------------------
const assert = require("assert")
-const parse = require("..").parseForESLint
+const parse = require("../src").parseForESLint
//------------------------------------------------------------------------------
// Helpers
@@ -30,20 +30,27 @@ const PARSER_OPTIONS = {
describe("[references] expression containers", () => {
describe("in directives", () => {
- const code = "
"
+ const code = '
'
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should have references", () => {
- const directive = ast.templateBody.children[0].startTag.attributes[0]
+ const directive =
+ ast.templateBody.children[0].startTag.attributes[0]
assert(directive.key.type === "VDirectiveKey")
assert(directive.value.references != null)
- assert(directive.value.references[0].id === directive.value.expression.left)
- assert(directive.value.references[1].id === directive.value.expression.right)
+ assert(
+ directive.value.references[0].id ===
+ directive.value.expression.left,
+ )
+ assert(
+ directive.value.references[1].id ===
+ directive.value.expression.right,
+ )
})
})
@@ -52,7 +59,7 @@ describe("[references] expression containers", () => {
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should have references", () => {
@@ -66,31 +73,35 @@ describe("[references] expression containers", () => {
})
describe("in v-on directive", () => {
- const code = "
"
+ const code = '
'
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should not include $event references.", () => {
- const directive = ast.templateBody.children[0].startTag.attributes[0]
+ const directive =
+ ast.templateBody.children[0].startTag.attributes[0]
assert(directive.key.type === "VDirectiveKey")
- assert(directive.key.name === "on")
+ assert(directive.key.name.name === "on")
assert(directive.value.references.length === 1)
- assert(directive.value.references[0].id === directive.value.expression.body[0].expression.callee)
+ assert(
+ directive.value.references[0].id ===
+ directive.value.expression.body[0].expression.callee,
+ )
})
})
})
describe("[variables] elements", () => {
describe("which have v-for directive", () => {
- const code = "
"
+ const code = '
'
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should have references", () => {
@@ -99,18 +110,23 @@ describe("[variables] elements", () => {
assert(element.type === "VElement")
assert(element.variables.length === 1)
- assert(element.variables[0].id === directive.value.expression.left[0])
+ assert(
+ element.variables[0].id === directive.value.expression.left[0],
+ )
assert(directive.value.references.length === 1)
- assert(directive.value.references[0].id === directive.value.expression.right)
+ assert(
+ directive.value.references[0].id ===
+ directive.value.expression.right,
+ )
})
})
describe("which have v-for directive (with index)", () => {
- const code = "
"
+ const code = '
'
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should have references", () => {
@@ -119,19 +135,26 @@ describe("[variables] elements", () => {
assert(element.type === "VElement")
assert(element.variables.length === 2)
- assert(element.variables[0].id === directive.value.expression.left[0])
- assert(element.variables[1].id === directive.value.expression.left[1])
+ assert(
+ element.variables[0].id === directive.value.expression.left[0],
+ )
+ assert(
+ element.variables[1].id === directive.value.expression.left[1],
+ )
assert(directive.value.references.length === 1)
- assert(directive.value.references[0].id === directive.value.expression.right)
+ assert(
+ directive.value.references[0].id ===
+ directive.value.expression.right,
+ )
})
})
describe("which have scope attribute", () => {
- const code = " "
+ const code = ' '
let ast = null
before(() => {
- ast = parse(code, Object.assign({filePath: "test.vue"}, PARSER_OPTIONS)).ast
+ ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
})
it("should have variables", () => {
@@ -144,7 +167,219 @@ describe("[variables] elements", () => {
assert(element.variables[0].id.range[0] === 27)
assert(element.variables[0].id.range[1] === 28)
assert(element.variables[0].kind === "scope")
- assert(attribute.value.type === "VLiteral")
+ assert(attribute.value.type === "VExpressionContainer")
+ assert(attribute.value.expression.type === "VSlotScopeExpression")
+ assert(attribute.value.expression.params[0].type === "Identifier")
+ assert(attribute.value.expression.params[0].name === "a")
})
})
})
+
+describe("Variables of v-for and references", () => {
+ const code =
+ '{{x}} '
+ let variables = null
+ let vForReferences = null
+ let vBindKeyReferences = null
+ let mustacheReferences1 = null
+ let mustacheReferences2 = null
+ let mustacheReferences3 = null
+
+ before(() => {
+ const ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
+ variables = ast.templateBody.children[0].variables
+ vForReferences =
+ ast.templateBody.children[0].startTag.attributes[0].value.references
+ vBindKeyReferences =
+ ast.templateBody.children[0].startTag.attributes[1].value.references
+ mustacheReferences1 =
+ ast.templateBody.children[0].children[0].references
+ mustacheReferences2 =
+ ast.templateBody.children[0].children[1].children[0].references
+ mustacheReferences3 = ast.templateBody.children[1].references
+ })
+
+ it("should have relationship each other", () => {
+ assert(variables.length === 1)
+ assert(vForReferences.length === 1)
+ assert(vBindKeyReferences.length === 1)
+ assert(mustacheReferences1.length === 2)
+ assert(mustacheReferences2.length === 1)
+ assert(mustacheReferences3.length === 1)
+ assert(variables[0].references.length === 3)
+ assert(variables[0].references[0] === vBindKeyReferences[0])
+ assert(variables[0].references[1] === mustacheReferences1[0])
+ assert(variables[0].references[2] === mustacheReferences2[0])
+ assert(vForReferences[0].variable === null)
+ assert(vBindKeyReferences[0].variable === variables[0])
+ assert(mustacheReferences1[0].variable === variables[0])
+ assert(mustacheReferences1[1].variable === null)
+ assert(mustacheReferences2[0].variable === variables[0])
+ assert(mustacheReferences3[0].variable === null)
+ })
+
+ it("`Variable#references` should be non-enumerable", () => {
+ for (const variable of variables) {
+ assert(
+ Object.getOwnPropertyDescriptor(variable, "references")
+ .enumerable === false,
+ )
+ }
+ })
+
+ it("`Reference#variable` should be non-enumerable", () => {
+ for (const reference of [].concat(
+ vForReferences,
+ vBindKeyReferences,
+ mustacheReferences1,
+ mustacheReferences2,
+ mustacheReferences3,
+ )) {
+ assert(
+ Object.getOwnPropertyDescriptor(reference, "variable")
+ .enumerable === false,
+ )
+ }
+ })
+})
+
+describe("Variables of template-scope and references", () => {
+ const code =
+ '{{x + y}}{{x}}
{{x}} '
+ let variables = null
+ let vBindKeyReferences = null
+ let mustacheReferences1 = null
+ let mustacheReferences2 = null
+ let mustacheReferences3 = null
+
+ before(() => {
+ const ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
+ variables = ast.templateBody.children[0].variables
+ vBindKeyReferences =
+ ast.templateBody.children[0].startTag.attributes[1].value.references
+ mustacheReferences1 =
+ ast.templateBody.children[0].children[0].references
+ mustacheReferences2 =
+ ast.templateBody.children[0].children[1].children[0].references
+ mustacheReferences3 = ast.templateBody.children[1].references
+ })
+
+ it("should have relationship each other", () => {
+ assert(variables.length === 1)
+ assert(vBindKeyReferences.length === 1)
+ assert(mustacheReferences1.length === 2)
+ assert(mustacheReferences2.length === 1)
+ assert(mustacheReferences3.length === 1)
+ assert(variables[0].references.length === 3)
+ assert(variables[0].references[0] === vBindKeyReferences[0])
+ assert(variables[0].references[1] === mustacheReferences1[0])
+ assert(variables[0].references[2] === mustacheReferences2[0])
+ assert(vBindKeyReferences[0].variable === variables[0])
+ assert(mustacheReferences1[0].variable === variables[0])
+ assert(mustacheReferences1[1].variable === null)
+ assert(mustacheReferences2[0].variable === variables[0])
+ assert(mustacheReferences3[0].variable === null)
+ })
+
+ it("`Variable#references` should be non-enumerable", () => {
+ for (const variable of variables) {
+ assert(
+ Object.getOwnPropertyDescriptor(variable, "references")
+ .enumerable === false,
+ )
+ }
+ })
+
+ it("`Reference#variable` should be non-enumerable", () => {
+ for (const reference of [].concat(
+ vBindKeyReferences,
+ mustacheReferences1,
+ mustacheReferences2,
+ mustacheReferences3,
+ )) {
+ assert(
+ Object.getOwnPropertyDescriptor(reference, "variable")
+ .enumerable === false,
+ )
+ }
+ })
+})
+
+describe("Variables of v-for and references of dynamic arguments", () => {
+ const code = '
'
+ let variables = null
+ let vForReferences = null
+ let vBindKeyReferences = null
+
+ before(() => {
+ const ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
+ variables = ast.templateBody.children[0].variables
+ vForReferences =
+ ast.templateBody.children[0].startTag.attributes[0].value.references
+ vBindKeyReferences =
+ ast.templateBody.children[0].startTag.attributes[1].key.argument
+ .references
+ })
+
+ it("should have relationship each other", () => {
+ assert(variables.length === 1)
+ assert(vForReferences.length === 1)
+ assert(vBindKeyReferences.length === 1)
+ assert(variables[0].references.length === 1)
+ assert(variables[0].references[0] === vBindKeyReferences[0])
+ assert(vForReferences[0].variable === null)
+ assert(vBindKeyReferences[0].variable === variables[0])
+ })
+})
+
+describe("Variables of v-for and references of v-bind same-name shorthand", () => {
+ const code = '
'
+ let variables = null
+ let vForReferences = null
+ let vBindReferences = null
+
+ before(() => {
+ const ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
+ variables = ast.templateBody.children[0].variables
+ vForReferences =
+ ast.templateBody.children[0].startTag.attributes[0].value.references
+ vBindReferences =
+ ast.templateBody.children[0].startTag.attributes[1].value.references
+ })
+
+ it("should have relationship each other", () => {
+ assert(variables.length === 1)
+ assert(vForReferences.length === 1)
+ assert(vBindReferences.length === 1)
+ assert(variables[0].references.length === 1)
+ assert(variables[0].references[0] === vBindReferences[0])
+ assert(vForReferences[0].variable === null)
+ assert(vBindReferences[0].variable === variables[0])
+ })
+})
+
+describe("Variables of v-for and references of v-bind same-name shorthand with kebab-case", () => {
+ const code = '
'
+ let variables = null
+ let vForReferences = null
+ let vBindReferences = null
+
+ before(() => {
+ const ast = parse(code, { filePath: "test.vue", ...PARSER_OPTIONS }).ast
+ variables = ast.templateBody.children[0].variables
+ vForReferences =
+ ast.templateBody.children[0].startTag.attributes[0].value.references
+ vBindReferences =
+ ast.templateBody.children[0].startTag.attributes[1].value.references
+ })
+
+ it("should have relationship each other", () => {
+ assert(variables.length === 1)
+ assert(vForReferences.length === 1)
+ assert(vBindReferences.length === 1)
+ assert(variables[0].references.length === 1)
+ assert(variables[0].references[0] === vBindReferences[0])
+ assert(vForReferences[0].variable === null)
+ assert(vBindReferences[0].variable === variables[0])
+ })
+})
diff --git a/tsconfig.json b/tsconfig.json
index c8432660..e4cbfcc2 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,43 +1,41 @@
{
- "compileOnSave": true,
- "compilerOptions": {
- "allowJs": false,
- "allowSyntheticDefaultImports": true,
- "allowUnreachableCode": false,
- "allowUnusedLabels": false,
- "alwaysStrict": true,
- "baseUrl": ".",
- "checkJs": false,
- "declaration": true,
- "diagnostics": true,
- "forceConsistentCasingInFileNames": true,
- "inlineSources": true,
- "lib": [
- "es2015"
- ],
- "module": "es2015",
- "moduleResolution": "node",
- "newLine": "LF",
- "noEmitOnError": true,
- "noFallthroughCasesInSwitch": true,
- "noImplicitAny": true,
- "noImplicitReturns": true,
- "noImplicitThis": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "outDir": ".temp",
- "paths": {
- "*": ["typings/*"]
- },
- "pretty": true,
- "removeComments": true,
- "sourceMap": true,
- "sourceRoot": "src",
- "strict": true,
- "strictNullChecks": true,
- "target": "es2015"
+ "compileOnSave": true,
+ "compilerOptions": {
+ "allowJs": false,
+ "allowSyntheticDefaultImports": true,
+ "allowUnreachableCode": false,
+ "allowUnusedLabels": false,
+ "alwaysStrict": true,
+ "baseUrl": ".",
+ "checkJs": false,
+ "declaration": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "inlineSources": true,
+ "lib": ["es2015"],
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "newLine": "LF",
+ "noEmitOnError": true,
+ "noFallthroughCasesInSwitch": true,
+ "noImplicitAny": true,
+ "noImplicitReturns": true,
+ "noImplicitThis": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "outDir": ".temp",
+ "paths": {
+ "*": ["typings/*"]
},
- "include": [
- "src/**/*.ts"
- ]
+ "pretty": true,
+ "removeComments": true,
+ "sourceMap": true,
+ "sourceRoot": "src",
+ "strict": true,
+ "strictNullChecks": true,
+ "target": "ES2024",
+
+ "skipLibCheck": true
+ },
+ "include": ["src/**/*.ts"]
}
diff --git a/typings/eslint-scope/index.d.ts b/typings/eslint-scope/index.d.ts
index 18a10743..6d14afcf 100644
--- a/typings/eslint-scope/index.d.ts
+++ b/typings/eslint-scope/index.d.ts
@@ -3,9 +3,8 @@
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
-import * as estree from "estree"
-
-export declare function analyze(ast: object, options?: AnalysisOptions): ScopeManager
+import type * as estree from "estree"
+import type { VisitorKeys } from "eslint-visitor-keys"
export interface AnalysisOptions {
optimistic?: boolean
@@ -16,7 +15,7 @@ export interface AnalysisOptions {
fallback?: string | Function
sourceType?: "script" | "module"
ecmaVersion?: number
-
+ childVisitorKeys?: VisitorKeys
}
export interface ScopeManager {
@@ -44,13 +43,13 @@ export interface Scope {
variableScope: Scope
}
-export interface Variable {
- defs: VariableDefinition[]
- identifiers: estree.Identifier[]
- name: string
- references: Reference[]
- scope: Scope
- stack: boolean
+export class Variable {
+ public defs: VariableDefinition[]
+ public identifiers: estree.Identifier[]
+ public name: string
+ public references: Reference[]
+ public scope: Scope
+ public stack: boolean
}
export interface VariableDefinition {
@@ -60,18 +59,28 @@ export interface VariableDefinition {
parent?: estree.Node
}
-export interface Reference {
- from: Scope
- identifier: estree.Identifier
- partial: boolean
- resolved: Variable | null
- tainted: boolean
- writeExpr: estree.Expression
+export class Reference {
+ public from: Scope
+ public identifier: estree.Identifier
+ public partial: boolean
+ public resolved: Variable | null
+ public tainted: boolean
+ public writeExpr: estree.Expression
- isRead(): boolean
- isReadOnly(): boolean
- isReadWrite(): boolean
- isStatic(): boolean
- isWrite(): boolean
- isWriteOnly(): boolean
+ public isRead(): boolean
+ public isReadOnly(): boolean
+ public isReadWrite(): boolean
+ public isStatic(): boolean
+ public isWrite(): boolean
+ public isWriteOnly(): boolean
+
+ // For typescript-eslint
+ public isTypeReference?: boolean
+ public isValueReference?: boolean
}
+
+export declare const analyze: (
+ ast: object,
+ options?: AnalysisOptions,
+) => ScopeManager
+export declare const version: string
diff --git a/typings/eslint-visitor-keys/index.d.ts b/typings/eslint-visitor-keys/index.d.ts
new file mode 100644
index 00000000..88253e60
--- /dev/null
+++ b/typings/eslint-visitor-keys/index.d.ts
@@ -0,0 +1,13 @@
+/**
+ * @author Toru Nagashima
+ * @copyright 2017 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+
+export type VisitorKeys = Readonly<{
+ [type: string]: readonly string[] | undefined
+}>
+
+export declare const KEYS: VisitorKeys
+export declare const getKeys: (node: { type: string }) => readonly string[]
+export declare const unionWith: (keys: VisitorKeys) => VisitorKeys
diff --git a/typings/eslint/lib/token-store.d.ts b/typings/eslint/lib/token-store.d.ts
deleted file mode 100644
index 70795193..00000000
--- a/typings/eslint/lib/token-store.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * @author Toru Nagashima
- * @copyright 2017 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-
-/**
- * Dummy TokenStore interface.
- */
-declare class TokenStore {
- constructor(tokens: any[], comments: any[])
-}
-
-export default TokenStore
diff --git a/typings/eslint/lib/util/node-event-generator.d.ts b/typings/eslint/lib/util/node-event-generator.d.ts
deleted file mode 100644
index 9fb453be..00000000
--- a/typings/eslint/lib/util/node-event-generator.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * @author Toru Nagashima
- * @copyright 2017 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
-import EventEmitter from "events"
-
-declare class NodeEventGenerator {
- constructor(emitter: EventEmitter)
- enterNode(node: any): void
- leaveNode(node: any): void
-}
-
-export default NodeEventGenerator
diff --git a/typings/esquery/index.d.ts b/typings/esquery/index.d.ts
new file mode 100644
index 00000000..1861f0bb
--- /dev/null
+++ b/typings/esquery/index.d.ts
@@ -0,0 +1,123 @@
+/**
+ * @author Toru Nagashima
+ * @copyright 2017 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+
+import type { Node } from "../../src/ast/index"
+import type { VisitorKeys } from "eslint-visitor-keys"
+
+export type Selector =
+ | AdjacentSelector
+ | AttributeSelector
+ | ChildSelector
+ | ClassSelector
+ | CompoundSelector
+ | DescendantSelector
+ | FieldSelector
+ | HasSelector
+ | IdentifierSelector
+ | MatchesSelector
+ | NotSelector
+ | NthChildSelector
+ | NthLastChildSelector
+ | SiblingSelector
+ | WildcardSelector
+
+export type TraverseOptionFallback = (node: Node) => readonly string[]
+export interface ESQueryOptions {
+ visitorKeys?: VisitorKeys
+ fallback?: TraverseOptionFallback
+}
+
+export interface AdjacentSelector {
+ type: "adjacent"
+ left: Selector
+ right: Selector
+}
+
+export interface AttributeSelector {
+ type: "attribute"
+ name: string
+ operator: string | null | undefined
+ value: { type: string; value: any }
+}
+
+export interface ChildSelector {
+ type: "child"
+ left: Selector
+ right: Selector
+}
+
+export interface ClassSelector {
+ type: "class"
+}
+
+export interface CompoundSelector {
+ type: "compound"
+ selectors: Selector[]
+}
+
+export interface DescendantSelector {
+ type: "descendant"
+ left: Selector
+ right: Selector
+}
+
+export interface FieldSelector {
+ type: "field"
+ name: string
+}
+
+export interface HasSelector {
+ type: "has"
+ selectors: Selector[]
+}
+
+export interface IdentifierSelector {
+ type: "identifier"
+ value: string
+}
+
+export interface MatchesSelector {
+ type: "matches"
+ selectors: Selector[]
+}
+
+export interface NotSelector {
+ type: "not"
+ selectors: Selector[]
+}
+
+export interface NthChildSelector {
+ type: "nth-child"
+ right: Selector
+ index: { type: string; value: any }
+}
+
+export interface NthLastChildSelector {
+ type: "nth-last-child"
+ right: Selector
+ index: { type: string; value: any }
+}
+
+export interface SiblingSelector {
+ type: "sibling"
+ left: Selector
+ right: Selector
+}
+
+export interface WildcardSelector {
+ type: "wildcard"
+}
+
+declare const esquery: {
+ parse(query: string): Selector
+ matches(
+ node: object,
+ selector: Selector,
+ ancestry: object[],
+ options?: ESQueryOptions,
+ ): boolean
+}
+export default esquery