1
0
Fork 0
forked from forgejo/forgejo

Vendor Update (#16121)

* update github.com/PuerkitoBio/goquery

* update github.com/alecthomas/chroma

* update github.com/blevesearch/bleve/v2

* update github.com/caddyserver/certmagic

* update github.com/go-enry/go-enry/v2

* update github.com/go-git/go-billy/v5

* update github.com/go-git/go-git/v5

* update github.com/go-redis/redis/v8

* update github.com/go-testfixtures/testfixtures/v3

* update github.com/jaytaylor/html2text

* update github.com/json-iterator/go

* update github.com/klauspost/compress

* update github.com/markbates/goth

* update github.com/mattn/go-isatty

* update github.com/mholt/archiver/v3

* update github.com/microcosm-cc/bluemonday

* update github.com/minio/minio-go/v7

* update github.com/prometheus/client_golang

* update github.com/unrolled/render

* update github.com/xanzy/go-gitlab

* update github.com/yuin/goldmark

* update github.com/yuin/goldmark-highlighting

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
6543 2021-06-10 16:44:25 +02:00 committed by GitHub
parent f088dc4ea1
commit 86e2789960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
819 changed files with 38072 additions and 34969 deletions

View file

@ -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},
},
},
))
}
}

View file

@ -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)},
},
},
))
}
}

View file

@ -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,
@ -44,5 +49,5 @@ var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer(
{`[^\\\s]+`, Other, nil},
{`.|\n`, Other, nil},
},
},
)))
}
}

View file

@ -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},
},
},
))
}
}

View file

@ -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},
},
},
))
}
}

View file

@ -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)},
},
},
))
}
}

View file

@ -0,0 +1,107 @@
package m
import (
. "github.com/alecthomas/chroma" // nolint
"github.com/alecthomas/chroma/lexers/internal"
)
// mcfunction lexer.
var MCFunction = internal.Register(MustNewLexer(
&Config{
Name: "mcfunction",
Aliases: []string{"mcfunction"},
Filenames: []string{"*.mcfunction"},
MimeTypes: []string{},
NotMultiline: true,
DotAll: true,
},
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},
},
},
))

View file

@ -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},
},
},
))
}
}

View file

@ -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},
},
},
))
}
}

View file

@ -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"),
},
},
))
}
}

View file

@ -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)),
},
},
))
}
}

View file

@ -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},
},
},
))
}
}

View file

@ -7,14 +7,18 @@ 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},
@ -36,5 +40,5 @@ var Myghty = internal.Register(MustNewLexer(
\Z # end of string
)`, ByGroups(Other, Operator), nil},
},
},
))
}
}

View file

@ -6,7 +6,7 @@ import (
)
// MySQL lexer.
var MySQL = internal.Register(MustNewLexer(
var MySQL = internal.Register(MustNewLazyLexer(
&Config{
Name: "MySQL",
Aliases: []string{"mysql"},
@ -15,9 +15,13 @@ var MySQL = internal.Register(MustNewLexer(
NotMultiline: true,
CaseInsensitive: true,
},
Rules{
mySQLRules,
))
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 +29,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 +54,5 @@ var MySQL = internal.Register(MustNewLexer(
{`""`, LiteralStringDouble, nil},
{`"`, LiteralStringDouble, Pop(1)},
},
},
))
}
}