g

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GDScript = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "GDScript",
		Aliases:   []string{"gdscript", "gd"},
		Filenames: []string{"*.gd"},
		MimeTypes: []string{"text/x-gdscript", "application/x-gdscript"},
	},
	gdscriptRules,
))

GDScript lexer.

View Source
var GLSL = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "GLSL",
		Aliases:   []string{"glsl"},
		Filenames: []string{"*.vert", "*.frag", "*.geo"},
		MimeTypes: []string{"text/x-glslsrc"},
	},
	glslRules,
))

GLSL lexer.

View Source
var Gas = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "GAS",
		Aliases:   []string{"gas", "asm"},
		Filenames: []string{"*.s", "*.S"},
		MimeTypes: []string{"text/x-gas"},
	},
	gasRules,
))

Gas lexer.

View Source
var Genshi = internal.Register(MustNewLazyLexer(
	&Config{
		Name:         "Genshi",
		Aliases:      []string{"genshi", "kid", "xml+genshi", "xml+kid"},
		Filenames:    []string{"*.kid"},
		MimeTypes:    []string{"application/x-genshi", "application/x-kid"},
		NotMultiline: true,
		DotAll:       true,
	},
	genshiMarkupRules,
))

Genshi lexer.

View Source
var GenshiHTMLTemplate = internal.Register(MustNewLazyLexer(
	&Config{
		Name:         "Genshi HTML",
		Aliases:      []string{"html+genshi", "html+kid"},
		Filenames:    []string{},
		MimeTypes:    []string{"text/html+genshi"},
		NotMultiline: true,
		DotAll:       true,
	},
	genshiMarkupRules,
))

Html+Genshi lexer.

View Source
var GenshiText = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Genshi Text",
		Aliases:   []string{"genshitext"},
		Filenames: []string{},
		MimeTypes: []string{"application/x-genshi-text", "text/x-genshi"},
	},
	genshiTextRules,
))

Genshi Text lexer.

View Source
var Gherkin = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Gherkin",
		Aliases:   []string{"cucumber", "Cucumber", "gherkin", "Gherkin"},
		Filenames: []string{"*.feature", "*.FEATURE"},
		MimeTypes: []string{"text/x-gherkin"},
	},
	gherkinRules,
))

Gherkin lexer.

View Source
var Gnuplot = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Gnuplot",
		Aliases:   []string{"gnuplot"},
		Filenames: []string{"*.plot", "*.plt"},
		MimeTypes: []string{"text/x-gnuplot"},
	},
	gnuplotRules,
))

Gnuplot lexer.

View Source
var Go = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Go",
		Aliases:   []string{"go", "golang"},
		Filenames: []string{"*.go"},
		MimeTypes: []string{"text/x-gosrc"},
		EnsureNL:  true,
	},
	goRules,
).SetAnalyser(func(text string) float32 {
	if strings.Contains(text, "fmt.") && strings.Contains(text, "package ") {
		return 0.5
	}
	if strings.Contains(text, "package ") {
		return 0.1
	}
	return 0.0
}))

Go lexer.

View Source
var GoHTMLTemplate = internal.Register(DelegatingLexer(h.HTML, MustNewLazyLexer(
	&Config{
		Name:    "Go HTML Template",
		Aliases: []string{"go-html-template"},
	},
	goTemplateRules,
)))
View Source
var GoTextTemplate = internal.Register(MustNewLazyLexer(
	&Config{
		Name:    "Go Text Template",
		Aliases: []string{"go-text-template"},
	},
	goTemplateRules,
))
View Source
var Graphql = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "GraphQL",
		Aliases:   []string{"graphql", "graphqls", "gql"},
		Filenames: []string{"*.graphql", "*.graphqls"},
	},
	graphqlRules,
))

Go lexer.

View Source
var Groff = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Groff",
		Aliases:   []string{"groff", "nroff", "man"},
		Filenames: []string{"*.[1-9]", "*.1p", "*.3pm", "*.man"},
		MimeTypes: []string{"application/x-troff", "text/troff"},
	},
	func() Rules {
		return Rules{
			"root": {
				{`(\.)(\w+)`, ByGroups(Text, Keyword), Push("request")},
				{`\.`, Punctuation, Push("request")},
				{`[^\\\n]+`, Text, Push("textline")},
				Default(Push("textline")),
			},
			"textline": {
				Include("escapes"),
				{`[^\\\n]+`, Text, nil},
				{`\n`, Text, Pop(1)},
			},
			"escapes": {
				{`\\"[^\n]*`, Comment, nil},
				{`\\[fn]\w`, LiteralStringEscape, nil},
				{`\\\(.{2}`, LiteralStringEscape, nil},
				{`\\.\[.*\]`, LiteralStringEscape, nil},
				{`\\.`, LiteralStringEscape, nil},
				{`\\\n`, Text, Push("request")},
			},
			"request": {
				{`\n`, Text, Pop(1)},
				Include("escapes"),
				{`"[^\n"]+"`, LiteralStringDouble, nil},
				{`\d+`, LiteralNumber, nil},
				{`\S+`, LiteralString, nil},
				{`\s+`, Text, nil},
			},
		}
	},
))

Groff lexer.

View Source
var Groovy = internal.Register(MustNewLazyLexer(
	&Config{
		Name:      "Groovy",
		Aliases:   []string{"groovy"},
		Filenames: []string{"*.groovy", "*.gradle"},
		MimeTypes: []string{"text/x-groovy"},
		DotAll:    true,
	},
	groovyRules,
))

Groovy lexer.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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