From 752b1fe51666166eb5f1df593edfa68324077af0 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 30 Jul 2015 17:43:39 -0400 Subject: Correct order of arguments to Regex.replace --- src/regex.urs | 2 +- src/regex__FFI.cc | 4 ++-- src/regex__FFI.js | 2 +- src/regex__FFI.urs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/regex.urs b/src/regex.urs index 9d2ad25..bd7696b 100644 --- a/src/regex.urs +++ b/src/regex.urs @@ -28,6 +28,6 @@ val match : string (* needle *) (* Replaces all substrings in 'haystack' that match 'needle' with the string 'replacement.' *) val replace : string (* needle *) - -> string (* haystack *) -> string (* replacement *) + -> string (* haystack *) -> string diff --git a/src/regex__FFI.cc b/src/regex__FFI.cc index 57d4ce8..e3ff601 100644 --- a/src/regex__FFI.cc +++ b/src/regex__FFI.cc @@ -151,8 +151,8 @@ uw_Regex__FFI_match uw_Regex__FFI_do_match(uw_context* const context, uw_Basis_string uw_Regex__FFI_replace(uw_context* const context, const uw_Basis_string needle_string, - const uw_Basis_string haystack, - const uw_Basis_string replacement) { + const uw_Basis_string replacement, + const uw_Basis_string haystack) { std::regex needle = Compile(context, needle_string); // Perform the replacement. std::string result; diff --git a/src/regex__FFI.js b/src/regex__FFI.js index c7aa880..b02f059 100644 --- a/src/regex__FFI.js +++ b/src/regex__FFI.js @@ -43,7 +43,7 @@ doMatch: function(needle, haystack) { return haystack.match(UrWeb.Regex._compile(needle)); }, -replace: function(needle, haystack, replacement) { +replace: function(needle, replacement, haystack) { return haystack.replace(UrWeb.Regex._compile(needle), replacement); }, diff --git a/src/regex__FFI.urs b/src/regex__FFI.urs index f01a27e..0f10052 100644 --- a/src/regex__FFI.urs +++ b/src/regex__FFI.urs @@ -32,6 +32,6 @@ val do_match : string (* needle *) (* Replaces all substrings in 'haystack' that match 'needle' with the string 'replacement.' *) val replace : string (* needle *) - -> string (* haystack *) -> string (* replacement *) + -> string (* haystack *) -> string -- cgit v1.2.3