Robin,

> Anyway, this bit is still relevant (though it doesn't affect
> the behaviour):

It sure doesn't add a *lot* of functionality :-) 

I resend the patch of mine as an attachment.

Tom
--- expr.cpp    Tue Nov 14 17:56:31 2000
+++ expr.cpp.new        Tue Nov 14 17:58:14 2000
@@ -2098,13 +2098,20 @@
                 E( e -> parse(t,from,leftmost - 1) );
                 int another = leftmost, 
                     lastone = leftmost;
-                t.getDelim(another);
+                // tom 24-10-00
+                // the following fails for "x and not(x and x)"
+                // t.getDelim(another);
+                // changing it to:
+                another = t.findTop(t.items[another]->tok, another+1);
                 while((another <= to) && (t.items[another]->tok != TOK_END))
                 {
                     args.append(e = new Expression(ownerV,proc));
                     E( e -> parse(t, lastone + 1, another - 1));
                     lastone = another;
-                    t.getDelim(another);
+
+                    // tom 14-11-00
+                    // t.getDelim(another);     failed too, for "x and x and (x and 
+x)"
+                    another = t.findTop(t.items[another]->tok, another+1);
                 };
                 args.append(e = new Expression(ownerV,proc));
                 E( e -> parse(t,lastone + 1, to) );
@@ -2692,13 +2699,14 @@
     case EXFF_SUBSTRING_AFTER:
         {
             Str s;
-            const Str& theSmaller = atoms[1] -> tostringRef();
-            char *thestring;
+            const Str& 
+                theBigger = atoms[0] -> tostring(),
+                theSmaller = atoms[1] -> tostring();
             checkArgsCount(2);
             checkIsString2(0,1);
             int where = firstOccurence(
                 // changing tostringCharPtr() to tostring():
-                thestring = atoms[0] -> tostring(),
+                theBigger,
                 theSmaller);
             if (where == -1)
                 s.empty();
@@ -2709,10 +2717,10 @@
                     if (where == 0)
                         s.empty();
                     else
-                        getBetween(s, thestring, 0, where-1);
+                        getBetween(s, theBigger, 0, where-1);
                 }
                 else
-                    getBetween(s, thestring, where + theSmaller.length(), -1);
+                    getBetween(s, theBigger, where + theSmaller.length(), -1);
             };
             retxpr.setAtom(s);
         }; break;
@@ -2799,11 +2807,14 @@
             checkIsString(2);
 
             DStr resulting;
+            Str baseStr = atoms[0] -> tostring(),
+                srcStr = atoms[1] -> tostring(),
+                destStr = atoms[2] -> tostring();
             char *q,
                 // changing tostringCharPtr() to tostring():
-                *p = atoms[0] -> tostring(),
-                *src = atoms[1] -> tostring(),
-                *dest = atoms[2] -> tostring();
+                *p = baseStr,
+                *src = srcStr,
+                *dest = destStr;
             int ndx,
                 destlen = strlen(dest);
             while(*p)

Reply via email to