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