def parse(self, token_parser: TokenParser) -> FilesSourceSdv: file_specs = self._parse_file_specs(token_parser) token_parser.require_has_valid_head_token(_FILE_NAME_OR_SET_END) token_parser.consume_mandatory_keyword__part_of_syntax_element( syntax.FILE_LIST_END, False, syntax_elements.FILES_SOURCE_SYNTAX_ELEMENT.singular_name, ) return file_list.Sdv(file_specs)
def _parse_constant(tokens: TokenParser) -> FilesConditionSdv: elements = _parse_elements(tokens) tokens.require_has_valid_head_token(_FILE_NAME_OR_SET_END) tokens.consume_mandatory_keyword__part_of_syntax_element( syntax.LITERAL_END, False, syntax_elements.FILES_CONDITION_SYNTAX_ELEMENT.singular_name, ) return files_conditions.new_constant(elements)