You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when (lengthnsFromKeys/=lengthnsToVals) $ throwError $ErrorCall"builtins.replaceStrings: Arguments `from`&`to` construct a key-value map, so the number of their elements must always match."
947
+
when (lengthfromKeys/=lengthtoVals) $ throwError $ErrorCall"builtins.replaceStrings: Arguments `from`&`to` construct a key-value map, so the number of their elements must always match."
948
948
949
949
let
950
-
go remainder processed ctx =
951
-
case maybePrefixMatch remainder of
950
+
-- 2021-02-18: NOTE: if there is no match - the process does not changes the context, but walks the string.
951
+
-- So it should be more effective to have context as the first argument.
952
+
go remaining processed ctx =
953
+
case maybePrefixMatch remaining of
952
954
Nothing->
953
955
-- Chip away chars until match
954
-
stepOneCharNgo remainder processed ctx
955
-
Just (matched, replacementNS, rest) ->
956
+
stepOneCharNgo remaining processed ctx
957
+
Just (matched, replacementNS, tailNS) ->
956
958
-- Allowing match on "" is a bug-quirk of Nix,
957
959
-- when "" is checked - it always matches. And so - when it checks - it always insers a replacement, and then process simply passesthrough the char that was under match.
0 commit comments