Replaced all the *Box with a generic LocBox<T>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::{parser::Delimiter, tokeniser::Token};
|
||||
use crate::{common::loc::LocBox, parser::Delimiter, tokeniser::Token};
|
||||
|
||||
use super::{ast::{typ::{Type, TypeBox}, TokenType}, expr::parse_expr, utils, Keyword, Punctuation};
|
||||
use super::{ast::{typ::Type, TokenType}, expr::parse_expr, utils, Keyword, Punctuation};
|
||||
|
||||
pub fn parse_type(tokens: &mut Vec<Token>) -> Result<TypeBox> {
|
||||
pub fn parse_type(tokens: &mut Vec<Token>) -> Result<LocBox<Type>> {
|
||||
let mut ref_cnt = Vec::new();
|
||||
let mut loc = None;
|
||||
while let Some(tok) = utils::check_consume(tokens, TokenType::Punct(Punctuation::Ampersand)) {
|
||||
@@ -60,5 +60,5 @@ pub fn parse_type(tokens: &mut Vec<Token>) -> Result<TypeBox> {
|
||||
_ => unreachable!()
|
||||
}
|
||||
}
|
||||
Ok(TypeBox::new(&loc.unwrap(), typ))
|
||||
Ok(LocBox::new(&loc.unwrap(), typ))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user