MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / evaluateDependency

Function evaluateDependency

scripts/parse_dependency.py:219–230  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

217 raise Exception(f'invalid op: {op}')
218
219def 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
232def evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root, parent_op = None):
233 """Evaluate an expression stack, returning an English equivalent

Callers 7

evaluatePipelineIfdefMethod · 0.90
evaluateAccessIfdefMethod · 0.90
endFileMethod · 0.90
testFunction · 0.85

Calls 2

dependencyBNFFunction · 0.85
evaluateStackFunction · 0.85

Tested by

no test coverage detected