Skip to main content

Module parser

Module parser 

Source
Expand description

Based on a set of rules, validate a token stream and collect the tokens by type.

See the β€œrules” module for definitions of keywords types and per-keyword rules.

The key types in this module are SectionRules, which explains how to validate and partition a stream of Item, and Section, which contains a validated set of Item, ready to be interpreted.

Β§Example

(This is an internal API, so see the routerdesc.rs source for an example of use.)

Re-exportsΒ§

use crate::parse::keyword::Keyword; πŸ”’
use crate::NetdocErrorKind as EK; πŸ”’
use crate::Result; πŸ”’
use educe::Educe; πŸ”’
use crate::parse::rules::*; πŸ”’
use crate::parse::tokenize::*; πŸ”’

StructsΒ§

Section πŸ”’
A Section is the result of sorting a document’s entries by keyword.
SectionRules πŸ”’
Describe the rules for one section of a document.
SectionRulesBuilder πŸ”’
A builder for a set of section rules.
TokVal πŸ”’
The entry or entries for a particular keyword within a document.