Skip to main content

Crate rustyfi_syntax

Crate rustyfi_syntax 

Source
Expand description

Lexer, token stream, and surface grammar for SATySFi.

Port of the v0.0.6 SATySFi frontend (lexer.mll / parser.mly) on top of the syan parser framework.

Re-exports§

pub use cst::parse_file;
pub use cst::ParseFileError;
pub use cst_v1::parse_file_v1;
pub use cst_v1::FileV1;
pub use lexer::lex;
pub use lexer::lex_partial;
pub use lexer::lex_with_version;
pub use lexer::LexError;
pub use parse_error::ParseFailureKind;
pub use span::Loc;
pub use span::Span;
pub use token::Atom;
pub use token::Token;
pub use version::sniff_headers;
pub use version::sniff_version;
pub use version::HeaderSniff;
pub use version::ParseVersionError;
pub use version::RustyfiVersion;

Modules§

cst
The SATySFi 0.0.6 surface grammar (a subset of the v0.0.6 parser.mly), parsed with syan derives over the SATySFi token atoms.
cst_v1
The SATySFi 0.1.0 (dev-0-1-0) surface grammar — a fork of crate::cst, not a version-gate of it (gating one shared cst.rs would mean hand-writing Parse for nearly every node, destroying the derive idiom and risking 0.0.6 on every 0.1 edit). crate::cst stays frozen: this module imports only its token-Atom-generic, non-recursive helpers (crate::cst::Header, crate::cst::ParseFileError) and re-declares everything else — including its own *ErasedV1 eraser leaves and its own copy of render_parse_error — so that touching cst_v1.rs never touches cst.rs.
leaf
Leaf token types and the delimiter Group aliases.
lexer
Stateful mode-stack lexer, a direct port of the v0.0.6 lexer.mll.
parse_error
Turning a failed parse into one diagnostic a human can act on.
span
stream
The parse source for the SATySFi surface grammar.
token
version
Target SATySFi language version.