mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-15 18:05:03 +01:00
use ref instead of box for ast
This commit is contained in:
parent
62e4ffac6c
commit
5e66841577
2 changed files with 31 additions and 48 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
use crate::errors::Span;
|
||||
use crate::value::Symbol;
|
||||
use bumpalo::boxed::Box;
|
||||
use bumpalo::collections::Vec;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
|
|
@ -63,7 +62,7 @@ pub struct IfStmt<'ast> {
|
|||
pub span: Span,
|
||||
pub cond: Expr<'ast>,
|
||||
pub body: Block<'ast>,
|
||||
pub else_part: Option<Box<'ast, ElsePart<'ast>>>,
|
||||
pub else_part: Option<&'ast ElsePart<'ast>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
|
|
@ -92,9 +91,9 @@ pub struct WhileStmt<'ast> {
|
|||
pub enum Expr<'ast> {
|
||||
Ident(Ident),
|
||||
Literal(Literal<'ast>),
|
||||
UnaryOp(Box<'ast, UnaryOp<'ast>>),
|
||||
BinaryOp(Box<'ast, BinaryOp<'ast>>),
|
||||
Call(Box<'ast, Call<'ast>>),
|
||||
UnaryOp(&'ast UnaryOp<'ast>),
|
||||
BinaryOp(&'ast BinaryOp<'ast>),
|
||||
Call(&'ast Call<'ast>),
|
||||
}
|
||||
|
||||
impl Expr<'_> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue