github.com/solo-io/cue@v0.4.7/cue/testdata/cycle/compbottomnofinal.txtar (about) 1 // Issues: #667, #695, #622 2 -- in.cue -- 3 import ( 4 "strconv" 5 "regexp" 6 ) 7 8 // In these test, it is impossible to determine the existence of some arcs due 9 // to mutual dependence on becoming concrete. 10 // 11 // This tests shows the essences of when an existence check cannot be resolved. 12 minimal: { 13 a: { 14 if b.port == _|_ { 15 port: "" 16 } 17 } 18 19 b: { 20 if a.port == _|_ { 21 port: "" 22 } 23 } 24 } 25 26 small: { 27 #userHostPort: #"^(:(?P<port>\d+))?$"# 28 29 p1: { 30 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 31 32 #X: { 33 if #Y.port == _|_ { 34 port: "" 35 } 36 if #Y.port != _|_ { 37 port: ":" + strconv.FormatInt(#Y.port, 10) 38 } 39 } 40 } 41 42 p2: { 43 #X: { 44 if #Y.port == _|_ { 45 port: "" 46 } 47 if #Y.port != _|_ { 48 port: ":" + strconv.FormatInt(#Y.port, 10) 49 } 50 } 51 52 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 53 } 54 } 55 56 medium: { 57 #userHostPort: #"^(:(?P<port>\d+))?$"# 58 59 p1: { 60 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 61 62 Y: { 63 if #Y.port != _|_ { 64 port: strconv.Atoi(#Y.port) 65 } 66 } 67 68 #X: { 69 // Can never determine whether Y.port exists as its resolution 70 // depends on #Y becoming finalized, which, in turn, depends on #X 71 // becoming finalized. 72 if Y.port == _|_ { 73 port: "" 74 } 75 if Y.port != _|_ { 76 port: ":" + strconv.FormatInt(Y.port, 10) 77 } 78 } 79 } 80 81 p2: { 82 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 83 84 #X: { 85 // Can never determine whether Y.port exists as its resolution 86 // depends on #Y becoming finalized, which, in turn, depends on #X 87 // becoming finalized. 88 if Y.port == _|_ { 89 port: "" 90 } 91 if Y.port != _|_ { 92 port: ":" + strconv.FormatInt(Y.port, 10) 93 } 94 } 95 96 Y: { 97 if #Y.port != _|_ { 98 port: strconv.Atoi(#Y.port) 99 } 100 } 101 } 102 103 p3: { 104 Y: { 105 if #Y.port != _|_ { 106 port: strconv.Atoi(#Y.port) 107 } 108 } 109 110 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 111 112 #X: { 113 // Can never determine whether Y.port exists as its resolution 114 // depends on #Y becoming finalized, which, in turn, depends on #X 115 // becoming finalized. 116 if Y.port == _|_ { 117 port: "" 118 } 119 if Y.port != _|_ { 120 port: ":" + strconv.FormatInt(Y.port, 10) 121 } 122 } 123 } 124 125 p4: { 126 Y: { 127 if #Y.port != _|_ { 128 port: strconv.Atoi(#Y.port) 129 } 130 } 131 132 #X: { 133 // Can never determine whether Y.port exists as its resolution 134 // depends on #Y becoming finalized, which, in turn, depends on #X 135 // becoming finalized. 136 if Y.port == _|_ { 137 port: "" 138 } 139 if Y.port != _|_ { 140 port: ":" + strconv.FormatInt(Y.port, 10) 141 } 142 } 143 144 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 145 } 146 147 p5: { 148 #X: { 149 // Can never determine whether Y.port exists as its resolution 150 // depends on #Y becoming finalized, which, in turn, depends on #X 151 // becoming finalized. 152 if Y.port == _|_ { 153 port: "" 154 } 155 if Y.port != _|_ { 156 port: ":" + strconv.FormatInt(Y.port, 10) 157 } 158 } 159 160 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 161 162 Y: { 163 if #Y.port != _|_ { 164 port: strconv.Atoi(#Y.port) 165 } 166 } 167 } 168 169 p6: { 170 #X: { 171 // Can never determine whether Y.port exists as its resolution 172 // depends on #Y becoming finalized, which, in turn, depends on #X 173 // becoming finalized. 174 if Y.port == _|_ { 175 port: "" 176 } 177 if Y.port != _|_ { 178 port: ":" + strconv.FormatInt(Y.port, 10) 179 } 180 } 181 182 Y: { 183 if #Y.port != _|_ { 184 port: strconv.Atoi(#Y.port) 185 } 186 } 187 188 #Y: regexp.FindNamedSubmatch(#userHostPort, #X.port) 189 } 190 } 191 192 193 large: { 194 #userHostPort: #"^((?P<userinfo>[[:alnum:]]*)@)?(?P<host>[[:alnum:].]+)(:(?P<port>\d+))?$"# 195 196 p1: { 197 Y: { 198 userinfo: "user" 199 host: "example.com" 200 } 201 202 X: #X.userinfo + #X.host + #X.port 203 204 #X: { 205 if Y.userinfo == _|_ { 206 userinfo: "" 207 } 208 if Y.userinfo != _|_ { 209 userinfo: Y.userinfo + "@" 210 } 211 212 host: Y.host 213 214 if Y.port == _|_ { 215 port: "" 216 } 217 if Y.port != _|_ { 218 port: ":" + strconv.FormatInt(Y.port, 10) 219 } 220 } 221 222 Y: { 223 if #Y.userinfo != _|_ { 224 userinfo: #Y.userinfo 225 } 226 227 host: #Y.host 228 229 if #Y.port != _|_ { 230 port: strconv.Atoi(#Y.port) 231 } 232 } 233 234 #Y: regexp.FindNamedSubmatch(#userHostPort, X) 235 } 236 237 p2: { 238 X: #X.userinfo + #X.host + #X.port 239 240 Y: { 241 userinfo: "user" 242 host: "example.com" 243 } 244 245 #X: { 246 if Y.userinfo == _|_ { 247 userinfo: "" 248 } 249 if Y.userinfo != _|_ { 250 userinfo: Y.userinfo + "@" 251 } 252 253 host: Y.host 254 255 if Y.port == _|_ { 256 port: "" 257 } 258 if Y.port != _|_ { 259 port: ":" + strconv.FormatInt(Y.port, 10) 260 } 261 } 262 263 Y: { 264 if #Y.userinfo != _|_ { 265 userinfo: #Y.userinfo 266 } 267 268 host: #Y.host 269 270 if #Y.port != _|_ { 271 port: strconv.Atoi(#Y.port) 272 } 273 } 274 275 #Y: regexp.FindNamedSubmatch(#userHostPort, X) 276 } 277 278 p3: { 279 X: #X.userinfo + #X.host + #X.port 280 281 #X: { 282 if Y.userinfo == _|_ { 283 userinfo: "" 284 } 285 if Y.userinfo != _|_ { 286 userinfo: Y.userinfo + "@" 287 } 288 289 host: Y.host 290 291 if Y.port == _|_ { 292 port: "" 293 } 294 if Y.port != _|_ { 295 port: ":" + strconv.FormatInt(Y.port, 10) 296 } 297 } 298 299 Y: { 300 userinfo: "user" 301 host: "example.com" 302 } 303 304 Y: { 305 if #Y.userinfo != _|_ { 306 userinfo: #Y.userinfo 307 } 308 309 host: #Y.host 310 311 if #Y.port != _|_ { 312 port: strconv.Atoi(#Y.port) 313 } 314 } 315 316 #Y: regexp.FindNamedSubmatch(#userHostPort, X) 317 } 318 319 p4: { 320 X: #X.userinfo + #X.host + #X.port 321 322 #X: { 323 if Y.userinfo == _|_ { 324 userinfo: "" 325 } 326 if Y.userinfo != _|_ { 327 userinfo: Y.userinfo + "@" 328 } 329 330 host: Y.host 331 332 if Y.port == _|_ { 333 port: "" 334 } 335 if Y.port != _|_ { 336 port: ":" + strconv.FormatInt(Y.port, 10) 337 } 338 } 339 340 #Y: regexp.FindNamedSubmatch(#userHostPort, X) 341 342 Y: { 343 userinfo: "user" 344 host: "example.com" 345 } 346 347 Y: { 348 if #Y.userinfo != _|_ { 349 userinfo: #Y.userinfo 350 } 351 352 host: #Y.host 353 354 if #Y.port != _|_ { 355 port: strconv.Atoi(#Y.port) 356 } 357 } 358 } 359 } 360 -- out/eval -- 361 Errors: 362 large.p1.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 363 large.p2.#Y: cycle: field was added after an if clause evaluated it: userinfo 364 large.p2.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 365 large.p3.#Y: cycle: field was added after an if clause evaluated it: userinfo 366 large.p3.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 367 large.p4.#Y: cycle: field was added after an if clause evaluated it: userinfo 368 medium.p1.#Y: cycle: field was added after an if clause evaluated it: port 369 medium.p2.#Y: cycle: field was added after an if clause evaluated it: port 370 medium.p3.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 371 medium.p4.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 372 minimal.b: cycle: field inserted by if clause that was previously evaluated by another if clause: port 373 small.p1.#Y: cycle: field was added after an if clause evaluated it: port 374 error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 375 ./in.cue:104:23 376 error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 377 ./in.cue:126:23 378 error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 379 ./in.cue:228:23 380 error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 381 ./in.cue:269:23 382 error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 383 ./in.cue:310:23 384 385 Result: 386 (_|_){ 387 // [eval] 388 minimal: (_|_){ 389 // [eval] 390 a: (struct){ 391 } 392 b: (_|_){ 393 // [eval] minimal.b: cycle: field inserted by if clause that was previously evaluated by another if clause: port 394 port: (string){ "" } 395 } 396 } 397 small: (_|_){ 398 // [eval] 399 #userHostPort: (string){ "^(:(?P<port>\\d+))?$" } 400 p1: (_|_){ 401 // [eval] 402 #Y: (_|_){ 403 // [eval] small.p1.#Y: cycle: field was added after an if clause evaluated it: port 404 port: (string){ "" } 405 } 406 #X: (#struct){ 407 port: (string){ "" } 408 } 409 } 410 p2: (struct){ 411 #X: (#struct){ 412 port: (string){ "" } 413 } 414 #Y: (_|_){ 415 // [incomplete] small.p2.#Y: undefined field: port: 416 // ./in.cue:50:50 417 port: (string){ "" } 418 } 419 } 420 } 421 medium: (_|_){ 422 // [eval] 423 #userHostPort: (string){ "^(:(?P<port>\\d+))?$" } 424 p1: (_|_){ 425 // [eval] 426 #Y: (_|_){ 427 // [eval] medium.p1.#Y: cycle: field was added after an if clause evaluated it: port 428 port: (string){ "" } 429 } 430 Y: (struct){ 431 } 432 #X: (#struct){ 433 port: (string){ "" } 434 } 435 } 436 p2: (_|_){ 437 // [eval] 438 #Y: (_|_){ 439 // [eval] medium.p2.#Y: cycle: field was added after an if clause evaluated it: port 440 port: (string){ "" } 441 } 442 #X: (#struct){ 443 port: (string){ "" } 444 } 445 Y: (struct){ 446 } 447 } 448 p3: (_|_){ 449 // [eval] 450 Y: (_|_){ 451 // [eval] medium.p3.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 452 port: (_|_){ 453 // [eval] error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 454 // ./in.cue:104:23 455 } 456 } 457 #Y: (#struct){ 458 port: (string){ "" } 459 } 460 #X: (#struct){ 461 port: (string){ "" } 462 } 463 } 464 p4: (_|_){ 465 // [eval] 466 Y: (_|_){ 467 // [eval] medium.p4.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 468 port: (_|_){ 469 // [eval] error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 470 // ./in.cue:126:23 471 } 472 } 473 #X: (#struct){ 474 port: (string){ "" } 475 } 476 #Y: (#struct){ 477 port: (string){ "" } 478 } 479 } 480 p5: (struct){ 481 #X: (#struct){ 482 port: (string){ "" } 483 } 484 #Y: (_|_){ 485 // [incomplete] medium.p5.#Y: undefined field: port: 486 // ./in.cue:158:56 487 port: (string){ "" } 488 } 489 Y: (struct){ 490 } 491 } 492 p6: (struct){ 493 #X: (#struct){ 494 port: (string){ "" } 495 } 496 Y: (struct){ 497 } 498 #Y: (_|_){ 499 // [incomplete] medium.p6.#Y: undefined field: port: 500 // ./in.cue:186:56 501 port: (string){ "" } 502 } 503 } 504 } 505 large: (_|_){ 506 // [eval] 507 #userHostPort: (string){ "^((?P<userinfo>[[:alnum:]]*)@)?(?P<host>[[:alnum:].]+)(:(?P<port>\\d+))?$" } 508 p1: (_|_){ 509 // [eval] 510 Y: (_|_){ 511 // [eval] large.p1.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 512 userinfo: (string){ "user" } 513 host: (string){ "example.com" } 514 port: (_|_){ 515 // [eval] error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 516 // ./in.cue:228:23 517 } 518 } 519 X: (string){ "user@example.com" } 520 #X: (#struct){ 521 host: (string){ "example.com" } 522 userinfo: (string){ "user@" } 523 port: (string){ "" } 524 } 525 #Y: (#struct){ 526 host: (string){ "example.com" } 527 port: (string){ "" } 528 userinfo: (string){ "user" } 529 } 530 } 531 p2: (_|_){ 532 // [eval] 533 X: (string){ "user@example.com" } 534 Y: (_|_){ 535 // [eval] large.p2.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 536 userinfo: (string){ "user" } 537 host: (string){ "example.com" } 538 port: (_|_){ 539 // [eval] error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 540 // ./in.cue:269:23 541 } 542 } 543 #X: (#struct){ 544 host: (string){ "example.com" } 545 userinfo: (string){ "user@" } 546 port: (string){ "" } 547 } 548 #Y: (_|_){ 549 // [eval] large.p2.#Y: cycle: field was added after an if clause evaluated it: userinfo 550 host: (string){ "example.com" } 551 port: (string){ "" } 552 userinfo: (string){ "user" } 553 } 554 } 555 p3: (_|_){ 556 // [eval] 557 X: (string){ "user@example.com" } 558 #X: (#struct){ 559 host: (string){ "example.com" } 560 userinfo: (string){ "user@" } 561 port: (string){ "" } 562 } 563 Y: (_|_){ 564 // [eval] large.p3.Y: cycle: field inserted by if clause that was previously evaluated by another if clause: port 565 userinfo: (string){ "user" } 566 host: (string){ "example.com" } 567 port: (_|_){ 568 // [eval] error in call to strconv.Atoi: strconv.Atoi: parsing "": invalid syntax: 569 // ./in.cue:310:23 570 } 571 } 572 #Y: (_|_){ 573 // [eval] large.p3.#Y: cycle: field was added after an if clause evaluated it: userinfo 574 host: (string){ "example.com" } 575 port: (string){ "" } 576 userinfo: (string){ "user" } 577 } 578 } 579 p4: (_|_){ 580 // [eval] 581 X: (string){ "user@example.com" } 582 #X: (#struct){ 583 host: (string){ "example.com" } 584 userinfo: (string){ "user@" } 585 port: (string){ "" } 586 } 587 #Y: (_|_){ 588 // [eval] large.p4.#Y: cycle: field was added after an if clause evaluated it: userinfo 589 host: (string){ "example.com" } 590 port: (string){ "" } 591 userinfo: (string){ "user" } 592 } 593 Y: (_|_){ 594 // [eval] 595 userinfo: (string){ "user" } 596 host: (_|_){ 597 // [eval] large.p4.#Y: cycle: field was added after an if clause evaluated it: userinfo 598 } 599 } 600 } 601 } 602 } 603 -- out/compile -- 604 --- in.cue 605 { 606 minimal: { 607 a: { 608 if (〈1;b〉.port == _|_(explicit error (_|_ literal) in source)) { 609 port: "" 610 } 611 } 612 b: { 613 if (〈1;a〉.port == _|_(explicit error (_|_ literal) in source)) { 614 port: "" 615 } 616 } 617 } 618 small: { 619 #userHostPort: "^(:(?P<port>\\d+))?$" 620 p1: { 621 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 622 #X: { 623 if (〈1;#Y〉.port == _|_(explicit error (_|_ literal) in source)) { 624 port: "" 625 } 626 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 627 port: (":" + 〈import;strconv〉.FormatInt(〈2;#Y〉.port, 10)) 628 } 629 } 630 } 631 p2: { 632 #X: { 633 if (〈1;#Y〉.port == _|_(explicit error (_|_ literal) in source)) { 634 port: "" 635 } 636 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 637 port: (":" + 〈import;strconv〉.FormatInt(〈2;#Y〉.port, 10)) 638 } 639 } 640 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 641 } 642 } 643 medium: { 644 #userHostPort: "^(:(?P<port>\\d+))?$" 645 p1: { 646 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 647 Y: { 648 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 649 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 650 } 651 } 652 #X: { 653 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 654 port: "" 655 } 656 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 657 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 658 } 659 } 660 } 661 p2: { 662 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 663 #X: { 664 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 665 port: "" 666 } 667 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 668 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 669 } 670 } 671 Y: { 672 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 673 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 674 } 675 } 676 } 677 p3: { 678 Y: { 679 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 680 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 681 } 682 } 683 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 684 #X: { 685 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 686 port: "" 687 } 688 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 689 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 690 } 691 } 692 } 693 p4: { 694 Y: { 695 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 696 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 697 } 698 } 699 #X: { 700 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 701 port: "" 702 } 703 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 704 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 705 } 706 } 707 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 708 } 709 p5: { 710 #X: { 711 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 712 port: "" 713 } 714 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 715 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 716 } 717 } 718 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 719 Y: { 720 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 721 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 722 } 723 } 724 } 725 p6: { 726 #X: { 727 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 728 port: "" 729 } 730 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 731 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 732 } 733 } 734 Y: { 735 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 736 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 737 } 738 } 739 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;#X〉.port) 740 } 741 } 742 large: { 743 #userHostPort: "^((?P<userinfo>[[:alnum:]]*)@)?(?P<host>[[:alnum:].]+)(:(?P<port>\\d+))?$" 744 p1: { 745 Y: { 746 userinfo: "user" 747 host: "example.com" 748 } 749 X: ((〈0;#X〉.userinfo + 〈0;#X〉.host) + 〈0;#X〉.port) 750 #X: { 751 if (〈1;Y〉.userinfo == _|_(explicit error (_|_ literal) in source)) { 752 userinfo: "" 753 } 754 if (〈1;Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 755 userinfo: (〈2;Y〉.userinfo + "@") 756 } 757 host: 〈1;Y〉.host 758 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 759 port: "" 760 } 761 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 762 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 763 } 764 } 765 Y: { 766 if (〈1;#Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 767 userinfo: 〈2;#Y〉.userinfo 768 } 769 host: 〈1;#Y〉.host 770 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 771 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 772 } 773 } 774 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;X〉) 775 } 776 p2: { 777 X: ((〈0;#X〉.userinfo + 〈0;#X〉.host) + 〈0;#X〉.port) 778 Y: { 779 userinfo: "user" 780 host: "example.com" 781 } 782 #X: { 783 if (〈1;Y〉.userinfo == _|_(explicit error (_|_ literal) in source)) { 784 userinfo: "" 785 } 786 if (〈1;Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 787 userinfo: (〈2;Y〉.userinfo + "@") 788 } 789 host: 〈1;Y〉.host 790 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 791 port: "" 792 } 793 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 794 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 795 } 796 } 797 Y: { 798 if (〈1;#Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 799 userinfo: 〈2;#Y〉.userinfo 800 } 801 host: 〈1;#Y〉.host 802 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 803 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 804 } 805 } 806 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;X〉) 807 } 808 p3: { 809 X: ((〈0;#X〉.userinfo + 〈0;#X〉.host) + 〈0;#X〉.port) 810 #X: { 811 if (〈1;Y〉.userinfo == _|_(explicit error (_|_ literal) in source)) { 812 userinfo: "" 813 } 814 if (〈1;Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 815 userinfo: (〈2;Y〉.userinfo + "@") 816 } 817 host: 〈1;Y〉.host 818 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 819 port: "" 820 } 821 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 822 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 823 } 824 } 825 Y: { 826 userinfo: "user" 827 host: "example.com" 828 } 829 Y: { 830 if (〈1;#Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 831 userinfo: 〈2;#Y〉.userinfo 832 } 833 host: 〈1;#Y〉.host 834 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 835 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 836 } 837 } 838 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;X〉) 839 } 840 p4: { 841 X: ((〈0;#X〉.userinfo + 〈0;#X〉.host) + 〈0;#X〉.port) 842 #X: { 843 if (〈1;Y〉.userinfo == _|_(explicit error (_|_ literal) in source)) { 844 userinfo: "" 845 } 846 if (〈1;Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 847 userinfo: (〈2;Y〉.userinfo + "@") 848 } 849 host: 〈1;Y〉.host 850 if (〈1;Y〉.port == _|_(explicit error (_|_ literal) in source)) { 851 port: "" 852 } 853 if (〈1;Y〉.port != _|_(explicit error (_|_ literal) in source)) { 854 port: (":" + 〈import;strconv〉.FormatInt(〈2;Y〉.port, 10)) 855 } 856 } 857 #Y: 〈import;regexp〉.FindNamedSubmatch(〈1;#userHostPort〉, 〈0;X〉) 858 Y: { 859 userinfo: "user" 860 host: "example.com" 861 } 862 Y: { 863 if (〈1;#Y〉.userinfo != _|_(explicit error (_|_ literal) in source)) { 864 userinfo: 〈2;#Y〉.userinfo 865 } 866 host: 〈1;#Y〉.host 867 if (〈1;#Y〉.port != _|_(explicit error (_|_ literal) in source)) { 868 port: 〈import;strconv〉.Atoi(〈2;#Y〉.port) 869 } 870 } 871 } 872 } 873 }