mirror of https://github.com/sveltejs/svelte
[feat] improve parser errors (#6612)
parent
1292bdcfa5
commit
64b882e3c5
@ -0,0 +1,10 @@
|
||||
{
|
||||
"code": "missing-attribute-value",
|
||||
"message": "Expected value for the attribute",
|
||||
"pos": 12,
|
||||
"start": {
|
||||
"character": 12,
|
||||
"column": 12,
|
||||
"line": 1
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<div class= ></div>
|
@ -0,0 +1 @@
|
||||
<div a="" b={''} c='' d="{''}" ></div>
|
@ -0,0 +1,108 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 38,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 38,
|
||||
"type": "Element",
|
||||
"name": "div",
|
||||
"attributes": [
|
||||
{
|
||||
"start": 5,
|
||||
"end": 9,
|
||||
"type": "Attribute",
|
||||
"name": "a",
|
||||
"value": [
|
||||
{
|
||||
"start": 8,
|
||||
"end": 8,
|
||||
"type": "Text",
|
||||
"raw": "",
|
||||
"data": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 10,
|
||||
"end": 16,
|
||||
"type": "Attribute",
|
||||
"name": "b",
|
||||
"value": [
|
||||
{
|
||||
"start": 12,
|
||||
"end": 16,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"start": 13,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"value": "",
|
||||
"raw": "''"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 17,
|
||||
"end": 21,
|
||||
"type": "Attribute",
|
||||
"name": "c",
|
||||
"value": [
|
||||
{
|
||||
"start": 20,
|
||||
"end": 20,
|
||||
"type": "Text",
|
||||
"raw": "",
|
||||
"data": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 22,
|
||||
"end": 30,
|
||||
"type": "Attribute",
|
||||
"name": "d",
|
||||
"value": [
|
||||
{
|
||||
"start": 25,
|
||||
"end": 29,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"start": 26,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"value": "",
|
||||
"raw": "''"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"code": "unclosed-attribute-value",
|
||||
"message": "Expected to close the attribute value with }",
|
||||
"pos": 25,
|
||||
"start": {
|
||||
"character": 25,
|
||||
"column": 25,
|
||||
"line": 1
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<Component test={{a: 1} />
|
Loading…
Reference in new issue