lexers

package
v0.0.0-...-08dbdac Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Smark = Register(MustNewLexer(
	&Config{
		Name:      "sMark",
		Aliases:   []string{"sm", "smark"},
		Filenames: []string{"*.sm"},
		MimeTypes: []string{"text/x-sMark"},
	},
	Rules{
		"root": {
			{` .*\n`, Text, nil},
			{`^\s*.+\n\s*=+\n`, GenericHeading, nil},
			{`^\s*.+\n\s*-+\n`, GenericSubheading, nil},
			{`^\|.*\n`, Literal, nil},
			{`^-+ .*\n`, Literal, nil},
			{`\[.\]`, GenericStrong, nil},
			{`\[.{2,}\]\n`, GenericOutput, Push("code")},
			{`\n-{2,}\n`, GenericEmph, nil},
			{`".+"@".+"`, LiteralStringSingle, nil},
			{`\*.*\*`, GenericStrong, nil},
			{`/.*/`, GenericEmph, nil},
			{`_.*_`, GenericEmph, nil},
			{`\-.*\-`, GenericEmph, nil},
			{`\++\n(.*\n)+\++\n`, GenericOutput, nil},
			{`.*\n`, Text, nil},
		},
		"code": {
			{`.*\n`, GenericOutput, nil},
			{`\[end\]\n`, GenericOutput, Pop(1)},
		},
	},
))

Smark 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