Merge remote-tracking branch 'origin/more-explicit-invalid-syntax' into more-explicit-invalid-syntax
This commit is contained in:
commit
cf661e6ac7
@ -121,12 +121,17 @@ object parser {
|
||||
|
||||
// Statements
|
||||
private lazy val `<program>` = Program(
|
||||
"begin" ~> many(
|
||||
atomic(`<type>`.label("function declaration") <~> `<ident>` <~ "(") <**> `<partial-func-decl>`
|
||||
).label("function declaration"),
|
||||
(atomic(`<ident>` <~ "(").verifiedExplain("function is missing return type") | `<stmt>`.label(
|
||||
"begin" ~> (
|
||||
many(
|
||||
atomic(
|
||||
`<type>`.label("function declaration") <~> `<ident>` <~ "("
|
||||
) <**> `<partial-func-decl>`
|
||||
).label("function declaration") |
|
||||
atomic(`<ident>` <~ "(").verifiedExplain("function declaration is missing return type")
|
||||
),
|
||||
`<stmt>`.label(
|
||||
"main program body"
|
||||
)) <~ "end"
|
||||
) <~ "end"
|
||||
)
|
||||
private lazy val `<partial-func-decl>` =
|
||||
FuncDecl(
|
||||
|
Loading…
x
Reference in New Issue
Block a user