(self, message: str, tkn: Token | None = None)
| 91 | return lines[lineno - 1] |
| 92 | |
| 93 | def make_syntax_error(self, message: str, tkn: Token | None = None) -> SyntaxError: |
| 94 | # Construct a SyntaxError instance from message and token |
| 95 | if tkn is None: |
| 96 | tkn = self.peek() |
| 97 | if tkn is None: |
| 98 | tkn = self.tokens[-1] |
| 99 | return lx.make_syntax_error( |
| 100 | message, self.filename, tkn.line, tkn.column, self.extract_line(tkn.line) |
| 101 | ) |
| 102 | |
| 103 | |
| 104 | if __name__ == "__main__": |
no test coverage detected