MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _find_column

Function _find_column

SLiCAP/SLiCAPlex.py:299–310  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

297 print(out)
298
299def _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
312def _get_input_line(token):
313 """

Callers 1

_printErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected