(self, tk, fields, values, key_fields, key_values)
Handler for inserts.
Handler for inserts.
Handler for inserts .
def parse_insert(self, tk, fields, values, key_fields, key_values):
        """Handler for inserts."""
        # (col1, col2) values ('data', null)
        if tk.next() != "(":
            raise Exception("syntax error")
        while 1:
            fields.append(tk.next())
            t = tk.next()
            if t == ")":
                break
            elif t != ",":
                raise Exception("syntax error")
        if tk.next().lower() != "values":
            raise Exception("syntax error, expected VALUES")
        if tk.next() != "(":
            raise Exception("syntax error, expected (")
        while 1:
            values.append(tk.next())
            t = tk.next()
            if t == ")":
                break
            if t == ",":
                continue
            raise Exception("expected , or ) got "+t)
        t = tk.next()
        raise Exception("expected EOF, got " + repr(t))
def parse_insert ( self , tk , fields , values , key_fields , key_values ) : # (col1, col2) values ('data', null) if tk . next ( ) != "(" : raise Exception ( "syntax error" ) while 1 : fields . append ( tk . next ( ) ) t = tk . next ( ) if t == ")" : break elif t != "," : raise Exception ( "syntax error" ) if tk . next ( ) . lower ( ) != "values" : raise Exception ( "syntax error, expected VALUES" ) if tk . next ( ) != "(" : raise Exception ( "syntax error, expected (" ) while 1 : values . append ( tk . next ( ) ) t = tk . next ( ) if t == ")" : break if t == "," : continue raise Exception ( "expected , or ) got " + t ) t = tk . next ( ) raise Exception ( "expected EOF, got " + repr ( t ) )