Esempio n. 1
0
 def get_free_variables(self, start_pos: Pos) -> FreeVariables:
     freevars = FreeVariables()
     if isinstance(self.tree, tuple):
         for e in self.tree:
             freevars = freevars.union(e.get_free_variables(start_pos))
         return freevars
     return self.tree.get_free_variables(start_pos)
Esempio n. 2
0
 def get_free_variables(self, start_pos: Pos) -> FreeVariables:
   fv = (
       self.start.get_free_variables(start_pos)
       if self.start else FreeVariables())
   return fv.union(
       self.limit.get_free_variables(start_pos) if self
       .limit else FreeVariables())
Esempio n. 3
0
 def get_free_variables(self, start_pos: Pos) -> FreeVariables:
     return FreeVariables()
Esempio n. 4
0
 def get_free_variables(self, start_pos: Pos) -> FreeVariables:
     freevars = FreeVariables()
     for member in self.members:
         freevars = freevars.union(member.get_free_variables(start_pos))
     return freevars
Esempio n. 5
0
 def get_free_variables(self, start_pos: Pos) -> FreeVariables:
     accum = FreeVariables()
     for _, member in self.members:
         accum = accum.union(member.get_free_variables(start_pos))
     accum = accum.union(self.splatted.get_free_variables(start_pos))
     return accum
Esempio n. 6
0
 def get_free_variables(
         self,
         pos: Pos  # pylint: disable=unused-argument
 ) -> FreeVariables:
     return FreeVariables()
Esempio n. 7
0
 def get_free_variables(self, pos: Pos) -> FreeVariables:
     if not hasattr(self.name_def,
                    'span') or self.name_def.span.start < pos:
         return FreeVariables({self.identifier: [self]})
     return FreeVariables()