MCPcopy Create free account
hub / github.com/Singular/Singular / iiTestAssume

Function iiTestAssume

Singular/ipshell.cc:6445–6468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6443}
6444
6445BOOLEAN iiTestAssume(leftv a, leftv b)
6446{
6447 // assume a: level
6448 if ((a->Typ()==INT_CMD)&&((long)a->Data()>=0))
6449 {
6450 if ((TEST_V_ALLWARN) && (myynest==0)) WarnS("ASSUME at top level is of no use: see documentation");
6451 char assume_yylinebuf[80];
6452 strncpy(assume_yylinebuf,my_yylinebuf,79);
6453 int lev=(long)a->Data();
6454 int startlev=0;
6455 idhdl h=ggetid("assumeLevel");
6456 if ((h!=NULL)&&(IDTYP(h)==INT_CMD)) startlev=(long)IDINT(h);
6457 if(lev <=startlev)
6458 {
6459 BOOLEAN bo=b->Eval();
6460 if (bo) { WerrorS("syntax error in ASSUME");return TRUE;}
6461 if (b->Typ()!=INT_CMD) { WerrorS("ASUMME(<level>,<int expr>)");return TRUE; }
6462 if (b->Data()==NULL) { Werror("ASSUME failed:%s",assume_yylinebuf);return TRUE;}
6463 }
6464 }
6465 b->CleanUp();
6466 a->CleanUp();
6467 return FALSE;
6468}
6469
6470#include "libparse.h"
6471

Callers 1

grammar.ccFile · 0.85

Calls 8

WarnSFunction · 0.85
ggetidFunction · 0.85
WerrorSFunction · 0.85
WerrorFunction · 0.85
EvalMethod · 0.80
CleanUpMethod · 0.80
TypMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected