summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-07-30 17:43:39 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-07-30 17:43:39 -0400
commit752b1fe51666166eb5f1df593edfa68324077af0 (patch)
treec13eaec2a50cd855cb04bafe4c5cf56405c0ffbf
parent655f2bc59e11ccd16229f2e7474b013e585192fb (diff)
Correct order of arguments to Regex.replace
-rw-r--r--src/regex.urs2
-rw-r--r--src/regex__FFI.cc4
-rw-r--r--src/regex__FFI.js2
-rw-r--r--src/regex__FFI.urs2
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