Return an error instead of printing stray illegal\n to stdout.

This commit is contained in:
Sean Chittenden 2017-04-20 16:09:49 -07:00
parent 630949a3c5
commit 20ef8cf57f
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16

View File

@ -147,7 +147,7 @@ func (p *Parser) objectKey() ([]*ast.ObjectKey, error) {
// Done
return keys, nil
case token.ILLEGAL:
fmt.Println("illegal")
return nil, errors.New("illegal")
default:
return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type)
}