Parse closing parameter group symbol ']'.
(self, function: Function)
| 1202 | function.docstring_only = True |
| 1203 | |
| 1204 | def parse_closing_square_bracket(self, function: Function) -> None: |
| 1205 | """Parse closing parameter group symbol ']'.""" |
| 1206 | if not self.group: |
| 1207 | fail(f"Function {function.name!r} has a ']' without a matching '['.") |
| 1208 | if not any(p.group == self.group for p in function.parameters.values()): |
| 1209 | fail(f"Function {function.name!r} has an empty group. " |
| 1210 | "All groups must contain at least one parameter.") |
| 1211 | self.group -= 1 |
| 1212 | match self.parameter_state: |
| 1213 | case ParamState.LEFT_SQUARE_BEFORE | ParamState.GROUP_BEFORE: |
| 1214 | self.parameter_state = ParamState.GROUP_BEFORE |
| 1215 | case ParamState.GROUP_AFTER | ParamState.RIGHT_SQUARE_AFTER: |
| 1216 | self.parameter_state = ParamState.RIGHT_SQUARE_AFTER |
| 1217 | case st: |
| 1218 | fail(f"Function {function.name!r} " |
| 1219 | f"has an unsupported group configuration. " |
| 1220 | f"(Unexpected state {st}.c)") |
| 1221 | |
| 1222 | def parse_slash(self, function: Function, version: VersionTuple | None) -> None: |
| 1223 | """Parse positional-only parameter marker '/'. |
no test coverage detected