Skip to content

vihaco_parser (crate)

vihaco_parser

vihaco_parser

Modules

classBareTokensource

vihaco_parser::BareToken

Bases: Debug, Clone, StructuralPartialEq, PartialEq, Eq, PartialOrd, Ord, Hash, AsRef<str>, Borrow<str>, Display, From<BareToken>, Parse<'src>

Rust struct. An unquoted SST token whose interpretation is deferred to a resolver.

pub struct BareToken

Fields

NameTypeDescription
0String
source

methodas_strsource

vihaco_parser::BareToken::as_str

pub fn as_str(&self) -> &str

Returns

&str

Borrow the lexical text.

source

methodinto_innersource

vihaco_parser::BareToken::into_inner

pub fn into_inner(self) -> String

Returns

String

Consume this value and return its owned text.

source

classIdentsource

vihaco_parser::Ident

Bases: Debug, Clone, StructuralPartialEq, PartialEq, Eq, PartialOrd, Ord, Hash, AsRef<str>, Borrow<str>, Display, From<Ident>, Parse<'src>

Rust struct. An unquoted SST identifier, without a leading `@` sigil.

pub struct Ident

Fields

NameTypeDescription
0String
source

methodas_strsource

vihaco_parser::Ident::as_str

pub fn as_str(&self) -> &str

Returns

&str

Borrow the lexical text.

source

methodinto_innersource

vihaco_parser::Ident::into_inner

pub fn into_inner(self) -> String

Returns

String

Consume this value and return its owned text.

source

classQuotedStringsource

vihaco_parser::QuotedString

Bases: Debug, Clone, StructuralPartialEq, PartialEq, Eq, PartialOrd, Ord, Hash, AsRef<str>, Borrow<str>, Display, From<QuotedString>, Parse<'src>

Rust struct. The decoded contents of a quoted SST string literal.

pub struct QuotedString

Fields

NameTypeDescription
0String
source

methodas_strsource

vihaco_parser::QuotedString::as_str

pub fn as_str(&self) -> &str

Returns

&str

Borrow the lexical text.

source

methodinto_innersource

vihaco_parser::QuotedString::into_inner

pub fn into_inner(self) -> String

Returns

String

Consume this value and return its owned text.

source

classParsesource

vihaco_parser::Parse

Rust trait. A parser whose input is `&'src str` (char stream) and whose error type is `Simple<char>`.

pub trait Parse<'src>: Sized

The lifetime `‘src` is the input lifetime. Output type `Self` is owned and does not borrow from the input.

source

methodparsersource

vihaco_parser::Parse::parser

Signature
fn parser() -> impl Parser<'src, &'src str, Self, Err<Simple<'src, char>>>

Returns

impl Parser<'src, &'src str, Self, Err<Simple<'src, char>>>

source

classSurfaceInstructionsource

vihaco_parser::SurfaceInstruction

Rust trait. Marker for enums whose pattern-derived parser represents instruction syntax.

pub trait SurfaceInstruction

`#[derive(vihaco_parser_derive::Parse)]` implements this trait for enums annotated with `#[syntax_class(instruction)]` or `#[syntax_class(instruction, head = ”…”)]`.

source

functionbare_tokensource

vihaco_parser::bare_token

Signature
pub fn bare_token<'src>() -> impl Parser<'src, &'src str, String, Err<Simple<'src, char>>> + Clone

Returns

impl Parser<'src, &'src str, String, Err<Simple<'src, char>>> + Clone

Parse an unquoted token without wrapping it in BareToken.

Unlike ident, this accepts `@` because a resolver may need to interpret the token later. Quotes, pattern metacharacters, whitespace, and structural delimiters are rejected.

source

functionidentsource

vihaco_parser::ident

Signature
pub fn ident<'src>() -> impl Parser<'src, &'src str, String, Err<Simple<'src, char>>> + Clone

Returns

impl Parser<'src, &'src str, String, Err<Simple<'src, char>>> + Clone

Parse the text of an unquoted SST identifier without wrapping it in Ident.

Dots and colons are accepted for hardware and namespaced identifiers. The `@` sigil, quotes, pattern metacharacters, whitespace, and structural delimiters are rejected.

source