(
prevtokens: list[str],
prevtags: list[str],
token_lists: Sequence[Sequence[str]],
)
| 91 | must_be_present = None |
| 92 | |
| 93 | def _recur_param( |
| 94 | prevtokens: list[str], |
| 95 | prevtags: list[str], |
| 96 | token_lists: Sequence[Sequence[str]], |
| 97 | ) -> Generator[tuple[list[str], list[str], str], None, None]: |
| 98 | |
| 99 | if not token_lists: |
| 100 | return |
| 101 | |
| 102 | tokens = token_lists[0] |
| 103 | remainder = token_lists[1:] |
| 104 | |
| 105 | for i, token in enumerate(tokens): |
| 106 | |
| 107 | if _is_py_version(token): |
| 108 | is_our_python = token == OUR_PYTHON |
| 109 | tokentag = _python_to_tag(token) |
| 110 | is_default_token = is_our_python |
| 111 | else: |
| 112 | is_our_python = False |
| 113 | tokentag = token |
| 114 | is_default_token = i == 0 |
| 115 | |
| 116 | if is_our_python: |
| 117 | our_python_tags = ["py"] |
| 118 | else: |
| 119 | our_python_tags = [] |
| 120 | |
| 121 | if not tokentag.startswith("_"): |
| 122 | tags = ( |
| 123 | prevtags |
| 124 | + [tokentag] |
| 125 | + [tag + "-" + tokentag for tag in prevtags] |
| 126 | + our_python_tags |
| 127 | ) |
| 128 | else: |
| 129 | tags = prevtags + our_python_tags |
| 130 | |
| 131 | if remainder: |
| 132 | for args, newtags, ids in _recur_param( |
| 133 | prevtokens + [token], tags, remainder |
| 134 | ): |
| 135 | if not is_default_token: |
| 136 | newtags = [ |
| 137 | t |
| 138 | for t in newtags |
| 139 | if tokentag in t or t in our_python_tags |
| 140 | ] |
| 141 | |
| 142 | yield args, newtags, ids |
| 143 | else: |
| 144 | if not is_default_token: |
| 145 | newtags = [ |
| 146 | t |
| 147 | for t in tags |
| 148 | if tokentag in t or t in our_python_tags |
| 149 | ] |
| 150 | else: |
no test coverage detected