MCPcopy Index your code
hub / github.com/python/cpython / parse_opening_square_bracket

Method parse_opening_square_bracket

Tools/clinic/libclinic/dsl_parser.py:1190–1202  ·  view source on GitHub ↗

Parse opening parameter group symbol '['.

(self, function: Function)

Source from the content-addressed store, hash-verified

1188 self.deprecated_positional = version
1189
1190 def parse_opening_square_bracket(self, function: Function) -> None:
1191 """Parse opening parameter group symbol '['."""
1192 match self.parameter_state:
1193 case ParamState.START | ParamState.LEFT_SQUARE_BEFORE:
1194 self.parameter_state = ParamState.LEFT_SQUARE_BEFORE
1195 case ParamState.REQUIRED | ParamState.GROUP_AFTER:
1196 self.parameter_state = ParamState.GROUP_AFTER
1197 case st:
1198 fail(f"Function {function.name!r} "
1199 f"has an unsupported group configuration. "
1200 f"(Unexpected state {st}.b)")
1201 self.group += 1
1202 function.docstring_only = True
1203
1204 def parse_closing_square_bracket(self, function: Function) -> None:
1205 """Parse closing parameter group symbol ']'."""

Callers 1

state_parameterMethod · 0.95

Calls 1

failFunction · 0.90

Tested by

no test coverage detected