Saved location in tokens post parsing, fixed parsing just skipping stuff
(shoulda thought of that)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use typ::Type;
|
||||
use statement::{Enum, Function, Struct, TypeAlias};
|
||||
|
||||
pub use crate::tokeniser::tokentype::*;
|
||||
|
||||
@@ -12,17 +12,17 @@ pub mod typ;
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Program {
|
||||
pub ast: expr::Block,
|
||||
pub structs: HashMap<Ident, HashMap<Ident, usize>>,
|
||||
pub enums: HashMap<Ident, usize>,
|
||||
pub types: HashMap<Type, Type>,
|
||||
pub functions: HashMap<Ident, (Vec<(Ident, Type)>, Type)>,
|
||||
pub member_functions: HashMap<Ident, HashMap<Ident, (Vec<(Ident, Type)>, Type)>>,
|
||||
pub structs: HashMap<Ident, Struct>,
|
||||
pub enums: HashMap<Ident, Enum>,
|
||||
pub types: HashMap<Ident, TypeAlias>,
|
||||
pub functions: HashMap<Ident, Function>,
|
||||
pub member_functions: HashMap<Ident, HashMap<Ident, Function>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Ast {
|
||||
Expr(expr::Expr),
|
||||
Statement(statement::Statement),
|
||||
Expr(expr::ExprBox),
|
||||
Statement(statement::StatementBox),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user