mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 12:28:12 +02:00
[script] Correctly parse multiple parameter functions and allow dangeling comma
Typo was causing parsing errors.
This commit is contained in:
parent
7901df33f9
commit
b2e08f4968
1 changed files with 5 additions and 5 deletions
|
|
@ -139,7 +139,7 @@ static script_exp* script_parse_exp_pi (ply_scan_t* scan)
|
|||
script_parse_error (curtoken, "Function parameters should be separated with a ',' and terminated with a ')'");
|
||||
return NULL;
|
||||
}
|
||||
ply_scan_get_next_token(scan);
|
||||
curtoken = ply_scan_get_next_token(scan);
|
||||
}
|
||||
ply_scan_get_next_token(scan);
|
||||
func->data.function.name = exp;
|
||||
|
|
@ -591,15 +591,15 @@ static script_op* script_parse_function (ply_scan_t* scan)
|
|||
curtoken = ply_scan_get_next_token(scan);
|
||||
|
||||
if (curtoken->type != PLY_SCAN_TOKEN_TYPE_SYMBOL){
|
||||
script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated ')'");
|
||||
script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated with a ')'");
|
||||
return NULL;
|
||||
}
|
||||
if (curtoken->data.symbol == ')') break;
|
||||
if (curtoken->data.symbol == ','){
|
||||
script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated ')'");
|
||||
if (curtoken->data.symbol != ','){
|
||||
script_parse_error (curtoken, "Function declaration parameters must separated with ',' and terminated with a ')'");
|
||||
return NULL;
|
||||
}
|
||||
ply_scan_get_next_token(scan);
|
||||
curtoken = ply_scan_get_next_token(scan);
|
||||
}
|
||||
|
||||
curtoken = ply_scan_get_next_token(scan);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue