@@ -1005,10 +1005,10 @@ def __repr__(self):
1005
1005
def get_match_count (self , vars = {}):
1006
1006
return self .pattern .get_match_count (vars )
1007
1007
1008
- def match (self , yield_func , expression , vars_dict , evaluation , ** kwargs ):
1009
- existing = vars_dict .get (self .varname , None )
1008
+ def match (self , yield_func , expression , vars , evaluation , ** kwargs ):
1009
+ existing = vars .get (self .varname , None )
1010
1010
if existing is None :
1011
- new_vars = vars_dict .copy ()
1011
+ new_vars = vars .copy ()
1012
1012
new_vars [self .varname ] = expression
1013
1013
# for vars_2, rest in self.pattern.match(
1014
1014
# expression, new_vars, evaluation):
@@ -1021,24 +1021,22 @@ def match(self, yield_func, expression, vars_dict, evaluation, **kwargs):
1021
1021
self .pattern .match (yield_func , expression , new_vars , evaluation )
1022
1022
else :
1023
1023
if existing .sameQ (expression ):
1024
- yield_func (vars_dict , None )
1024
+ yield_func (vars , None )
1025
1025
1026
1026
def get_match_candidates (
1027
- self , elements : tuple , expression , attributes , evaluation , vars_dict = None
1027
+ self , elements : tuple , expression , attributes , evaluation , vars = {}
1028
1028
):
1029
- if vars_dict is None :
1030
- vars_dict = {}
1031
- existing = vars_dict .get (self .varname , None )
1029
+ existing = vars .get (self .varname , None )
1032
1030
if existing is None :
1033
1031
return self .pattern .get_match_candidates (
1034
- elements , expression , attributes , evaluation , vars_dict
1032
+ elements , expression , attributes , evaluation , vars
1035
1033
)
1036
1034
else :
1037
1035
# Treat existing variable as verbatim
1038
1036
verbatim_expr = Expression (SymbolVerbatim , existing )
1039
1037
verbatim = Verbatim (verbatim_expr )
1040
1038
return verbatim .get_match_candidates (
1041
- elements , expression , attributes , evaluation , vars_dict
1039
+ elements , expression , attributes , evaluation , vars
1042
1040
)
1043
1041
1044
1042
0 commit comments