aboutsummaryrefslogtreecommitdiff
path: root/lexer.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-03-10 04:19:52 +0000
committerFelix Hanley <felix@userspace.com.au>2020-03-10 04:19:52 +0000
commit78cfd8633bdf1f77b40a10929556d30042cb5dff (patch)
tree1f0fca376281352d255ef2bb5f9973d91c3c8215 /lexer.go
parent794369aa072d877cae9db28de74bdf94b00ca9e4 (diff)
downloadlexer-78cfd8633bdf1f77b40a10929556d30042cb5dff.tar.gz
lexer-78cfd8633bdf1f77b40a10929556d30042cb5dff.tar.bz2
Add Tokens() returning the internal channelv0.1.1
Diffstat (limited to 'lexer.go')
-rw-r--r--lexer.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/lexer.go b/lexer.go
index 5dff2c8..35daff9 100644
--- a/lexer.go
+++ b/lexer.go
@@ -203,6 +203,11 @@ func (l *Lexer) SkipWhitespace() {
}
}
+// Tokens returns the a token channel.
+func (l *Lexer) Tokens() <-chan Token {
+ return l.tokens
+}
+
// NextToken returns the next token from the lexer and done
func (l *Lexer) NextToken() (*Token, bool) {
if tok, ok := <-l.tokens; ok {