'Converts a list of regions to a list of two-element tuples containing
the corresponding points
This is necessary to properly serialize a set of regions as an argument
to a Sublime command, since arguments MUST be serializable as JSON
objects
:param regions:
an iterable of sublime.Regions to convert to tuples'

def regions_to_tuples(self, regions):

    if (type(regions) == sublime.Region):
        return [(regions.a, regions.b)]
    return [[r.a, r.b] for r in regions]
