Documentation
¶
Index ¶
- Variables
- func LineContentAt[T StringLikeContent](anchor Anchor, buf T) T
- func MakeErrorAt[T StringLikeContent](anchor Anchor, buf T, err error) error
- type Anchor
- type Error
- type Location
- type LocationInFile
- type Scanner
- func (scn *Scanner) Anchor() Anchor
- func (scn *Scanner) IsAnyOf(chars string) bool
- func (scn *Scanner) IsByte(c byte) bool
- func (scn *Scanner) IsByteFunc(f func(byte) bool) bool
- func (scn *Scanner) IsEOF() bool
- func (scn *Scanner) IsEOL() bool
- func (scn *Scanner) IsNextByte(offset int, c byte) bool
- func (scn *Scanner) IsNextByteFunc(offset int, f func(byte) bool) bool
- func (scn *Scanner) IsSequence(s string) bool
- func (scn *Scanner) IsWS() bool
- func (scn *Scanner) LineContentAt(anchor Anchor) string
- func (scn *Scanner) LocationAt(anchor Anchor) Location
- func (scn *Scanner) MakeErrorAt(anchor Anchor, err error) error
- func (scn *Scanner) ReadDecUint() (uint64, error)
- func (scn *Scanner) ReadHexUint() (uint64, error)
- func (scn *Scanner) ReadLineUntil(c byte) string
- func (scn *Scanner) ReadSequenceFunc(isFirst, isOther func(byte) bool) string
- func (scn *Scanner) Skip() bool
- func (scn *Scanner) SkipByte(c byte) bool
- func (scn *Scanner) SkipByteFunc(f func(byte) bool) bool
- func (scn *Scanner) SkipEOL() bool
- func (scn *Scanner) SkipSequence(s string) bool
- func (scn *Scanner) SkipWS() bool
- func (scn *Scanner) SkipWSEOL() bool
- type StringLikeContent
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDecDigitExpected = errors.New("a valid decimal digit expected")
View Source
var ErrHexDigitExpected = errors.New("a valid hex digit expected")
Functions ¶
func LineContentAt ¶
func LineContentAt[T StringLikeContent](anchor Anchor, buf T) T
func MakeErrorAt ¶
func MakeErrorAt[T StringLikeContent](anchor Anchor, buf T, err error) error
Types ¶
type Anchor ¶
func CalcAnchor ¶
func CalcAnchor[T StringLikeContent](buf T) Anchor
type Location ¶
Location specifies line:column position within a text file - both numers are 1-based - empty inputs are treated as 1:1
func LocationAt ¶
func LocationAt[T StringLikeContent](anchor Anchor, buf T) Location
type LocationInFile ¶
func (*LocationInFile) String ¶
func (loc *LocationInFile) String() string
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a generic helper for scraping source code for translation strings
func NewScanner ¶
func (*Scanner) IsNextByteFunc ¶
func (*Scanner) IsSequence ¶
func (*Scanner) LineContentAt ¶
func (*Scanner) LocationAt ¶
func (*Scanner) ReadDecUint ¶
func (*Scanner) ReadHexUint ¶
func (*Scanner) ReadLineUntil ¶
func (*Scanner) ReadSequenceFunc ¶
func (*Scanner) SkipSequence ¶
type StringLikeContent ¶
Click to show internal directories.
Click to hide internal directories.