blynn / nex

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

add api to stop leaked goroutine #41

Closed wolfkdy closed 7 years ago

wolfkdy commented 7 years ago

Hi, I want to add a Stop Method for Lex. When other goroutines create a Lex instance but didnot input until EOF happens. the goroutine inside lex will hang there forever. In this case, we can add a stop-channel so that other goroutines can stop it manually.

blynn commented 7 years ago

Thanks!