svg-filters & basic parser #15

Merged
schrottkatze merged 67 commits from schrottkatze/iowo:svg-filters into main 2024-07-08 18:29:05 +00:00
3 changed files with 13 additions and 20 deletions
Showing only changes of commit 8d7401531e - Show all commits

View file

@ -100,14 +100,3 @@ pub(crate) fn parser<
decls: IndexMap::from_iter(decls),
}))
}
pub mod asg {
use std::collections::BTreeMap;
use petgraph::{adj::NodeIndex, data::Build, graph::DiGraph};
use super::{ast::Expr, Spanned};
pub struct Asg<'src> {
ast: Expr<'src>,
}
}

View file

@ -28,18 +28,18 @@ pub enum Expr<'src> {
Option<Spanned<IndexMap<Spanned<&'src str>, Expression<'src>>>>,
),
SimplePipe(Box<Expression<'src>>, Box<Expression<'src>>),
NamingPipe(
Box<Expression<'src>>,
(Vec<Spanned<&'src str>>, Vec<Spanned<&'src str>>),
Box<Expression<'src>>,
),
// NamingPipe(
// Box<Expression<'src>>,
// (Vec<Spanned<&'src str>>, Vec<Spanned<&'src str>>),
// Box<Expression<'src>>,
// ),
MappingPipe(Box<Expression<'src>>, Box<Expression<'src>>),
NullPipe(Box<Expression<'src>>, Box<Expression<'src>>),
MultiPipe(IndexMap<Spanned<&'src str>, Expression<'src>>),
LetIn(
IndexMap<Spanned<&'src str>, Box<Expression<'src>>>,
Box<Expression<'src>>,
),
// LetIn(
// IndexMap<Spanned<&'src str>, Box<Expression<'src>>>,
// Box<Expression<'src>>,
// ),
// $
Var(&'src str),
// @

View file

@ -10,6 +10,10 @@ pub enum Token<'a> {
// so a declaration needs the keyword def until i can figure this out
#[token("def")]
Def,
#[token("let")]
Let,
#[token("in")]
In,
#[regex("[a-zA-Z0-9_\\-]+", |lex| lex.slice())]
Word(&'a str),
#[regex("\\$[a-zA-Z0-9_\\-]+", |lex| &lex.slice()[1..])]