MCPcopy Index your code
hub / github.com/cpplint/cpplint / _CountOpenParentheses

Method _CountOpenParentheses

cpplint.py:3404–3427  ·  view source on GitHub ↗
(self, line: str)

Source from the content-addressed store, hash-verified

3402 self.popped_top = self.stack.pop()
3403
3404 def _CountOpenParentheses(self, line: str):
3405 # Count parentheses. This is to avoid adding struct arguments to
3406 # the nesting stack.
3407 if self.stack:
3408 inner_block = self.stack[-1]
3409 depth_change = line.count("(") - line.count(")")
3410 inner_block.open_parentheses += depth_change
3411
3412 # Also check if we are starting or ending an inline assembly block.
3413 if inner_block.inline_asm in (_NO_ASM, _END_ASM):
3414 if (
3415 depth_change != 0
3416 and inner_block.open_parentheses == 1
3417 and _MATCH_ASM.match(line)
3418 ):
3419 # Enter assembly block
3420 inner_block.inline_asm = _INSIDE_ASM
3421 else:
3422 # Not entering assembly block. If previous line was _END_ASM,
3423 # we will now shift to _NO_ASM state.
3424 inner_block.inline_asm = _NO_ASM
3425 elif inner_block.inline_asm == _INSIDE_ASM and inner_block.open_parentheses == 0:
3426 # Exit assembly block
3427 inner_block.inline_asm = _END_ASM
3428
3429 def _UpdateNamesapce(self, line: str, linenum: int) -> str | None:
3430 """

Callers 1

UpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected