Prints the line with the error and an error message, and shows the position of the error. :param msg: Error message. :type msg: str :param line: Input line with the error. :param line: str :param pos: Position of therror in the input line. :type pos: int :ret
(msg, tok)
| 272 | return lines, lexer.errCount |
| 273 | |
| 274 | def _printError(msg, tok): |
| 275 | """ |
| 276 | Prints the line with the error and an error message, and shows the position |
| 277 | of the error. |
| 278 | |
| 279 | :param msg: Error message. |
| 280 | :type msg: str |
| 281 | |
| 282 | :param line: Input line with the error. |
| 283 | :param line: str |
| 284 | |
| 285 | :param pos: Position of therror in the input line. |
| 286 | :type pos: int |
| 287 | |
| 288 | :return: out: Input line with error message. |
| 289 | :rtype: str |
| 290 | """ |
| 291 | pos = _find_column(tok) |
| 292 | txt = _get_input_line(tok) |
| 293 | out = '\n' + txt + '\n' |
| 294 | for i in range(pos-1): |
| 295 | out += '.' |
| 296 | out += '|\n' + msg |
| 297 | print(out) |
| 298 | |
| 299 | def _find_column(token): |
| 300 | """ |
no test coverage detected