Make anchors aware of the nodes they point to
This commit is contained in:
parent
eb96b456ef
commit
3fa399c317
31 changed files with 366 additions and 230 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use parser::{token::Token, lexeme::Lexeme};
|
||||
|
||||
use crate::types::Config;
|
||||
use crate::types::Graph;
|
||||
|
||||
pub mod parser;
|
||||
|
||||
|
|
@ -8,12 +8,13 @@ pub trait Parseable: std::fmt::Display {
|
|||
fn probe(lexeme: &Lexeme) -> bool;
|
||||
fn lex(lexeme: &Lexeme) -> Self;
|
||||
fn render(&self) -> String;
|
||||
fn flatten(&self) -> String;
|
||||
}
|
||||
|
||||
type Probe = fn(&Lexeme) -> bool;
|
||||
type Lexer = fn(&Lexeme) -> Token;
|
||||
type LexMap<'lm> = &'lm [(Probe, Lexer)];
|
||||
|
||||
pub fn parse(text: &str, config: &Config) -> String {
|
||||
parser::read(text, config)
|
||||
pub fn parse(text: &str, graph: &Graph) -> String {
|
||||
parser::read(text, graph)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue