MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / _has_environment_mismatch

Function _has_environment_mismatch

scripts/lint_note.py:1146–1156  ·  view source on GitHub ↗
(expr: str)

Source from the content-addressed store, hash-verified

1144
1145
1146def _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
1159def _has_left_right_mismatch(expr: str) -> bool:

Callers 1

math_render_issuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected