solar_parse/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![doc = include_str!("../README.md")]
#![doc(
    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/solar/main/assets/logo.png",
    html_favicon_url = "https://raw.githubusercontent.com/paradigmxyz/solar/main/assets/favicon.ico"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

#[macro_use]
extern crate tracing;

use solar_interface::diagnostics::{DiagnosticBuilder, ErrorGuaranteed};

pub mod lexer;
pub use lexer::{unescape, Cursor, Lexer};

mod parser;
pub use parser::Parser;

// Convenience re-exports.
pub use bumpalo;
pub use solar_ast::{ast, token};
pub use solar_interface as interface;

/// Parser error type.
pub type PErr<'a> = DiagnosticBuilder<'a, ErrorGuaranteed>;

/// Parser result type. This is a shorthand for `Result<T, PErr<'a>>`.
pub type PResult<'a, T> = Result<T, PErr<'a>>;