fix: style fixes
This commit is contained in:
parent
4602b75628
commit
057d625464
@ -73,11 +73,15 @@ object parser {
|
|||||||
)
|
)
|
||||||
private lazy val `<pair-elem-type>` =
|
private lazy val `<pair-elem-type>` =
|
||||||
(`<base-type>` <**> (`<array-type>` </> identity)) |
|
(`<base-type>` <**> (`<array-type>` </> identity)) |
|
||||||
`<pair-type>` ~> ((`<pair-elems-type>` <**> `<array-type>`.explain("for a pair to contain a pair type, it must be an array or erased pair")) </> UntypedPairType)
|
`<pair-type>` ~> ((`<pair-elems-type>` <**> `<array-type>`.explain(
|
||||||
|
"for a pair to contain a pair type, it must be an array or erased pair"
|
||||||
|
)) </> UntypedPairType)
|
||||||
// TODO: better explanation here?
|
// TODO: better explanation here?
|
||||||
// Statements
|
// Statements
|
||||||
private lazy val `<program>` = Program(
|
private lazy val `<program>` = Program(
|
||||||
"begin" ~> many(atomic(`<type>`.label("function declaration") <~> `<ident>` <~ "(") <**> `<partial-func-decl>`).label("function declaration"),
|
"begin" ~> many(
|
||||||
|
atomic(`<type>`.label("function declaration") <~> `<ident>` <~ "(") <**> `<partial-func-decl>`
|
||||||
|
).label("function declaration"),
|
||||||
`<stmt>`.label("main program body") <~ "end"
|
`<stmt>`.label("main program body") <~ "end"
|
||||||
)
|
)
|
||||||
private lazy val `<partial-func-decl>` =
|
private lazy val `<partial-func-decl>` =
|
||||||
@ -126,7 +130,7 @@ object parser {
|
|||||||
) | `<expr>`.label("valid expression")
|
) | `<expr>`.label("valid expression")
|
||||||
private lazy val `<pair-elem>` =
|
private lazy val `<pair-elem>` =
|
||||||
Fst("fst" ~> `<lvalue>`.label("a valid pair"))
|
Fst("fst" ~> `<lvalue>`.label("a valid pair"))
|
||||||
| Snd("snd" ~> `<lvalue>`.label("a valid pair"))
|
| Snd("snd" ~> `<lvalue>`.label("a valid pair"))
|
||||||
private lazy val `<array-liter>` = ArrayLiter(
|
private lazy val `<array-liter>` = ArrayLiter(
|
||||||
"[" ~> sepBy(`<expr>`, ",") <~ "]"
|
"[" ~> sepBy(`<expr>`, ",") <~ "]"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user