func (pt *preparedText) ParagraphEnd(start int) int {
	cur := start
	for ; cur < len(pt.lines); cur++ {
		if strings.TrimSpace(pt.lines[cur]) == "" {
			return cur
		}
	}
	return cur
}
Find first empty line starting from line `start'.
package parse_doc
import (
	"bufio"
	"errors"
	"io"
	"strings"
	"unicode"
	"github.com/dim-an/cod/datastore"
)
type parseContext struct {
	args []string
	text *preparedText
}
func makeParseContext(args []string, helpText string) (ctx parseContext, err error) {
	ctx.text, err = makePreparedText(helpText)
	if err != nil {
		return
	}
	ctx.args = args
	return
}
type parseResult struct {
	completions []datastore.Completion
}
type preparedText struct {
	lines []string
}
func makePreparedText(text string) (prepared *preparedText, err error) {
	reader := bufio.NewReader(strings.NewReader(text))
	var lines []string
	for {
		var line string
		line, err = reader.ReadString('\n')
		if errors.Is(err, io.EOF) {
			err = nil
			break
		} else if err != nil {
			return
		}
		lines = append(lines, line[:len(line)-1])
	}
	prepared = &preparedText{
		lines: lines,
	}
	return
}
func (pt *preparedText) FindFirstLine(pattern string) int {
	for idx, line := range pt.lines {
		if strings.Contains(line, pattern) {
			return idx
		}
	}
	return -1
}