Add external functions (both import and export), make includes work
still need to fix literal arrays, it has the same problem as struct literals had with moving the literal into memory and modifying the memory with variables
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use anyhow::{Result, bail};
|
||||
|
||||
use crate::{common::loc::LocBox, lerror, parser::{Delimiter, ast::{expr::Expr, literal::Literal}}, tokeniser::Token};
|
||||
use crate::{cli::CliArgs, common::loc::LocBox, lerror, parser::{Delimiter, ast::{expr::Expr, literal::Literal}}, tokeniser::Token};
|
||||
|
||||
use super::{ast::{typ::Type, TokenType}, expr::parse_expr, utils, Keyword, Punctuation};
|
||||
|
||||
@@ -25,7 +25,7 @@ pub fn parse_type(tokens: &mut Vec<Token>) -> Result<LocBox<Type>> {
|
||||
}
|
||||
let itm_typ = parse_type(tokens)?;
|
||||
if let Some(_) = utils::check_consume(tokens, TokenType::Punct(Punctuation::Semi)) {
|
||||
let count = parse_expr(tokens, 0, false)?.unwrap();
|
||||
let count = parse_expr(tokens, 0, false, &CliArgs::default())?.unwrap();
|
||||
|
||||
match count.inner() {
|
||||
Expr::Literal(_, Literal::Number(_)) |
|
||||
|
||||
Reference in New Issue
Block a user