def doit(fn, line):
    try:
        ast = fn(line, show_tokens=True)
        print(ast)
    except ScannerError as e:
        print('Scanner error')
        print(e.text)
        print(e.text_cursor)
    except LocationError as e:
        print('Parser error at or near')
        print(e.text)
        print(e.text_cursor)
def doit(fn, line):
    try:
        ast = fn(line, show_tokens=True)
        print(ast)
    except ScannerError as e:
        print('Scanner error')
        print(e.text)
        print(e.text_cursor)
    except LocationError as e:
        print('Parser error at or near')
        print(e.text)
        print(e.text_cursor)