KrikriJinja
Constants
Dict keys are stored as strings; non-string Python keys get a marker prefix so repr/lookup/json can recover their true type and value.
The reserved words that are tokenized as idents but mean something to the parser.
Filters that accept keyword arguments in real Jinja2; map/filter passing must raise for any others (Python raises TypeError instead).
Strict positional arity for filters python raises on when over-called.
Class methods
Ansible's strict undefined: raises when an undefined value is USED, and chains through attribute/subscript access on the way there.
Truncating quotient/remainder with Python's floor adjustment.
Int64-overflowing decimal strings are the engine's big-int representation; Python reprs them unquoted.
Decimal-string big-int helpers shared by pow and add overflow paths. Decimal-string bignum: needed when Int64 pow overflows (Python has arbitrary-precision ints).
Exact comparison of a decimal-string integer against an Int64.
Unsigned long division of decimal strings; a and b must be non-negative.
Ordering: returns -1, 0, 1. Raises on incomparable types (Python-like).
Builds a boxed context hash from plain Crystal values.
Builds an engine that inherits the shared default engine's registered
filters, tests, and globals, with the caller's loader, lexer options, and
undefined behavior. Use this instead of Engine.new when host extensions
must stay visible (for example a .j2 render with its own loader).
Alternate encoding for python's 1 == True key equivalence, or nil.
Plain string form of a numeric key, or nil for anything else. Hosts
that hand the engine pre-built dicts through a JSON round trip lose
their YAML key types (a JSON object's keys are always strings), so
an integer YAML key (7:) arrives as the plain string "7" while the
subscript still indexes with the real int - the type-preserving
encodings above miss it and the lookup wrongly reports undefined
(robertdebock.tomcat's _tomcat_unarchive_urls[instance.version]
became the literal string "undefined" instead of a download URL).
Real Jinja2 matches dict keys by value, so the plain form is tried
as a last resort. Strings deliberately get no fallback here: the
caller has already tried the string itself, and coercing a string
key into a numeric encoding would fabricate matches real Jinja2
does not make.
The integral-truncation form of a numeric key ("8" for 8.0) - the int/float key-equivalence fallback dict_lookup tries after the plain string form (Python: d[8] also hits a float 8.0 key, d[8.0] hits an int 8 key).
One dict lookup for every call site: the type-preserving encoding, then the True/1 equivalence alternate, then the plain string form, then the integral-truncation form.
Like evaluate_expression, but reports undefined results explicitly so
callers can tell them apart from a JSON null value.
python str.istitle: each cased word starts upper, continues lower
Percent-encoding matching urllib.parse.quote (space becomes %20).
Python %-style formatting (the format filter). tuple_arg marks a
parenthesized right operand; CPython only errors on leftover args for
tuples and scalars, never for lists/dicts/undefined.
CPython str repr: single quotes preferred, double when the value contains ' but not ", backslash/quote/control chars escaped.
Percent-encoding matching urllib.parse.quote_plus (space becomes +).
str.format: positional ({} and {N}) replacement with {{ }} escapes.
Converts a JSON::Any value into a boxed template value.
Python's type name for a value, as error messages report it.
The message real Jinja2/Ansible reports names the variable that was missing; fall back to a generic word when the name is unknown.
Python-like equality/comparison across values.
Deep-converts plain Crystal values (nested hashes/arrays of mixed types) into boxed template values.
Nested types
- KrikriJinja::AnyV
- KrikriJinja::AnyValue
- KrikriJinja::BigIntValue
- KrikriJinja::Callable
- KrikriJinja::CallerCallable
- KrikriJinja::Context
- KrikriJinja::Cycler
- KrikriJinja::DictLoader
- KrikriJinja::Engine
- KrikriJinja::ErrorKind
- KrikriJinja::Evaluator
- KrikriJinja::ExprNode
- KrikriJinja::ExpressionResult
- KrikriJinja::FileSystemLoader
- KrikriJinja::FilterFn
- KrikriJinja::FunctionFn
- KrikriJinja::GeneratorValue
- KrikriJinja::HostContext
- KrikriJinja::HostObject
- KrikriJinja::Joiner
- KrikriJinja::JsonFilterFn
- KrikriJinja::JsonFunctionFn
- KrikriJinja::JsonTestFn
- KrikriJinja::Lexer
- KrikriJinja::LexerOptions
- KrikriJinja::Loader
- KrikriJinja::LoopCallable
- KrikriJinja::LoopObject
- KrikriJinja::MacroCallable
- KrikriJinja::Markup
- KrikriJinja::Namespace
- KrikriJinja::Node
- KrikriJinja::Nodes
- KrikriJinja::Parser
- KrikriJinja::PythonRandom
- KrikriJinja::SimpleCallable
- KrikriJinja::StrictUndefined
- KrikriJinja::TargetSpec
- KrikriJinja::TemplateError
- KrikriJinja::TestFn
- KrikriJinja::Token
- KrikriJinja::TokenType
- KrikriJinja::TupleValue
- KrikriJinja::Undefined
- KrikriJinja::VariableResolver