[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:54:29 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit b0911710223aff41a4d7730e4e47d5588f319a5d
Author: Hans Schoenemann <hannes at mathematik.uni-kl.de>
Date:   Thu Mar 29 12:02:27 2012 +0200

    add iiOpsTwoChar (see iiTwoOps)a: overload operators for ewstruct

diff --git a/Singular/ipshell.cc b/Singular/ipshell.cc
index 8b12466..359710e 100644
--- a/Singular/ipshell.cc
+++ b/Singular/ipshell.cc
@@ -102,6 +102,34 @@ const char * iiTwoOps(int t)
   }
 }
 
+int iiOpsTwoChar(const char *s)
+{
+/* not handling: &&, ||, ** */
+  if (s[1]=='\0') return s[0];
+  else if (s[2]!='\0') return 0;
+  switch(s[0])
+  {
+    case '.': if (s[1]=='.') return DOTDOT;
+              else           return 0;
+    case ':': if (s[1]==':') return COLONCOLON;
+              else           return 0;
+    case '-': if (s[1]=='-') return COLONCOLON;
+              else           return 0;
+    case '+': if (s[1]=='+') return PLUSPLUS;
+              else           return 0;
+    case '=': if (s[1]=='=') return EQUAL_EQUAL;
+              else           return 0;
+    case '<': if (s[1]=='=') return LE;
+              else if (s[1]=='>') return NOTEQUAL;
+              else           return 0;
+    case '>': if (s[1]=='=') return GE;
+              else           return 0;
+    case '!': if (s[1]=='=') return NOTEQUAL;
+              else           return 0;
+    defaukt: return 0;
+  }
+}
+
 static void list1(const char* s, idhdl h,BOOLEAN c, BOOLEAN fullname)
 {
   char buffer[22];
diff --git a/Singular/ipshell.h b/Singular/ipshell.h
index a81d616..dbbd49e 100644
--- a/Singular/ipshell.h
+++ b/Singular/ipshell.h
@@ -45,6 +45,7 @@ void    killlocals(int v);
 int     exprlist_length(leftv v);
 const char *  Tok2Cmdname(int i);
 const char *  iiTwoOps(int t);
+int           iiOpsTwoChar(const char *s);
 int     IsPrime(int i);
 
 BOOLEAN iiWRITE(leftv res,leftv exprlist);
diff --git a/Singular/newstruct.cc b/Singular/newstruct.cc
index e2a697f..758d6cf 100644
--- a/Singular/newstruct.cc
+++ b/Singular/newstruct.cc
@@ -577,10 +577,15 @@ BOOLEAN newstruct_set_proc(const char *bbname,const char *func, int args,procinf
   p->next=desc->procs; desc->procs=p;
   if(!IsCmd(func,p->t))
   {
+    int t=0;
     if (func[1]=='\0') p->t=func[0];
+    else if((t=iiOpsTwoChar(func))!=0)
+    {
+      p->t=t;
+    }
     else
     {
-      Werror(">>%s<< is not e kernel command",func);
+      Werror(">>%s<< is not a kernel command",func);
       return TRUE;
     }
   }

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list