@@ -3,6 +3,7 @@ import type {
3
3
SvelteAnimationDirective ,
4
4
SvelteAttribute ,
5
5
SvelteShorthandAttribute ,
6
+ SvelteAttachTag ,
6
7
SvelteBindingDirective ,
7
8
SvelteClassDirective ,
8
9
SvelteDirective ,
@@ -56,6 +57,7 @@ export function* convertAttributes(
56
57
| SvelteAttribute
57
58
| SvelteShorthandAttribute
58
59
| SvelteSpreadAttribute
60
+ | SvelteAttachTag
59
61
| SvelteDirective
60
62
| SvelteStyleDirective
61
63
> {
@@ -68,6 +70,10 @@ export function* convertAttributes(
68
70
yield convertSpreadAttribute ( attr , parent , ctx ) ;
69
71
continue ;
70
72
}
73
+ if ( attr . type === "AttachTag" ) {
74
+ yield convertAttachTag ( attr , parent , ctx ) ;
75
+ continue ;
76
+ }
71
77
if ( attr . type === "BindDirective" || attr . type === "Binding" ) {
72
78
yield convertBindingDirective ( attr , parent , ctx ) ;
73
79
continue ;
@@ -344,6 +350,25 @@ function convertSpreadAttribute(
344
350
return attribute ;
345
351
}
346
352
353
+ function convertAttachTag (
354
+ node : SvAST . AttachTag | Compiler . AttachTag ,
355
+ parent : SvelteAttachTag [ "parent" ] ,
356
+ ctx : Context ,
357
+ ) : SvelteAttachTag {
358
+ const attachTag : SvelteAttachTag = {
359
+ type : "SvelteAttachTag" ,
360
+ expression : node . expression ,
361
+ parent,
362
+ ...ctx . getConvertLocation ( node ) ,
363
+ } ;
364
+
365
+ ctx . scriptLet . addExpression ( node . expression , attachTag , null , ( es ) => {
366
+ attachTag . expression = es ;
367
+ } ) ;
368
+
369
+ return attachTag ;
370
+ }
371
+
347
372
/** Convert for Binding Directive */
348
373
function convertBindingDirective (
349
374
node : SvAST . DirectiveForExpression | Compiler . BindDirective ,
0 commit comments