Evaluate a dependency expression, returning a boolean result. - dependency - the expression - isSupported - function taking a version or extension name string and returning True or False if that name is supported or not.
(dependency, isSupported)
| 217 | raise Exception(f'invalid op: {op}') |
| 218 | |
| 219 | def evaluateDependency(dependency, isSupported): |
| 220 | """Evaluate a dependency expression, returning a boolean result. |
| 221 | |
| 222 | - dependency - the expression |
| 223 | - isSupported - function taking a version or extension name string and |
| 224 | returning True or False if that name is supported or not.""" |
| 225 | |
| 226 | global exprStack |
| 227 | exprStack = [] |
| 228 | results = dependencyBNF().parse_string(dependency, parse_all=True) |
| 229 | val = evaluateStack(exprStack[:], isSupported) |
| 230 | return val |
| 231 | |
| 232 | def evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root, parent_op = None): |
| 233 | """Evaluate an expression stack, returning an English equivalent |
no test coverage detected