lang: state with confusing error
This commit is contained in:
parent
198c74c7ae
commit
bfd4b3765f
5 changed files with 74 additions and 24 deletions
|
@ -4,12 +4,12 @@ use indexmap::IndexMap;
|
|||
|
||||
use super::{Span, Spanned};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct File<'src> {
|
||||
pub decls: IndexMap<Spanned<&'src str>, Expression<'src>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct Expression<'src> {
|
||||
pub expr: Expr<'src>,
|
||||
pub span: Span,
|
||||
|
@ -21,7 +21,7 @@ impl<'src> Expression<'src> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Expr<'src> {
|
||||
Node(
|
||||
Spanned<&'src str>,
|
||||
|
@ -45,4 +45,13 @@ pub enum Expr<'src> {
|
|||
// @
|
||||
InputVar(&'src str),
|
||||
AttrSet(Spanned<IndexMap<Spanned<&'src str>, Expression<'src>>>),
|
||||
Lit(Lit<'src>),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Lit<'src> {
|
||||
// TODO: more bigger better number types
|
||||
Int(i64),
|
||||
Float(f64),
|
||||
String(&'src str),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue