Signed-off-by: Jean Privat <jean@pryen.org>
+ # Consume comments and end of lines if any
+ fun consume_comments do
+ while current_token isa TEol or current_token isa TComment do visit current_token
+ end
+
# Visit `current_token`.
fun consume(token: String) do
# Visit `current_token`.
fun consume(token: String) do
if current_token.text == token then else current_token.debug("Got `{current_token.text}`; expected `{token}`.")
visit current_token
end
if current_token.text == token then else current_token.debug("Got `{current_token.text}`; expected `{token}`.")
visit current_token
end
- while not v.current_token isa TKwelse do
- v.consume v.current_token.text
- end