Expand description
An INI grammar plugin for the tabnas parsing engine.
INI is the oldest configuration format still in daily use, and the
least specified: every implementation is a dialect. This one layers
on the relaxed-JSON grammar from
tabnas-jsonic and lexes keys,
values and section-header segments with
tabnas-hoover.
[server]
host = localhost
port = 8080
=> {"server":{"host":"localhost","port":"8080"}}This is the Rust port; the TypeScript package (ts/src/ini.ts) is
canonical and the Go port (go/ini.go) is the nearer structural
model. The three are held together by the shared test/spec/*.tsv
fixtures, which every runtime discovers and runs.
Structs§
- Comment
Options - Comment handling. Line comments are always on; this controls the inline ones.
- IniError
- The engine’s error, re-exported under this crate’s name.
- IniOptions
- The INI plugin options.
- IniPlugin
Error - A failure to install the plugin: a missing base grammar, a hoover block the host refuses, or a grammar document the engine rejects.
- Inline
Comment Options - Inline comment behaviour.
- Inline
Escape Options - Escape mechanisms for a literal comment character inside a value.
- Multiline
Options - Multiline value continuation.
- Section
Options - Section header handling.
- Translation
Part - One optional alchemy translation source and its explicit entry point.
- Translation
Parts - The package-local structural translation interface.
Enums§
- Duplicate
- How a repeated section header is treated.
Constants§
- DEPTH_
LIMIT - The deepest a document may nest before the parse is refused with the
engine’s
cancelcode. - PLUGIN_
NAME - The plugin name, and the namespace
use_pluginfiles its option bag under. - VERSION
- This crate’s version. It MUST equal
ts/package.json“version”: the release orchestrator rewrites both, andtests/version_test.rsfails the build if they drift. MirrorsVERSIONints/src/ini.tsandconst VERSIONingo/ini.go.
Functions§
- ini
- Install the INI grammar on an engine that ALREADY carries jsonic.
- make
- Build an INI parser with the default options.
- make_
with - Build an INI parser with caller options.
- manifest_
text - The plugin’s manifest,
tabnas.plugin.json, as the repository carries it. Itstranslateobject is what a host that translates reads: the shape INI is read as and written from (tree), the root its render needs (object), the file that holds the render, the sentences that say what the render does not keep, and the file that holds the transducer part (transduce), the document’s JSON events from the grammar’s rule passes under its default options, through which a host that reads parser events reads a document. The crate embeds its own copies,translate/manifest.jsonandtranslate/transduce.alc, since a packaged crate holds nothing outsiders/;tests/translate_test.rsholds each copy to its file. - parse
- Parse an INI source string with the shared default parser.
- parse_
with - Parse an INI source string with caller options.
- plugin
- The plugin form of
ini, forTabnas::use_plugin. - render_
text - INI’s render,
alchemy/render.alc, the file the manifest’stranslate.rendernames: a library of alchemy definitions, with noexport, whose entry pointini-renderwrites a tree’s events as one INI document. A host links it with its own program. The crate embeds its own copy,translate/render.alc, held to the file as the manifest’s is. - translate
- Return INI’s immutable translation parts.