changeset 2045:534577e429e1

Added javascript for Basis.strsindex
author Samuel Dukhovni <dukhovni@mit.edu>
date Mon, 28 Jul 2014 20:18:43 -0400
parents 42ae25a354f8
children ced78ef1c82f
files lib/js/urweb.js src/settings.sml
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Jul 29 14:46:06 2014 -0400
+++ b/lib/js/urweb.js	Mon Jul 28 20:18:43 2014 -0400
@@ -1212,6 +1212,13 @@
     else
         return r;
 }
+function ssidx(h, n) {
+    var r = h.indexOf(n);
+    if (r == -1)
+        return null;
+    else
+        return r;
+}
 function sspn(s, chs) {
     for (var i = 0; i < s.length; ++i)
         if (chs.indexOf(s.charAt(i)) != -1)
--- a/src/settings.sml	Tue Jul 29 14:46:06 2014 -0400
+++ b/src/settings.sml	Mon Jul 28 20:18:43 2014 -0400
@@ -289,6 +289,7 @@
                           ("strsuffix", "suf"),
                           ("strlen", "slen"),
                           ("strindex", "sidx"),
+                          ("strsindex", "ssidx"),
                           ("strchr", "schr"),
                           ("substring", "ssub"),
                           ("strcspn", "sspn"),