mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
patterns: Fixed multiple parse and evaluate issues
This commit is contained in:
@@ -365,7 +365,8 @@ namespace hex::lang {
|
||||
std::vector<std::string> params;
|
||||
|
||||
// Parse parameter list
|
||||
while (MATCHES(sequence(IDENTIFIER))) {
|
||||
bool hasParams = MATCHES(sequence(IDENTIFIER));
|
||||
while (hasParams) {
|
||||
params.push_back(getValue<std::string>(-1));
|
||||
|
||||
if (!MATCHES(sequence(SEPARATOR_COMMA))) {
|
||||
@@ -375,6 +376,10 @@ namespace hex::lang {
|
||||
throwParseError("expected closing ')' after parameter list");
|
||||
}
|
||||
}
|
||||
if (!hasParams) {
|
||||
if (!MATCHES(sequence(SEPARATOR_ROUNDBRACKETCLOSE)))
|
||||
throwParseError("expected closing ')' after parameter list");
|
||||
}
|
||||
|
||||
if (!MATCHES(sequence(SEPARATOR_CURLYBRACKETOPEN)))
|
||||
throwParseError("expected opening '{' after function definition");
|
||||
|
||||
Reference in New Issue
Block a user