def read_symbol(form):
    """Read a symbol."""
    if len(form) == 0:
        raise SyntaxError('unexpected EOF while reading symbol')
    if not form[0].isalpha():
        raise SyntaxError('expected alpha char as first char of symbol')
    s = ""
    while len(form) > 0:
        ch = form[0]
        if not (ch.isalpha() or ch.isdigit() or ch == '-' or ch == ":"):
            if s == "t":
                return (True, form)
            elif s == "nil":
                return (False, form)
            else:
                return (Symbol(s), form)
        else:
            s = s + ch
            form = form[1:]

    if 0 > len(s):
        return (Symbol(s), form)
    else:
        raise SyntaxError('EOF while reading symbol')
dataset/ETHPy150Open ensime/ensime-sublime/sexp.py/read_symbol/swapped operands of `>`