Separates the text after '::' in a variable definition to extract all the variables,
        their dimensions and default values.

def _separate_multiple_def(self, defstring, parent, refstring, refline):
        """Separates the text after '::' in a variable definition to extract all the variables,
        their dimensions and default values.
        """
        import pyparsing
        nester = pyparsing.nestedExpr('(', ')')
        try:
            parsed = nester.parseString("(" + re.sub("=(>?)", " =\\1 ", defstring) + ")").asList()[0]
        except pyparsing.ParseException as err:
            from fortpy import msg
            repl = (parent.name, refline[0], refstring,
                    defstring, ''.join(['-']*(err.loc-1))+'^', err.msg)
            msg.err("parsing variable from '{}:{} >> {}': \n'{}'\n{} {}.".format(*repl))
            raise
        
        i = 0
        clean = []
        while i < len(parsed):
            if (isinstance(parsed[i], str) and not re.match("=>?", parsed[i]) and 
                i+1 < len(parsed) and isinstance(parsed[i+1], list)):
                clean.append((parsed[i], parsed[i+1]))
                i += 2
            elif isinstance(parsed[i], str) and parsed[i] == ",":
                i += 1
            else:
                clean.append(parsed[i])
                i += 1

        #Now pass through again to handle the default values.
        i = 0
        ready = []
        while i < len(clean):
            if isinstance(clean[i], str) and re.match("=>?", clean[i]):
                ready.pop()
                if ">" in clean[i]:
                    ready.append([clean[i-1], ("> " + clean[i+1][0], clean[i+1][1])])
                else:
                    ready.append([clean[i-1], clean[i+1]])
                i += 2
            else:
                ready.append(clean[i])
                i += 1

        return ready