feat: show exact statement which must be returning at the end of a function
This commit is contained in:
@@ -75,15 +75,15 @@ object parser {
|
||||
|
||||
// Statements
|
||||
private lazy val `<program>` = Program(
|
||||
"begin" ~> many(atomic(`<func>`)),
|
||||
"begin" ~> many(`<func>`),
|
||||
`<stmt>` <~ "end"
|
||||
)
|
||||
private lazy val `<func>` = FuncDecl(
|
||||
`<type>`,
|
||||
`<ident>` <~ "(",
|
||||
atomic(`<type>`),
|
||||
atomic(`<ident>`) <~ "(",
|
||||
sepBy(`<param>`, ",") <~ ")" <~ "is",
|
||||
`<stmt>` <~ "end"
|
||||
)
|
||||
`<stmt>`
|
||||
) <~ "end"
|
||||
private lazy val `<param>` = Param(`<type>`, `<ident>`)
|
||||
private lazy val `<stmt>`: Parsley[NonEmptyList[Stmt]] =
|
||||
sepBy1(`<basic-stmt>`, ";")
|
||||
|
||||
Reference in New Issue
Block a user