-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adjust static attribute regex (#9551)
a `+` was missing Fixes sveltejs/vite-plugin-svelte#804
- Loading branch information
1 parent
36b2c50
commit 77ba5e7
Showing
5 changed files
with
193 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: adjust static attribute regex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/svelte/test/parser/samples/script-context-module-unquoted/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script context=module> | ||
export const foo = 'bar'; | ||
</script> | ||
|
||
<script> | ||
foo; | ||
</script> |
178 changes: 178 additions & 0 deletions
178
packages/svelte/test/parser/samples/script-context-module-unquoted/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
{ | ||
"html": { | ||
"start": 62, | ||
"end": 60, | ||
"type": "Fragment", | ||
"children": [ | ||
{ | ||
"start": 60, | ||
"end": 62, | ||
"type": "Text", | ||
"raw": "\n\n", | ||
"data": "\n\n" | ||
} | ||
] | ||
}, | ||
"instance": { | ||
"type": "Script", | ||
"start": 62, | ||
"end": 86, | ||
"context": "default", | ||
"content": { | ||
"type": "Program", | ||
"start": 70, | ||
"end": 77, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 0 | ||
} | ||
}, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 72, | ||
"end": 76, | ||
"loc": { | ||
"start": { | ||
"line": 6, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"column": 5 | ||
} | ||
}, | ||
"expression": { | ||
"type": "Identifier", | ||
"start": 72, | ||
"end": 75, | ||
"loc": { | ||
"start": { | ||
"line": 6, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"column": 4 | ||
} | ||
}, | ||
"name": "foo" | ||
} | ||
} | ||
], | ||
"sourceType": "module" | ||
} | ||
}, | ||
"module": { | ||
"type": "Script", | ||
"start": 0, | ||
"end": 60, | ||
"context": "module", | ||
"content": { | ||
"type": "Program", | ||
"start": 23, | ||
"end": 51, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 0 | ||
} | ||
}, | ||
"body": [ | ||
{ | ||
"type": "ExportNamedDeclaration", | ||
"start": 25, | ||
"end": 50, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 26 | ||
} | ||
}, | ||
"declaration": { | ||
"type": "VariableDeclaration", | ||
"start": 32, | ||
"end": 50, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 8 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 26 | ||
} | ||
}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start": 38, | ||
"end": 49, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 38, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 17 | ||
} | ||
}, | ||
"name": "foo" | ||
}, | ||
"init": { | ||
"type": "Literal", | ||
"start": 44, | ||
"end": 49, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"value": "bar", | ||
"raw": "'bar'" | ||
} | ||
} | ||
], | ||
"kind": "const" | ||
}, | ||
"specifiers": [], | ||
"source": null | ||
} | ||
], | ||
"sourceType": "module" | ||
} | ||
} | ||
} |