Fixed error when parsing a function with no arguments
This commit is contained in:
parent
d5f02cf1d5
commit
cb297bf75e
|
@ -195,6 +195,9 @@ fn parse_fn_params(tokens: &mut Vec<Token>) -> Result<Vec<(Ident, LocBox<Type>)>
|
|||
let mut args = Vec::new();
|
||||
utils::check_consume_or_err(tokens, TokenType::Delim(Delimiter::ParenL), "")?;
|
||||
while !tokens.is_empty() {
|
||||
if let Some(_) = utils::check(tokens, TokenType::Delim(Delimiter::ParenR)) {
|
||||
break;
|
||||
}
|
||||
let name = utils::check_consume_or_err(tokens, TokenType::ident(""), "")?;
|
||||
utils::check_consume_or_err(tokens, TokenType::Punct(Punctuation::Colon), "")?;
|
||||
//dbg!(&name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user