fix: use verifiedExplain for missing return type check

This commit is contained in:
Gleb Koval 2025-02-07 15:39:50 +00:00
parent 0955f19a81
commit 959c556eae
Signed by: cyclane
GPG Key ID: 15E168A8B332382C

View File

@ -119,7 +119,7 @@ object parser {
"begin" ~> many( "begin" ~> many(
atomic(`<type>`.label("function declaration") <~> `<ident>` <~ "(") <**> `<partial-func-decl>` atomic(`<type>`.label("function declaration") <~> `<ident>` <~ "(") <**> `<partial-func-decl>`
).label("function declaration"), ).label("function declaration"),
(atomic(`<ident>` <~ "(") ~> fail("function is missing return type") | `<stmt>`.label( (atomic(`<ident>` <~ "(").verifiedExplain("function is missing return type") | `<stmt>`.label(
"main program body" "main program body"
)) <~ "end" )) <~ "end"
) )