Changeset 1ba856 in git
 Timestamp:
 Aug 5, 2019, 1:54:09 PM (4 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 621203ad7373159254c97525b77e9edda2f36c37
 Parents:
 31212ff491b316ea34617fe1509cfbc676781d4b
 gitauthor:
 Andreas Steenpass <steenpass@mathematik.unikl.de>20190805 13:54:09+02:00
 gitcommitter:
 Andreas Steenpass <steenpass@mathematik.unikl.de>20190806 17:17:17+02:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/standard.lib
r31212ff r1ba856 2517 2517 static proc parse_L1(string l1) 2518 2518 { 2519 list tokens; 2519 2520 if (find(l1, "(", 1) == 0) // no parentheses 2520 2521 { 2521 return(int(l1)); 2522 } 2523 list tokens = tuple_to_tokens(l1); 2522 tokens[1] = l1; 2523 } 2524 else 2525 { 2526 tokens = tuple_to_tokens(l1); 2527 } 2528 if (tokens[1] == "real") 2529 { 2530 int p1 = 6; 2531 int p2 = 6; 2532 if (size(tokens) > 1) 2533 { 2534 p1 = int(tokens[2]); 2535 p2 = p1; 2536 } 2537 if (size(tokens) > 2) 2538 { 2539 p2 = int(tokens[3]); 2540 } 2541 return(list(0, list(p1, p2))); 2542 } 2543 if (tokens[1] == "complex") 2544 { 2545 int p1 = 6; 2546 int p2 = 6; 2547 string imag_unit = "i"; 2548 if (int(tokens[size(tokens)]) == 0) // not an integer 2549 { 2550 imag_unit = tokens[size(tokens)]; 2551 tokens = delete(tokens, size(tokens)); 2552 } 2553 if (size(tokens) > 1) 2554 { 2555 p1 = int(tokens[2]); 2556 p2 = p1; 2557 } 2558 if (size(tokens) > 2) 2559 { 2560 p2 = int(tokens[3]); 2561 } 2562 return(list(0, list(p1, p2), imag_unit)); 2563 } 2524 2564 if (size(tokens) == 1) 2525 2565 { 2526 2566 return(int(tokens[1])); 2527 2567 } 2528 2568 list L = int(tokens[1]); … … 2537 2577 if (v[1, 4] == "var(" && defined(basering)) 2538 2578 { 2539 2540 2579 int i = int(v[5,size(v)5]); 2580 v = ringlist(basering)[2][i]; 2541 2581 } 2542 2582 return(v); … … 2552 2592 if (find(l2, "(", 1) == 0) // no parentheses 2553 2593 { 2554 2594 return(list(parse_var(l2))); 2555 2595 } 2556 2596 list V = tuple_to_tokens(l2); 2557 2597 for (int i = size(V); i > 0; i) 2558 2598 { 2559 2599 V[i] = parse_var(V[i]); 2560 2600 } 2561 2601 return(V);
Note: See TracChangeset
for help on using the changeset viewer.