( selector, parseOnly )
| 672 | var tokenCache = createCache(); |
| 673 | |
| 674 | function tokenize( selector, parseOnly ) { |
| 675 | var matched, match, tokens, type, |
| 676 | soFar, groups, preFilters, |
| 677 | cached = tokenCache[ selector + " " ]; |
| 678 | |
| 679 | if ( cached ) { |
| 680 | return parseOnly ? 0 : cached.slice( 0 ); |
| 681 | } |
| 682 | |
| 683 | soFar = selector; |
| 684 | groups = []; |
| 685 | preFilters = jQuery.expr.preFilter; |
| 686 | |
| 687 | while ( soFar ) { |
| 688 | |
| 689 | // Comma and first run |
| 690 | if ( !matched || ( match = rcomma.exec( soFar ) ) ) { |
| 691 | if ( match ) { |
| 692 | |
| 693 | // Don't consume trailing commas as valid |
| 694 | soFar = soFar.slice( match[ 0 ].length ) || soFar; |
| 695 | } |
| 696 | groups.push( ( tokens = [] ) ); |
| 697 | } |
| 698 | |
| 699 | matched = false; |
| 700 | |
| 701 | // Combinators |
| 702 | if ( ( match = rleadingCombinator.exec( soFar ) ) ) { |
| 703 | matched = match.shift(); |
| 704 | tokens.push( { |
| 705 | value: matched, |
| 706 | |
| 707 | // Cast descendant combinators to space |
| 708 | type: match[ 0 ].replace( rtrimCSS, " " ) |
| 709 | } ); |
| 710 | soFar = soFar.slice( matched.length ); |
| 711 | } |
| 712 | |
| 713 | // Filters |
| 714 | for ( type in filterMatchExpr ) { |
| 715 | if ( ( match = jQuery.expr.match[ type ].exec( soFar ) ) && ( !preFilters[ type ] || |
| 716 | ( match = preFilters[ type ]( match ) ) ) ) { |
| 717 | matched = match.shift(); |
| 718 | tokens.push( { |
| 719 | value: matched, |
| 720 | type: type, |
| 721 | matches: match |
| 722 | } ); |
| 723 | soFar = soFar.slice( matched.length ); |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | if ( !matched ) { |
| 728 | break; |
| 729 | } |
| 730 | } |
| 731 |
no test coverage detected