(line: str)
| 176 | body_prefix = self.language.body_prefix.format(dsl_name=dsl_name) |
| 177 | |
| 178 | def is_stop_line(line: str) -> bool: |
| 179 | # make sure to recognize stop line even if it |
| 180 | # doesn't end with EOL (it could be the very end of the file) |
| 181 | if line.startswith(stop_line): |
| 182 | remainder = line.removeprefix(stop_line) |
| 183 | if remainder and not remainder.isspace(): |
| 184 | fail(f"Garbage after stop line: {remainder!r}") |
| 185 | return True |
| 186 | else: |
| 187 | # gh-92256: don't allow incorrectly formatted stop lines |
| 188 | if line.lstrip().startswith(stop_line): |
| 189 | fail(f"Whitespace is not allowed before the stop line: {line!r}") |
| 190 | return False |
| 191 | |
| 192 | # consume body of program |
| 193 | while self.input: |
nothing calls this directly
no test coverage detected