From 5e2028e943f2cbcdb9fec889d0ef408ddc8af584 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 16 Oct 2016 21:23:24 +0300 Subject: [PATCH] handle parsing of unmapping and uncommanding Mentioned in #16. --- parse.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/parse.go b/parse.go index 2c2b227..8cde8c7 100644 --- a/parse.go +++ b/parse.go @@ -134,19 +134,31 @@ func (p *Parser) parseExpr() Expr { result = &SetExpr{opt, val} case "map": + var expr Expr + s.scan() keys := s.tok s.scan() - expr := p.parseExpr() + if s.typ != TokenSemicolon { + expr = p.parseExpr() + } else { + s.scan() + } result = &MapExpr{keys, expr} case "cmd": + var expr Expr + s.scan() name := s.tok s.scan() - expr := p.parseExpr() + if s.typ != TokenSemicolon { + expr = p.parseExpr() + } else { + s.scan() + } result = &CmdExpr{name, expr} default: