From 34e9aedbd60903c0d609750590abe01366aaee3d Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 27 Nov 2024 12:15:01 -0500 Subject: [PATCH] Compile lookaround regex to avoid compiling each time we want to use it --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index ef07279..e4af22f 100644 --- a/main.go +++ b/main.go @@ -469,6 +469,8 @@ func thompson(re []postfixNode) *State { state.assert = NLB } } + tmpRe := shuntingYard(state.lookaroundRegex) + state.lookaroundNFA = thompson(tmpRe) } }