Documentation
¶
Overview ¶
Package highlight classifies the bytes of Ant source for coloring, as the REPL colors its input and ant check its code snippets.
Index ¶
Constants ¶
const Reset = "\x1b[0m"
Reset ends a color.
Variables ¶
var ANSI = [Bad + 1]string{ Keyword: "\x1b[35m", Constant: "\x1b[33m", String: "\x1b[32m", Number: "\x1b[33m", Regex: "\x1b[31m", Comment: "\x1b[90m", Type: "\x1b[36m", Function: "\x1b[34m", Markup: "\x1b[36m", Bad: "\x1b[31m", }
ANSI colors each class with the terminal's own sixteen colors, so that it suits a light or a dark background alike.
Functions ¶
Types ¶
type Class ¶
type Class uint8
A Class is what a byte of source is, for its color.
const ( Plain Class = iota Keyword // a keyword Constant // true, false, null, void String // a string or raw string, including the braces of its interpolations Number // a number literal Regex // a regular expression literal Comment // a comment Type // a namespace, a type, or a module: a capitalized name, or a built-in type Function // a name that is called Markup // an HTML expression, outside its interpolations Bad // what the lexer could not read, or a reserved word )
func Classes ¶
Classes returns the class of every byte of src, which may be unfinished: the lexer goes on past what it cannot read.
func FileClasses ¶
FileClasses is Classes for the whole text of a file, whose first line may be a #! line.