",
"\n ",
- "",
"\n ",
"\n
\n",
+ "text": "
\n \n",
"children": [
{
"type": "VStartTag",
@@ -15,7 +15,7 @@
},
{
"type": "VElement",
- "text": "
",
+ "text": "
",
"children": [
{
"type": "VStartTag",
@@ -62,11 +62,11 @@
},
{
"type": "VElement",
- "text": "
\n Hello
\n ",
+ "text": "
\n Hello
\n ",
"children": [
{
"type": "VStartTag",
- "text": "
",
+ "text": "",
"children": []
},
{
@@ -102,7 +102,7 @@
},
{
"type": "VEndTag",
- "text": "",
+ "text": "",
"children": []
}
]
diff --git a/test/fixtures/ast/input-component/ast.json b/test/fixtures/ast/input-component/ast.json
new file mode 100644
index 00000000..422c77da
--- /dev/null
+++ b/test/fixtures/ast/input-component/ast.json
@@ -0,0 +1,1246 @@
+{
+ "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,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "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,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "name": "div",
+ "rawName": "div",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 13,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 23,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "name": "input",
+ "rawName": "Input",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 23,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "selfClosing": false,
+ "attributes": []
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 30,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 37,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "name": "template",
+ "rawName": "template",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 37,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 47,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 47,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 23
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "column": 16,
+ "line": 4
+ },
+ "end": {
+ "column": 17,
+ "line": 4
+ }
+ },
+ "name": "slot",
+ "rawName": "#"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "column": 17,
+ "line": 4
+ },
+ "end": {
+ "column": 23,
+ "line": 4
+ }
+ },
+ "name": "suffix",
+ "rawName": "suffix"
+ },
+ "modifiers": []
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 55,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 64,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "name": "icon",
+ "rawName": "Icon",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 64,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 70,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 70,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "name": "name",
+ "rawName": "name"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 75,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "user"
+ }
+ }
+ ]
+ },
+ "children": [],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 82,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 89,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 33
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 96,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 107,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 112,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 120,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 123,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 130,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "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": "HTMLTagClose",
+ "range": [
+ 17,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 6
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 18,
+ 23
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 7
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 23,
+ 29
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 10
+ }
+ },
+ "value": "input"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 29,
+ 30
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 30,
+ 37
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 37,
+ 46
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 15
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 47,
+ 48
+ ],
+ "loc": {
+ "start": {
+ "column": 16,
+ "line": 4
+ },
+ "end": {
+ "column": 17,
+ "line": 4
+ }
+ },
+ "value": "#"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 48,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "column": 17,
+ "line": 4
+ },
+ "end": {
+ "column": 23,
+ "line": 4
+ }
+ },
+ "value": "suffix"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 54,
+ 55
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 23
+ },
+ "end": {
+ "line": 4,
+ "column": 24
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 55,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 24
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 64,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 13
+ }
+ },
+ "value": "icon"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 70,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 14
+ },
+ "end": {
+ "line": 5,
+ "column": 18
+ }
+ },
+ "value": "name"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 18
+ },
+ "end": {
+ "line": 5,
+ "column": 19
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 75,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 19
+ },
+ "end": {
+ "line": 5,
+ "column": 25
+ }
+ },
+ "value": "user"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 81,
+ 82
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 26
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 82,
+ 88
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 32
+ }
+ },
+ "value": "icon"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 88,
+ 89
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 32
+ },
+ "end": {
+ "line": 5,
+ "column": 33
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 89,
+ 96
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 33
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 96,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 16
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 106,
+ 107
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 16
+ },
+ "end": {
+ "line": 6,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 107,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 17
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 112,
+ 119
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": "input"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 119,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 7,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 120,
+ 123
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 12
+ },
+ "end": {
+ "line": 8,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 123,
+ 128
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 2
+ },
+ "end": {
+ "line": 8,
+ "column": 7
+ }
+ },
+ "value": "div"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 128,
+ 129
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 7
+ },
+ "end": {
+ "line": 8,
+ "column": 8
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 129,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 130,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 0
+ },
+ "end": {
+ "line": 9,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 140,
+ 141
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 10
+ },
+ "end": {
+ "line": 9,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 141,
+ 142
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 210,
+ 211
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 68
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "HTMLComment",
+ "range": [
+ 142,
+ 210
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 68
+ }
+ },
+ "value": " from https://github.com/vuejs/eslint-plugin-vue/issues/1292 "
+ }
+ ],
+ "errors": []
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/input-component/source.vue b/test/fixtures/ast/input-component/source.vue
new file mode 100644
index 00000000..be80913a
--- /dev/null
+++ b/test/fixtures/ast/input-component/source.vue
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/input-component/token-ranges.json b/test/fixtures/ast/input-component/token-ranges.json
new file mode 100644
index 00000000..72ecce42
--- /dev/null
+++ b/test/fixtures/ast/input-component/token-ranges.json
@@ -0,0 +1,38 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "
",
+ "\n",
+ "",
+ "\n",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/input-component/tree.json b/test/fixtures/ast/input-component/tree.json
new file mode 100644
index 00000000..859c2908
--- /dev/null
+++ b/test/fixtures/ast/input-component/tree.json
@@ -0,0 +1,162 @@
+[
+ {
+ "type": "VElement",
+ "text": "
\n \n \n \n \n \n \n
\n",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "
",
+ "children": []
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n \n \n \n \n
",
+ "children": [
+ {
+ "type": "VStartTag",
+ "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": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "#suffix",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "#suffix",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "#",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "suffix",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "name=\"user\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "name",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"user\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "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": []
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n",
+ "children": []
+ },
+ {
+ "type": "VEndTag",
+ "text": "",
+ "children": []
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/link-component/ast.json b/test/fixtures/ast/link-component/ast.json
new file mode 100644
index 00000000..fd6b6861
--- /dev/null
+++ b/test/fixtures/ast/link-component/ast.json
@@ -0,0 +1,2581 @@
+{
+ "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,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "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,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "name": "link",
+ "rawName": "Link",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 13,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 19,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 19,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 8
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 2
+ },
+ "end": {
+ "column": 9,
+ "line": 2
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 20,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "name": "to",
+ "rawName": "to"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 23,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 24,
+ 26
+ ],
+ "name": "to"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 24,
+ 26
+ ],
+ "name": "to"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 28,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 28,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "name": "class",
+ "rawName": "class"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 34,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": "flex items-center"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 59,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "name": "span",
+ "rawName": "span",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 59,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 58
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 65,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 44
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 10
+ },
+ "end": {
+ "line": 3,
+ "column": 14
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "name": "if",
+ "rawName": "if"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 70,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 44
+ }
+ },
+ "expression": {
+ "type": "LogicalExpression",
+ "start": 71,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "range": [
+ 71,
+ 98
+ ],
+ "left": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 71,
+ 81
+ ],
+ "name": "prefixIcon"
+ },
+ "operator": "||",
+ "right": {
+ "type": "MemberExpression",
+ "start": 85,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "range": [
+ 85,
+ 98
+ ],
+ "object": {
+ "type": "Identifier",
+ "start": 85,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 85,
+ 91
+ ],
+ "name": "$slots"
+ },
+ "property": {
+ "type": "Identifier",
+ "start": 92,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "range": [
+ 92,
+ 98
+ ],
+ "name": "prefix"
+ },
+ "computed": false
+ }
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 71,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 71,
+ 81
+ ],
+ "name": "prefixIcon"
+ },
+ "mode": "r"
+ },
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 85,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 85,
+ 91
+ ],
+ "name": "$slots"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 100,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 57
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 100,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 50
+ }
+ },
+ "name": "class",
+ "rawName": "class"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 106,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 57
+ }
+ },
+ "value": "mr-1"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 113,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 58
+ },
+ "end": {
+ "line": 4,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 120,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "name": "slot",
+ "rawName": "slot",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 120,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "selfClosing": false,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 126,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 126,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "name": "name",
+ "rawName": "name"
+ },
+ "value": {
+ "type": "VLiteral",
+ "range": [
+ 131,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "value": "prefix"
+ }
+ }
+ ]
+ },
+ "children": [
+ {
+ "type": "VText",
+ "range": [
+ 140,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 149,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 75
+ }
+ },
+ "name": "fontawesomeicon",
+ "rawName": "FontAwesomeIcon",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 149,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 75
+ }
+ },
+ "selfClosing": true,
+ "attributes": [
+ {
+ "type": "VAttribute",
+ "range": [
+ 166,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 166,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 25
+ },
+ "end": {
+ "line": 5,
+ "column": 29
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 166,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "column": 25,
+ "line": 5
+ },
+ "end": {
+ "column": 29,
+ "line": 5
+ }
+ },
+ "name": "if",
+ "rawName": "if"
+ },
+ "argument": null,
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 171,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 172,
+ "end": 182,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "range": [
+ 172,
+ 182
+ ],
+ "name": "prefixIcon"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 172,
+ "end": 182,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "range": [
+ 172,
+ 182
+ ],
+ "name": "prefixIcon"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 184,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 61
+ }
+ },
+ "directive": true,
+ "key": {
+ "type": "VDirectiveKey",
+ "range": [
+ 184,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 43
+ },
+ "end": {
+ "line": 5,
+ "column": 48
+ }
+ },
+ "name": {
+ "type": "VIdentifier",
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "column": 43,
+ "line": 5
+ },
+ "end": {
+ "column": 44,
+ "line": 5
+ }
+ },
+ "name": "bind",
+ "rawName": ":"
+ },
+ "argument": {
+ "type": "VIdentifier",
+ "range": [
+ 185,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "column": 44,
+ "line": 5
+ },
+ "end": {
+ "column": 48,
+ "line": 5
+ }
+ },
+ "name": "icon",
+ "rawName": "icon"
+ },
+ "modifiers": []
+ },
+ "value": {
+ "type": "VExpressionContainer",
+ "range": [
+ 190,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 49
+ },
+ "end": {
+ "line": 5,
+ "column": 61
+ }
+ },
+ "expression": {
+ "type": "Identifier",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 50
+ },
+ "end": {
+ "line": 5,
+ "column": 60
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ],
+ "name": "prefixIcon"
+ },
+ "references": [
+ {
+ "id": {
+ "type": "Identifier",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 50
+ },
+ "end": {
+ "line": 5,
+ "column": 60
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ],
+ "name": "prefixIcon"
+ },
+ "mode": "r"
+ }
+ ]
+ }
+ },
+ {
+ "type": "VAttribute",
+ "range": [
+ 203,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 62
+ },
+ "end": {
+ "line": 5,
+ "column": 72
+ }
+ },
+ "directive": false,
+ "key": {
+ "type": "VIdentifier",
+ "range": [
+ 203,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 62
+ },
+ "end": {
+ "line": 5,
+ "column": 72
+ }
+ },
+ "name": "fixedwidth",
+ "rawName": "fixedWidth"
+ },
+ "value": null
+ }
+ ]
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 216,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 75
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 223,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 230,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 235,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 242,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "VElement",
+ "range": [
+ 247,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "name": "slot",
+ "rawName": "slot",
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "startTag": {
+ "type": "VStartTag",
+ "range": [
+ 247,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "selfClosing": true,
+ "attributes": []
+ },
+ "children": [],
+ "endTag": null,
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 255,
+ 258
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 258,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ }
+ },
+ "variables": []
+ },
+ {
+ "type": "VText",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "endTag": {
+ "type": "VEndTag",
+ "range": [
+ 266,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "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,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 2
+ },
+ "end": {
+ "line": 2,
+ "column": 7
+ }
+ },
+ "value": "link"
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 19,
+ 20
+ ],
+ "loc": {
+ "start": {
+ "column": 8,
+ "line": 2
+ },
+ "end": {
+ "column": 9,
+ "line": 2
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 20,
+ 22
+ ],
+ "loc": {
+ "start": {
+ "column": 9,
+ "line": 2
+ },
+ "end": {
+ "column": 11,
+ "line": 2
+ }
+ },
+ "value": "to"
+ },
+ {
+ "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": "to",
+ "start": 24,
+ "end": 26,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ },
+ "range": [
+ 24,
+ 26
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 26,
+ 27
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 15
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 28,
+ 33
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 22
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 22
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 34,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 23
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ },
+ "value": "flex items-center"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 43
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 59,
+ 64
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 4
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ },
+ "value": "span"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 65,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "column": 10,
+ "line": 3
+ },
+ "end": {
+ "column": 14,
+ "line": 3
+ }
+ },
+ "value": "v-if"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 14
+ },
+ "end": {
+ "line": 3,
+ "column": 15
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 15
+ },
+ "end": {
+ "line": 3,
+ "column": 16
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "prefixIcon",
+ "start": 71,
+ "end": 81,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 16
+ },
+ "end": {
+ "line": 3,
+ "column": 26
+ }
+ },
+ "range": [
+ 71,
+ 81
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": "||",
+ "start": 82,
+ "end": 84,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 27
+ },
+ "end": {
+ "line": 3,
+ "column": 29
+ }
+ },
+ "range": [
+ 82,
+ 84
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "$slots",
+ "start": 85,
+ "end": 91,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 30
+ },
+ "end": {
+ "line": 3,
+ "column": 36
+ }
+ },
+ "range": [
+ 85,
+ 91
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "value": ".",
+ "start": 91,
+ "end": 92,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 36
+ },
+ "end": {
+ "line": 3,
+ "column": 37
+ }
+ },
+ "range": [
+ 91,
+ 92
+ ]
+ },
+ {
+ "type": "Identifier",
+ "value": "prefix",
+ "start": 92,
+ "end": 98,
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 37
+ },
+ "end": {
+ "line": 3,
+ "column": 43
+ }
+ },
+ "range": [
+ 92,
+ 98
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 98,
+ 99
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 43
+ },
+ "end": {
+ "line": 3,
+ "column": 44
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 100,
+ 105
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 45
+ },
+ "end": {
+ "line": 3,
+ "column": 50
+ }
+ },
+ "value": "class"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 105,
+ 106
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 50
+ },
+ "end": {
+ "line": 3,
+ "column": 51
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 106,
+ 112
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 51
+ },
+ "end": {
+ "line": 3,
+ "column": 57
+ }
+ },
+ "value": "mr-1"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 112,
+ 113
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 57
+ },
+ "end": {
+ "line": 3,
+ "column": 58
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 113,
+ 120
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 58
+ },
+ "end": {
+ "line": 4,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 120,
+ 125
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 6
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ },
+ "value": "slot"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 126,
+ 130
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 12
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ },
+ "value": "name"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 130,
+ 131
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLLiteral",
+ "range": [
+ 131,
+ 139
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 25
+ }
+ },
+ "value": "prefix"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 139,
+ 140
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 25
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 140,
+ 149
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 26
+ },
+ "end": {
+ "line": 5,
+ "column": 8
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 149,
+ 165
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 8
+ },
+ "end": {
+ "line": 5,
+ "column": 24
+ }
+ },
+ "value": "fontawesomeicon"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 166,
+ 170
+ ],
+ "loc": {
+ "start": {
+ "column": 25,
+ "line": 5
+ },
+ "end": {
+ "column": 29,
+ "line": 5
+ }
+ },
+ "value": "v-if"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 170,
+ 171
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 29
+ },
+ "end": {
+ "line": 5,
+ "column": 30
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 171,
+ 172
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 30
+ },
+ "end": {
+ "line": 5,
+ "column": 31
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "prefixIcon",
+ "start": 172,
+ "end": 182,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 31
+ },
+ "end": {
+ "line": 5,
+ "column": 41
+ }
+ },
+ "range": [
+ 172,
+ 182
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 182,
+ 183
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 41
+ },
+ "end": {
+ "line": 5,
+ "column": 42
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 184,
+ 185
+ ],
+ "loc": {
+ "start": {
+ "column": 43,
+ "line": 5
+ },
+ "end": {
+ "column": 44,
+ "line": 5
+ }
+ },
+ "value": ":"
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 185,
+ 189
+ ],
+ "loc": {
+ "start": {
+ "column": 44,
+ "line": 5
+ },
+ "end": {
+ "column": 48,
+ "line": 5
+ }
+ },
+ "value": "icon"
+ },
+ {
+ "type": "HTMLAssociation",
+ "range": [
+ 189,
+ 190
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 48
+ },
+ "end": {
+ "line": 5,
+ "column": 49
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 190,
+ 191
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 49
+ },
+ "end": {
+ "line": 5,
+ "column": 50
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "Identifier",
+ "value": "prefixIcon",
+ "start": 191,
+ "end": 201,
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 50
+ },
+ "end": {
+ "line": 5,
+ "column": 60
+ }
+ },
+ "range": [
+ 191,
+ 201
+ ]
+ },
+ {
+ "type": "Punctuator",
+ "range": [
+ 201,
+ 202
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 60
+ },
+ "end": {
+ "line": 5,
+ "column": 61
+ }
+ },
+ "value": "\""
+ },
+ {
+ "type": "HTMLIdentifier",
+ "range": [
+ 203,
+ 213
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 62
+ },
+ "end": {
+ "line": 5,
+ "column": 72
+ }
+ },
+ "value": "fixedwidth"
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 214,
+ 216
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 73
+ },
+ "end": {
+ "line": 5,
+ "column": 75
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 216,
+ 223
+ ],
+ "loc": {
+ "start": {
+ "line": 5,
+ "column": 75
+ },
+ "end": {
+ "line": 6,
+ "column": 6
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 223,
+ 229
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 6
+ },
+ "end": {
+ "line": 6,
+ "column": 12
+ }
+ },
+ "value": "slot"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 229,
+ 230
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 12
+ },
+ "end": {
+ "line": 6,
+ "column": 13
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 230,
+ 235
+ ],
+ "loc": {
+ "start": {
+ "line": 6,
+ "column": 13
+ },
+ "end": {
+ "line": 7,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 235,
+ 241
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 4
+ },
+ "end": {
+ "line": 7,
+ "column": 10
+ }
+ },
+ "value": "span"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 241,
+ 242
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 10
+ },
+ "end": {
+ "line": 7,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 242,
+ 247
+ ],
+ "loc": {
+ "start": {
+ "line": 7,
+ "column": 11
+ },
+ "end": {
+ "line": 8,
+ "column": 4
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLTagOpen",
+ "range": [
+ 247,
+ 252
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 4
+ },
+ "end": {
+ "line": 8,
+ "column": 9
+ }
+ },
+ "value": "slot"
+ },
+ {
+ "type": "HTMLSelfClosingTagClose",
+ "range": [
+ 253,
+ 255
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 10
+ },
+ "end": {
+ "line": 8,
+ "column": 12
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 255,
+ 258
+ ],
+ "loc": {
+ "start": {
+ "line": 8,
+ "column": 12
+ },
+ "end": {
+ "line": 9,
+ "column": 2
+ }
+ },
+ "value": "\n "
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 258,
+ 264
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 2
+ },
+ "end": {
+ "line": 9,
+ "column": 8
+ }
+ },
+ "value": "link"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 264,
+ 265
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 8
+ },
+ "end": {
+ "line": 9,
+ "column": 9
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 265,
+ 266
+ ],
+ "loc": {
+ "start": {
+ "line": 9,
+ "column": 9
+ },
+ "end": {
+ "line": 10,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLEndTagOpen",
+ "range": [
+ 266,
+ 276
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 0
+ },
+ "end": {
+ "line": 10,
+ "column": 10
+ }
+ },
+ "value": "template"
+ },
+ {
+ "type": "HTMLTagClose",
+ "range": [
+ 276,
+ 277
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 10
+ },
+ "end": {
+ "line": 10,
+ "column": 11
+ }
+ },
+ "value": ""
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 277,
+ 278
+ ],
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 11,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ },
+ {
+ "type": "HTMLWhitespace",
+ "range": [
+ 346,
+ 347
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 68
+ },
+ "end": {
+ "line": 12,
+ "column": 0
+ }
+ },
+ "value": "\n"
+ }
+ ],
+ "comments": [
+ {
+ "type": "HTMLComment",
+ "range": [
+ 278,
+ 346
+ ],
+ "loc": {
+ "start": {
+ "line": 11,
+ "column": 0
+ },
+ "end": {
+ "line": 11,
+ "column": 68
+ }
+ },
+ "value": " from https://github.com/vuejs/eslint-plugin-vue/issues/1439 "
+ }
+ ],
+ "errors": [
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 149,
+ "lineNumber": 5,
+ "column": 8
+ },
+ {
+ "message": "non-void-html-element-start-tag-with-trailing-solidus",
+ "index": 247,
+ "lineNumber": 8,
+ "column": 4
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/fixtures/ast/link-component/source.vue b/test/fixtures/ast/link-component/source.vue
new file mode 100644
index 00000000..5f81ad87
--- /dev/null
+++ b/test/fixtures/ast/link-component/source.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/ast/link-component/token-ranges.json b/test/fixtures/ast/link-component/token-ranges.json
new file mode 100644
index 00000000..4a579f82
--- /dev/null
+++ b/test/fixtures/ast/link-component/token-ranges.json
@@ -0,0 +1,70 @@
+[
+ "
",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n ",
+ "",
+ "\n",
+ "",
+ "\n",
+ "\n",
+ ""
+]
\ No newline at end of file
diff --git a/test/fixtures/ast/link-component/tree.json b/test/fixtures/ast/link-component/tree.json
new file mode 100644
index 00000000..640c4961
--- /dev/null
+++ b/test/fixtures/ast/link-component/tree.json
@@ -0,0 +1,340 @@
+[
+ {
+ "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 \n \n \n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": ":to=\"to\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":to",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "to",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"to\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "to",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "class=\"flex items-center\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "class",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"flex items-center\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n \n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-if=\"prefixIcon || $slots.prefix\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-if",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-if",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"prefixIcon || $slots.prefix\"",
+ "children": [
+ {
+ "type": "LogicalExpression",
+ "text": "prefixIcon || $slots.prefix",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "prefixIcon",
+ "children": []
+ },
+ {
+ "type": "MemberExpression",
+ "text": "$slots.prefix",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "$slots",
+ "children": []
+ },
+ {
+ "type": "Identifier",
+ "text": "prefix",
+ "children": []
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "class=\"mr-1\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "class",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"mr-1\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "\n \n ",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "name=\"prefix\"",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "name",
+ "children": []
+ },
+ {
+ "type": "VLiteral",
+ "text": "\"prefix\"",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VText",
+ "text": "\n ",
+ "children": []
+ },
+ {
+ "type": "VElement",
+ "text": "",
+ "children": [
+ {
+ "type": "VStartTag",
+ "text": "",
+ "children": [
+ {
+ "type": "VAttribute",
+ "text": "v-if=\"prefixIcon\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": "v-if",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "v-if",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"prefixIcon\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "prefixIcon",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": ":icon=\"prefixIcon\"",
+ "children": [
+ {
+ "type": "VDirectiveKey",
+ "text": ":icon",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": ":",
+ "children": []
+ },
+ {
+ "type": "VIdentifier",
+ "text": "icon",
+ "children": []
+ }
+ ]
+ },
+ {
+ "type": "VExpressionContainer",
+ "text": "\"prefixIcon\"",
+ "children": [
+ {
+ "type": "Identifier",
+ "text": "prefixIcon",
+ "children": []
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "VAttribute",
+ "text": "fixedWidth",
+ "children": [
+ {
+ "type": "VIdentifier",
+ "text": "fixedWidth",
+ "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": "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/ast/svg-upper/ast.json b/test/fixtures/ast/svg-upper/ast.json
new file mode 100644
index 00000000..24ac6fb7
--- /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": "script",
+ "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"
+]
\ 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",
+ "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": []
+ }
+ ]
+ }
+]
\ No newline at end of file