@@ -15,7 +15,7 @@ use diagnostics::{
1515 diagnostic:: { Diagnostic , Span , SpanKind , SpanPosition } ,
1616} ;
1717
18- use crate :: types:: ASTType ;
18+ use crate :: { ranges :: ASTRange , types:: ASTType } ;
1919
2020#[ derive( Debug , PartialEq , Clone ) ]
2121pub struct FunctionDeclarationArgument {
@@ -78,7 +78,13 @@ pub enum ASTTreeNodeKind {
7878
7979 VariableReference ( HashedString ) ,
8080
81- PointerGrab ( Box < ASTTreeNode > ) ,
81+ Dereference ( Box < ASTTreeNode > ) ,
82+
83+ DereferenceModify {
84+ pointer : Box < ASTTreeNode > ,
85+ val : Box < ASTTreeNode > ,
86+ } ,
87+
8288 ReferenceGrab ( Box < ASTTreeNode > ) ,
8389
8490 StructInitializer {
@@ -166,13 +172,20 @@ pub enum ASTTreeNodeKind {
166172 cond : Box < ASTTreeNode > ,
167173 body : Vec < Box < ASTTreeNode > > ,
168174 } ,
175+
169176 ForBlock {
170177 initial_state : Box < ASTTreeNode > ,
171178 cond : Box < ASTTreeNode > ,
172179 increment : Box < ASTTreeNode > ,
173180 body : Vec < Box < ASTTreeNode > > ,
174181 } ,
175182
183+ RangedForBlock {
184+ var : Box < ASTTreeNode > ,
185+ range : ASTRange ,
186+ body : Vec < Box < ASTTreeNode > > ,
187+ } ,
188+
176189 FunctionCall {
177190 func : HashedString ,
178191 args : Vec < Box < ASTTreeNode > > ,
@@ -185,7 +198,7 @@ pub enum ASTTreeNodeKind {
185198 requires_this : bool ,
186199 } ,
187200
188- ShadowFunctionDeclaration {
201+ ExternFunctionDeclaration {
189202 func_name : HashedString ,
190203 args : Vec < FunctionDeclarationArgument > ,
191204 return_type : Option < ASTType > ,
@@ -222,7 +235,7 @@ impl ASTTreeNodeKind {
222235 ASTTreeNodeKind :: FunctionDeclaration { .. }
223236 | ASTTreeNodeKind :: EnumDeclaration { .. }
224237 | ASTTreeNodeKind :: StaticVariableDeclaration { .. }
225- | ASTTreeNodeKind :: ShadowFunctionDeclaration { .. }
238+ | ASTTreeNodeKind :: ExternFunctionDeclaration { .. }
226239 | ASTTreeNodeKind :: StructLayoutDeclaration { .. }
227240 ) ;
228241 }
@@ -239,7 +252,7 @@ impl ASTTreeNodeKind {
239252 return Some ( HashedString :: new ( func_name. val . to_string ( ) ) ) ;
240253 }
241254
242- ASTTreeNodeKind :: ShadowFunctionDeclaration {
255+ ASTTreeNodeKind :: ExternFunctionDeclaration {
243256 func_name,
244257 args : _,
245258 return_type : _,
@@ -349,7 +362,8 @@ impl Display for ASTTreeNodeKind {
349362 Self :: BooleanBasedConditionMember { .. } => "boolean condition" ,
350363 Self :: MathResult { .. } => "math operation" ,
351364 Self :: VariableReference ( _) => "variable reference" ,
352- Self :: PointerGrab ( _) => "pointer grabbing" ,
365+ Self :: DereferenceModify { .. } => "modifying dereference" ,
366+ Self :: Dereference ( _) => "dereference" ,
353367 Self :: ReferenceGrab ( _) => "reference" ,
354368 Self :: StructInitializer { .. } => "struct value initializer" ,
355369 Self :: ArrayVariableInitializerValue { .. }
@@ -364,10 +378,10 @@ impl Display for ASTTreeNodeKind {
364378 Self :: ReturnStatement { .. } => "return statement" ,
365379 Self :: StaticVariableDeclaration { .. } => "static variable declaration" ,
366380 Self :: WhileBlock { .. } => "while block" ,
367- Self :: ForBlock { .. } => "for block" ,
381+ Self :: ForBlock { .. } | Self :: RangedForBlock { .. } => "for block" ,
368382 Self :: FunctionCall { .. } => "function call" ,
369383 Self :: FunctionDeclaration { .. } => "function declaration" ,
370- Self :: ShadowFunctionDeclaration { .. } => "shadow function declaration" ,
384+ Self :: ExternFunctionDeclaration { .. } => "extern function declaration" ,
371385 Self :: StructLRFunction { .. } => "struct LRU function usage" ,
372386 Self :: StructLRVariable { .. } => "struct LRU variable usage" ,
373387 Self :: StructLayoutDeclaration { .. } => "struct / layout declaration" ,
0 commit comments