def p_error(p): if p: print("Syntax error at line {0}, column {1}: LexToken({2}, '{3}')". format(p.lineno, scanner.find_tok_column(line, p), p.type, p.value)) else: print("Unexpected end of input")
def p_error(p): if p is None: print('Unexpected end of input') else: column = find_tok_column(p) print( f"Syntax error at line {p.lineno}, column {column}: LexToken({p.type}, '{p.value}')" )
def p_error(p): if p: print('Syntax error at line {0}, column {1}: LexToken({2}, \'{3}\')'.format( p.lexer.lineno, scanner.find_tok_column(p), p.type, p.value)) else: print('Unexpected end of input')