Skip to main content

Module functions

Module functions 

Source
Expand description

Auto-generated module

🤖 Generated with SplitRS

Re-exports§

pub use crate::ast_impl::Decl;
pub use crate::ast_impl::Located;
pub use crate::ast_impl::SurfaceExpr;
pub use crate::error_impl::ParseError;
pub use crate::error_impl::ParseErrorKind;
pub use crate::lexer::Lexer;
pub use crate::parser_impl::Parser;
pub use crate::tokens::Span;
pub use crate::tokens::Token;
pub use crate::tokens::TokenKind;

Functions§

collect_results
Collect a sequence of Results, stopping at the first error.
consume
Consume a specific token.
consume_ident
Consume any identifier.
count_until
Count tokens from pos until end_token (exclusive).
find_matching_close
Find the matching closing token for an open bracket at pos.
ident_at
Extracts the identifier at a given byte position.
is_keyword
Checks if a string is a keyword in OxiLean.
is_multi_char_op
Checks if a string is a multi-char operator.
is_operator_start
Checks if a character is a valid start of an operator.
is_valid_decl
Check whether a source string is parseable as a declaration.
is_valid_expr
Check whether a source string is parseable as an expression.
is_valid_identifier
Checks if a string is a valid OxiLean identifier.
line_col_to_offset
Computes byte offset from line and column in source.
nesting_depth_at
Computes the nesting depth at a given position in source.
offset_to_line_col
Computes line and column from byte offset in source.
parse_decl
Parse a single declaration from source text.
parse_decls
Parse all declarations in a source file.
parse_expr
Parse a single expression from source text.
parse_ident
A simple token-based identifier parser (returns name + new pos).
parse_many0
A simple parser combinator: many0 (zero or more).
parse_many1
A simple parser combinator: many1 (one or more).
parse_number
A simple token-based number parser.
parse_optional
A simple parser combinator: optional.
parse_parens
Parse a parenthesised sequence.
parse_sep_by
A simple parser combinator: separated list.
parse_string_lit
A simple token-based string literal parser.
peek
A utility to peek at token pos without consuming it.