@@ -9,6 +9,7 @@ use super::{Variable, traits};
99use crate :: parser:: display:: repr_option_vec;
1010use crate :: parser:: keyword:: attributes:: { AttributeKeyword , UserDefinedTypes } ;
1111use crate :: parser:: literal:: { Attribute , repr_vec_attr} ;
12+ use crate :: parser:: modifiers:: functions:: { CanMakeFnRes , MakeFunction } ;
1213use crate :: parser:: modifiers:: push:: Push ;
1314use crate :: parser:: operators:: api:: OperatorConversions ;
1415use crate :: parser:: tree:: api:: { Ast , CanPush } ;
@@ -93,6 +94,30 @@ impl AttributeVariable {
9394 }
9495}
9596
97+ impl MakeFunction for AttributeVariable {
98+ fn can_make_function ( & self ) -> CanMakeFnRes {
99+ match self . declarations . last ( ) ? {
100+ Some ( declaration) => declaration. value . as_ref ( ) ?. can_make_function ( ) ,
101+ None => CanMakeFnRes :: None ,
102+ }
103+ }
104+
105+ fn make_function ( & mut self , depth : u32 , arguments : Vec < Ast > ) {
106+ match self
107+ . declarations
108+ . last_mut ( )
109+ . expect ( "checked with can_make_function" )
110+ {
111+ Some ( declaration) => declaration
112+ . value
113+ . as_mut ( )
114+ . expect ( "checked with can_make_function" )
115+ . make_function ( depth, arguments) ,
116+ None => unreachable ! ( ) ,
117+ }
118+ }
119+ }
120+
96121impl CanPush for AttributeVariable {
97122 fn can_push_leaf ( & self ) -> bool {
98123 self . declarations . last ( ) . is_some_and ( |opt| {
0 commit comments