def rule_name_SA(parser, node, children):
    rule_name = str(node)

    if parser.debug:
        parser.dprint("Creating class: {}".format(rule_name))

    # If a class is given by the user use it. Else, create new class.
    if parser.metamodel.user_classes in rule_name:

        cls = parser.metamodel.user_classes[rule_name]

        # Initialize special attributes
        parser.metamodel._init_class(cls, None, node.position)
    else:
        # Create class to collect attributes. At this time PEG rule
        # is not known.
        cls = parser.metamodel._new_class(rule_name, None, node.position)

    parser._current_cls = cls

    # First class will be the root of the meta-model
    if not parser.metamodel.rootcls:
        parser.metamodel.rootcls = cls

    return rule_name
dataset/ETHPy150Open igordejanovic/textX/textx/textx.py/rule_name_SA/swapped operands of `in`