File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -961,25 +961,24 @@ replaceStrings tfrom tto ts =
961961
962962 go orig resultAccum ctx = case lookupPrefix orig of
963963 Nothing ->
964- maybe
965- (finish resultAccum)
966- (\ (h, t) -> go t (resultAccum <> Builder. singleton h))
967- (Text. uncons orig)
968- ctx
964+ process resultAccum orig ctx
969965 Just (prefix, replacementNS, rest) ->
970- (if prefix == mempty
966+ ( if prefix == mempty
971967 then
972- maybe
973- (finish newResultAccum)
974- (\ (h,t) -> go t (newResultAccum <> Builder. singleton h))
975- (Text. uncons rest)
968+ process newResultAccum rest
976969 else
977- go rest newResultAccum)
978- (ctx <> newCtx)
970+ go rest newResultAccum
971+ ) (ctx <> newCtx)
979972 where
980973 replacement = Builder. fromText $ stringIgnoreContext replacementNS
981974 newResultAccum = resultAccum <> replacement
982975 newCtx = NixString. getContext replacementNS
976+ where
977+ process r t =
978+ maybe
979+ (finish r)
980+ (\ (h, t) -> go t (r <> Builder. singleton h))
981+ (Text. uncons t)
983982 toValue
984983 $ go (stringIgnoreContext ns) mempty
985984 $ NixString. getContext ns
You can’t perform that action at this time.
0 commit comments