1.1 --- a/branching.py Tue Aug 30 16:51:10 2016 +0200
1.2 +++ b/branching.py Tue Aug 30 17:25:15 2016 +0200
1.3 @@ -180,10 +180,6 @@
1.4
1.5 self.loop_branches = []
1.6
1.7 - # Inherited usage.
1.8 -
1.9 - self.inherited = None
1.10 -
1.11 # Structure assembly methods.
1.12
1.13 def new_branchpoint(self, loop_node=False):
1.14 @@ -452,63 +448,6 @@
1.15 for branch in branches:
1.16 branch.contributors.add(contributor)
1.17
1.18 - # Namespace methods.
1.19 -
1.20 - def inherit_branches(self, tracker, names):
1.21 -
1.22 - """
1.23 - Propagate branches from the given 'tracker' excluding those associated
1.24 - with 'names'.
1.25 - """
1.26 -
1.27 - # For each inherited name, create a branch connected to the inherited
1.28 - # branches.
1.29 -
1.30 - self.inherited = {}
1.31 -
1.32 - for name, branches in tracker.attribute_branches[-1].items():
1.33 -
1.34 - # Do not inherit any listed names (typically parameters) or any
1.35 - # special names.
1.36 -
1.37 - if name in names or name.startswith("$"):
1.38 - continue
1.39 -
1.40 - # Make a tentative assignment for the name.
1.41 -
1.42 - contributor = Branch([name], True)
1.43 - init_item(self.assignments, name, list)
1.44 - self.assignments[name].append(contributor)
1.45 -
1.46 - # Connect the inherited branch to the new one.
1.47 -
1.48 - for branch in branches:
1.49 - init_item(contributor.suppliers, name, set)
1.50 - contributor.suppliers[name].add(branch)
1.51 - branch.contributors.add(contributor)
1.52 -
1.53 - # Record the inherited branch.
1.54 -
1.55 - self.inherited[name] = [contributor]
1.56 -
1.57 - self.attribute_branches[-1].update(self.inherited)
1.58 -
1.59 - def disconnect_name(self, name):
1.60 -
1.61 - "Disconnect inherited branches for 'name'."
1.62 -
1.63 - if not self.inherited or not self.inherited.has_key(name):
1.64 - return
1.65 -
1.66 - # Remove the new branch from the inherited branches for the name.
1.67 -
1.68 - for contributor in self.inherited[name]:
1.69 - for supplier in contributor.suppliers[name]:
1.70 - supplier.contributors.remove(contributor)
1.71 - del contributor.suppliers[name]
1.72 -
1.73 - del self.inherited[name]
1.74 -
1.75 # Attribute usage methods.
1.76
1.77 def tracking_name(self, name):
1.78 @@ -518,13 +457,11 @@
1.79 if it is.
1.80 """
1.81
1.82 - return self.assignments.has_key(name) and \
1.83 - (not self.inherited or not self.inherited.has_key(name)) and \
1.84 - self.have_name(name)
1.85 + return self.assignments.has_key(name) and self.have_name(name)
1.86
1.87 def have_name(self, name):
1.88
1.89 - "Return whether 'name' is known, perhaps having been inherited."
1.90 + "Return whether 'name' is known."
1.91
1.92 return self.attribute_branches[-1].get(name)
1.93
1.94 @@ -539,8 +476,6 @@
1.95 branch = Branch(names, True, values)
1.96
1.97 for name in names:
1.98 - self.disconnect_name(name)
1.99 -
1.100 branches[name] = [branch]
1.101 init_item(self.assignments, name, list)
1.102 self.assignments[name].append(branch)