runes

package
v0.0.0-...-d3fc8e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Infinity = 0x7FFFFFFF
View Source
const RuneSize = 4

Variables

This section is empty.

Functions

func CleanPath

func CleanPath(r []rune) []rune

func Clone

func Clone(r []rune) []rune

func Compare

func Compare(a, b []rune) int

func Convert

func Convert(b []byte, r []rune, eof bool) (nb, nr int, nulls bool)

Convert converts bytes in b to runes in r, returning the number of bytes processed from b, the number of runes written to r, and whether any null bytes were elided. If eof is true, then any partial runes at the end of b should be processed, and nb == len(b) at return. Otherwise, partial runes are left behind and nb may be up to utf8.UTFMax-1 bytes short of len(b).

func Equal

func Equal(s1, s2 []rune) bool

func Index

func Index(r, s []rune) int

func IndexRune

func IndexRune(rs []rune, c rune) int

func IsAddr

func IsAddr(r rune) bool

func IsAlphaNum

func IsAlphaNum(c rune) bool

func IsFilename

func IsFilename(r rune) bool

func IsRegx

func IsRegx(r rune) bool

* quite hard: could be almost anything but white space, but we are a little conservative, * aiming for regular expressions of alphanumerics and no white space

func SkipBlank

func SkipBlank(r []rune) []rune

func SkipNonBlank

func SkipNonBlank(r []rune) []rune

Types

type Range

type Range struct {
	Pos int
	End int
}

func Rng

func Rng(q0 int, q1 int) Range

type Text

type Text interface {
	Len() int
	RuneAt(pos int) rune
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL