1
0
Fork 0

Parser is aware of lexer errors #finally

This commit is contained in:
Gregory Eremin 2015-02-18 00:36:52 +07:00
parent b3068f0e16
commit 6bcd7fd2e7
1 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,10 @@ func (p *Parser) pushValue(item lexer.Item) {
func (p *Parser) next() lexer.Item { func (p *Parser) next() lexer.Item {
if item, ok := p.lex.NextItem(); ok { if item, ok := p.lex.NextItem(); ok {
if item.Token == lexer.Error {
panic(item)
}
fmt.Println(item) fmt.Println(item)
return item return item
} else { } else {