Skip to content

Instantly share code, notes, and snippets.

@korzio
Last active February 6, 2021 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korzio/2502354aa734046a29d0c4f144e8db99 to your computer and use it in GitHub Desktop.
Save korzio/2502354aa734046a29d0c4f144e8db99 to your computer and use it in GitHub Desktop.
func (l *Lexer) Tokens() rxgo.Observable {
return l.observable.
Filter(func(i interface{}) bool {
var str = i.(string)
return !isWhitespace(str)
})
// next operator
}
func isWhitespace(ch string) bool {
return ch == " " || ch == "\t" || ch == "\n" || ch == "\r"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment