mirror of https://github.com/sveltejs/svelte
fix: throw compilation error for malformed snippets (#12144)
* fix: throw compilation error for malformed snippets * fix: support multiline * tweak --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/12155/head
parent
ce7abe4471
commit
8e696b0817
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: throw compilation error for malformed snippets
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'expected_token',
|
||||||
|
message: 'Expected token )',
|
||||||
|
position: [31, 31]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1 @@
|
|||||||
|
{#snippet children(hi{/snippet}
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
error: {
|
||||||
|
code: 'expected_token',
|
||||||
|
message: 'Expected token }',
|
||||||
|
position: [20, 20]
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1 @@
|
|||||||
|
{#snippet children()hi{/snippet}
|
Loading…
Reference in new issue