derete the fil #2
|
@ -106,9 +106,8 @@ proc done(self: Parser): bool =
|
|||
## end of the file. Note that the
|
||||
## parser expects an explicit
|
||||
## EOF token to signal the end
|
||||
## of the file (unless the token
|
||||
## list is empty)
|
||||
result = self.tokens.len() == 0 or self.peek().kind == EndOfFile
|
||||
## of the file
|
||||
result = self.peek().kind == EndOfFile
|
||||
|
||||
|
||||
proc step(self: Parser, n: int = 1): Token =
|
||||
|
@ -172,7 +171,7 @@ proc match(self: Parser, kind: openarray[TokenType]): bool =
|
|||
|
||||
proc expect(self: Parser, kind: TokenType, message: string = "") =
|
||||
## Behaves like self.match(), except that
|
||||
## when a token doesn't match an error
|
||||
## when a token doesn't match, an error
|
||||
## is raised. If no error message is
|
||||
## given, a default one is used
|
||||
if not self.match(kind):
|
||||
|
|
Loading…
Reference in New Issue