diff options
| author | Felix Hanley <felix@userspace.com.au> | 2020-07-31 03:42:25 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2020-07-31 03:42:25 +0000 |
| commit | 3995bd02a8fc232eaf705588c61dbbc085ad23a5 (patch) | |
| tree | c14e23405c55762b763be261c95c0f228cb4a7d7 /lexer.go | |
| parent | 78cfd8633bdf1f77b40a10929556d30042cb5dff (diff) | |
| download | lexer-3995bd02a8fc232eaf705588c61dbbc085ad23a5.tar.gz lexer-3995bd02a8fc232eaf705588c61dbbc085ad23a5.tar.bz2 | |
Diffstat (limited to 'lexer.go')
| -rw-r--r-- | lexer.go | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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. |
