blynn / nex

Lexer for Go
http://cs.stanford.edu/~blynn/nex/
GNU General Public License v3.0
416 stars 47 forks source link

no way to change func (yylex Lexer) Error(e string) #24

Closed ellisonch closed 6 years ago

ellisonch commented 9 years ago

As far as I can tell, there doesn't seem to be a way to change the func (yylex Lexer) Error(e string) function. This function gets called automatically from a go tool yacc generated parser, so it would be nice to be able to customize it.

purpleidea commented 7 years ago

UTSL...

add -e to the nex call and add the function in your foo.nex:

// YOLO
func (yylex Lexer) Error(e string) {
        fmt.Println("WE ERROR!!!")
        panic(e)
}
purpleidea commented 6 years ago

This issue can be closed.

purpleidea commented 6 years ago

Closing because I think this is solved. If not please open a new issue.