Match start of namespace, append to stack, and consume line Args: line: Line to check and consume linenum: Line number of the line to check Returns: The consumed line if namespace matched; None otherwise
(self, line: str, linenum: int)
| 3495 | inner_block.inline_asm = _END_ASM |
| 3496 | |
| 3497 | def _UpdateNamesapce(self, line: str, linenum: int) -> str | None: |
| 3498 | """ |
| 3499 | Match start of namespace, append to stack, and consume line |
| 3500 | Args: |
| 3501 | line: Line to check and consume |
| 3502 | linenum: Line number of the line to check |
| 3503 | |
| 3504 | Returns: |
| 3505 | The consumed line if namespace matched; None otherwise |
| 3506 | """ |
| 3507 | # Match start of namespace. The "\b\s*" below catches namespace |
| 3508 | # declarations even if it weren't followed by a whitespace, this |
| 3509 | # is so that we don't confuse our namespace checker. The |
| 3510 | # missing spaces will be flagged by CheckSpacing. |
| 3511 | namespace_decl_match = re.match(r"^\s*namespace\b\s*([:\w]+)?(.*)$", line) |
| 3512 | if not namespace_decl_match: |
| 3513 | return None |
| 3514 | |
| 3515 | new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum) |
| 3516 | self.stack.append(new_namespace) |
| 3517 | |
| 3518 | line = namespace_decl_match.group(2) |
| 3519 | if line.find("{") != -1: |
| 3520 | new_namespace.seen_open_brace = True |
| 3521 | line = line[line.find("{") + 1 :] |
| 3522 | return line |
| 3523 | |
| 3524 | def _UpdateConstructor(self, line: str, linenum: int, class_name: str | None = None): |
| 3525 | """ |
no test coverage detected