Lichen

Change of results.py

794:7dd8e4815848
results.py
     1.1 --- a/results.py	Fri Mar 31 18:42:27 2017 +0200
     1.2 +++ b/results.py	Fri Mar 31 23:26:47 2017 +0200
     1.3 @@ -209,6 +209,26 @@
     1.4      def __repr__(self):
     1.5          return "LiteralSequenceRef(%r, %r, %r, %r)" % (self.name, self.ref, self.node, self.items)
     1.6  
     1.7 +class MultipleRef(Result):
     1.8 +
     1.9 +    "A multiple outcome result."
    1.10 +
    1.11 +    def __init__(self, results):
    1.12 +        self.results = results
    1.13 +
    1.14 +    def reference(self):
    1.15 +        refs = set(self.references())
    1.16 +        ref = len(refs) == 1 and list(refs)[0] or Reference("<var>")
    1.17 +
    1.18 +    def references(self):
    1.19 +        refs = []
    1.20 +        for result in self.results:
    1.21 +            refs.append(result.reference())
    1.22 +        return refs
    1.23 +
    1.24 +    def __repr__(self):
    1.25 +        return "MultipleRef(%r)" % self.results
    1.26 +
    1.27  class VariableRef(Result):
    1.28  
    1.29      "A variable reference."