mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-09 05:12:56 +02:00
Update Dependencies (#390)
Co-authored-by: Norwin Roosen <git@nroo.de> Co-authored-by: Norwin <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/390 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Norwin <noerw@noreply.gitea.io> Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
12
vendor/github.com/alecthomas/chroma/lexers/m/make.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/make.go
generated
vendored
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
// Makefile lexer.
|
||||
var Makefile = internal.Register(MustNewLexer(
|
||||
var Makefile = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Base Makefile",
|
||||
Aliases: []string{"make", "makefile", "mf", "bsdmake"},
|
||||
@ -15,7 +15,11 @@ var Makefile = internal.Register(MustNewLexer(
|
||||
MimeTypes: []string{"text/x-makefile"},
|
||||
EnsureNL: true,
|
||||
},
|
||||
Rules{
|
||||
makefileRules,
|
||||
))
|
||||
|
||||
func makefileRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`^(?:[\t ]+.*\n|\n)+`, Using(Bash), nil},
|
||||
{`\$[<@$+%?|*]`, Keyword, nil},
|
||||
@ -50,5 +54,5 @@ var Makefile = internal.Register(MustNewLexer(
|
||||
{`\n`, Text, Pop(1)},
|
||||
{`.`, Text, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/mako.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/mako.go
generated
vendored
@ -7,14 +7,18 @@ import (
|
||||
)
|
||||
|
||||
// Mako lexer.
|
||||
var Mako = internal.Register(MustNewLexer(
|
||||
var Mako = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Mako",
|
||||
Aliases: []string{"mako"},
|
||||
Filenames: []string{"*.mao"},
|
||||
MimeTypes: []string{"application/x-mako"},
|
||||
},
|
||||
Rules{
|
||||
makoRules,
|
||||
))
|
||||
|
||||
func makoRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`(\s*)(%)(\s*end(?:\w+))(\n|\Z)`, ByGroups(Text, CommentPreproc, Keyword, Other), nil},
|
||||
{`(\s*)(%)([^\n]*)(\n|\Z)`, ByGroups(Text, CommentPreproc, Using(Python), Other), nil},
|
||||
@ -56,5 +60,5 @@ var Mako = internal.Register(MustNewLexer(
|
||||
{`'.*?'`, LiteralString, Pop(1)},
|
||||
{`[^\s>]+`, LiteralString, Pop(1)},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
17
vendor/github.com/alecthomas/chroma/lexers/m/markdown.go
generated
vendored
17
vendor/github.com/alecthomas/chroma/lexers/m/markdown.go
generated
vendored
@ -7,14 +7,18 @@ import (
|
||||
)
|
||||
|
||||
// Markdown lexer.
|
||||
var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
|
||||
var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "markdown",
|
||||
Aliases: []string{"md", "mkd"},
|
||||
Filenames: []string{"*.md", "*.mkd", "*.markdown"},
|
||||
MimeTypes: []string{"text/x-markdown"},
|
||||
},
|
||||
Rules{
|
||||
markdownRules,
|
||||
)))
|
||||
|
||||
func markdownRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`^(#[^#].+\n)`, ByGroups(GenericHeading), nil},
|
||||
{`^(#{2,6}.+\n)`, ByGroups(GenericSubheading), nil},
|
||||
@ -23,7 +27,8 @@ var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
|
||||
{`^(\s*)([0-9]+\.)( .+\n)`, ByGroups(Text, Keyword, UsingSelf("inline")), nil},
|
||||
{`^(\s*>\s)(.+\n)`, ByGroups(Keyword, GenericEmph), nil},
|
||||
{"^(```\\n)([\\w\\W]*?)(^```$)", ByGroups(String, Text, String), nil},
|
||||
{"^(```)(\\w+)(\\n)([\\w\\W]*?)(^```$)",
|
||||
{
|
||||
"^(```)(\\w+)(\\n)([\\w\\W]*?)(^```$)",
|
||||
UsingByGroup(
|
||||
internal.Get,
|
||||
2, 4,
|
||||
@ -35,7 +40,7 @@ var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
|
||||
},
|
||||
"inline": {
|
||||
{`\\.`, Text, nil},
|
||||
{`(\s)([*_][^*_]+[*_])(\W|\n)`, ByGroups(Text, GenericEmph, Text), nil},
|
||||
{`(\s)(\*|_)((?:(?!\2).)*)(\2)((?=\W|\n))`, ByGroups(Text, GenericEmph, GenericEmph, GenericEmph, Text), nil},
|
||||
{`(\s)((\*\*|__).*?)\3((?=\W|\n))`, ByGroups(Text, GenericStrong, GenericStrong, Text), nil},
|
||||
{`(\s)(~~[^~]+~~)((?=\W|\n))`, ByGroups(Text, GenericDeleted, Text), nil},
|
||||
{"`[^`]+`", LiteralStringBacktick, nil},
|
||||
@ -44,5 +49,5 @@ var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
|
||||
{`[^\\\s]+`, Other, nil},
|
||||
{`.|\n`, Other, nil},
|
||||
},
|
||||
},
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/mason.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/mason.go
generated
vendored
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
// Mason lexer.
|
||||
var Mason = internal.Register(MustNewLexer(
|
||||
var Mason = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Mason",
|
||||
Aliases: []string{"mason"},
|
||||
@ -16,7 +16,11 @@ var Mason = internal.Register(MustNewLexer(
|
||||
MimeTypes: []string{"application/x-mason"},
|
||||
Priority: 0.1,
|
||||
},
|
||||
Rules{
|
||||
masonRules,
|
||||
))
|
||||
|
||||
func masonRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\s+`, Text, nil},
|
||||
{`(<%doc>)(.*?)(</%doc>)(?s)`, ByGroups(NameTag, CommentMultiline, NameTag), nil},
|
||||
@ -39,5 +43,5 @@ var Mason = internal.Register(MustNewLexer(
|
||||
\Z # end of string
|
||||
)`, ByGroups(Using(HTML), Operator), nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/mathematica.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/mathematica.go
generated
vendored
@ -6,14 +6,18 @@ import (
|
||||
)
|
||||
|
||||
// Mathematica lexer.
|
||||
var Mathematica = internal.Register(MustNewLexer(
|
||||
var Mathematica = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Mathematica",
|
||||
Aliases: []string{"mathematica", "mma", "nb"},
|
||||
Filenames: []string{"*.nb", "*.cdf", "*.nbp", "*.ma"},
|
||||
MimeTypes: []string{"application/mathematica", "application/vnd.wolfram.mathematica", "application/vnd.wolfram.mathematica.package", "application/vnd.wolfram.cdf"},
|
||||
},
|
||||
Rules{
|
||||
mathematicaRules,
|
||||
))
|
||||
|
||||
func mathematicaRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`(?s)\(\*.*?\*\)`, Comment, nil},
|
||||
{"([a-zA-Z]+[A-Za-z0-9]*`)", NameNamespace, nil},
|
||||
@ -28,5 +32,5 @@ var Mathematica = internal.Register(MustNewLexer(
|
||||
{`".*?"`, LiteralString, nil},
|
||||
{`\s+`, TextWhitespace, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/matlab.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/matlab.go
generated
vendored
@ -6,14 +6,18 @@ import (
|
||||
)
|
||||
|
||||
// Matlab lexer.
|
||||
var Matlab = internal.Register(MustNewLexer(
|
||||
var Matlab = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Matlab",
|
||||
Aliases: []string{"matlab"},
|
||||
Filenames: []string{"*.m"},
|
||||
MimeTypes: []string{"text/matlab"},
|
||||
},
|
||||
Rules{
|
||||
matlabRules,
|
||||
))
|
||||
|
||||
func matlabRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\n`, Text, nil},
|
||||
{`^!.*`, LiteralStringOther, nil},
|
||||
@ -47,5 +51,5 @@ var Matlab = internal.Register(MustNewLexer(
|
||||
{`(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)`, ByGroups(TextWhitespace, Text, TextWhitespace, Punctuation, TextWhitespace, NameFunction, Punctuation, Text, Punctuation, TextWhitespace), Pop(1)},
|
||||
{`(\s*)([a-zA-Z_]\w*)`, ByGroups(Text, NameFunction), Pop(1)},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
109
vendor/github.com/alecthomas/chroma/lexers/m/mcfunction.go
generated
vendored
Normal file
109
vendor/github.com/alecthomas/chroma/lexers/m/mcfunction.go
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
package m
|
||||
|
||||
import (
|
||||
. "github.com/alecthomas/chroma" // nolint
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
)
|
||||
|
||||
// mcfunction lexer.
|
||||
var MCFunction = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "mcfunction",
|
||||
Aliases: []string{"mcfunction"},
|
||||
Filenames: []string{"*.mcfunction"},
|
||||
MimeTypes: []string{},
|
||||
NotMultiline: true,
|
||||
DotAll: true,
|
||||
},
|
||||
func() Rules {
|
||||
return Rules{
|
||||
"simplevalue": {
|
||||
{`(true|false)`, KeywordConstant, nil},
|
||||
{`[01]b`, LiteralNumber, nil},
|
||||
{`-?(0|[1-9]\d*)(\.\d+[eE](\+|-)?\d+|[eE](\+|-)?\d+|\.\d+)`, LiteralNumberFloat, nil},
|
||||
{`(-?\d+)(\.\.)(-?\d+)`, ByGroups(LiteralNumberInteger, Punctuation, LiteralNumberInteger), nil},
|
||||
{`-?(0|[1-9]\d*)`, LiteralNumberInteger, nil},
|
||||
{`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil},
|
||||
{`'[^']+'`, LiteralStringSingle, nil},
|
||||
{`([!#]?)(\w+)`, ByGroups(Punctuation, Text), nil},
|
||||
},
|
||||
"nbtobjectattribute": {
|
||||
Include("nbtvalue"),
|
||||
{`:`, Punctuation, nil},
|
||||
{`,`, Punctuation, Pop(1)},
|
||||
{`\}`, Punctuation, Pop(2)},
|
||||
},
|
||||
"nbtobjectvalue": {
|
||||
{`("(\\\\|\\"|[^"])*"|[a-zA-Z0-9_]+)`, NameTag, Push("nbtobjectattribute")},
|
||||
{`\}`, Punctuation, Pop(1)},
|
||||
},
|
||||
"nbtarrayvalue": {
|
||||
Include("nbtvalue"),
|
||||
{`,`, Punctuation, nil},
|
||||
{`\]`, Punctuation, Pop(1)},
|
||||
},
|
||||
"nbtvalue": {
|
||||
Include("simplevalue"),
|
||||
{`\{`, Punctuation, Push("nbtobjectvalue")},
|
||||
{`\[`, Punctuation, Push("nbtarrayvalue")},
|
||||
},
|
||||
"argumentvalue": {
|
||||
Include("simplevalue"),
|
||||
{`,`, Punctuation, Pop(1)},
|
||||
{`[}\]]`, Punctuation, Pop(2)},
|
||||
},
|
||||
"argumentlist": {
|
||||
{`(nbt)(={)`, ByGroups(NameAttribute, Punctuation), Push("nbtobjectvalue")},
|
||||
{`([A-Za-z0-9/_!]+)(={)`, ByGroups(NameAttribute, Punctuation), Push("argumentlist")},
|
||||
{`([A-Za-z0-9/_!]+)(=)`, ByGroups(NameAttribute, Punctuation), Push("argumentvalue")},
|
||||
Include("simplevalue"),
|
||||
{`,`, Punctuation, nil},
|
||||
{`[}\]]`, Punctuation, Pop(1)},
|
||||
},
|
||||
"root": {
|
||||
{`#.*?\n`, CommentSingle, nil},
|
||||
{Words(`/?`, `\b`, `ability`, `attributes`, `advancement`,
|
||||
`ban`, `ban-ip`, `banlist`, `bossbar`,
|
||||
`camerashake`, `classroommode`, `clear`,
|
||||
`clearspawnpoint`, `clone`, `code`, `collect`,
|
||||
`createagent`, `data`, `datapack`, `debug`,
|
||||
`defaultgamemode`, `deop`, `destroy`, `detect`,
|
||||
`detectredstone`, `difficulty`, `dropall`,
|
||||
`effect`, `enchant`, `event`, `execute`,
|
||||
`experience`, `fill`, `flog`, `forceload`,
|
||||
`function`, `gamemode`, `gamerule`,
|
||||
`geteduclientinfo`, `give`, `help`, `item`,
|
||||
`immutableworld`, `kick`, `kill`, `list`,
|
||||
`locate`, `locatebiome`, `loot`, `me`, `mixer`,
|
||||
`mobevent`, `move`, `msg`, `music`, `op`,
|
||||
`pardon`, `particle`, `playanimation`,
|
||||
`playsound`, `position`, `publish`,
|
||||
`raytracefog`, `recipe`, `reload`, `remove`,
|
||||
`replaceitem`, `ride`, `save`, `save-all`,
|
||||
`save-off`, `save-on`, `say`, `schedule`,
|
||||
`scoreboard`, `seed`, `setblock`,
|
||||
`setidletimeout`, `setmaxplayers`,
|
||||
`setworldspawn`, `spawnpoint`, `spectate`,
|
||||
`spreadplayers`, `stop`, `stopsound`,
|
||||
`structure`, `summon`, `tag`, `team`, `teammsg`,
|
||||
`teleport`, `tell`, `tellraw`, `testfor`,
|
||||
`testforblock`, `testforblocks`, `tickingarea`,
|
||||
`time`, `title`, `toggledownfall`, `tp`,
|
||||
`tpagent`, `transfer`, `transferserver`,
|
||||
`trigger`, `turn`, `w`, `weather`, `whitelist`,
|
||||
`worldborder`, `worldbuilder`, `wsserver`, `xp`,
|
||||
), KeywordReserved, nil},
|
||||
{Words(``, ``, `@p`, `@r`, `@a`, `@e`, `@s`, `@c`, `@v`),
|
||||
KeywordConstant, nil},
|
||||
{`\[`, Punctuation, Push("argumentlist")},
|
||||
{`{`, Punctuation, Push("nbtobjectvalue")},
|
||||
{`~`, NameBuiltin, nil},
|
||||
{`([a-zA-Z_]+:)?[a-zA-Z_]+\b`, Text, nil},
|
||||
{`([a-z]+)(\.)([0-9]+)\b`, ByGroups(Text, Punctuation, LiteralNumber), nil},
|
||||
{`([<>=]|<=|>=)`, Punctuation, nil},
|
||||
Include("simplevalue"),
|
||||
{`\s+`, TextWhitespace, nil},
|
||||
},
|
||||
}
|
||||
},
|
||||
))
|
101
vendor/github.com/alecthomas/chroma/lexers/m/metal.go
generated
vendored
Normal file
101
vendor/github.com/alecthomas/chroma/lexers/m/metal.go
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
package m
|
||||
|
||||
import (
|
||||
. "github.com/alecthomas/chroma" // nolint
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
)
|
||||
|
||||
// Metal lexer.
|
||||
var Metal = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Metal",
|
||||
Aliases: []string{"metal"},
|
||||
Filenames: []string{"*.metal"},
|
||||
MimeTypes: []string{"text/x-metal"},
|
||||
EnsureNL: true,
|
||||
},
|
||||
metalRules,
|
||||
))
|
||||
|
||||
func metalRules() Rules {
|
||||
return Rules{
|
||||
"statements": {
|
||||
{Words(``, `\b`, `namespace`, `operator`, `template`, `this`, `using`, `constexpr`), Keyword, nil},
|
||||
{`(enum)\b(\s+)(class)\b(\s*)`, ByGroups(Keyword, Text, Keyword, Text), Push("classname")},
|
||||
{`(class|struct|enum|union)\b(\s*)`, ByGroups(Keyword, Text), Push("classname")},
|
||||
{`\[\[.+\]\]`, NameAttribute, nil},
|
||||
{`(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*`, LiteralNumberFloat, nil},
|
||||
{`(\d+\.\d*|\.\d+|\d+[fF])[fF]?`, LiteralNumberFloat, nil},
|
||||
{`0[xX]([0-9A-Fa-f]('?[0-9A-Fa-f]+)*)[LlUu]*`, LiteralNumberHex, nil},
|
||||
{`0('?[0-7]+)+[LlUu]*`, LiteralNumberOct, nil},
|
||||
{`0[Bb][01]('?[01]+)*[LlUu]*`, LiteralNumberBin, nil},
|
||||
{`[0-9]('?[0-9]+)*[LlUu]*`, LiteralNumberInteger, nil},
|
||||
{`\*/`, Error, nil},
|
||||
{`[~!%^&*+=|?:<>/-]`, Operator, nil},
|
||||
{`[()\[\],.]`, Punctuation, nil},
|
||||
{Words(``, `\b`, `break`, `case`, `const`, `continue`, `do`, `else`, `enum`, `extern`, `for`, `if`, `return`, `sizeof`, `static`, `struct`, `switch`, `typedef`, `union`, `while`), Keyword, nil},
|
||||
{`(bool|float|half|long|ptrdiff_t|size_t|unsigned|u?char|u?int((8|16|32|64)_t)?|u?short)\b`, KeywordType, nil},
|
||||
{`(bool|float|half|u?(char|int|long|short))(2|3|4)\b`, KeywordType, nil},
|
||||
{`packed_(float|half|long|u?(char|int|short))(2|3|4)\b`, KeywordType, nil},
|
||||
{`(float|half)(2|3|4)x(2|3|4)\b`, KeywordType, nil},
|
||||
{`atomic_u?int\b`, KeywordType, nil},
|
||||
{`(rg?(8|16)(u|s)norm|rgba(8|16)(u|s)norm|srgba8unorm|rgb10a2|rg11b10f|rgb9e5)\b`, KeywordType, nil},
|
||||
{`(array|depth(2d|cube)(_array)?|depth2d_ms(_array)?|sampler|texture_buffer|texture(1|2)d(_array)?|texture2d_ms(_array)?|texture3d|texturecube(_array)?|uniform|visible_function_table)\b`, KeywordType, nil},
|
||||
{`(true|false|NULL)\b`, NameBuiltin, nil},
|
||||
{Words(``, `\b`, `device`, `constant`, `ray_data`, `thread`, `threadgroup`, `threadgroup_imageblock`), Keyword, nil},
|
||||
{`([a-zA-Z_]\w*)(\s*)(:)(?!:)`, ByGroups(NameLabel, Text, Punctuation), nil},
|
||||
{`[a-zA-Z_]\w*`, Name, nil},
|
||||
},
|
||||
"root": {
|
||||
Include("whitespace"),
|
||||
{`(fragment|kernel|vertex)?((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)`, ByGroups(Keyword, UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), Push("function")},
|
||||
{`(fragment|kernel|vertex)?((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)`, ByGroups(Keyword, UsingSelf("root"), NameFunction, UsingSelf("root"), UsingSelf("root"), Punctuation), nil},
|
||||
Default(Push("statement")),
|
||||
},
|
||||
"classname": {
|
||||
{`(\[\[.+\]\])(\s*)`, ByGroups(NameAttribute, Text), nil},
|
||||
{`[a-zA-Z_]\w*`, NameClass, Pop(1)},
|
||||
{`\s*(?=[>{])`, Text, Pop(1)},
|
||||
},
|
||||
"whitespace": {
|
||||
{`^#if\s+0`, CommentPreproc, Push("if0")},
|
||||
{`^#`, CommentPreproc, Push("macro")},
|
||||
{`^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("if0")},
|
||||
{`^(\s*(?:/[*].*?[*]/\s*)?)(#)`, ByGroups(UsingSelf("root"), CommentPreproc), Push("macro")},
|
||||
{`\n`, Text, nil},
|
||||
{`\s+`, Text, nil},
|
||||
{`\\\n`, Text, nil},
|
||||
{`//(\n|[\w\W]*?[^\\]\n)`, CommentSingle, nil},
|
||||
{`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil},
|
||||
{`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil},
|
||||
},
|
||||
"statement": {
|
||||
Include("whitespace"),
|
||||
Include("statements"),
|
||||
{`[{]`, Punctuation, Push("root")},
|
||||
{`[;}]`, Punctuation, Pop(1)},
|
||||
},
|
||||
"function": {
|
||||
Include("whitespace"),
|
||||
Include("statements"),
|
||||
{`;`, Punctuation, nil},
|
||||
{`\{`, Punctuation, Push()},
|
||||
{`\}`, Punctuation, Pop(1)},
|
||||
},
|
||||
"macro": {
|
||||
{`(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)`, ByGroups(CommentPreproc, Text, CommentPreprocFile), nil},
|
||||
{`[^/\n]+`, CommentPreproc, nil},
|
||||
{`/[*](.|\n)*?[*]/`, CommentMultiline, nil},
|
||||
{`//.*?\n`, CommentSingle, Pop(1)},
|
||||
{`/`, CommentPreproc, nil},
|
||||
{`(?<=\\)\n`, CommentPreproc, nil},
|
||||
{`\n`, CommentPreproc, Pop(1)},
|
||||
},
|
||||
"if0": {
|
||||
{`^\s*#if.*?(?<!\\)\n`, CommentPreproc, Push()},
|
||||
{`^\s*#el(?:se|if).*\n`, CommentPreproc, Pop(1)},
|
||||
{`^\s*#endif.*?(?<!\\)\n`, CommentPreproc, Pop(1)},
|
||||
{`.*?\n`, Comment, nil},
|
||||
},
|
||||
}
|
||||
}
|
12
vendor/github.com/alecthomas/chroma/lexers/m/minizinc.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/minizinc.go
generated
vendored
@ -6,14 +6,18 @@ import (
|
||||
)
|
||||
|
||||
// MiniZinc lexer.
|
||||
var MZN = internal.Register(MustNewLexer(
|
||||
var MZN = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "MiniZinc",
|
||||
Aliases: []string{"minizinc", "MZN", "mzn"},
|
||||
Filenames: []string{"*.mzn", "*.dzn", "*.fzn"},
|
||||
MimeTypes: []string{"text/minizinc"},
|
||||
},
|
||||
Rules{
|
||||
mznRules,
|
||||
))
|
||||
|
||||
func mznRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\n`, Text, nil},
|
||||
{`\s+`, Text, nil},
|
||||
@ -37,5 +41,5 @@ var MZN = internal.Register(MustNewLexer(
|
||||
{`\b([^\W\d]\w*)\b(\()`, ByGroups(NameFunction, Punctuation), nil},
|
||||
{`[^\W\d]\w*`, NameOther, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/mlir.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/mlir.go
generated
vendored
@ -6,14 +6,18 @@ import (
|
||||
)
|
||||
|
||||
// MLIR lexer.
|
||||
var Mlir = internal.Register(MustNewLexer(
|
||||
var Mlir = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "MLIR",
|
||||
Aliases: []string{"mlir"},
|
||||
Filenames: []string{"*.mlir"},
|
||||
MimeTypes: []string{"text/x-mlir"},
|
||||
},
|
||||
Rules{
|
||||
mlirRules,
|
||||
))
|
||||
|
||||
func mlirRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
Include("whitespace"),
|
||||
{`c?"[^"]*?"`, LiteralString, nil},
|
||||
@ -39,5 +43,5 @@ var Mlir = internal.Register(MustNewLexer(
|
||||
{`bf16|f16|f32|f64|index`, Keyword, nil},
|
||||
{`i[1-9]\d*`, Keyword, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/modula2.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/modula2.go
generated
vendored
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// Modula-2 lexer.
|
||||
var Modula2 = internal.Register(MustNewLexer(
|
||||
var Modula2 = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Modula-2",
|
||||
Aliases: []string{"modula2", "m2"},
|
||||
@ -14,7 +14,11 @@ var Modula2 = internal.Register(MustNewLexer(
|
||||
MimeTypes: []string{"text/x-modula2"},
|
||||
DotAll: true,
|
||||
},
|
||||
Rules{
|
||||
modula2Rules,
|
||||
))
|
||||
|
||||
func modula2Rules() Rules {
|
||||
return Rules{
|
||||
"whitespace": {
|
||||
{`\n+`, Text, nil},
|
||||
{`\s+`, Text, nil},
|
||||
@ -111,5 +115,5 @@ var Modula2 = internal.Register(MustNewLexer(
|
||||
Include("unigraph_punctuation"),
|
||||
Include("unigraph_operators"),
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/monkeyc.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/monkeyc.go
generated
vendored
@ -5,14 +5,18 @@ import (
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
)
|
||||
|
||||
var MonkeyC = internal.Register(MustNewLexer(
|
||||
var MonkeyC = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "MonkeyC",
|
||||
Aliases: []string{"monkeyc"},
|
||||
Filenames: []string{"*.mc"},
|
||||
MimeTypes: []string{"text/x-monkeyc"},
|
||||
},
|
||||
Rules{
|
||||
monkeyCRules,
|
||||
))
|
||||
|
||||
func monkeyCRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`[^\S\n]+`, Text, nil},
|
||||
{`\n`, Text, nil},
|
||||
@ -58,5 +62,5 @@ var MonkeyC = internal.Register(MustNewLexer(
|
||||
{`[a-zA-Z_][\w_\.]*`, NameNamespace, nil},
|
||||
Default(Pop(1)),
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/alecthomas/chroma/lexers/m/mwscript.go
generated
vendored
12
vendor/github.com/alecthomas/chroma/lexers/m/mwscript.go
generated
vendored
@ -6,14 +6,18 @@ import (
|
||||
)
|
||||
|
||||
// MorrowindScript lexer.
|
||||
var MorrowindScript = internal.Register(MustNewLexer(
|
||||
var MorrowindScript = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "MorrowindScript",
|
||||
Aliases: []string{"morrowind", "mwscript"},
|
||||
Filenames: []string{},
|
||||
MimeTypes: []string{},
|
||||
},
|
||||
Rules{
|
||||
morrowindScriptRules,
|
||||
))
|
||||
|
||||
func morrowindScriptRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\s+`, Text, nil},
|
||||
{`;.*$`, Comment, nil},
|
||||
@ -49,5 +53,5 @@ var MorrowindScript = internal.Register(MustNewLexer(
|
||||
{`[#=,./%+\-?]`, Operator, nil},
|
||||
{`(==|<=|<|>=|>|!=)`, Operator, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
22
vendor/github.com/alecthomas/chroma/lexers/m/myghty.go
generated
vendored
22
vendor/github.com/alecthomas/chroma/lexers/m/myghty.go
generated
vendored
@ -7,24 +7,28 @@ import (
|
||||
)
|
||||
|
||||
// Myghty lexer.
|
||||
var Myghty = internal.Register(MustNewLexer(
|
||||
var Myghty = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Myghty",
|
||||
Aliases: []string{"myghty"},
|
||||
Filenames: []string{"*.myt", "autodelegate"},
|
||||
MimeTypes: []string{"application/x-myghty"},
|
||||
},
|
||||
Rules{
|
||||
myghtyRules,
|
||||
))
|
||||
|
||||
func myghtyRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\s+`, Text, nil},
|
||||
{`(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil},
|
||||
{`(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using(Python), NameTag), nil},
|
||||
{`(<&[^|])(.*?)(,.*?)?(&>)`, ByGroups(NameTag, NameFunction, Using(Python), NameTag), nil},
|
||||
{`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using(Python), NameTag), nil},
|
||||
{`(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using(Python2), NameTag), nil},
|
||||
{`(<&[^|])(.*?)(,.*?)?(&>)`, ByGroups(NameTag, NameFunction, Using(Python2), NameTag), nil},
|
||||
{`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using(Python2), NameTag), nil},
|
||||
{`</&>`, NameTag, nil},
|
||||
{`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using(Python), NameTag), nil},
|
||||
{`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using(Python2), NameTag), nil},
|
||||
{`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil},
|
||||
{`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using(Python), Other), nil},
|
||||
{`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using(Python2), Other), nil},
|
||||
{`(?sx)
|
||||
(.+?) # anything, followed by:
|
||||
(?:
|
||||
@ -36,5 +40,5 @@ var Myghty = internal.Register(MustNewLexer(
|
||||
\Z # end of string
|
||||
)`, ByGroups(Other, Operator), nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
43
vendor/github.com/alecthomas/chroma/lexers/m/mysql.go
generated
vendored
43
vendor/github.com/alecthomas/chroma/lexers/m/mysql.go
generated
vendored
@ -1,12 +1,19 @@
|
||||
package m
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
. "github.com/alecthomas/chroma" // nolint
|
||||
"github.com/alecthomas/chroma/lexers/internal"
|
||||
)
|
||||
|
||||
var (
|
||||
mysqlAnalyserNameBetweenBacktickRe = regexp.MustCompile("`[a-zA-Z_]\\w*`")
|
||||
mysqlAnalyserNameBetweenBracketRe = regexp.MustCompile(`\[[a-zA-Z_]\w*\]`)
|
||||
)
|
||||
|
||||
// MySQL lexer.
|
||||
var MySQL = internal.Register(MustNewLexer(
|
||||
var MySQL = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "MySQL",
|
||||
Aliases: []string{"mysql"},
|
||||
@ -15,9 +22,31 @@ var MySQL = internal.Register(MustNewLexer(
|
||||
NotMultiline: true,
|
||||
CaseInsensitive: true,
|
||||
},
|
||||
Rules{
|
||||
mySQLRules,
|
||||
).SetAnalyser(func(text string) float32 {
|
||||
nameBetweenBacktickCount := len(mysqlAnalyserNameBetweenBacktickRe.FindAllString(text, -1))
|
||||
nameBetweenBracketCount := len(mysqlAnalyserNameBetweenBracketRe.FindAllString(text, -1))
|
||||
|
||||
var result float32
|
||||
|
||||
// Same logic as above in the TSQL analysis.
|
||||
dialectNameCount := nameBetweenBacktickCount + nameBetweenBracketCount
|
||||
if dialectNameCount >= 1 && nameBetweenBacktickCount >= (2*nameBetweenBracketCount) {
|
||||
// Found at least twice as many `name` as [name].
|
||||
result += 0.5
|
||||
} else if nameBetweenBacktickCount > nameBetweenBracketCount {
|
||||
result += 0.2
|
||||
} else if nameBetweenBacktickCount > 0 {
|
||||
result += 0.1
|
||||
}
|
||||
|
||||
return result
|
||||
}))
|
||||
|
||||
func mySQLRules() Rules {
|
||||
return Rules{
|
||||
"root": {
|
||||
{`\s+`, Text, nil},
|
||||
{`\s+`, TextWhitespace, nil},
|
||||
{`(#|--\s+).*\n?`, CommentSingle, nil},
|
||||
{`/\*`, CommentMultiline, Push("multiline-comments")},
|
||||
{`[0-9]+`, LiteralNumberInteger, nil},
|
||||
@ -25,11 +54,11 @@ var MySQL = internal.Register(MustNewLexer(
|
||||
{`((?:_[a-z0-9]+)?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("string")},
|
||||
{`((?:_[a-z0-9]+)?)(")`, ByGroups(LiteralStringAffix, LiteralStringDouble), Push("double-string")},
|
||||
{"[+*/<>=~!@#%^&|`?-]", Operator, nil},
|
||||
{`\b(tinyint|smallint|mediumint|int|integer|bigint|date|datetime|time|bit|bool|tinytext|mediumtext|longtext|text|tinyblob|mediumblob|longblob|blob|float|double|double\s+precision|real|numeric|dec|decimal|timestamp|year|char|varchar|varbinary|varcharacter|enum|set)(\b\s*)(\()?`, ByGroups(KeywordType, Text, Punctuation), nil},
|
||||
{`\b(tinyint|smallint|mediumint|int|integer|bigint|date|datetime|time|bit|bool|tinytext|mediumtext|longtext|text|tinyblob|mediumblob|longblob|blob|float|double|double\s+precision|real|numeric|dec|decimal|timestamp|year|char|varchar|varbinary|varcharacter|enum|set)(\b\s*)(\()?`, ByGroups(KeywordType, TextWhitespace, Punctuation), nil},
|
||||
{`\b(add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|escaped|exists|exit|explain|fetch|flush|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|identified|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|lines|load|localtime|localtimestamp|lock|long|loop|low_priority|match|minute_microsecond|minute_second|mod|modifies|natural|no_write_to_binlog|not|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|privileges|procedure|purge|raid0|read|reads|real|references|regexp|release|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|soname|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|then|to|trailing|trigger|undo|union|unique|unlock|unsigned|update|usage|use|user|using|utc_date|utc_time|utc_timestamp|values|varying|when|where|while|with|write|x509|xor|year_month|zerofill)\b`, Keyword, nil},
|
||||
{`\b(auto_increment|engine|charset|tables)\b`, KeywordPseudo, nil},
|
||||
{`(true|false|null)`, NameConstant, nil},
|
||||
{`([a-z_]\w*)(\s*)(\()`, ByGroups(NameFunction, Text, Punctuation), nil},
|
||||
{`([a-z_]\w*)(\s*)(\()`, ByGroups(NameFunction, TextWhitespace, Punctuation), nil},
|
||||
{`[a-z_]\w*`, Name, nil},
|
||||
{`@[a-z0-9]*[._]*[a-z0-9]*`, NameVariable, nil},
|
||||
{`[;:()\[\],.]`, Punctuation, nil},
|
||||
@ -50,5 +79,5 @@ var MySQL = internal.Register(MustNewLexer(
|
||||
{`""`, LiteralStringDouble, nil},
|
||||
{`"`, LiteralStringDouble, Pop(1)},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user