MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _printError

Function _printError

SLiCAP/SLiCAPlex.py:274–297  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

272 return lines, lexer.errCount
273
274def _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
299def _find_column(token):
300 """

Callers 11

_parseNetlistFunction · 0.90
_createSubCKTFunction · 0.90
_parseElementFunction · 0.90
_parseSubcircuitElementFunction · 0.90
_parseCommandFunction · 0.90
_parseLibraryFunction · 0.90
t_PARDEFFunction · 0.85
t_EXPRFunction · 0.85
t_SCIFunction · 0.85
t_SCALEFunction · 0.85
t_errorFunction · 0.85

Calls 2

_find_columnFunction · 0.85
_get_input_lineFunction · 0.85

Tested by

no test coverage detected