Skip to main content

Module knowledge

Module knowledge 

Source
Expand description

Knowledge base: the backing store behind ParseContext.

A KnowledgeBase holds indexed command, environment, character, and delimiter-control metadata loaded from texform-knowledge package definitions. It is the single source of truth the parser consults when recognizing control sequences and environments.

§Architecture

The KB separates raw storage from the parser-facing active view:

  • Explicit commands are definitions with concrete argument specs (\frac, \text, etc.).
  • Character entries are zero-arg symbols (\alpha, \div, etc.) that the KB projects into synthetic command views so the parser can recognize them uniformly.
  • Active index maps each name to whichever source (explicit or character) is currently authoritative. Explicit commands always win.

§Package import order

Managed packages (base, ams, physics, …) are always imported in a fixed canonical order regardless of the caller-supplied order. This keeps merge results and from_packages arrays stable.

For rapid prototyping, configuration errors fail fast (panic).

Structs§

ActiveCharacterRecord
ActiveCommandRecord
ActiveDelimiterRecord
ActiveEnvironmentRecord
ArgSpec
ArgSpecParseError
BuiltinCharacterRecord
BuiltinCommandRecord
BuiltinDelimiterRecord
BuiltinEnvironmentRecord
KnowledgeBase
The knowledge base separates raw storage from the parser-facing view:
ParsedArgSpec
A parsed argspec: the structured argument list together with the source string it was parsed from. Produced by the argspec! compile-time macro.

Enums§

AllowedMode
ArgForm
CommandKind
DelimiterToken
PackageLoadError
Error returned when a requested package name is not found in the registry.
ValueKind

Functions§

default_package_names
lookup_command_node_name
lookup_environment_node_name