342{
343 int len = 0;
345 long this_elem = 0;
346 if (*str != '[')
347 {
348 fprintf(stderr, "expected '[', got %s\n", str);
349 exit(1);
350 }
351 str++;
352
353 while (*str != ']')
354 {
355 while (isspace(*str)) str++;
356 if (*str == ',')
357 {
358 str++;
359 }
360 else if (isdigit(*str))
361 {
363 this_elem = strtol(str, &
end, 10);
365 while (isspace(*str)) str++;
366 if (*str == ',') str++;
367 }
368 else
369 {
370 fprintf(stderr, "expected , or [, but got %s\n", str);
371 exit(1);
372 }
373 elems[len++] = this_elem;
374 this_elem = 0;
375 }
376
377 str++;
381}
static TowerPolynomial alloc_poly_0(int deg, long *elems=nullptr)
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define newarray_atomic(T, len)
TermIterator< Nterm > end(Nterm *)