def check_config_style(filepath):
    bad_count_file = 0

    def pushClosing(t):
        closingStack.append(closing.expr)
        (closing << Literal(closingFor[t[0]]))

    def popClosing():
        (closing << closingStack.pop())
    with open(filepath, 'r', encoding='utf-8', errors='ignore') as file:
        content = file.read()
        brackets_list = []
        isInCommentBlock = False
        checkIfInComment = False
        ignoreTillEndOfLine = False
        checkIfNextIsClosingBlock = False
        isInString = False
        inStringType = ''
        lastIsCurlyBrace = False
        checkForSemiColumn = False
        lineNumber = 1
        indexOfCharacter = 0
        for c in content:
            if lastIsCurlyBrace:
                lastIsCurlyBrace = False
            if (c == '\n'):
                lineNumber += 1
            if isInString:
                if (c == inStringType):
                    isInString = False
            elif (isInCommentBlock == False):
                if checkIfInComment:
                    checkIfInComment = False
                    if (c == '*'):
                        isInCommentBlock = True
                    elif (c == '/'):
                        ignoreTillEndOfLine = True
                if (isInCommentBlock == False):
                    if ignoreTillEndOfLine:
                        if (c == '\n'):
                            ignoreTillEndOfLine = False
                    elif ((c == '"') or (c == "'")):
                        isInString = True
                        inStringType = c
                    elif (c == '/'):
                        checkIfInComment = True
                    elif (c == '('):
                        brackets_list.append('(')
                    elif (c == ')'):
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['{', '['])):
                            print("ERROR: Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append(')')
                    elif (c == '['):
                        brackets_list.append('[')
                    elif (c == ']'):
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['{', '('])):
                            print("ERROR: Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append(']')
                    elif (c == '{'):
                        brackets_list.append('{')
                    elif (c == '}'):
                        lastIsCurlyBrace = True
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['(', '['])):
                            print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append('}')
            elif (c == '*'):
                checkIfNextIsClosingBlock = True
            elif checkIfNextIsClosingBlock:
                if (c == '/'):
                    isInCommentBlock = False
                elif (c != '*'):
                    checkIfNextIsClosingBlock = False
            indexOfCharacter += 1
        if (brackets_list.count('[') != brackets_list.count(']')):
            print('ERROR: A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}'.format(filepath, brackets_list.count('['), brackets_list.count(']')))
            bad_count_file += 1
        if (brackets_list.count('(') != brackets_list.count(')')):
            print('ERROR: A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}'.format(filepath, brackets_list.count('('), brackets_list.count(')')))
            bad_count_file += 1
        if (brackets_list.count('{') != brackets_list.count('}')):
            print('ERROR: A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}'.format(filepath, brackets_list.count('{'), brackets_list.count('}')))
            bad_count_file += 1
    return bad_count_file
def check_config_style(filepath):
    bad_count_file = 0

    def pushClosing(t):
        closingStack.append(closing.expr)
        (closing << Literal(closingFor[t[0]]))

    def popClosing():
        (closing << closingStack.pop())
    with open(filepath, 'r', encoding='utf-8', errors='ignore') as file:
        content = file.read()
        brackets_list = []
        isInCommentBlock = False
        checkIfInComment = False
        ignoreTillEndOfLine = False
        checkIfNextIsClosingBlock = False
        isInString = False
        inStringType = 
        lastIsCurlyBrace = False
        checkForSemiColumn = False
        lineNumber = 1
        indexOfCharacter = 0
        for c in content:
            if lastIsCurlyBrace:
                lastIsCurlyBrace = False
            if (c == '\n'):
                lineNumber += 1
            if isInString:
                if (c == inStringType):
                    isInString = False
            elif (isInCommentBlock == False):
                if checkIfInComment:
                    checkIfInComment = False
                    if (c == '*'):
                        isInCommentBlock = True
                    elif (c == '/'):
                        ignoreTillEndOfLine = True
                if (isInCommentBlock == False):
                    if ignoreTillEndOfLine:
                        if (c == '\n'):
                            ignoreTillEndOfLine = False
                    elif ((c == '"') or (c == "'")):
                        isInString = True
                        inStringType = c
                    elif (c == '/'):
                        checkIfInComment = True
                    elif (c == '('):
                        brackets_list.append('(')
                    elif (c == ')'):
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['{', '['])):
                            print("ERROR: Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append(')')
                    elif (c == '['):
                        brackets_list.append('[')
                    elif (c == ']'):
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['{', '('])):
                            print("ERROR: Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append(']')
                    elif (c == '{'):
                        brackets_list.append('{')
                    elif (c == '}'):
                        lastIsCurlyBrace = True
                        if ((len(brackets_list) > 0) and (brackets_list[(- 1)] in ['(', '['])):
                            print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath, lineNumber))
                            bad_count_file += 1
                        brackets_list.append('}')
            elif (c == '*'):
                checkIfNextIsClosingBlock = True
            elif checkIfNextIsClosingBlock:
                if (c == '/'):
                    isInCommentBlock = False
                elif (c != '*'):
                    checkIfNextIsClosingBlock = False
            indexOfCharacter += 1
        if (brackets_list.count('[') != brackets_list.count(']')):
            print('ERROR: A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}'.format(filepath, brackets_list.count('['), brackets_list.count(']')))
            bad_count_file += 1
        if (brackets_list.count('(') != brackets_list.count(')')):
            print('ERROR: A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}'.format(filepath, brackets_list.count('('), brackets_list.count(')')))
            bad_count_file += 1
        if (brackets_list.count('{') != brackets_list.count('}')):
            print('ERROR: A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}'.format(filepath, brackets_list.count('{'), brackets_list.count('}')))
            bad_count_file += 1
    return bad_count_file