aboutsummaryrefslogtreecommitdiff
path: root/lexer.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-07-31 03:42:25 +0000
committerFelix Hanley <felix@userspace.com.au>2020-07-31 03:42:25 +0000
commit3995bd02a8fc232eaf705588c61dbbc085ad23a5 (patch)
treec14e23405c55762b763be261c95c0f228cb4a7d7 /lexer.go
parent78cfd8633bdf1f77b40a10929556d30042cb5dff (diff)
downloadlexer-3995bd02a8fc232eaf705588c61dbbc085ad23a5.tar.gz
lexer-3995bd02a8fc232eaf705588c61dbbc085ad23a5.tar.bz2
Synchronous testsHEADmaster
Diffstat (limited to 'lexer.go')
-rw-r--r--lexer.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/lexer.go b/lexer.go
index 35daff9..85c5220 100644
--- a/lexer.go
+++ b/lexer.go
@@ -64,13 +64,7 @@ func New(src string, start StateFunc) *Lexer {
// Start begins executing the Lexer in an asynchronous manner (using a goroutine).
func (l *Lexer) Start() {
- // Take half the string length as a buffer size.
- buffSize := len(l.source) / 2
- if buffSize <= 0 {
- buffSize = 1
- }
- l.tokens = make(chan Token, buffSize)
- go l.run()
+ go l.StartSync()
}
// StartSync starts the lexer synchronously.