Skip to main content

Module registry

Module registry 

Source
Expand description

Dialect-spec parser dispatch.

This module is the single source of truth for dialect selection, in two layers:

  • dialect_for_tags maps legacy format:* tags to a built-in DialectSpec — the back-compat path for catalog rows persisted before specs existed (and for models whose spec could not be derived).
  • get_parser turns a resolved spec into a parser. Any spec drives the delimited parser; no spec means the identity passthrough.

Adding a new builtin dialect is one entry in dialect_for_tags (plus its constant in super::tags). Template-derived dialects need no code at all: detection persists a spec and it arrives here as Some.

No other crate looks at format:* tags for parser selection — they resolve a spec (usually via ModelContext) and call get_parser. This keeps the dialect surface area tightly contained and prevents drift between callers.

Functions§

dialect_for_tags
Map legacy format:* tags to a built-in DialectSpec.
get_parser
Pick a parser for a resolved dialect.