<commit_before>from basic import *
import expression

class Statement(Node):
    pass

class DeclarationList(Node):
    CODE = "350100"
    LABEL = "DeclList"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], DeclarationList.CODE)
        return DeclarationList(jsn['pos'],\
                               [Node.from_json(c) for c in jsn['children']])

    def __init__(self, pos, declarations):
        super().__init__(pos)
        self.__declarations = declarations

# A declaration isn't quite a statement, but this is the best place for it,
# for now.
class Declaration(Node):
    CODE = "450100"
    LABEL = "Declaration"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], Declaration.CODE)
        return Declaration(jsn['pos'],\
                           DeclarationList.from_json(jsn['children'][0]))

    def __init__(self, pos, declared):
        super().__init__(pos)
        self.__declared = declared

# Generic definition class
class Definition(Node):
    CODE = "450200"
    LABEL = "Definition"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], Definition.CODE)
        return Definition(jsn['pos'],\
                          Node.from_json(jsn['children'][0]))

    def __init__(self, pos, defined):
        super().__init__(pos)
        self.__defined = defined

    def defined(self):
        return self.__defined


    def to_s(self):
        return self__defined.to_s()

# Used to specify the default switch case
class Default(Statement):
    CODE = "270400"
    LABEL = "Default"<commit_msg>added Continue<commit_after>from basic import *
import expression

class Statement(Node):
    pass

class DeclarationList(Node):
    CODE = "350100"
    LABEL = "DeclList"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], DeclarationList.CODE)
        return DeclarationList(jsn['pos'],\
                               [Node.from_json(c) for c in jsn['children']])

    def __init__(self, pos, declarations):
        super().__init__(pos)
        self.__declarations = declarations

# A declaration isn't quite a statement, but this is the best place for it,
# for now.
class Declaration(Node):
    CODE = "450100"
    LABEL = "Declaration"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], Declaration.CODE)
        return Declaration(jsn['pos'],\
                           DeclarationList.from_json(jsn['children'][0]))

    def __init__(self, pos, declared):
        super().__init__(pos)
        self.__declared = declared

# Generic definition class
class Definition(Node):
    CODE = "450200"
    LABEL = "Definition"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], Definition.CODE)
        return Definition(jsn['pos'],\
                          Node.from_json(jsn['children'][0]))

    def __init__(self, pos, defined):
        super().__init__(pos)
        self.__defined = defined

    def defined(self):
        return self.__defined


    def to_s(self):
        return self__defined.to_s()

class Continue(Statement):
    CODE = "280001"
    LABEL = "Continue"

    @staticmethod
    def from_json(jsn):
        Node.check_code(jsn['type'], Continue.CODE)
        assert not jsn['children']
        return Continue(jsn['pos'])

# Used to specify the default switch case
class Default(Statement):
    CODE = "270400"
    LABEL = "Default"
{'fraction_non_alphanumeric': 0.11768115942028985, 'fraction_numerical': 0.01681159420289855, 'mean_word_length': 2.6479915433403804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4757239', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1005, 'n_words': 246}