1.1 --- a/common.py Fri Sep 01 19:35:20 2023 +0200
1.2 +++ b/common.py Fri Sep 01 23:41:53 2023 +0200
1.3 @@ -623,7 +623,7 @@
1.4 # raise LoopExit
1.5
1.6 [(compiler.ast.Name("StopIteration"), None,
1.7 - compiler.ast.Raise(compiler.ast.Name("$loop_exit")))],
1.8 + compiler.ast.Raise(compiler.ast.Name("__loop_exit")))],
1.9 None),
1.10
1.11 # <var>... = <t3>
2.1 --- a/inspector.py Fri Sep 01 19:35:20 2023 +0200
2.2 +++ b/inspector.py Fri Sep 01 23:41:53 2023 +0200
2.3 @@ -907,20 +907,6 @@
2.4 self.set_special(n.name, value)
2.5 return value
2.6
2.7 - # Special case for loops.
2.8 -
2.9 - elif n.name == "$loop_exit":
2.10 -
2.11 - # Attempt to get a reference.
2.12 -
2.13 - ref = self.get_builtin("__loop_exit")
2.14 -
2.15 - # Record the imported name and provide the resolved name reference.
2.16 -
2.17 - value = ResolvedNameRef(n.name, ref)
2.18 - self.set_special(n.name, value)
2.19 - return value
2.20 -
2.21 # Test for self usage, which is only allowed in methods.
2.22
2.23 if n.name == "self" and not (self.in_function and self.in_class):
3.1 --- a/resolving.py Fri Sep 01 19:35:20 2023 +0200
3.2 +++ b/resolving.py Fri Sep 01 23:41:53 2023 +0200
3.3 @@ -3,7 +3,7 @@
3.4 """
3.5 Name resolution.
3.6
3.7 -Copyright (C) 2016, 2017, 2023 Paul Boddie <paul@boddie.org.uk>
3.8 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
3.9
3.10 This program is free software; you can redistribute it and/or modify it under
3.11 the terms of the GNU General Public License as published by the Free Software
3.12 @@ -73,11 +73,7 @@
3.13
3.14 for name, value in self.special.items():
3.15 ref, paths = value
3.16 -
3.17 - # Handle special instances.
3.18 -
3.19 - origin = ref.is_well_defined_instance() and ref.get_name() or ref.get_origin()
3.20 - self.special[name] = self.importer.identify(origin), paths
3.21 + self.special[name] = self.importer.identify(ref.get_origin()), paths
3.22
3.23 def check_names_used(self):
3.24
4.1 --- a/translator.py Fri Sep 01 19:35:20 2023 +0200
4.2 +++ b/translator.py Fri Sep 01 23:41:53 2023 +0200
4.3 @@ -1619,8 +1619,7 @@
4.4 # function names to references.
4.5
4.6 elif n.name.startswith("$L") or n.name.startswith("$op") or \
4.7 - n.name.startswith("$seq") or n.name.startswith("$print") or \
4.8 - n.name == "$loop_exit":
4.9 + n.name.startswith("$seq") or n.name.startswith("$print"):
4.10
4.11 ref, paths = self.importer.get_module(self.name).special[n.name]
4.12 return TrResolvedNameRef(n.name, ref)