Fixing concurrency problems

dev
Nick Dumas 1 year ago
parent 949b5c240e
commit 10076d69ea

@ -44,9 +44,11 @@ func lexIdent(l *Lexer) stateFn {
case isHeading(s): case isHeading(s):
l.emit(ItemIdent) l.emit(ItemIdent)
return lexHeading return lexHeading
} }
} }
return nil panic("we shouldn't be here")
return nil // this shouldn't ever be reached
} }
func lexHeading(l *Lexer) stateFn { func lexHeading(l *Lexer) stateFn {
@ -78,7 +80,8 @@ func lexText(l *Lexer) stateFn {
r := l.next() r := l.next()
switch { switch {
case r == EOF || r == '\n': case r == EOF || r == '\n':
return l.errorf("wikilink terminated incorrectly") l.emit(ItemText)
return nil
} }
} }
} }

Loading…
Cancel
Save