Documentation ¶
Overview ¶
Package parse contains a collection of parsers for various formats in its subpackages.
Index ¶
- Constants
- Variables
- func Copy(src []byte) (dst []byte)
- func DataURI(dataURI []byte) ([]byte, []byte, error)
- func DecodeURL(b []byte) []byte
- func Dimension(b []byte) (int, int)
- func EncodeURL(b []byte, table [256]bool) []byte
- func EqualFold(s, targetLower []byte) bool
- func IsAllWhitespace(b []byte) bool
- func IsNewline(c byte) bool
- func IsWhitespace(c byte) bool
- func Mediatype(b []byte) ([]byte, map[string]string)
- func Number(b []byte) int
- func Position(r io.Reader, offset int) (line, col int, context string)
- func Printable(r rune) string
- func QuoteEntity(b []byte) (quote byte, n int)
- func ReplaceEntities(b []byte, entitiesMap map[string][]byte, revEntitiesMap map[byte][]byte) []byte
- func ReplaceMultipleWhitespace(b []byte) []byte
- func ReplaceMultipleWhitespaceAndEntities(b []byte, entitiesMap map[string][]byte, revEntitiesMap map[byte][]byte) []byte
- func ToLower(src []byte) []byte
- func TrimWhitespace(b []byte) []byte
- type BinaryFileReader
- func (r *BinaryFileReader) BufferLen() int
- func (r *BinaryFileReader) Len() uint64
- func (r *BinaryFileReader) Offset() uint64
- func (r *BinaryFileReader) Pos() uint64
- func (r *BinaryFileReader) Read(b []byte) (int, error)
- func (r *BinaryFileReader) ReadByte() byte
- func (r *BinaryFileReader) ReadBytes(n int) []byte
- func (r *BinaryFileReader) ReadInt16() int16
- func (r *BinaryFileReader) ReadInt32() int32
- func (r *BinaryFileReader) ReadInt64() int64
- func (r *BinaryFileReader) ReadInt8() int8
- func (r *BinaryFileReader) ReadString(n int) string
- func (r *BinaryFileReader) ReadUint16() uint16
- func (r *BinaryFileReader) ReadUint32() uint32
- func (r *BinaryFileReader) ReadUint64() uint64
- func (r *BinaryFileReader) ReadUint8() uint8
- func (r *BinaryFileReader) Seek(pos uint64) error
- type BinaryReader
- func (r *BinaryReader) EOF() bool
- func (r *BinaryReader) Len() uint32
- func (r *BinaryReader) Pos() uint32
- func (r *BinaryReader) Read(b []byte) (int, error)
- func (r *BinaryReader) ReadByte() byte
- func (r *BinaryReader) ReadBytes(n uint32) []byte
- func (r *BinaryReader) ReadInt16() int16
- func (r *BinaryReader) ReadInt32() int32
- func (r *BinaryReader) ReadInt64() int64
- func (r *BinaryReader) ReadInt8() int8
- func (r *BinaryReader) ReadString(n uint32) string
- func (r *BinaryReader) ReadUint16() uint16
- func (r *BinaryReader) ReadUint32() uint32
- func (r *BinaryReader) ReadUint64() uint64
- func (r *BinaryReader) ReadUint8() uint8
- func (r *BinaryReader) Seek(pos uint32) error
- type BinaryReader2
- func NewBinaryReader2(f IBinaryReader) *BinaryReader2
- func NewBinaryReader2Bytes(data []byte) (*BinaryReader2, error)
- func NewBinaryReader2File(filename string) (*BinaryReader2, error)
- func NewBinaryReader2Mmap(filename string) (*BinaryReader2, error)
- func NewBinaryReader2Reader(r io.Reader, n int64) (*BinaryReader2, error)
- func (r *BinaryReader2) Close() error
- func (r *BinaryReader2) Err() error
- func (r *BinaryReader2) Free()
- func (r *BinaryReader2) InPageCache(start, end int64) bool
- func (r *BinaryReader2) Len() int
- func (r *BinaryReader2) Pos() int64
- func (r *BinaryReader2) Read(b []byte) (int, error)
- func (r *BinaryReader2) ReadByte() byte
- func (r *BinaryReader2) ReadBytes(n int) []byte
- func (r *BinaryReader2) ReadInt16() int16
- func (r *BinaryReader2) ReadInt32() int32
- func (r *BinaryReader2) ReadInt64() int64
- func (r *BinaryReader2) ReadInt8() int8
- func (r *BinaryReader2) ReadString(n int) string
- func (r *BinaryReader2) ReadUint16() uint16
- func (r *BinaryReader2) ReadUint32() uint32
- func (r *BinaryReader2) ReadUint64() uint64
- func (r *BinaryReader2) ReadUint8() uint8
- func (r *BinaryReader2) Seek(pos int64)
- type BinaryWriter
- func (w *BinaryWriter) Bytes() []byte
- func (w *BinaryWriter) Len() uint32
- func (w *BinaryWriter) Write(b []byte) (int, error)
- func (w *BinaryWriter) WriteByte(v byte)
- func (w *BinaryWriter) WriteBytes(v []byte)
- func (w *BinaryWriter) WriteInt16(v int16)
- func (w *BinaryWriter) WriteInt32(v int32)
- func (w *BinaryWriter) WriteInt64(v int64)
- func (w *BinaryWriter) WriteInt8(v int8)
- func (w *BinaryWriter) WriteString(v string)
- func (w *BinaryWriter) WriteUint16(v uint16)
- func (w *BinaryWriter) WriteUint32(v uint32)
- func (w *BinaryWriter) WriteUint64(v uint64)
- func (w *BinaryWriter) WriteUint8(v uint8)
- type BitmapReader
- type BitmapWriter
- type Error
- type IBinaryReader
- type Indenter
- type Input
- func (z *Input) Bytes() []byte
- func (z *Input) Err() error
- func (z *Input) Len() int
- func (z *Input) Lexeme() []byte
- func (z *Input) Move(n int)
- func (z *Input) MoveRune()
- func (z *Input) Offset() int
- func (z *Input) Peek(pos int) byte
- func (z *Input) PeekErr(pos int) error
- func (z *Input) PeekRune(pos int) (rune, int)
- func (z *Input) Pos() int
- func (z *Input) Reset()
- func (z *Input) Restore()
- func (z *Input) Rewind(pos int)
- func (z *Input) Shift() []byte
- func (z *Input) Skip()
Constants ¶
const PageSize = 4096
Variables ¶
var DataURIEncodingTable = [256]bool{}/* 256 elements not displayed */
DataURIEncodingTable is a charmap for which characters need escaping in the Data URI encoding scheme Escape only non-printable characters, unicode and %, #, &. IE11 additionally requires encoding of \, [, ], ", <, >, `, {, }, |, ^ which is not required by Chrome, Firefox, Opera, Edge, Safari, Yandex To pass the HTML validator, restricted URL characters must be escaped: non-printable characters, space, <, >, #, %, "
var ErrBadDataURI = errors.New("not a data URI")
ErrBadDataURI is returned by DataURI when the byte slice does not start with 'data:' or is too short.
var URLEncodingTable = [256]bool{}/* 256 elements not displayed */
URLEncodingTable is a charmap for which characters need escaping in the URL encoding scheme
Functions ¶
func EqualFold ¶
EqualFold returns true when s matches case-insensitively the targetLower (which must be lowercase).
func IsAllWhitespace ¶
IsAllWhitespace returns true when the entire byte slice consists of space, \n, \r, \t, \f.
func IsWhitespace ¶
IsWhitespace returns true for space, \n, \r, \t, \f.
func Mediatype ¶
Mediatype parses a given mediatype and splits the mimetype from the parameters. It works similar to mime.ParseMediaType but is faster.
func Number ¶
Number returns the number of bytes that parse as a number of the regex format (+|-)?([0-9]+(\.[0-9]+)?|\.[0-9]+)((e|E)(+|-)?[0-9]+)?.
func Position ¶
Position returns the line and column number for a certain position in a file. It is useful for recovering the position in a file that caused an error. It only treates \n, \r, and \r\n as newlines, which might be different from some languages also recognizing \f, \u2028, and \u2029 to be newlines.
func QuoteEntity ¶
QuoteEntity parses the given byte slice and returns the quote that got matched (' or ") and its entity length. TODO: deprecated
func ReplaceEntities ¶ added in v2.3.11
func ReplaceEntities(b []byte, entitiesMap map[string][]byte, revEntitiesMap map[byte][]byte) []byte
ReplaceEntities replaces all occurrences of entites (such as ") to their respective unencoded bytes.
func ReplaceMultipleWhitespace ¶
ReplaceMultipleWhitespace replaces character series of space, \n, \t, \f, \r into a single space or newline (when the serie contained a \n or \r).
func ReplaceMultipleWhitespaceAndEntities ¶ added in v2.3.13
func ReplaceMultipleWhitespaceAndEntities(b []byte, entitiesMap map[string][]byte, revEntitiesMap map[byte][]byte) []byte
ReplaceMultipleWhitespaceAndEntities is a combination of ReplaceMultipleWhitespace and ReplaceEntities. It is faster than executing both sequentially.
func TrimWhitespace ¶
TrimWhitespace removes any leading and trailing whitespace characters.
Types ¶
type BinaryFileReader ¶ added in v2.7.14
type BinaryFileReader struct { Endianness binary.ByteOrder // contains filtered or unexported fields }
func NewBinaryFileReader ¶ added in v2.7.14
func NewBinaryFileReader(f *os.File, chunk int) (*BinaryFileReader, error)
func (*BinaryFileReader) BufferLen ¶ added in v2.7.14
func (r *BinaryFileReader) BufferLen() int
BufferLen returns the length of the buffer.
func (*BinaryFileReader) Len ¶ added in v2.7.14
func (r *BinaryFileReader) Len() uint64
Len returns the remaining length of the buffer.
func (*BinaryFileReader) Offset ¶ added in v2.7.14
func (r *BinaryFileReader) Offset() uint64
Offset returns the offset of the buffer.
func (*BinaryFileReader) Pos ¶ added in v2.7.14
func (r *BinaryFileReader) Pos() uint64
Pos returns the reader's position.
func (*BinaryFileReader) Read ¶ added in v2.7.14
func (r *BinaryFileReader) Read(b []byte) (int, error)
Read complies with io.Reader.
func (*BinaryFileReader) ReadByte ¶ added in v2.7.14
func (r *BinaryFileReader) ReadByte() byte
ReadByte reads a single byte.
func (*BinaryFileReader) ReadBytes ¶ added in v2.7.14
func (r *BinaryFileReader) ReadBytes(n int) []byte
ReadBytes reads n bytes.
func (*BinaryFileReader) ReadInt16 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadInt16() int16
ReadInt16 reads a int16.
func (*BinaryFileReader) ReadInt32 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadInt32() int32
ReadInt32 reads a int32.
func (*BinaryFileReader) ReadInt64 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadInt64() int64
ReadInt64 reads a int64.
func (*BinaryFileReader) ReadInt8 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadInt8() int8
ReadInt8 reads a int8.
func (*BinaryFileReader) ReadString ¶ added in v2.7.14
func (r *BinaryFileReader) ReadString(n int) string
ReadString reads a string of length n.
func (*BinaryFileReader) ReadUint16 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadUint16() uint16
ReadUint16 reads a uint16.
func (*BinaryFileReader) ReadUint32 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadUint32() uint32
ReadUint32 reads a uint32.
func (*BinaryFileReader) ReadUint64 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadUint64() uint64
ReadUint64 reads a uint64.
func (*BinaryFileReader) ReadUint8 ¶ added in v2.7.14
func (r *BinaryFileReader) ReadUint8() uint8
ReadUint8 reads a uint8.
func (*BinaryFileReader) Seek ¶ added in v2.7.14
func (r *BinaryFileReader) Seek(pos uint64) error
Seek set the reader position in the buffer.
type BinaryReader ¶ added in v2.7.14
BinaryReader is a binary big endian file format reader.
func NewBinaryReader ¶ added in v2.7.14
func NewBinaryReader(buf []byte) *BinaryReader
NewBinaryReader returns a big endian binary file format reader.
func NewBinaryReaderLE ¶ added in v2.7.14
func NewBinaryReaderLE(buf []byte) *BinaryReader
NewBinaryReaderLE returns a little endian binary file format reader.
func (*BinaryReader) EOF ¶ added in v2.7.14
func (r *BinaryReader) EOF() bool
EOF returns true if we reached the end-of-file.
func (*BinaryReader) Len ¶ added in v2.7.14
func (r *BinaryReader) Len() uint32
Len returns the remaining length of the buffer.
func (*BinaryReader) Pos ¶ added in v2.7.14
func (r *BinaryReader) Pos() uint32
Pos returns the reader's position.
func (*BinaryReader) Read ¶ added in v2.7.14
func (r *BinaryReader) Read(b []byte) (int, error)
Read complies with io.Reader.
func (*BinaryReader) ReadByte ¶ added in v2.7.14
func (r *BinaryReader) ReadByte() byte
ReadByte reads a single byte.
func (*BinaryReader) ReadBytes ¶ added in v2.7.14
func (r *BinaryReader) ReadBytes(n uint32) []byte
ReadBytes reads n bytes.
func (*BinaryReader) ReadInt16 ¶ added in v2.7.14
func (r *BinaryReader) ReadInt16() int16
ReadInt16 reads a int16.
func (*BinaryReader) ReadInt32 ¶ added in v2.7.14
func (r *BinaryReader) ReadInt32() int32
ReadInt32 reads a int32.
func (*BinaryReader) ReadInt64 ¶ added in v2.7.14
func (r *BinaryReader) ReadInt64() int64
ReadInt64 reads a int64.
func (*BinaryReader) ReadInt8 ¶ added in v2.7.14
func (r *BinaryReader) ReadInt8() int8
ReadInt8 reads a int8.
func (*BinaryReader) ReadString ¶ added in v2.7.14
func (r *BinaryReader) ReadString(n uint32) string
ReadString reads a string of length n.
func (*BinaryReader) ReadUint16 ¶ added in v2.7.14
func (r *BinaryReader) ReadUint16() uint16
ReadUint16 reads a uint16.
func (*BinaryReader) ReadUint32 ¶ added in v2.7.14
func (r *BinaryReader) ReadUint32() uint32
ReadUint32 reads a uint32.
func (*BinaryReader) ReadUint64 ¶ added in v2.7.14
func (r *BinaryReader) ReadUint64() uint64
ReadUint64 reads a uint64.
func (*BinaryReader) ReadUint8 ¶ added in v2.7.14
func (r *BinaryReader) ReadUint8() uint8
ReadUint8 reads a uint8.
func (*BinaryReader) Seek ¶ added in v2.7.14
func (r *BinaryReader) Seek(pos uint32) error
Seek set the reader position in the buffer.
type BinaryReader2 ¶ added in v2.7.16
func NewBinaryReader2 ¶ added in v2.7.16
func NewBinaryReader2(f IBinaryReader) *BinaryReader2
func NewBinaryReader2Bytes ¶ added in v2.7.16
func NewBinaryReader2Bytes(data []byte) (*BinaryReader2, error)
func NewBinaryReader2File ¶ added in v2.7.16
func NewBinaryReader2File(filename string) (*BinaryReader2, error)
func NewBinaryReader2Mmap ¶ added in v2.7.16
func NewBinaryReader2Mmap(filename string) (*BinaryReader2, error)
func NewBinaryReader2Reader ¶ added in v2.7.16
func NewBinaryReader2Reader(r io.Reader, n int64) (*BinaryReader2, error)
func (*BinaryReader2) Close ¶ added in v2.7.16
func (r *BinaryReader2) Close() error
func (*BinaryReader2) Err ¶ added in v2.7.16
func (r *BinaryReader2) Err() error
func (*BinaryReader2) Free ¶ added in v2.7.16
func (r *BinaryReader2) Free()
Free frees all previously read bytes, you cannot seek from before this position (for reader).
func (*BinaryReader2) InPageCache ¶ added in v2.7.16
func (r *BinaryReader2) InPageCache(start, end int64) bool
InPageCache returns true if the range is already in the page cache (for mmap).
func (*BinaryReader2) Len ¶ added in v2.7.16
func (r *BinaryReader2) Len() int
Len returns the remaining length of the buffer.
func (*BinaryReader2) Pos ¶ added in v2.7.16
func (r *BinaryReader2) Pos() int64
Pos returns the reader's position.
func (*BinaryReader2) Read ¶ added in v2.7.16
func (r *BinaryReader2) Read(b []byte) (int, error)
Read complies with io.Reader.
func (*BinaryReader2) ReadByte ¶ added in v2.7.16
func (r *BinaryReader2) ReadByte() byte
ReadByte reads a single byte.
func (*BinaryReader2) ReadBytes ¶ added in v2.7.16
func (r *BinaryReader2) ReadBytes(n int) []byte
ReadBytes reads n bytes.
func (*BinaryReader2) ReadInt16 ¶ added in v2.7.16
func (r *BinaryReader2) ReadInt16() int16
ReadInt16 reads a int16.
func (*BinaryReader2) ReadInt32 ¶ added in v2.7.16
func (r *BinaryReader2) ReadInt32() int32
ReadInt32 reads a int32.
func (*BinaryReader2) ReadInt64 ¶ added in v2.7.16
func (r *BinaryReader2) ReadInt64() int64
ReadInt64 reads a int64.
func (*BinaryReader2) ReadInt8 ¶ added in v2.7.16
func (r *BinaryReader2) ReadInt8() int8
ReadInt8 reads a int8.
func (*BinaryReader2) ReadString ¶ added in v2.7.16
func (r *BinaryReader2) ReadString(n int) string
ReadString reads a string of length n.
func (*BinaryReader2) ReadUint16 ¶ added in v2.7.16
func (r *BinaryReader2) ReadUint16() uint16
ReadUint16 reads a uint16.
func (*BinaryReader2) ReadUint32 ¶ added in v2.7.16
func (r *BinaryReader2) ReadUint32() uint32
ReadUint32 reads a uint32.
func (*BinaryReader2) ReadUint64 ¶ added in v2.7.16
func (r *BinaryReader2) ReadUint64() uint64
ReadUint64 reads a uint64.
func (*BinaryReader2) ReadUint8 ¶ added in v2.7.16
func (r *BinaryReader2) ReadUint8() uint8
ReadUint8 reads a uint8.
func (*BinaryReader2) Seek ¶ added in v2.7.16
func (r *BinaryReader2) Seek(pos int64)
type BinaryWriter ¶ added in v2.7.14
type BinaryWriter struct {
// contains filtered or unexported fields
}
BinaryWriter is a big endian binary file format writer.
func NewBinaryWriter ¶ added in v2.7.14
func NewBinaryWriter(buf []byte) *BinaryWriter
NewBinaryWriter returns a big endian binary file format writer.
func (*BinaryWriter) Bytes ¶ added in v2.7.14
func (w *BinaryWriter) Bytes() []byte
Bytes returns the buffer's bytes.
func (*BinaryWriter) Len ¶ added in v2.7.14
func (w *BinaryWriter) Len() uint32
Len returns the buffer's length in bytes.
func (*BinaryWriter) Write ¶ added in v2.7.14
func (w *BinaryWriter) Write(b []byte) (int, error)
Write complies with io.Writer.
func (*BinaryWriter) WriteByte ¶ added in v2.7.14
func (w *BinaryWriter) WriteByte(v byte)
WriteByte writes the given byte to the buffer.
func (*BinaryWriter) WriteBytes ¶ added in v2.7.14
func (w *BinaryWriter) WriteBytes(v []byte)
WriteBytes writes the given bytes to the buffer.
func (*BinaryWriter) WriteInt16 ¶ added in v2.7.14
func (w *BinaryWriter) WriteInt16(v int16)
WriteInt16 writes the given int16 to the buffer.
func (*BinaryWriter) WriteInt32 ¶ added in v2.7.14
func (w *BinaryWriter) WriteInt32(v int32)
WriteInt32 writes the given int32 to the buffer.
func (*BinaryWriter) WriteInt64 ¶ added in v2.7.14
func (w *BinaryWriter) WriteInt64(v int64)
WriteInt64 writes the given int64 to the buffer.
func (*BinaryWriter) WriteInt8 ¶ added in v2.7.14
func (w *BinaryWriter) WriteInt8(v int8)
WriteInt8 writes the given int8 to the buffer.
func (*BinaryWriter) WriteString ¶ added in v2.7.14
func (w *BinaryWriter) WriteString(v string)
WriteString writes the given string to the buffer.
func (*BinaryWriter) WriteUint16 ¶ added in v2.7.14
func (w *BinaryWriter) WriteUint16(v uint16)
WriteUint16 writes the given uint16 to the buffer.
func (*BinaryWriter) WriteUint32 ¶ added in v2.7.14
func (w *BinaryWriter) WriteUint32(v uint32)
WriteUint32 writes the given uint32 to the buffer.
func (*BinaryWriter) WriteUint64 ¶ added in v2.7.14
func (w *BinaryWriter) WriteUint64(v uint64)
WriteUint64 writes the given uint64 to the buffer.
func (*BinaryWriter) WriteUint8 ¶ added in v2.7.14
func (w *BinaryWriter) WriteUint8(v uint8)
WriteUint8 writes the given uint8 to the buffer.
type BitmapReader ¶ added in v2.7.14
type BitmapReader struct {
// contains filtered or unexported fields
}
BitmapReader is a binary bitmap reader.
func NewBitmapReader ¶ added in v2.7.14
func NewBitmapReader(buf []byte) *BitmapReader
NewBitmapReader returns a binary bitmap reader.
func (*BitmapReader) EOF ¶ added in v2.7.14
func (r *BitmapReader) EOF() bool
EOF returns if we reached the buffer's end-of-file.
func (*BitmapReader) Pos ¶ added in v2.7.14
func (r *BitmapReader) Pos() uint32
Pos returns the current bit position.
func (*BitmapReader) Read ¶ added in v2.7.14
func (r *BitmapReader) Read() bool
Read reads the next bit.
type BitmapWriter ¶ added in v2.7.14
type BitmapWriter struct {
// contains filtered or unexported fields
}
BitmapWriter is a binary bitmap writer.
func NewBitmapWriter ¶ added in v2.7.14
func NewBitmapWriter(buf []byte) *BitmapWriter
NewBitmapWriter returns a binary bitmap writer.
func (*BitmapWriter) Bytes ¶ added in v2.7.14
func (w *BitmapWriter) Bytes() []byte
Bytes returns the buffer's bytes.
func (*BitmapWriter) Len ¶ added in v2.7.14
func (w *BitmapWriter) Len() uint32
Len returns the buffer's length in bytes.
func (*BitmapWriter) Write ¶ added in v2.7.14
func (w *BitmapWriter) Write(bit bool)
Write writes the next bit.
type Error ¶
Error is a parsing error returned by parser. It contains a message and an offset at which the error occurred.
func NewErrorLexer ¶
NewErrorLexer creates a new error from an active Lexer.
type IBinaryReader ¶ added in v2.7.16
type Input ¶ added in v2.5.0
type Input struct {
// contains filtered or unexported fields
}
Input is a buffered reader that allows peeking forward and shifting, taking an io.Input. It keeps data in-memory until Free, taking a byte length, is called to move beyond the data.
func NewInput ¶ added in v2.5.0
NewInput returns a new Input for a given io.Input and uses ioutil.ReadAll to read it into a byte slice. If the io.Input implements Bytes, that is used instead. It will append a NULL at the end of the buffer.
func NewInputBytes ¶ added in v2.5.0
NewInputBytes returns a new Input for a given byte slice and appends NULL at the end. To avoid reallocation, make sure the capacity has room for one more byte.
func NewInputString ¶ added in v2.5.0
NewInputString returns a new Input for a given string and appends NULL at the end.
func (*Input) Err ¶ added in v2.5.0
Err returns the error returned from io.Input or io.EOF when the end has been reached.
func (*Input) MoveRune ¶ added in v2.7.14
func (z *Input) MoveRune()
MoveRune advances the position by the length of the current rune.
func (*Input) Peek ¶ added in v2.5.0
Peek returns the ith byte relative to the end position. Peek returns 0 when an error has occurred, Err returns the erroz.
func (*Input) PeekErr ¶ added in v2.5.0
PeekErr returns the error at position pos. When pos is zero, this is the same as calling Err().
func (*Input) PeekRune ¶ added in v2.5.0
PeekRune returns the rune and rune length of the ith byte relative to the end position.
func (*Input) Reset ¶ added in v2.5.0
func (z *Input) Reset()
Reset resets position to the underlying buffez.
func (*Input) Restore ¶ added in v2.5.0
func (z *Input) Restore()
Restore restores the replaced byte past the end of the buffer by NULL.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package buffer contains buffer and wrapper types for byte slices.
|
Package buffer contains buffer and wrapper types for byte slices. |
Package css is a CSS3 lexer and parser following the specifications at http://www.w3.org/TR/css-syntax-3/.
|
Package css is a CSS3 lexer and parser following the specifications at http://www.w3.org/TR/css-syntax-3/. |
Package html is an HTML5 lexer following the specifications at http://www.w3.org/TR/html5/syntax.html.
|
Package html is an HTML5 lexer following the specifications at http://www.w3.org/TR/html5/syntax.html. |
Package js is an ECMAScript5.1 lexer following the specifications at http://www.ecma-international.org/ecma-262/5.1/.
|
Package js is an ECMAScript5.1 lexer following the specifications at http://www.ecma-international.org/ecma-262/5.1/. |
Package json is a JSON parser following the specifications at http://json.org/.
|
Package json is a JSON parser following the specifications at http://json.org/. |
Package xml is an XML1.0 lexer following the specifications at http://www.w3.org/TR/xml/.
|
Package xml is an XML1.0 lexer following the specifications at http://www.w3.org/TR/xml/. |