func (p *parser) doClobReplacements(str []byte) []byte {
	strLen := len(str)
	ret := make([]byte, 0, strLen)
	for index := 0; index < strLen; index++ {
		switch ch := str[index]; ch {
		case '\r':
			// We normalize "\r" and "\r\n" as "\n".
			if index < strLen-1 && str[index+1] == '\n' {
				index++
			}
			ret = append(ret, '\n')
		case '\\':
			if index >= strLen-1 {
				continue
			}
			// We have an escape character.  Do different things depending on
			// what we are escaping.
			switch next := str[index+1]; next {
			case '\r':
				// Newline being escaped.
				index++
				// Newline being escaped may be \r\n or just \r.
				if index < strLen-1 && str[index+1] == '\n' {
					index++
				}
			case '\n':
				// Newline being escaped.
				index++
			case 'n':
				ret = append(ret, '\n')
				index++
			case 'r':
				ret = append(ret, '\r')
				index++
			case '\'', '"', '\\':
				ret = append(ret, next)
				index++
			case 'x':
				index += 2
				data := p.decodeHex(str, index, 2)
				index += 1
				ret = append(ret, data...)
			default:
				// Don't have anything special to do with the next character, so
				// just add the current character and let the next one get added
				// as normal.
				ret = append(ret, ch)
			}
		default:
			ret = append(ret, ch)
		}
	}

	return ret
}
// doClobReplacements is like doStringReplacements but is restricted to escapes that CLOBs have.
doClobReplacements is like doStringReplacements but is restricted to escapes that CLOBs have.
// doClobReplacements is like doStringReplacements but is restricted to escapes that CLOBs have .
func (p *parser) doClobReplacements(str []byte) []byte {
	strLen := len(str)
	ret := make([]byte, 0, strLen)
	for index := 0; index < strLen; index++ {
		switch ch := str[index]; ch {
		case '\r':
			if index < strLen-1 && str[index+1] == '\n' {
				index++
			}
			ret = append(ret, '\n')
		case '\\':
			if index >= strLen-1 {
				continue
			}
			switch next := str[index+1]; next {
			case '\r':
				index++
				if index < strLen-1 && str[index+1] == '\n' {
					index++
				}
			case '\n':
				index++
			case 'n':
				ret = append(ret, '\n')
				index++
			case 'r':
				ret = append(ret, '\r')
				index++
			case '\'', '"', '\\':
				ret = append(ret, next)
				index++
			case 'x':
				index += 2
				data := p.decodeHex(str, index, 2)
				index += 1
				ret = append(ret, data...)
			default:
				ret = append(ret, ch)
			}
		default:
			ret = append(ret, ch)
		}
	}
	return ret
}
func ( p * parser ) doClobReplacements ( str [ ] byte ) [ ] byte { strLen := len ( str ) ret := make ( [ ] byte , 0 , strLen ) for index := 0 ; index < strLen ; index ++ { switch ch := str [ index ] ; ch { case '\r' : if index < strLen - 1 && str [ index + 1 ] == '\n' { index ++ } ret = append ( ret , '\n' ) case '\\' : if index >= strLen - 1 { continue } switch next := str [ index + 1 ] ; next { case '\r' : index ++ if index < strLen - 1 && str [ index + 1 ] == '\n' { index ++ } case '\n' : index ++ case 'n' : ret = append ( ret , '\n' ) index ++ case 'r' : ret = append ( ret , '\r' ) index ++ case '\'' , '"' , '\\' : ret = append ( ret , next ) index ++ case 'x' : index += 2 data := p . decodeHex ( str , index , 2 ) index += 1 ret = append ( ret , data ... ) default : ret = append ( ret , ch ) } default : ret = append ( ret , ch ) } } return ret }
doClobReplacements is like doStringReplacements but is restricted to escapes that CLOBs have.
doClobReplacements is like doStringReplacements but is restricted to escapes that CLOBs have .
// We normalize "\r" and "\r\n" as "\n". // We have an escape character.  Do different things depending on // what we are escaping. // Newline being escaped. // Newline being escaped may be \r\n or just \r. // Newline being escaped. // Don't have anything special to do with the next character, so // just add the current character and let the next one get added // as normal.