import re


def extractVarNames(decLine):
    """Given a logical line that declares one or more variables,
    return the variable names in a list."""

    # a Fortran parameter does not need a threadprivate declaration
    if re.search(r"\bparameter\b(?=.*::)", decLine, re.IGNORECASE) is not None:
        return []
    else:
        # print(decLine)
        decLine = decLine.split("::")[1]  # Remove declaration text
        decLine = decLine.split("!")[0]  # Remove code comment
        listOfVars = decLine.split(",")  # Separate variable names
        listOfVars = [x.split("=")[0] for x in listOfVars]  # Remove equations
        listOfVars = [x.strip() for x in listOfVars]  # Remove extra whitespace
    return listOfVars