Computes and returns the column number of 'token'. :param token: Token of which the column number has to be calculated. :type token: ply.lex.token :return: Column position of this token. :rtype: int
(token)
| 297 | print(out) |
| 298 | |
| 299 | def _find_column(token): |
| 300 | """ |
| 301 | Computes and returns the column number of 'token'. |
| 302 | |
| 303 | :param token: Token of which the column number has to be calculated. |
| 304 | :type token: ply.lex.token |
| 305 | |
| 306 | :return: Column position of this token. |
| 307 | :rtype: int |
| 308 | """ |
| 309 | line_start = lexer.lexdata.rfind('\n', 0, token.lexpos) + 1 |
| 310 | return (token.lexpos - line_start) + 1 |
| 311 | |
| 312 | def _get_input_line(token): |
| 313 | """ |