No need to create extra variable

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-04 10:02:00 +00:00
parent b5da299ea3
commit e0bcd5ff37

View file

@ -176,7 +176,7 @@ func (p *parser) shouldBe(expected ...Token) (tok Token, lit string, err error)
tok, lit, _ = p.scan() tok, lit, _ = p.scan()
if found := p.in(tok, expected); !found { if !p.in(tok, expected) {
p.unscan() p.unscan()
err = &ParseError{Found: lit, Expected: lookup(expected)} err = &ParseError{Found: lit, Expected: lookup(expected)}
} }