Ejemplo n.º 1
0
/*
parsingSkipSeparator parse until we found separator or EOF
*/
func parsingSkipSeparator(sep, line []byte, startAt int) (
	p int, eRead *ReaderError,
) {
	p = startAt

	p, found := tekstus.BytesSkipUntil(line, sep, p, false)

	if found {
		return p, nil
	}

	eRead = &ReaderError{
		T:    EReadMissSeparator,
		Func: "parsingSkipSeparator",
		What: "Missing separator '" + string(sep) + "'",
		Line: string(line),
		Pos:  p,
		N:    0,
	}

	return p, eRead
}
Ejemplo n.º 2
0
/*
parsingLeftQuote parse the left-quote string from line.
*/
func parsingLeftQuote(lq, line []byte, startAt int) (
	p int, eRead *ReaderError,
) {
	p = startAt

	// parsing until we found left quote token
	p, found := tekstus.BytesSkipUntil(line, lq, p, false)

	if found {
		return p, nil
	}

	eRead = &ReaderError{
		T:    EReadMissLeftQuote,
		Func: "parsingLeftQuote",
		What: "Missing left-quote '" + string(lq) + "'",
		Line: string(line),
		Pos:  p,
		N:    0,
	}

	return p, eRead
}