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

Function iiCleanProcs

Singular/iplib.cc:937–965  ·  view source on GitHub ↗

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

Source from the content-addressed store, hash-verified

935}
936/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
937static void iiCleanProcs(idhdl &root)
938{
939 idhdl prev=NULL;
940 loop
941 {
942 if (root==NULL) return;
943 if (IDTYP(root)==PROC_CMD)
944 {
945 procinfo *pi=(procinfo*)IDDATA(root);
946 if ((pi->language == LANG_SINGULAR)
947 && (pi->data.s.body_start == 0L))
948 {
949 // procinfo data incorrect:
950 // - no proc body can start at the beginning of the file
951 killhdl(root);
952 if (prev==NULL)
953 root=IDROOT;
954 else
955 {
956 root=prev;
957 prev=NULL;
958 }
959 continue;
960 }
961 }
962 prev=root;
963 root=IDNEXT(root);
964 }
965}
966static void iiRunInit(package p)
967{
968 idhdl h=p->idroot->get("mod_init",0);

Callers 1

iiLoadLIBFunction · 0.85

Calls 2

killhdlFunction · 0.85
ifFunction · 0.50

Tested by

no test coverage detected