1.1 --- a/results.py Tue May 21 19:04:20 2024 +0200
1.2 +++ b/results.py Fri May 24 00:11:20 2024 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Result abstractions.
1.6
1.7 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2016, 2017, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -69,6 +69,20 @@
1.13 def has_kind(self, kinds):
1.14 return False
1.15
1.16 + # Support for formulating expressions for direct testing.
1.17 +
1.18 + def yields_integer(self):
1.19 + return False
1.20 +
1.21 + def apply_test(self):
1.22 +
1.23 + "Return the result in a form suitable for direct testing."
1.24 +
1.25 + if self.yields_integer():
1.26 + return "__INTEGER(%s)" % self
1.27 + else:
1.28 + return "__BOOL(%s)" % self
1.29 +
1.30 class AccessRef(Result):
1.31
1.32 """