func (p *parser) parseBinary(annotations []Symbol) Value {
	// Eat the IonBinaryStart.
	if item := p.next(); item.Type != lex.IonBinaryStart {
		p.panicf("expected binary start but found %q", item)
	}

	var value Value
	switch item := p.next(); item.Type {
	case lex.IonBlob:
		value = Blob{annotations: annotations, text: removeAny(item.Val, []byte(" \t\n\r\f\v"))}
	case lex.IonClobShort:
		value = Clob{annotations: annotations, text: p.doClobReplacements(item.Val)}
	case lex.IonClobLong:
		text := item.Val
		for peek := p.peekNonComment(); peek.Type == lex.IonClobLong; peek = p.peekNonComment() {
			text = append(text, p.next().Val...)
		}
		value = Clob{annotations: annotations, text: p.doClobReplacements(text)}
	default:
		p.panicf("expected a blob or clob but found %q", item)
	}

	if item := p.next(); item.Type != lex.IonBinaryEnd {
		p.panicf("expected binary end but found %q", item)
	}

	return value
}
// This file contains text parsers for Null, Padding, Bool, Symbol, String, Blob, and Clob.
This file contains text parsers for Null, Padding, Bool, Symbol, String, Blob, and Clob.
// This file contains text parsers for Null Padding Bool Symbol String Blob and Clob .
func (p *parser) parseBinary(annotations []Symbol) Value {
	if item := p.next(); item.Type != lex.IonBinaryStart {
		p.panicf("expected binary start but found %q", item)
	}
	var value Value
	switch item := p.next(); item.Type {
	case lex.IonBlob:
		value = Blob{annotations: annotations, text: removeAny(item.Val, []byte(" \t\n\r\f\v"))}
	case lex.IonClobShort:
		value = Clob{annotations: annotations, text: p.doClobReplacements(item.Val)}
	case lex.IonClobLong:
		text := item.Val
		for peek := p.peekNonComment(); peek.Type == lex.IonClobLong; peek = p.peekNonComment() {
			text = append(text, p.next().Val...)
		}
		value = Clob{annotations: annotations, text: p.doClobReplacements(text)}
	default:
		p.panicf("expected a blob or clob but found %q", item)
	}
	if item := p.next(); item.Type != lex.IonBinaryEnd {
		p.panicf("expected binary end but found %q", item)
	}
	return value
}
func ( p * parser ) parseBinary ( annotations [ ] Symbol ) Value { if item := p . next ( ) ; item . Type != lex . IonBinaryStart { p . panicf ( " " , item ) } var value Value switch item := p . next ( ) ; item . Type { case lex . IonBlob : value = Blob { annotations : annotations , text : removeAny ( item . Val , [ ] byte ( " \t \n \r \f \v " ) ) } case lex . IonClobShort : value = Clob { annotations : annotations , text : p . doClobReplacements ( item . Val ) } case lex . IonClobLong : text := item . Val for peek := p . peekNonComment ( ) ; peek . Type == lex . IonClobLong ; peek = p . peekNonComment ( ) { text = append ( text , p . next ( ) . Val ... ) } value = Clob { annotations : annotations , text : p . doClobReplacements ( text ) } default : p . panicf ( " " , item ) } if item := p . next ( ) ; item . Type != lex . IonBinaryEnd { p . panicf ( " " , item ) } return value }
This file contains text parsers for Null, Padding, Bool, Symbol, String, Blob, and Clob.
This file contains text parsers for Null Padding Bool Symbol String Blob and Clob .
// Eat the IonBinaryStart.