lang: some small, unfinished stuff
This commit is contained in:
parent
b6e304fa78
commit
8d7401531e
3 changed files with 13 additions and 20 deletions
|
@ -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>,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
// @
|
||||
|
|
|
@ -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..])]
|
||||
|
|
Loading…
Reference in a new issue