(cls, start, config_lines, indent, errors)
return cls(param_prop, description, start, block_len)
Main method used to parse a block starting at line 'start' with a given indentation.
Main method used to parse a block starting at line 'start' with a given indentation.
Main method used to parse a block starting at line start with a given indentation .
def parse_from_strings(cls, start, config_lines, indent, errors):
        """Main method used to parse a block starting at line 'start' with a given indentation."""
        idx = start

        # Let's first check if the block is a simple comment. If so, let's return and go to the next block
        if _is_comment(start, config_lines, indent, errors):
            comment, end = _parse_comment(start, config_lines)
            return cls(None, comment, start, end - start)

        # Let's get to the end of the block supposing it is formatted correctly (@param line, description, empty
        # comment, then the actual content). If it fails, let's ignore the whole block and its potential
        # sub-blocks.
        end = _get_end_of_param_declaration_block(start, len(config_lines), config_lines, indent, errors)
        if end is None:
            default_end = _get_next_block_in_case_of_failure(start, config_lines)
            return cls(None, None, start, default_end - start)

        block_len = end - start

        # Parsing the @param line
        param_prop = ParamProperties.parse_from_string(idx, config_lines, indent, errors)
        if param_prop is None:
            return cls(None, None, start, block_len)

        # If var is indicated as list, recompute end of block knowing it is a list
        if param_prop.type_name.startswith('list'):
            end = _get_end_of_param_declaration_block(
                start, len(config_lines), config_lines, indent, errors, is_list=True
            )
            if end is None:
                default_end = _get_next_block_in_case_of_failure(start, config_lines)
                return cls(None, None, start, default_end - start)
            block_len = end - start

        # Parsing the description
        idx += 1
        description, idx = _parse_description(idx, end, config_lines, indent, errors)
        if idx is None:
            return cls(param_prop, None, start, block_len)

        # We recurse if the variable is an object and contains at least one member with description
        is_object = _is_object(idx, config_lines, indent, param_prop, errors)
        if not is_object:
            return cls(param_prop, description, start, block_len)

        should_recurse, next_block = _should_recurse(idx, config_lines, indent)
        if should_recurse:
            # If we recurse we use block_len, pointing to the next sub-block
            return cls(param_prop, description, start, block_len, should_recurse=True)

        # If we don't recurse we use the next_object variable to point to the next block with the same or less
        # indentation and thus ignore sub-blocks.
        block_len = next_block - start
        return cls(param_prop, description, start, block_len)
def parse_from_strings ( cls , start , config_lines , indent , errors ) : idx = start # Let's first check if the block is a simple comment. If so, let's return and go to the next block if _is_comment ( start , config_lines , indent , errors ) : comment , end = _parse_comment ( start , config_lines ) return cls ( None , comment , start , end - start ) # Let's get to the end of the block supposing it is formatted correctly (@param line, description, empty # comment, then the actual content). If it fails, let's ignore the whole block and its potential # sub-blocks. end = _get_end_of_param_declaration_block ( start , len ( config_lines ) , config_lines , indent , errors ) if end is None : default_end = _get_next_block_in_case_of_failure ( start , config_lines ) return cls ( None , None , start , default_end - start ) block_len = end - start # Parsing the @param line param_prop = ParamProperties . parse_from_string ( idx , config_lines , indent , errors ) if param_prop is None : return cls ( None , None , start , block_len ) # If var is indicated as list, recompute end of block knowing it is a list if param_prop . type_name . startswith ( 'list' ) : end = _get_end_of_param_declaration_block ( start , len ( config_lines ) , config_lines , indent , errors , is_list = True ) if end is None : default_end = _get_next_block_in_case_of_failure ( start , config_lines ) return cls ( None , None , start , default_end - start ) block_len = end - start # Parsing the description idx += 1 description , idx = _parse_description ( idx , end , config_lines , indent , errors ) if idx is None : return cls ( param_prop , None , start , block_len ) # We recurse if the variable is an object and contains at least one member with description is_object = _is_object ( idx , config_lines , indent , param_prop , errors ) if not is_object : return cls ( param_prop , description , start , block_len ) should_recurse , next_block = _should_recurse ( idx , config_lines , indent ) if should_recurse : # If we recurse we use block_len, pointing to the next sub-block return cls ( param_prop , description , start , block_len , should_recurse = True ) # If we don't recurse we use the next_object variable to point to the next block with the same or less # indentation and thus ignore sub-blocks. block_len = next_block - start return cls ( param_prop , description , start , block_len )