( selector, match /* Internal Use Only */ )
| 2566 | } |
| 2567 | |
| 2568 | function compile( selector, match /* Internal Use Only */ ) { |
| 2569 | var i, |
| 2570 | setMatchers = [], |
| 2571 | elementMatchers = [], |
| 2572 | cached = compilerCache[ selector + " " ]; |
| 2573 | |
| 2574 | if ( !cached ) { |
| 2575 | |
| 2576 | // Generate a function of recursive functions that can be used to check each element |
| 2577 | if ( !match ) { |
| 2578 | match = tokenize( selector ); |
| 2579 | } |
| 2580 | i = match.length; |
| 2581 | while ( i-- ) { |
| 2582 | cached = matcherFromTokens( match[ i ] ); |
| 2583 | if ( cached[ expando ] ) { |
| 2584 | setMatchers.push( cached ); |
| 2585 | } else { |
| 2586 | elementMatchers.push( cached ); |
| 2587 | } |
| 2588 | } |
| 2589 | |
| 2590 | // Cache the compiled function |
| 2591 | cached = compilerCache( selector, |
| 2592 | matcherFromGroupMatchers( elementMatchers, setMatchers ) ); |
| 2593 | |
| 2594 | // Save selector and tokenization |
| 2595 | cached.selector = selector; |
| 2596 | } |
| 2597 | return cached; |
| 2598 | } |
| 2599 | |
| 2600 | /** |
| 2601 | * A low-level selection function that works with jQuery's compiled |
no test coverage detected