(expr: str)
| 1144 | |
| 1145 | |
| 1146 | def _has_environment_mismatch(expr: str) -> bool: |
| 1147 | stack: list[str] = [] |
| 1148 | pattern = re.compile(r"(?<!\\)\\(begin|end)\{([A-Za-z*]+)\}") |
| 1149 | for kind, env in pattern.findall(expr): |
| 1150 | if kind == "begin": |
| 1151 | stack.append(env) |
| 1152 | continue |
| 1153 | if not stack or stack[-1] != env: |
| 1154 | return True |
| 1155 | stack.pop() |
| 1156 | return bool(stack) |
| 1157 | |
| 1158 | |
| 1159 | def _has_left_right_mismatch(expr: str) -> bool: |
no outgoing calls
no test coverage detected