diff --git a/src/parsing.cpp b/src/parsing.cpp index bb8a3f9..b356a5a 100644 --- a/src/parsing.cpp +++ b/src/parsing.cpp @@ -391,7 +391,25 @@ namespace parsing { std::optional param_name{}; if (inner.peek().type == token::Type::Ident) { param_name = inner.expect(token::Type::Ident).content; + + std::cout << inner.peek().formatted() << std::endl; + auto postfix = parse_array_postfix(inner, true); + while (postfix.ok()) { + auto array_postfix = postfix.unwrap(); + if (array_postfix) { + param_ty = std::shared_ptr{ + new types::ArrayType(param_ty, *array_postfix) + }; + } + else { + param_ty = std::shared_ptr{ + new types::PointerType(param_ty) + }; + } + postfix = parse_array_postfix(inner, true); + } } + params.push_back(std::pair(param_name, std::move(param_ty))); }