refactor: scaladocs-style commenting added in parser
This commit is contained in:
parent
c6b57be2c3
commit
f9e5ae4d98
@ -48,6 +48,7 @@ object parser {
|
|||||||
case Expr
|
case Expr
|
||||||
case Pair
|
case Pair
|
||||||
|
|
||||||
|
// Lexer-backed errorBuilder
|
||||||
implicit val builder: ErrorBuilder[String] = new DefaultErrorBuilder with LexToken {
|
implicit val builder: ErrorBuilder[String] = new DefaultErrorBuilder with LexToken {
|
||||||
def tokens = errTokens
|
def tokens = errTokens
|
||||||
}
|
}
|
||||||
@ -151,8 +152,7 @@ object parser {
|
|||||||
)
|
)
|
||||||
| While("while" ~> `<expr>`.labelWithType(LabelType.Expr) <~ "do", `<stmt>` <~ "done")
|
| While("while" ~> `<expr>`.labelWithType(LabelType.Expr) <~ "do", `<stmt>` <~ "done")
|
||||||
| Block("begin" ~> `<stmt>` <~ "end")
|
| Block("begin" ~> `<stmt>` <~ "end")
|
||||||
| VarDecl(`<type>`, `<ident>` <~ "=", `<rvalue>`.label("valid initial value for variable"))
|
| VarDecl(`<type>`, `<ident>` <~ "=", `<rvalue>`)
|
||||||
// TODO: Can we inline the name of the variable in the message
|
|
||||||
| Assign(`<lvalue>` <~ "=", `<rvalue>`)
|
| Assign(`<lvalue>` <~ "=", `<rvalue>`)
|
||||||
private lazy val `<lvalue>`: Parsley[LValue] =
|
private lazy val `<lvalue>`: Parsley[LValue] =
|
||||||
`<pair-elem>` | `<ident-or-array-elem>`
|
`<pair-elem>` | `<ident-or-array-elem>`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user