@@ -34,13 +34,11 @@ mod kw {
34
34
wast:: custom_keyword!( noreturn) ;
35
35
wast:: custom_keyword!( pointer) ;
36
36
wast:: custom_keyword!( record) ;
37
- wast:: custom_keyword!( r#as = "as" ) ;
38
37
wast:: custom_keyword!( r#const = "const" ) ;
39
38
wast:: custom_keyword!( r#enum = "enum" ) ;
40
39
wast:: custom_keyword!( r#union = "union" ) ;
41
40
wast:: custom_keyword!( r#use = "use" ) ;
42
41
wast:: custom_keyword!( repr) ;
43
- wast:: custom_keyword!( resource) ;
44
42
wast:: custom_keyword!( s16) ;
45
43
wast:: custom_keyword!( s32) ;
46
44
wast:: custom_keyword!( s64) ;
@@ -229,7 +227,6 @@ impl<'a> Parse<'a> for TopLevelModule<'a> {
229
227
if parser. peek2 :: < kw:: r#use > ( )
230
228
|| parser. peek2 :: < annotation:: witx > ( )
231
229
|| parser. peek2 :: < kw:: typename > ( )
232
- || parser. peek2 :: < kw:: resource > ( )
233
230
{
234
231
decls. push ( Documented {
235
232
comments,
@@ -282,7 +279,6 @@ impl<'a> Parse<'a> for TopLevelSyntax<'a> {
282
279
#[ derive( Debug , Clone ) ]
283
280
pub enum DeclSyntax < ' a > {
284
281
Typename ( TypenameSyntax < ' a > ) ,
285
- Resource ( ResourceSyntax < ' a > ) ,
286
282
Const ( Documented < ' a , ConstSyntax < ' a > > ) ,
287
283
}
288
284
@@ -293,8 +289,6 @@ impl<'a> Parse<'a> for DeclSyntax<'a> {
293
289
Ok ( DeclSyntax :: Typename ( parser. parse ( ) ?) )
294
290
} else if l. peek :: < annotation:: witx > ( ) {
295
291
Ok ( DeclSyntax :: Const ( parser. parse ( ) ?) )
296
- } else if l. peek :: < kw:: resource > ( ) {
297
- Ok ( DeclSyntax :: Resource ( parser. parse ( ) ?) )
298
292
} else {
299
293
Err ( l. error ( ) )
300
294
}
@@ -319,7 +313,7 @@ impl<'a> Parse<'a> for UseSyntax<'a> {
319
313
320
314
#[ derive( Debug , Clone , PartialEq , Eq ) ]
321
315
pub enum UsedNames < ' a > {
322
- List ( Vec < UseName < ' a > > ) ,
316
+ List ( Vec < wast :: Id < ' a > > ) ,
323
317
All ( wast:: Span ) ,
324
318
}
325
319
@@ -339,32 +333,6 @@ impl<'a> Parse<'a> for UsedNames<'a> {
339
333
}
340
334
}
341
335
342
- #[ derive( Debug , Clone , PartialEq , Eq ) ]
343
- pub struct UseName < ' a > {
344
- pub other_name : wast:: Id < ' a > ,
345
- pub our_name : wast:: Id < ' a > ,
346
- }
347
-
348
- impl < ' a > Parse < ' a > for UseName < ' a > {
349
- fn parse ( parser : Parser < ' a > ) -> Result < Self > {
350
- let ( other_name, our_name) = if parser. peek :: < wast:: Id > ( ) {
351
- let name = parser. parse ( ) ?;
352
- ( name, name)
353
- } else {
354
- parser. parens ( |p| {
355
- let other_name = p. parse ( ) ?;
356
- p. parse :: < kw:: r#as > ( ) ?;
357
- let our_name = p. parse ( ) ?;
358
- Ok ( ( other_name, our_name) )
359
- } ) ?
360
- } ;
361
- Ok ( UseName {
362
- other_name,
363
- our_name,
364
- } )
365
- }
366
- }
367
-
368
336
#[ derive( Debug , Clone , PartialEq , Eq ) ]
369
337
pub struct TypenameSyntax < ' a > {
370
338
pub ident : wast:: Id < ' a > ,
@@ -389,7 +357,7 @@ pub enum TypedefSyntax<'a> {
389
357
Record ( RecordSyntax < ' a > ) ,
390
358
Union ( UnionSyntax < ' a > ) ,
391
359
Variant ( VariantSyntax < ' a > ) ,
392
- Handle ( HandleSyntax < ' a > ) ,
360
+ Handle ( HandleSyntax ) ,
393
361
List ( Box < TypedefSyntax < ' a > > ) ,
394
362
Pointer ( Box < TypedefSyntax < ' a > > ) ,
395
363
ConstPointer ( Box < TypedefSyntax < ' a > > ) ,
@@ -553,19 +521,6 @@ impl<'a> Parse<'a> for ConstSyntax<'a> {
553
521
}
554
522
}
555
523
556
- #[ derive( Debug , Clone , PartialEq , Eq ) ]
557
- pub struct ResourceSyntax < ' a > {
558
- pub ident : wast:: Id < ' a > ,
559
- }
560
-
561
- impl < ' a > Parse < ' a > for ResourceSyntax < ' a > {
562
- fn parse ( parser : Parser < ' a > ) -> Result < Self > {
563
- parser. parse :: < kw:: resource > ( ) ?;
564
- let ident = parser. parse ( ) ?;
565
- Ok ( ResourceSyntax { ident } )
566
- }
567
- }
568
-
569
524
#[ derive( Debug , Clone , PartialEq , Eq ) ]
570
525
pub struct FlagsSyntax < ' a > {
571
526
pub repr : Option < BuiltinType > ,
@@ -701,15 +656,12 @@ impl<'a> Parse<'a> for CaseSyntax<'a> {
701
656
}
702
657
703
658
#[ derive( Debug , Clone , PartialEq , Eq ) ]
704
- pub struct HandleSyntax < ' a > {
705
- pub resource : wast:: Id < ' a > ,
706
- }
659
+ pub struct HandleSyntax { }
707
660
708
- impl < ' a > Parse < ' a > for HandleSyntax < ' a > {
661
+ impl < ' a > Parse < ' a > for HandleSyntax {
709
662
fn parse ( parser : Parser < ' a > ) -> Result < Self > {
710
663
parser. parse :: < kw:: handle > ( ) ?;
711
- let resource = parser. parse ( ) ?;
712
- Ok ( HandleSyntax { resource } )
664
+ Ok ( HandleSyntax { } )
713
665
}
714
666
}
715
667
0 commit comments