Add Endor source reader before lexing with provenance and URI provider
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 6m53s
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 6m53s
This commit is contained in:
@@ -4,6 +4,17 @@ use crate::ast::{
|
||||
use crate::lexer::decode_string;
|
||||
use crate::{Diagnostic, DiagnosticKind, Span, Token, TokenKind, lex};
|
||||
|
||||
/// Parse a reader snapshot, retaining its origin and resolved revision on error.
|
||||
pub fn parse_source(source: &crate::SourceUnit) -> Result<Program, crate::SourceDiagnostic> {
|
||||
parse(source.text()).map_err(|error| source.annotate(error))
|
||||
}
|
||||
|
||||
pub fn parse_source_expression(
|
||||
source: &crate::SourceUnit,
|
||||
) -> Result<Expr, crate::SourceDiagnostic> {
|
||||
parse_expression(source.text()).map_err(|error| source.annotate(error))
|
||||
}
|
||||
|
||||
/// Parse one or more basic typed function declarations. This is a syntax
|
||||
/// operation: type names and name references are retained without resolution.
|
||||
pub fn parse(source: &str) -> Result<Program, Diagnostic> {
|
||||
|
||||
Reference in New Issue
Block a user