ansi

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var C1Sequences = map[string]string{
	"D":  "IND",
	"E":  "NEL",
	"H":  "HTS",
	"M":  "RI",
	"P":  "DCS",
	"[":  "CSI",
	"\\": "ST",
	"]":  "OSC",
}

C1 control codes (7-bit representation)

View Source
var EDCodes = map[int]string{
	0: "EraseBelow",
	1: "EraseAbove",
	2: "EraseAll",
}

ED codes descriptions

View Source
var SGRCodes = map[int]string{
	0:   "Reset",
	1:   "Bold",
	2:   "Dim",
	3:   "Italic",
	4:   "Underline",
	5:   "Blink",
	6:   "RapidBlink",
	7:   "Inverse",
	8:   "Invisible",
	9:   "StrikeThrough",
	21:  "DoubleUnderline",
	22:  "NormalIntensity",
	23:  "ItalicOff",
	24:  "UnderlineOff",
	25:  "BlinkOff",
	27:  "InverseOff",
	28:  "InvisibleOff",
	29:  "StrikeThroughOff",
	30:  "ForegroundBlack",
	31:  "ForegroundRed",
	32:  "ForegroundGreen",
	33:  "ForegroundYellow",
	34:  "ForegroundBlue",
	35:  "ForegroundMagenta",
	36:  "ForegroundCyan",
	37:  "ForegroundWhite",
	39:  "ForegroundDefault",
	40:  "BackgroundBlack",
	41:  "BackgroundRed",
	42:  "BackgroundGreen",
	43:  "BackgroundYellow",
	44:  "BackgroundBlue",
	45:  "BackgroundMagenta",
	46:  "BackgroundCyan",
	47:  "BackgroundWhite",
	49:  "BackgroundDefault",
	53:  "OverlineOn",
	55:  "OverlineOff",
	59:  "UnderlineColorDefault",
	90:  "ForegroundBrightBlack",
	91:  "ForegroundBrightRed",
	92:  "ForegroundBrightGreen",
	93:  "ForegroundBrightYellow",
	94:  "ForegroundBrightBlue",
	95:  "ForegroundBrightMagenta",
	96:  "ForegroundBrightCyan",
	97:  "ForegroundBrightWhite",
	100: "BackgroundBrightBlack",
	101: "BackgroundBrightRed",
	102: "BackgroundBrightGreen",
	103: "BackgroundBrightYellow",
	104: "BackgroundBrightBlue",
	105: "BackgroundBrightMagenta",
	106: "BackgroundBrightCyan",
	107: "BackgroundBrightWhite",
}

SGR codes descriptions

Functions

func ParseDoubleNumbersParam

func ParseDoubleNumbersParam(params []string, defaultValue []int) []int

func ParseEDParams

func ParseEDParams(params []string) []string

func ParseNumberParam

func ParseNumberParam(param string, defaultValue int) int

func ParseSGRParams

func ParseSGRParams(params []string) []string

Types

type Tokenizer

type Tokenizer struct {
	Tokens []types.Token    `json:"tokens"`
	Stats  types.TokenStats `json:"stats"`
	// contains filtered or unexported fields
}

func NewANSITokenizer

func NewANSITokenizer(input []byte) *Tokenizer

func NewANSITokenizerWithEncoding added in v0.3.0

func NewANSITokenizerWithEncoding(input []byte, encoding string) *Tokenizer

func (*Tokenizer) GetStats

func (t *Tokenizer) GetStats() types.TokenStats

GetStats retourne les statistiques de tokenization

func (*Tokenizer) Tokenize

func (t *Tokenizer) Tokenize() []types.Token

Jump to

Keyboard shortcuts

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