gonum.org/v1/gonum@v0.14.0/graph/formats/rdf/extract.go (about) 1 2 //line extract.rl:1 3 // Code generated by go generate gonum.org/v1/gonum/graph/formats/rdf; DO NOT EDIT. 4 5 // Copyright ©2020 The Gonum Authors. All rights reserved. 6 // Use of this source code is governed by a BSD-style 7 // license that can be found in the LICENSE file. 8 9 package rdf 10 11 import ( 12 "fmt" 13 "unicode" 14 ) 15 16 17 //line extract.go:18 18 const extract_start int = 1 19 const extract_first_final int = 31 20 const extract_error int = 0 21 22 const extract_en_value int = 1 23 24 25 //line extract.rl:28 26 27 28 func extract(data []rune) (text, qual string, kind Kind, err error) { 29 var ( 30 cs, p int 31 pe = len(data) 32 eof = pe 33 34 iri = -1 35 blank = -1 36 literal = -1 37 lang = -1 38 39 iriText string 40 blankText string 41 literalText string 42 langText string 43 ) 44 45 46 //line extract.go:47 47 { 48 cs = extract_start 49 } 50 51 //line extract.rl:48 52 53 54 //line extract.go:55 55 { 56 if p == pe { 57 goto _test_eof 58 } 59 switch cs { 60 case 1: 61 goto st_case_1 62 case 0: 63 goto st_case_0 64 case 2: 65 goto st_case_2 66 case 3: 67 goto st_case_3 68 case 31: 69 goto st_case_31 70 case 4: 71 goto st_case_4 72 case 32: 73 goto st_case_32 74 case 5: 75 goto st_case_5 76 case 33: 77 goto st_case_33 78 case 6: 79 goto st_case_6 80 case 7: 81 goto st_case_7 82 case 8: 83 goto st_case_8 84 case 9: 85 goto st_case_9 86 case 34: 87 goto st_case_34 88 case 10: 89 goto st_case_10 90 case 11: 91 goto st_case_11 92 case 12: 93 goto st_case_12 94 case 13: 95 goto st_case_13 96 case 14: 97 goto st_case_14 98 case 15: 99 goto st_case_15 100 case 16: 101 goto st_case_16 102 case 17: 103 goto st_case_17 104 case 18: 105 goto st_case_18 106 case 19: 107 goto st_case_19 108 case 20: 109 goto st_case_20 110 case 21: 111 goto st_case_21 112 case 22: 113 goto st_case_22 114 case 23: 115 goto st_case_23 116 case 24: 117 goto st_case_24 118 case 25: 119 goto st_case_25 120 case 26: 121 goto st_case_26 122 case 27: 123 goto st_case_27 124 case 28: 125 goto st_case_28 126 case 29: 127 goto st_case_29 128 case 35: 129 goto st_case_35 130 case 30: 131 goto st_case_30 132 } 133 goto st_out 134 st_case_1: 135 switch data[p] { 136 case 34: 137 goto st2 138 case 60: 139 goto st8 140 case 95: 141 goto st28 142 } 143 goto tr0 144 tr0: 145 //line extract_actions.rl:74 146 147 if p < len(data) { 148 if r := data[p]; r < unicode.MaxASCII { 149 return "", "", Invalid, fmt.Errorf("%w: unexpected rune %q at %d", ErrInvalidTerm, data[p], p) 150 } else { 151 return "", "", Invalid, fmt.Errorf("%w: unexpected rune %q (\\u%04[2]x) at %d", ErrInvalidTerm, data[p], p) 152 } 153 } 154 return "", "", Invalid, ErrIncompleteTerm 155 156 goto st0 157 //line extract.go:158 158 st_case_0: 159 st0: 160 cs = 0 161 goto _out 162 st2: 163 if p++; p == pe { 164 goto _test_eof2 165 } 166 st_case_2: 167 switch data[p] { 168 case 34: 169 goto tr5 170 case 92: 171 goto tr6 172 } 173 switch { 174 case data[p] < 11: 175 if 0 <= data[p] && data[p] <= 9 { 176 goto tr4 177 } 178 case data[p] > 12: 179 if 14 <= data[p] && data[p] <= 1114111 { 180 goto tr4 181 } 182 default: 183 goto tr4 184 } 185 goto tr0 186 tr4: 187 //line extract_actions.rl:34 188 189 literal = p 190 191 goto st3 192 st3: 193 if p++; p == pe { 194 goto _test_eof3 195 } 196 st_case_3: 197 //line extract.go:198 198 switch data[p] { 199 case 34: 200 goto tr8 201 case 92: 202 goto st19 203 } 204 switch { 205 case data[p] < 11: 206 if 0 <= data[p] && data[p] <= 9 { 207 goto st3 208 } 209 case data[p] > 12: 210 if 14 <= data[p] && data[p] <= 1114111 { 211 goto st3 212 } 213 default: 214 goto st3 215 } 216 goto tr0 217 tr5: 218 //line extract_actions.rl:34 219 220 literal = p 221 222 //line extract_actions.rl:38 223 224 if literal < 0 { 225 panic("unexpected parser state: literal start not set") 226 } 227 literalText = unEscape(data[literal:p]) 228 kind = Literal 229 230 goto st31 231 tr8: 232 //line extract_actions.rl:38 233 234 if literal < 0 { 235 panic("unexpected parser state: literal start not set") 236 } 237 literalText = unEscape(data[literal:p]) 238 kind = Literal 239 240 goto st31 241 st31: 242 if p++; p == pe { 243 goto _test_eof31 244 } 245 st_case_31: 246 //line extract.go:247 247 switch data[p] { 248 case 64: 249 goto tr39 250 case 94: 251 goto st6 252 } 253 goto st0 254 tr39: 255 //line extract_actions.rl:46 256 257 lang = p 258 259 goto st4 260 st4: 261 if p++; p == pe { 262 goto _test_eof4 263 } 264 st_case_4: 265 //line extract.go:266 266 switch { 267 case data[p] > 90: 268 if 97 <= data[p] && data[p] <= 122 { 269 goto st32 270 } 271 case data[p] >= 65: 272 goto st32 273 } 274 goto tr0 275 st32: 276 if p++; p == pe { 277 goto _test_eof32 278 } 279 st_case_32: 280 if data[p] == 45 { 281 goto st5 282 } 283 switch { 284 case data[p] > 90: 285 if 97 <= data[p] && data[p] <= 122 { 286 goto st32 287 } 288 case data[p] >= 65: 289 goto st32 290 } 291 goto st0 292 st5: 293 if p++; p == pe { 294 goto _test_eof5 295 } 296 st_case_5: 297 switch { 298 case data[p] < 65: 299 if 48 <= data[p] && data[p] <= 57 { 300 goto st33 301 } 302 case data[p] > 90: 303 if 97 <= data[p] && data[p] <= 122 { 304 goto st33 305 } 306 default: 307 goto st33 308 } 309 goto tr0 310 st33: 311 if p++; p == pe { 312 goto _test_eof33 313 } 314 st_case_33: 315 if data[p] == 45 { 316 goto st5 317 } 318 switch { 319 case data[p] < 65: 320 if 48 <= data[p] && data[p] <= 57 { 321 goto st33 322 } 323 case data[p] > 90: 324 if 97 <= data[p] && data[p] <= 122 { 325 goto st33 326 } 327 default: 328 goto st33 329 } 330 goto st0 331 st6: 332 if p++; p == pe { 333 goto _test_eof6 334 } 335 st_case_6: 336 if data[p] == 94 { 337 goto st7 338 } 339 goto tr0 340 st7: 341 if p++; p == pe { 342 goto _test_eof7 343 } 344 st_case_7: 345 if data[p] == 60 { 346 goto st8 347 } 348 goto tr0 349 st8: 350 if p++; p == pe { 351 goto _test_eof8 352 } 353 st_case_8: 354 switch data[p] { 355 case 62: 356 goto tr14 357 case 92: 358 goto tr15 359 case 95: 360 goto tr13 361 case 126: 362 goto tr13 363 } 364 switch { 365 case data[p] < 61: 366 if 33 <= data[p] && data[p] <= 59 { 367 goto tr13 368 } 369 case data[p] > 93: 370 switch { 371 case data[p] > 122: 372 if 128 <= data[p] && data[p] <= 1114111 { 373 goto tr13 374 } 375 case data[p] >= 97: 376 goto tr13 377 } 378 default: 379 goto tr13 380 } 381 goto tr0 382 tr13: 383 //line extract_actions.rl:8 384 385 iri = p 386 387 goto st9 388 st9: 389 if p++; p == pe { 390 goto _test_eof9 391 } 392 st_case_9: 393 //line extract.go:394 394 switch data[p] { 395 case 62: 396 goto tr17 397 case 92: 398 goto st10 399 case 95: 400 goto st9 401 case 126: 402 goto st9 403 } 404 switch { 405 case data[p] < 61: 406 if 33 <= data[p] && data[p] <= 59 { 407 goto st9 408 } 409 case data[p] > 93: 410 switch { 411 case data[p] > 122: 412 if 128 <= data[p] && data[p] <= 1114111 { 413 goto st9 414 } 415 case data[p] >= 97: 416 goto st9 417 } 418 default: 419 goto st9 420 } 421 goto tr0 422 tr14: 423 //line extract_actions.rl:8 424 425 iri = p 426 427 //line extract_actions.rl:12 428 429 if iri < 0 { 430 panic("unexpected parser state: iri start not set") 431 } 432 iriText = unEscape(data[iri:p]) 433 if kind == Invalid { 434 kind = IRI 435 } 436 437 goto st34 438 tr17: 439 //line extract_actions.rl:12 440 441 if iri < 0 { 442 panic("unexpected parser state: iri start not set") 443 } 444 iriText = unEscape(data[iri:p]) 445 if kind == Invalid { 446 kind = IRI 447 } 448 449 goto st34 450 st34: 451 if p++; p == pe { 452 goto _test_eof34 453 } 454 st_case_34: 455 //line extract.go:456 456 goto st0 457 tr15: 458 //line extract_actions.rl:8 459 460 iri = p 461 462 goto st10 463 st10: 464 if p++; p == pe { 465 goto _test_eof10 466 } 467 st_case_10: 468 //line extract.go:469 469 switch data[p] { 470 case 85: 471 goto st11 472 case 117: 473 goto st15 474 } 475 goto tr0 476 st11: 477 if p++; p == pe { 478 goto _test_eof11 479 } 480 st_case_11: 481 switch { 482 case data[p] < 65: 483 if 48 <= data[p] && data[p] <= 57 { 484 goto st12 485 } 486 case data[p] > 70: 487 if 97 <= data[p] && data[p] <= 102 { 488 goto st12 489 } 490 default: 491 goto st12 492 } 493 goto tr0 494 st12: 495 if p++; p == pe { 496 goto _test_eof12 497 } 498 st_case_12: 499 switch { 500 case data[p] < 65: 501 if 48 <= data[p] && data[p] <= 57 { 502 goto st13 503 } 504 case data[p] > 70: 505 if 97 <= data[p] && data[p] <= 102 { 506 goto st13 507 } 508 default: 509 goto st13 510 } 511 goto tr0 512 st13: 513 if p++; p == pe { 514 goto _test_eof13 515 } 516 st_case_13: 517 switch { 518 case data[p] < 65: 519 if 48 <= data[p] && data[p] <= 57 { 520 goto st14 521 } 522 case data[p] > 70: 523 if 97 <= data[p] && data[p] <= 102 { 524 goto st14 525 } 526 default: 527 goto st14 528 } 529 goto tr0 530 st14: 531 if p++; p == pe { 532 goto _test_eof14 533 } 534 st_case_14: 535 switch { 536 case data[p] < 65: 537 if 48 <= data[p] && data[p] <= 57 { 538 goto st15 539 } 540 case data[p] > 70: 541 if 97 <= data[p] && data[p] <= 102 { 542 goto st15 543 } 544 default: 545 goto st15 546 } 547 goto tr0 548 st15: 549 if p++; p == pe { 550 goto _test_eof15 551 } 552 st_case_15: 553 switch { 554 case data[p] < 65: 555 if 48 <= data[p] && data[p] <= 57 { 556 goto st16 557 } 558 case data[p] > 70: 559 if 97 <= data[p] && data[p] <= 102 { 560 goto st16 561 } 562 default: 563 goto st16 564 } 565 goto tr0 566 st16: 567 if p++; p == pe { 568 goto _test_eof16 569 } 570 st_case_16: 571 switch { 572 case data[p] < 65: 573 if 48 <= data[p] && data[p] <= 57 { 574 goto st17 575 } 576 case data[p] > 70: 577 if 97 <= data[p] && data[p] <= 102 { 578 goto st17 579 } 580 default: 581 goto st17 582 } 583 goto tr0 584 st17: 585 if p++; p == pe { 586 goto _test_eof17 587 } 588 st_case_17: 589 switch { 590 case data[p] < 65: 591 if 48 <= data[p] && data[p] <= 57 { 592 goto st18 593 } 594 case data[p] > 70: 595 if 97 <= data[p] && data[p] <= 102 { 596 goto st18 597 } 598 default: 599 goto st18 600 } 601 goto tr0 602 st18: 603 if p++; p == pe { 604 goto _test_eof18 605 } 606 st_case_18: 607 switch { 608 case data[p] < 65: 609 if 48 <= data[p] && data[p] <= 57 { 610 goto st9 611 } 612 case data[p] > 70: 613 if 97 <= data[p] && data[p] <= 102 { 614 goto st9 615 } 616 default: 617 goto st9 618 } 619 goto tr0 620 tr6: 621 //line extract_actions.rl:34 622 623 literal = p 624 625 goto st19 626 st19: 627 if p++; p == pe { 628 goto _test_eof19 629 } 630 st_case_19: 631 //line extract.go:632 632 switch data[p] { 633 case 34: 634 goto st3 635 case 39: 636 goto st3 637 case 85: 638 goto st20 639 case 92: 640 goto st3 641 case 98: 642 goto st3 643 case 102: 644 goto st3 645 case 110: 646 goto st3 647 case 114: 648 goto st3 649 case 116: 650 goto st3 651 case 117: 652 goto st24 653 } 654 goto tr0 655 st20: 656 if p++; p == pe { 657 goto _test_eof20 658 } 659 st_case_20: 660 switch { 661 case data[p] < 65: 662 if 48 <= data[p] && data[p] <= 57 { 663 goto st21 664 } 665 case data[p] > 70: 666 if 97 <= data[p] && data[p] <= 102 { 667 goto st21 668 } 669 default: 670 goto st21 671 } 672 goto tr0 673 st21: 674 if p++; p == pe { 675 goto _test_eof21 676 } 677 st_case_21: 678 switch { 679 case data[p] < 65: 680 if 48 <= data[p] && data[p] <= 57 { 681 goto st22 682 } 683 case data[p] > 70: 684 if 97 <= data[p] && data[p] <= 102 { 685 goto st22 686 } 687 default: 688 goto st22 689 } 690 goto tr0 691 st22: 692 if p++; p == pe { 693 goto _test_eof22 694 } 695 st_case_22: 696 switch { 697 case data[p] < 65: 698 if 48 <= data[p] && data[p] <= 57 { 699 goto st23 700 } 701 case data[p] > 70: 702 if 97 <= data[p] && data[p] <= 102 { 703 goto st23 704 } 705 default: 706 goto st23 707 } 708 goto tr0 709 st23: 710 if p++; p == pe { 711 goto _test_eof23 712 } 713 st_case_23: 714 switch { 715 case data[p] < 65: 716 if 48 <= data[p] && data[p] <= 57 { 717 goto st24 718 } 719 case data[p] > 70: 720 if 97 <= data[p] && data[p] <= 102 { 721 goto st24 722 } 723 default: 724 goto st24 725 } 726 goto tr0 727 st24: 728 if p++; p == pe { 729 goto _test_eof24 730 } 731 st_case_24: 732 switch { 733 case data[p] < 65: 734 if 48 <= data[p] && data[p] <= 57 { 735 goto st25 736 } 737 case data[p] > 70: 738 if 97 <= data[p] && data[p] <= 102 { 739 goto st25 740 } 741 default: 742 goto st25 743 } 744 goto tr0 745 st25: 746 if p++; p == pe { 747 goto _test_eof25 748 } 749 st_case_25: 750 switch { 751 case data[p] < 65: 752 if 48 <= data[p] && data[p] <= 57 { 753 goto st26 754 } 755 case data[p] > 70: 756 if 97 <= data[p] && data[p] <= 102 { 757 goto st26 758 } 759 default: 760 goto st26 761 } 762 goto tr0 763 st26: 764 if p++; p == pe { 765 goto _test_eof26 766 } 767 st_case_26: 768 switch { 769 case data[p] < 65: 770 if 48 <= data[p] && data[p] <= 57 { 771 goto st27 772 } 773 case data[p] > 70: 774 if 97 <= data[p] && data[p] <= 102 { 775 goto st27 776 } 777 default: 778 goto st27 779 } 780 goto tr0 781 st27: 782 if p++; p == pe { 783 goto _test_eof27 784 } 785 st_case_27: 786 switch { 787 case data[p] < 65: 788 if 48 <= data[p] && data[p] <= 57 { 789 goto st3 790 } 791 case data[p] > 70: 792 if 97 <= data[p] && data[p] <= 102 { 793 goto st3 794 } 795 default: 796 goto st3 797 } 798 goto tr0 799 st28: 800 if p++; p == pe { 801 goto _test_eof28 802 } 803 st_case_28: 804 if data[p] == 58 { 805 goto st29 806 } 807 goto tr0 808 st29: 809 if p++; p == pe { 810 goto _test_eof29 811 } 812 st_case_29: 813 if data[p] == 95 { 814 goto tr36 815 } 816 switch { 817 case data[p] < 895: 818 switch { 819 case data[p] < 192: 820 switch { 821 case data[p] < 65: 822 if 48 <= data[p] && data[p] <= 58 { 823 goto tr36 824 } 825 case data[p] > 90: 826 if 97 <= data[p] && data[p] <= 122 { 827 goto tr36 828 } 829 default: 830 goto tr36 831 } 832 case data[p] > 214: 833 switch { 834 case data[p] < 248: 835 if 216 <= data[p] && data[p] <= 246 { 836 goto tr36 837 } 838 case data[p] > 767: 839 if 880 <= data[p] && data[p] <= 893 { 840 goto tr36 841 } 842 default: 843 goto tr36 844 } 845 default: 846 goto tr36 847 } 848 case data[p] > 8191: 849 switch { 850 case data[p] < 12289: 851 switch { 852 case data[p] < 8304: 853 if 8204 <= data[p] && data[p] <= 8205 { 854 goto tr36 855 } 856 case data[p] > 8591: 857 if 11264 <= data[p] && data[p] <= 12271 { 858 goto tr36 859 } 860 default: 861 goto tr36 862 } 863 case data[p] > 55295: 864 switch { 865 case data[p] < 65008: 866 if 63744 <= data[p] && data[p] <= 64975 { 867 goto tr36 868 } 869 case data[p] > 65533: 870 if 65536 <= data[p] && data[p] <= 983039 { 871 goto tr36 872 } 873 default: 874 goto tr36 875 } 876 default: 877 goto tr36 878 } 879 default: 880 goto tr36 881 } 882 goto tr0 883 tr36: 884 //line extract_actions.rl:22 885 886 blank = p 887 888 goto st35 889 st35: 890 if p++; p == pe { 891 goto _test_eof35 892 } 893 st_case_35: 894 //line extract.go:895 895 switch data[p] { 896 case 45: 897 goto st35 898 case 46: 899 goto st30 900 case 95: 901 goto st35 902 case 183: 903 goto st35 904 } 905 switch { 906 case data[p] < 8204: 907 switch { 908 case data[p] < 192: 909 switch { 910 case data[p] < 65: 911 if 48 <= data[p] && data[p] <= 58 { 912 goto st35 913 } 914 case data[p] > 90: 915 if 97 <= data[p] && data[p] <= 122 { 916 goto st35 917 } 918 default: 919 goto st35 920 } 921 case data[p] > 214: 922 switch { 923 case data[p] < 248: 924 if 216 <= data[p] && data[p] <= 246 { 925 goto st35 926 } 927 case data[p] > 893: 928 if 895 <= data[p] && data[p] <= 8191 { 929 goto st35 930 } 931 default: 932 goto st35 933 } 934 default: 935 goto st35 936 } 937 case data[p] > 8205: 938 switch { 939 case data[p] < 12289: 940 switch { 941 case data[p] < 8304: 942 if 8255 <= data[p] && data[p] <= 8256 { 943 goto st35 944 } 945 case data[p] > 8591: 946 if 11264 <= data[p] && data[p] <= 12271 { 947 goto st35 948 } 949 default: 950 goto st35 951 } 952 case data[p] > 55295: 953 switch { 954 case data[p] < 65008: 955 if 63744 <= data[p] && data[p] <= 64975 { 956 goto st35 957 } 958 case data[p] > 65533: 959 if 65536 <= data[p] && data[p] <= 983039 { 960 goto st35 961 } 962 default: 963 goto st35 964 } 965 default: 966 goto st35 967 } 968 default: 969 goto st35 970 } 971 goto st0 972 st30: 973 if p++; p == pe { 974 goto _test_eof30 975 } 976 st_case_30: 977 switch data[p] { 978 case 45: 979 goto st35 980 case 46: 981 goto st30 982 case 95: 983 goto st35 984 case 183: 985 goto st35 986 } 987 switch { 988 case data[p] < 8204: 989 switch { 990 case data[p] < 192: 991 switch { 992 case data[p] < 65: 993 if 48 <= data[p] && data[p] <= 58 { 994 goto st35 995 } 996 case data[p] > 90: 997 if 97 <= data[p] && data[p] <= 122 { 998 goto st35 999 } 1000 default: 1001 goto st35 1002 } 1003 case data[p] > 214: 1004 switch { 1005 case data[p] < 248: 1006 if 216 <= data[p] && data[p] <= 246 { 1007 goto st35 1008 } 1009 case data[p] > 893: 1010 if 895 <= data[p] && data[p] <= 8191 { 1011 goto st35 1012 } 1013 default: 1014 goto st35 1015 } 1016 default: 1017 goto st35 1018 } 1019 case data[p] > 8205: 1020 switch { 1021 case data[p] < 12289: 1022 switch { 1023 case data[p] < 8304: 1024 if 8255 <= data[p] && data[p] <= 8256 { 1025 goto st35 1026 } 1027 case data[p] > 8591: 1028 if 11264 <= data[p] && data[p] <= 12271 { 1029 goto st35 1030 } 1031 default: 1032 goto st35 1033 } 1034 case data[p] > 55295: 1035 switch { 1036 case data[p] < 65008: 1037 if 63744 <= data[p] && data[p] <= 64975 { 1038 goto st35 1039 } 1040 case data[p] > 65533: 1041 if 65536 <= data[p] && data[p] <= 983039 { 1042 goto st35 1043 } 1044 default: 1045 goto st35 1046 } 1047 default: 1048 goto st35 1049 } 1050 default: 1051 goto st35 1052 } 1053 goto tr0 1054 st_out: 1055 _test_eof2: cs = 2; goto _test_eof 1056 _test_eof3: cs = 3; goto _test_eof 1057 _test_eof31: cs = 31; goto _test_eof 1058 _test_eof4: cs = 4; goto _test_eof 1059 _test_eof32: cs = 32; goto _test_eof 1060 _test_eof5: cs = 5; goto _test_eof 1061 _test_eof33: cs = 33; goto _test_eof 1062 _test_eof6: cs = 6; goto _test_eof 1063 _test_eof7: cs = 7; goto _test_eof 1064 _test_eof8: cs = 8; goto _test_eof 1065 _test_eof9: cs = 9; goto _test_eof 1066 _test_eof34: cs = 34; goto _test_eof 1067 _test_eof10: cs = 10; goto _test_eof 1068 _test_eof11: cs = 11; goto _test_eof 1069 _test_eof12: cs = 12; goto _test_eof 1070 _test_eof13: cs = 13; goto _test_eof 1071 _test_eof14: cs = 14; goto _test_eof 1072 _test_eof15: cs = 15; goto _test_eof 1073 _test_eof16: cs = 16; goto _test_eof 1074 _test_eof17: cs = 17; goto _test_eof 1075 _test_eof18: cs = 18; goto _test_eof 1076 _test_eof19: cs = 19; goto _test_eof 1077 _test_eof20: cs = 20; goto _test_eof 1078 _test_eof21: cs = 21; goto _test_eof 1079 _test_eof22: cs = 22; goto _test_eof 1080 _test_eof23: cs = 23; goto _test_eof 1081 _test_eof24: cs = 24; goto _test_eof 1082 _test_eof25: cs = 25; goto _test_eof 1083 _test_eof26: cs = 26; goto _test_eof 1084 _test_eof27: cs = 27; goto _test_eof 1085 _test_eof28: cs = 28; goto _test_eof 1086 _test_eof29: cs = 29; goto _test_eof 1087 _test_eof35: cs = 35; goto _test_eof 1088 _test_eof30: cs = 30; goto _test_eof 1089 1090 _test_eof: {} 1091 if p == eof { 1092 switch cs { 1093 case 31, 34: 1094 //line extract_actions.rl:57 1095 1096 switch kind { 1097 case IRI: 1098 return iriText, "", kind, nil 1099 case Blank: 1100 return blankText, "", kind, nil 1101 case Literal: 1102 qual = iriText 1103 if qual == "" { 1104 qual = langText 1105 } 1106 return literalText, qual, kind, nil 1107 default: 1108 return "", "", kind, ErrInvalidTerm 1109 } 1110 1111 case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30: 1112 //line extract_actions.rl:74 1113 1114 if p < len(data) { 1115 if r := data[p]; r < unicode.MaxASCII { 1116 return "", "", Invalid, fmt.Errorf("%w: unexpected rune %q at %d", ErrInvalidTerm, data[p], p) 1117 } else { 1118 return "", "", Invalid, fmt.Errorf("%w: unexpected rune %q (\\u%04[2]x) at %d", ErrInvalidTerm, data[p], p) 1119 } 1120 } 1121 return "", "", Invalid, ErrIncompleteTerm 1122 1123 case 35: 1124 //line extract_actions.rl:26 1125 1126 if blank < 0 { 1127 panic("unexpected parser state: blank start not set") 1128 } 1129 blankText = string(data[blank:p]) 1130 kind = Blank 1131 1132 //line extract_actions.rl:57 1133 1134 switch kind { 1135 case IRI: 1136 return iriText, "", kind, nil 1137 case Blank: 1138 return blankText, "", kind, nil 1139 case Literal: 1140 qual = iriText 1141 if qual == "" { 1142 qual = langText 1143 } 1144 return literalText, qual, kind, nil 1145 default: 1146 return "", "", kind, ErrInvalidTerm 1147 } 1148 1149 case 32, 33: 1150 //line extract_actions.rl:50 1151 1152 if lang < 0 { 1153 panic("unexpected parser state: lang start not set") 1154 } 1155 langText = string(data[lang:p]) 1156 1157 //line extract_actions.rl:57 1158 1159 switch kind { 1160 case IRI: 1161 return iriText, "", kind, nil 1162 case Blank: 1163 return blankText, "", kind, nil 1164 case Literal: 1165 qual = iriText 1166 if qual == "" { 1167 qual = langText 1168 } 1169 return literalText, qual, kind, nil 1170 default: 1171 return "", "", kind, ErrInvalidTerm 1172 } 1173 1174 //line extract.go:1175 1175 } 1176 } 1177 1178 _out: {} 1179 } 1180 1181 //line extract.rl:50 1182 1183 return "", "", 0, ErrInvalidTerm 1184 }