lang: start implementing parser combinators (i have no idea what i'm doing)
also, the current test.owo crashes for some reason. this is a headache. manual/imperative parsers are a nightmare.
This commit is contained in:
parent
9da157ff4a
commit
2d59a7f560
2 changed files with 18 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
|||
use std::borrow::Borrow;
|
||||
|
||||
use chumsky::container::Container;
|
||||
use rowan::{
|
||||
Checkpoint, GreenNode, GreenNodeBuilder, GreenNodeData, GreenTokenData, Language, NodeOrToken,
|
||||
};
|
||||
|
@ -12,6 +11,23 @@ use crate::parser::{
|
|||
|
||||
use super::lex::{self, SyntaxKind};
|
||||
|
||||
mod parsers {
|
||||
use rowan::GreenNode;
|
||||
|
||||
use crate::parser::ast::lossless::lex::SyntaxKind;
|
||||
|
||||
use super::SyntaxError;
|
||||
|
||||
struct ParseResult {
|
||||
green_node: GreenNode,
|
||||
errors: Vec<SyntaxError>,
|
||||
}
|
||||
|
||||
trait Parser {
|
||||
fn parse<'src>(input: &[(SyntaxKind, &'src str)]) -> ParseResult;
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub struct Parse {
|
||||
pub green_node: GreenNode,
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
};
|
||||
|
||||
pre-commit.hooks = {
|
||||
clippy.enable = true;
|
||||
clippy.enable = false;
|
||||
rustfmt.enable = true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue