hl

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const IndentMetaBinding bass.Symbol = "indent"

IndentMetaBinding is set to true in meta to indicate multiline forms using the combiner should have Vim lispwords style indentation, i.e. a 2 space indent instead of aligning with first argument.

Variables

View Source
var BassLexer = lexers.Register(MustNewLazyLexer(
	&Config{
		Name:      "Bass",
		Aliases:   []string{"bass"},
		Filenames: []string{"*.bass"},
		MimeTypes: []string{"text/x-bass", "application/x-bass"},
	},
	bassRules,
))
View Source
var TTYStyle = styles.Register(chroma.MustNewStyle("tty", chroma.StyleEntries{
	chroma.Comment:             ttyMap["95m"] + " italic",
	chroma.CommentPreproc:      ttyMap["90m"],
	chroma.KeywordConstant:     ttyMap["33m"],
	chroma.Keyword:             ttyMap["31m"],
	chroma.KeywordDeclaration:  ttyMap["35m"],
	chroma.NameBuiltin:         ttyMap["31m"],
	chroma.NameBuiltinPseudo:   ttyMap["36m"],
	chroma.NameFunction:        ttyMap["34m"],
	chroma.NameNamespace:       ttyMap["34m"],
	chroma.LiteralNumber:       ttyMap["31m"],
	chroma.LiteralString:       ttyMap["32m"],
	chroma.LiteralStringSymbol: ttyMap["33m"],
	chroma.Operator:            ttyMap["31m"],
	chroma.Punctuation:         ttyMap["90m"],
}))

TTY style matches to hex codes used by the TTY formatter to map them to specific ANSI escape codes.

Functions

func Bindings

func Bindings(scope *bass.Scope, class Class) []bass.Symbol

func LispWords

func LispWords(scope *bass.Scope) []bass.Symbol

Lispwords collects bindings from the scope whose value has IndentMetaBinding set to true.

Types

type Class

type Class int
const (
	Invalid Class = iota
	Bool
	Const
	Cond
	Repeat
	Var
	Def
	Fn
	Op
	Special
	Import
)

func (Class) String

func (i Class) String() string

type Classification

type Classification struct {
	Class    Class
	Bindings []bass.Symbol
}

func Classify

func Classify(scope *bass.Scope) []Classification

Jump to

Keyboard shortcuts

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