Skip to content

Commit aee04a5

Browse files
committed
fix: bitmap arrays were not being set to their proper type in parser
1 parent 3690ea4 commit aee04a5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/source/pl/core/parser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,7 @@ namespace pl::core {
22112211
} else if (MATCHES(sequence(tkn::Literal::Identifier, tkn::Separator::LeftBracket) && sequence<Not>(tkn::Separator::LeftBracket))){
22122212
// (parseType) Identifier[[(parseMathematicalExpression)|(parseWhileStatement)]];
22132213
auto fieldName = getValue<Token::Identifier>(-2).get();
2214+
auto identifier = std::get_if<Token::Identifier>(&((m_curr[-2]).value));
22142215

22152216
hlp::safe_unique_ptr<ast::ASTNode> size;
22162217
if (sequence(tkn::Keyword::While, tkn::Separator::LeftParenthesis))
@@ -2225,7 +2226,8 @@ namespace pl::core {
22252226
error("Expected ']' at end of array declaration, got {}.", getFormattedToken(0));
22262227
return nullptr;
22272228
}
2228-
2229+
if (identifier != nullptr)
2230+
identifier->setType(Token::Identifier::IdentifierType::PatternVariable);
22292231
member = create<ast::ASTNodeBitfieldArrayVariableDecl>(fieldName, std::move(type), std::move(size));
22302232
} else if (sequence(tkn::Literal::Identifier)) {
22312233
// (parseType) Identifier;

0 commit comments

Comments
 (0)