module

Krikri::ConditionalEvaluator

Constants

REGEX_BARE_CALL = /\A\w+\s*\(.*\)\z/
REGEX_DIGITS = /\d+/
REGEX_GENERIC_IS_TEST = /\bis\s+(not\s+)?\w/
REGEX_MATCH_SEARCH_TEST = /^(.+?)\s+is\s+(not\s+)?(match|search)\((.+)\)\s*$/
REGEX_SAME_FILE_TEST = /^(.+?)\s+is\s+(not\s+)?(?:is_)?same_file\((.+)\)\s*$/
REGEX_SUBSET_TEST = /^(.+?)\s+is\s+(not\s+)?(issubset|issuperset|subset|superset|contains)\((.+)\)\s*$/
REGEX_VERSION_TEST = /\A(.+?)\s+is\s+version(?:_compare)?\(/

Precompiled regular expressions for condition parsing. Eliminates runtime regex compilation in hot when: and test paths. version_compare is real Ansible's older alias for the version test and is still accepted by ansible-core 2.19 (verified live, round173). Missing it here was benign while conditionals were lenient - the expression fell through to the generic comparison splitter, which mistook the >= INSIDE the quoted operator argument for a real comparison operator and quietly evaluated false. Once 0.9.548 made a bare undefined reference RAISE, that same misparse started hard-failing the task ("'')' is undefined") for the extremely common x is version_compare(min, '>=') version-gate idiom.

URN_PATTERN = /^urn:[a-zA-Z0-9][a-zA-Z0-9-]{0,31}:[a-zA-Z0-9()+,\-.:=@;$_!*'%\/?#]+$/i

Class methods

allow_broken_conditionals?

Real Ansible's own escape hatch for the strict-boolean-conditional rule it introduced in 2.19; this project's benchmark harness has set it on the real-Ansible side since round 20, so honouring it here keeps both engines comparable under the same environment.

Source
cached_regex(pattern : String, anchored : Bool) : Regex
Source
evaluate(condition : String, vars : Hash(String, JSON::Any), strict : Bool = false, raise_undefined : Bool = false) : Bool
Source

Nested types