Return then the number of positional parameters and keyword parfameters represented by the attr (operand) field of token. This appears in CALL_FUNCTION or CALL_METHOD (PyPy) tokens
(self, token)
| 222 | raise ParserError(None, -1, self.debug["reduce"]) |
| 223 | |
| 224 | def get_pos_kw(self, token): |
| 225 | """ |
| 226 | Return then the number of positional parameters and keyword |
| 227 | parfameters represented by the attr (operand) field of |
| 228 | token. |
| 229 | |
| 230 | This appears in CALL_FUNCTION or CALL_METHOD (PyPy) tokens |
| 231 | """ |
| 232 | # Low byte indicates number of positional parameters, |
| 233 | # high byte number of keyword parameters |
| 234 | assert token.kind.startswith("CALL_FUNCTION") or token.kind.startswith( |
| 235 | "CALL_METHOD" |
| 236 | ) |
| 237 | args_pos = token.attr & 0xFF |
| 238 | args_kw = (token.attr >> 8) & 0xFF |
| 239 | return args_pos, args_kw |
| 240 | |
| 241 | def nonterminal(self, nt, args): |
| 242 | n = len(args) |
no outgoing calls
no test coverage detected