Parser is aware of lexer errors #finally
This commit is contained in:
parent
b3068f0e16
commit
6bcd7fd2e7
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue