handle parsing of unmapping and uncommanding

Mentioned in #16.
This commit is contained in:
Gokcehan 2016-10-16 21:23:24 +03:00
parent 5d0dfcde79
commit 5e2028e943

View File

@ -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: