feat: explicit invalid syntax checks improvements #17

Merged
gk1623 merged 6 commits from more-explicit-invalid-syntax into master 2025-02-07 16:42:38 +00:00
Showing only changes of commit 959c556eae - Show all commits

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"
) )