Skip to content

Commit

Permalink
refactor infix parser
Browse files Browse the repository at this point in the history
  • Loading branch information
KeenS committed May 29, 2022
1 parent fddb6bb commit 675145f
Show file tree
Hide file tree
Showing 2 changed files with 289 additions and 155 deletions.
10 changes: 10 additions & 0 deletions src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,16 @@ pub enum BIF {
LeChar,
}

pub trait HaveLocation {
fn span(&self) -> Span;
}

impl<Ty, T> HaveLocation for Annot<Ty, T> {
fn span(&self) -> Span {
self.span.clone()
}
}

impl<Ty, Inner> Annot<Ty, Inner> {
pub fn boxed(self) -> Box<Self> {
Box::new(self)
Expand Down
Loading

0 comments on commit 675145f

Please sign in to comment.