From b95e5ddaa1b182dfe58a386bfc107fa7d95c4393 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Thu, 20 Apr 2023 09:36:50 +0100 Subject: Remove the need for a semicolon after each command --- main/parse.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'main/parse.go') diff --git a/main/parse.go b/main/parse.go index 8211444..e0272e8 100644 --- a/main/parse.go +++ b/main/parse.go @@ -307,14 +307,10 @@ func (p *parser) parseCommands() []Command { return commands } commands = append(commands, p.parseCommand()) - semicolon := p.next() - if semicolon.typ == TokenEOF || semicolon.typ == TokenRBrace { - p.rewind(semicolon) + endToken := p.peek() + if endToken.typ == TokenEOF || endToken.typ == TokenRBrace { return commands } - if semicolon.typ != TokenSemicolon { - panic("Expected ; after command") - } } } -- cgit v1.2.3