@@ -43,15 +43,15 @@ mod function {
4343 /// ```
4444 #[ derive( Clone , Debug ) ]
4545 pub struct FunctionDeclaration {
46- #[ allow ( dead_code, reason = "token field" ) ]
46+ #[ expect ( dead_code, reason = "token field" ) ]
4747 pub tok_fn : tok:: Fn ,
4848 /// Name of the function.
4949 pub name : tok:: Ident ,
50- #[ allow ( dead_code, reason = "token field" ) ]
50+ #[ expect ( dead_code, reason = "token field" ) ]
5151 pub tok_l_parenthesis : tok:: LParenthesis ,
5252 /// Parameters for the function.
5353 pub parameters : PunctuatedList < FunctionParameter , tok:: Comma > ,
54- #[ allow ( dead_code, reason = "token field" ) ]
54+ #[ expect ( dead_code, reason = "token field" ) ]
5555 pub tok_r_parenthesis : tok:: RParenthesis ,
5656 /// Optional return type for the function.
5757 pub return_ty : Option < FunctionReturnType > ,
@@ -67,7 +67,7 @@ mod function {
6767 pub struct FunctionParameter {
6868 /// Name of the parameter.
6969 pub name : tok:: Ident ,
70- #[ allow ( dead_code, reason = "token field" ) ]
70+ #[ expect ( dead_code, reason = "token field" ) ]
7171 pub tok_colon : tok:: Colon ,
7272 /// Type of the parameter.
7373 pub ty : tok:: Ident ,
@@ -80,7 +80,7 @@ mod function {
8080 /// ```
8181 #[ derive( Clone , Debug ) ]
8282 pub struct FunctionReturnType {
83- #[ allow ( dead_code, reason = "token field" ) ]
83+ #[ expect ( dead_code, reason = "token field" ) ]
8484 pub tok_thin_arrow : tok:: ThinArrow ,
8585 /// Return type.
8686 pub ty : tok:: Ident ,
@@ -90,11 +90,11 @@ mod function {
9090/// Block, containing a collection of [`Statement`]s.
9191#[ derive( Clone , Debug ) ]
9292pub struct Block {
93- #[ allow ( dead_code, reason = "token field" ) ]
93+ #[ expect ( dead_code, reason = "token field" ) ]
9494 pub tok_l_brace : tok:: LBrace ,
9595 /// Collection of statements.
9696 pub statements : Vec < Statement > ,
97- #[ allow ( dead_code, reason = "token field" ) ]
97+ #[ expect ( dead_code, reason = "token field" ) ]
9898 pub tok_r_brace : tok:: RBrace ,
9999}
100100
@@ -115,35 +115,35 @@ mod statement {
115115 /// A `let` statement creates a new binding (`name`), and assigns `value` to it.
116116 #[ derive( Clone , Debug ) ]
117117 pub struct LetStatement {
118- #[ allow ( dead_code, reason = "token field" ) ]
118+ #[ expect ( dead_code, reason = "token field" ) ]
119119 pub tok_let : tok:: Let ,
120120 /// Name of the variable.
121121 pub variable : tok:: Ident ,
122- #[ allow ( dead_code, reason = "token field" ) ]
122+ #[ expect ( dead_code, reason = "token field" ) ]
123123 pub tok_eq : tok:: Eq ,
124124 /// Value that was assigned.
125125 pub value : Expression ,
126- #[ allow ( dead_code, reason = "token field" ) ]
126+ #[ expect ( dead_code, reason = "token field" ) ]
127127 pub tok_semicolon : tok:: SemiColon ,
128128 }
129129
130130 /// A `return` statement returns `value`.
131131 #[ derive( Clone , Debug ) ]
132132 pub struct ReturnStatement {
133- #[ allow ( dead_code, reason = "token field" ) ]
133+ #[ expect ( dead_code, reason = "token field" ) ]
134134 pub tok_return : tok:: Return ,
135135 /// Value that is being returned.
136136 pub value : Expression ,
137- #[ allow ( dead_code, reason = "token field" ) ]
137+ #[ expect ( dead_code, reason = "token field" ) ]
138138 pub tok_semicolon : tok:: SemiColon ,
139139 }
140140
141141 #[ derive( Clone , Debug ) ]
142142 pub struct BreakStatement {
143- #[ allow ( dead_code, reason = "token field" ) ]
143+ #[ expect ( dead_code, reason = "token field" ) ]
144144 pub tok_break : tok:: Break ,
145145 pub value : Option < Expression > ,
146- #[ allow ( dead_code, reason = "token field" ) ]
146+ #[ expect ( dead_code, reason = "token field" ) ]
147147 pub tok_semicolon : tok:: SemiColon ,
148148 }
149149
@@ -153,7 +153,6 @@ mod statement {
153153 /// Expression.
154154 pub expression : Expression ,
155155 /// Can be optionally terminated by semicolon.
156- #[ allow( dead_code, reason = "token field" ) ]
157156 pub tok_semicolon : Option < tok:: SemiColon > ,
158157 }
159158
@@ -196,7 +195,7 @@ mod expression {
196195 pub struct Assign {
197196 /// Variable being assigned to.
198197 pub assignee : Box < Expression > ,
199- #[ allow ( dead_code, reason = "token field" ) ]
198+ #[ expect ( dead_code, reason = "token field" ) ]
200199 pub tok_eq : tok:: Eq ,
201200 /// Value of the assignment.
202201 pub value : Box < Expression > ,
@@ -256,7 +255,7 @@ mod expression {
256255 /// An `if` statement
257256 #[ derive( Clone , Debug ) ]
258257 pub struct If {
259- #[ allow ( dead_code, reason = "token field" ) ]
258+ #[ expect ( dead_code, reason = "token field" ) ]
260259 pub tok_if : tok:: If ,
261260 /// Condition that is being checked.
262261 pub condition : Box < Expression > ,
@@ -269,7 +268,7 @@ mod expression {
269268 /// Optional trailing section of an `if` statement.
270269 #[ derive( Clone , Debug ) ]
271270 pub struct IfTrailer {
272- #[ allow ( dead_code, reason = "token field" ) ]
271+ #[ expect ( dead_code, reason = "token field" ) ]
273272 pub tok_else : tok:: Else ,
274273 /// Can be followed by `if` with another condition, or a final block.
275274 pub if_or_block : IfOrBlock ,
@@ -295,16 +294,15 @@ mod expression {
295294
296295 #[ derive( Clone , Debug ) ]
297296 pub struct Loop {
298- #[ allow ( dead_code, reason = "token field" ) ]
297+ #[ expect ( dead_code, reason = "token field" ) ]
299298 pub tok_loop : tok:: Loop ,
300299 pub body : Block ,
301300 }
302301
303302 // TODO: Implement while loops
304303 #[ derive( Clone , Debug ) ]
305- #[ allow ( dead_code, reason = "while statements will be implemented after loops" ) ]
304+ #[ expect ( dead_code, reason = "while statements will be implemented after loops" ) ]
306305 pub struct While {
307- #[ allow( dead_code, reason = "token field" ) ]
308306 pub tok_while : tok:: While ,
309307 pub condition : Box < Expression > ,
310308 pub body : Block ,
@@ -349,9 +347,9 @@ mod expression {
349347
350348 #[ derive( Clone , Debug ) ]
351349 pub struct UnitLiteral {
352- #[ allow ( dead_code, reason = "token field" ) ]
350+ #[ expect ( dead_code, reason = "token field" ) ]
353351 pub tok_l_parenthesis : tok:: LParenthesis ,
354- #[ allow ( dead_code, reason = "token field" ) ]
352+ #[ expect ( dead_code, reason = "token field" ) ]
355353 pub tok_r_parenthesis : tok:: RParenthesis ,
356354 }
357355
@@ -365,11 +363,11 @@ mod expression {
365363 /// An [`Expression`] wrapped in parentheses.
366364 #[ derive( Clone , Debug ) ]
367365 pub struct Parenthesis {
368- #[ allow ( dead_code, reason = "token field" ) ]
366+ #[ expect ( dead_code, reason = "token field" ) ]
369367 pub tok_l_parenthesis : tok:: LParenthesis ,
370368 /// Inner expression.
371369 pub expression : Box < Expression > ,
372- #[ allow ( dead_code, reason = "token field" ) ]
370+ #[ expect ( dead_code, reason = "token field" ) ]
373371 pub tok_r_parenthesis : tok:: RParenthesis ,
374372 }
375373
@@ -378,11 +376,11 @@ mod expression {
378376 pub struct Call {
379377 /// Callee of the function.
380378 pub callee : Box < Expression > ,
381- #[ allow ( dead_code, reason = "token field" ) ]
379+ #[ expect ( dead_code, reason = "token field" ) ]
382380 pub tok_l_parenthesis : tok:: LParenthesis ,
383381 /// Arguments passed to the call.
384382 pub arguments : PunctuatedList < Expression , tok:: Comma > ,
385- #[ allow ( dead_code, reason = "token field" ) ]
383+ #[ expect ( dead_code, reason = "token field" ) ]
386384 pub tok_r_parenthesis : tok:: RParenthesis ,
387385 }
388386
0 commit comments