From b9e1bab0756cef199981f6b8a9a46560f25d14a8 Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Sat, 1 Jul 2023 19:50:19 -0400 Subject: [PATCH] More concurrency debugging --- lexer.go | 1 + states.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lexer.go b/lexer.go index fe50d92..f4bda94 100644 --- a/lexer.go +++ b/lexer.go @@ -150,6 +150,7 @@ func (l *Lexer) next() rune { } func (l *Lexer) run() { + defer l.chanMutex.Unlock() for state := lexText; state != nil; { state = state(l) } diff --git a/states.go b/states.go index 6725eb0..f76f686 100644 --- a/states.go +++ b/states.go @@ -2,6 +2,8 @@ package wikilink import ( "strings" + + "go.uber.org/zap" ) func isOpenLink(s string) bool { @@ -27,6 +29,9 @@ func isBlockRef(s string) bool { func lexIdent(l *Lexer) stateFn { for { r := l.next() + l.L.Named("lexIdent").Debug("stepping through lexIdent", + zap.String("r", string(r)), + ) s := l.input[l.GetPos():] if r == '\\' { // i think this will handle escape characters? break