@@ -9,7 +9,7 @@ use super::*;
99#[ strum_discriminants( derive( EnumString , Ord , PartialOrd ) ) ]
1010#[ strum_discriminants( strum( serialize_all = "kebab-case" ) ) ]
1111pub ( crate ) enum Attribute < ' src > {
12- Alias ( Name < ' src > ) ,
12+ Alias ( Name < ' src > , StringLiteral < ' src > ) ,
1313 Confirm ( Option < StringLiteral < ' src > > ) ,
1414 Doc ( Option < StringLiteral < ' src > > ) ,
1515 ExitMessage ,
@@ -85,8 +85,9 @@ impl<'src> Attribute<'src> {
8585 . unwrap_or_default ( ) ;
8686
8787 Ok ( match discriminant {
88- AttributeDiscriminant :: Alias => Self :: Alias ( {
89- let delim = argument. unwrap ( ) . kind . delimiter_len ( ) ;
88+ AttributeDiscriminant :: Alias => {
89+ let string_literal = argument. unwrap ( ) ;
90+ let delim = string_literal. kind . delimiter_len ( ) ;
9091 let token = token. unwrap ( ) ;
9192 let token = Token {
9293 kind : TokenKind :: Identifier ,
@@ -105,8 +106,8 @@ impl<'src> Attribute<'src> {
105106 } ) ) ;
106107 }
107108
108- Name :: from_identifier ( token)
109- } ) ,
109+ Self :: Alias ( Name :: from_identifier ( token) , string_literal )
110+ }
110111 AttributeDiscriminant :: Confirm => Self :: Confirm ( argument) ,
111112 AttributeDiscriminant :: Doc => Self :: Doc ( argument) ,
112113 AttributeDiscriminant :: ExitMessage => Self :: ExitMessage ,
@@ -141,7 +142,7 @@ impl<'src> Attribute<'src> {
141142 }
142143
143144 pub ( crate ) fn repeatable ( & self ) -> bool {
144- matches ! ( self , Attribute :: Group ( _) | Attribute :: Alias ( _) )
145+ matches ! ( self , Attribute :: Group ( _) | Attribute :: Alias ( _, _ ) )
145146 }
146147}
147148
@@ -150,8 +151,8 @@ impl Display for Attribute<'_> {
150151 write ! ( f, "{}" , self . name( ) ) ?;
151152
152153 match self {
153- Self :: Alias ( argument ) => write ! ( f , "({ argument})" ) ? ,
154- Self :: Confirm ( Some ( argument) )
154+ Self :: Alias ( _ , argument)
155+ | Self :: Confirm ( Some ( argument) )
155156 | Self :: Doc ( Some ( argument) )
156157 | Self :: Extension ( argument)
157158 | Self :: Group ( argument)
0 commit comments