Module lookup
Expand description
Calendar lookup DSL.
Resolves a code string to a calendar: a business-centre code, or a
comma-separated list joined into the union of their holidays. Examples:
"GBLO", "GBLO,EUTA". A settlement calendar is not part of the expression: it is an
argument of the SettlementLag.
StructsΒ§
- Calendar
Spec - A calendar stated as data, for ingestion: the code it binds, the holidays it closes, and the weekdays that are not business days.
EnumsΒ§
- Calendar
Ingest Error - Why a calendar could not be ingested.
- Calendar
Parse Error - Error resolving a calendar-lookup string.
StaticsΒ§
- ANY_
INGESTED π - Whether any calendar has been ingested β the guard that keeps the binding table off the resolution path of a process that never ingests.
- INGEST_
GENERATION π - Bumped, under the composite cacheβs lock, by every ingest and clear: a composite built across a bump is not cached.
FunctionsΒ§
- bindings π
- bound π
- The calendar ingested under the canonical
code, if any β what a shipped centreβs or marketβs owncalendar()answers before its table, so every path that reaches a shipped calendar honours an override. - canonical_
code π - The canonical code a lookup token resolves under: an alias of a shipped centre or market reads as that centreβs code, anything else upper-cased.
- center
- Resolves a center code to a calendar, panicking on a wiring error.
- composite_
cache π - The process-wide composite-expression cache. Calendars are immutable, so an entry is invalidated only when a calendar is ingested under a code the expression names; the expression universe is the closed set of template calendar strings, so the map stays small.
- ingest_
calendar - Binds
spec.codeto a calendar built fromspec, process-wide. - ingest_
calendars - Ingests every spec in order; a later spec for the same code wins.
- ingested π
- ingested_
calendars - The codes ingested this process, sorted β what a run records to say which calendars it overrode or added.
- is_
well_ πformed_ code - Whether a token is a well-formed calendar code: non-empty after trimming
and made only of ASCII letters, digits and dots. This one rule decides what
lookupaccepts as a member and whatingest_calendaraccepts as a code, so a stray character is refused the same way wherever it appears. - join π
- Resolves a comma-separated list to a single calendar (joining by union of holidays when there is more than one member).
- lookup
- Resolves a lookup string to a calendar.
- reserved_
codes π - The reserved codes
lookupresolves ahead of the registry, for a rejection to name alongside the registered centres. The one place the spellings are written:resolve_reservedand the ingestion guard both read them from here, so what is advertised is what resolves. - resolve_
one π - Resolves a single token to a calendar: a bare FpML code (or alias) yields the
jurisdiction settlement calendar; a qualified
BASE.SUFFIXcode (or a market alias such asnyse) yields the market calendar. A calendar ingested under the code β or under the canonical code an alias spells β answers first. - resolve_
reserved π - The two rule-based calendars, reachable by a reserved code so that the whole substrate is namable in one expression language.
Type AliasesΒ§
- Bindings π
- The calendar bindings ingested this process: canonical code β calendar.
- Composite
Cache π - The composite-expression cacheβs storage: expression string β compiled calendar.