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:
Norwin
2021-08-30 23:18:50 +08:00
committed by Andrew Thornton
parent 4b9907fb54
commit d6df0a53b5
665 changed files with 29466 additions and 24547 deletions

View File

@ -6,14 +6,18 @@ import (
)
// R/S lexer.
var R = internal.Register(MustNewLexer(
var R = internal.Register(MustNewLazyLexer(
&Config{
Name: "R",
Aliases: []string{"splus", "s", "r"},
Filenames: []string{"*.S", "*.R", "*.r", ".Rhistory", ".Rprofile", ".Renviron"},
MimeTypes: []string{"text/S-plus", "text/S", "text/x-r-source", "text/x-r", "text/x-R", "text/x-r-history", "text/x-r-profile"},
},
Rules{
rRules,
))
func rRules() Rules {
return Rules{
"comments": {
{`#.*$`, CommentSingle, nil},
},
@ -62,5 +66,5 @@ var R = internal.Register(MustNewLexer(
"string_dquote": {
{`([^"\\]|\\.)*"`, LiteralString, Pop(1)},
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Racket lexer.
var Racket = internal.Register(MustNewLexer(
var Racket = internal.Register(MustNewLazyLexer(
&Config{
Name: "Racket",
Aliases: []string{"racket", "rkt"},
Filenames: []string{"*.rkt", "*.rktd", "*.rktl"},
MimeTypes: []string{"text/x-racket", "application/x-racket"},
},
Rules{
racketRules,
))
func racketRules() Rules {
return Rules{
"root": {
{`[)\]}]`, Error, nil},
{`(?!\Z)`, Text, Push("unquoted-datum")},
@ -98,5 +102,5 @@ var Racket = internal.Register(MustNewLexer(
{`(?s)\\([0-7]{1,3}|x[\da-fA-F]{1,2}|u[\da-fA-F]{1,4}|U[\da-fA-F]{1,8}|.)`, LiteralStringEscape, nil},
{`[^\\"]+`, LiteralStringDouble, nil},
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Ragel lexer.
var Ragel = internal.Register(MustNewLexer(
var Ragel = internal.Register(MustNewLazyLexer(
&Config{
Name: "Ragel",
Aliases: []string{"ragel"},
Filenames: []string{},
MimeTypes: []string{},
},
Rules{
ragelRules,
))
func ragelRules() Rules {
return Rules{
"whitespace": {
{`\s+`, TextWhitespace, nil},
},
@ -72,5 +76,5 @@ var Ragel = internal.Register(MustNewLexer(
{`\{`, Punctuation, Push()},
{`\}`, Punctuation, Pop(1)},
},
},
))
}
}

1496
vendor/github.com/alecthomas/chroma/lexers/r/raku.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,14 +6,18 @@ import (
)
// Reasonml lexer.
var Reasonml = internal.Register(MustNewLexer(
var Reasonml = internal.Register(MustNewLazyLexer(
&Config{
Name: "ReasonML",
Aliases: []string{"reason", "reasonml"},
Filenames: []string{"*.re", "*.rei"},
MimeTypes: []string{"text/x-reasonml"},
},
Rules{
reasonmlRules,
))
func reasonmlRules() Rules {
return Rules{
"escape-sequence": {
{`\\[\\"\'ntbr]`, LiteralStringEscape, nil},
{`\\[0-9]{3}`, LiteralStringEscape, nil},
@ -63,5 +67,5 @@ var Reasonml = internal.Register(MustNewLexer(
{`[a-z_][\w\']*`, Name, Pop(1)},
Default(Pop(1)),
},
},
))
}
}

View File

@ -6,14 +6,18 @@ import (
)
// Reg lexer.
var Reg = internal.Register(MustNewLexer(
var Reg = internal.Register(MustNewLazyLexer(
&Config{
Name: "reg",
Aliases: []string{"registry"},
Filenames: []string{"*.reg"},
MimeTypes: []string{"text/x-windows-registry"},
},
Rules{
regRules,
))
func regRules() Rules {
return Rules{
"root": {
{`Windows Registry Editor.*`, Text, nil},
{`\s+`, Text, nil},
@ -28,5 +32,5 @@ var Reg = internal.Register(MustNewLexer(
{`.+`, LiteralString, Pop(1)},
Default(Pop(1)),
},
},
))
}
}

View File

@ -6,7 +6,7 @@ import (
)
// Rexx lexer.
var Rexx = internal.Register(MustNewLexer(
var Rexx = internal.Register(MustNewLazyLexer(
&Config{
Name: "Rexx",
Aliases: []string{"rexx", "arexx"},
@ -15,7 +15,11 @@ var Rexx = internal.Register(MustNewLexer(
NotMultiline: true,
CaseInsensitive: true,
},
Rules{
rexxRules,
))
func rexxRules() Rules {
return Rules{
"root": {
{`\s`, TextWhitespace, nil},
{`/\*`, CommentMultiline, Push("comment")},
@ -55,5 +59,5 @@ var Rexx = internal.Register(MustNewLexer(
{`\*/`, CommentMultiline, Pop(1)},
{`\*`, CommentMultiline, nil},
},
},
))
}
}

View File

@ -8,14 +8,18 @@ import (
)
// Restructuredtext lexer.
var Restructuredtext = internal.Register(MustNewLexer(
var Restructuredtext = internal.Register(MustNewLazyLexer(
&Config{
Name: "reStructuredText",
Aliases: []string{"rst", "rest", "restructuredtext"},
Filenames: []string{"*.rst", "*.rest"},
MimeTypes: []string{"text/x-rst", "text/prs.fallenstein.rst"},
},
Rules{
restructuredtextRules,
))
func restructuredtextRules() Rules {
return Rules{
"root": {
{"^(=+|-+|`+|:+|\\.+|\\'+|\"+|~+|\\^+|_+|\\*+|\\++|#+)([ \\t]*\\n)(.+)(\\n)(\\1)(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text, GenericHeading, Text), nil},
{"^(\\S.*)(\\n)(={3,}|-{3,}|`{3,}|:{3,}|\\.{3,}|\\'{3,}|\"{3,}|~{3,}|\\^{3,}|_{3,}|\\*{3,}|\\+{3,}|#{3,})(\\n)", ByGroups(GenericHeading, Text, GenericHeading, Text), nil},
@ -56,10 +60,10 @@ var Restructuredtext = internal.Register(MustNewLexer(
{"``((?=$)|(?=[-/:.,; \\n\\x00\\\u2010\\\u2011\\\u2012\\\u2013\\\u2014\\\u00a0\\'\\\"\\)\\]\\}\\>\\\u2019\\\u201d\\\u00bb\\!\\?]))", LiteralString, Pop(1)},
{"`", LiteralString, nil},
},
},
))
}
}
func rstCodeBlock(groups []string, lexer Lexer) Iterator {
func rstCodeBlock(groups []string, state *LexerState) Iterator {
iterators := []Iterator{}
tokens := []Token{
{Punctuation, groups[1]},
@ -71,7 +75,7 @@ func rstCodeBlock(groups []string, lexer Lexer) Iterator {
{Text, groups[7]},
}
code := strings.Join(groups[8:], "")
lexer = internal.Get(groups[6])
lexer := internal.Get(groups[6])
if lexer == nil {
tokens = append(tokens, Token{String, code})
iterators = append(iterators, Literator(tokens...))

View File

@ -6,7 +6,7 @@ import (
)
// Ruby lexer.
var Ruby = internal.Register(MustNewLexer(
var Ruby = internal.Register(MustNewLazyLexer(
&Config{
Name: "Ruby",
Aliases: []string{"rb", "ruby", "duby"},
@ -14,7 +14,11 @@ var Ruby = internal.Register(MustNewLexer(
MimeTypes: []string{"text/x-ruby", "application/x-ruby"},
DotAll: true,
},
Rules{
rubyRules,
))
func rubyRules() Rules {
return Rules{
"root": {
{`\A#!.+?$`, CommentHashbang, nil},
{`#.*?$`, CommentSingle, nil},
@ -39,7 +43,7 @@ var Ruby = internal.Register(MustNewLexer(
{`(0_?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberOct, Text, Operator), nil},
{`(0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberHex, Text, Operator), nil},
{`(0b[01]+(?:_[01]+)*)(\s*)([/?])?`, ByGroups(LiteralNumberBin, Text, Operator), nil},
{`([\d]+(?:_\d+)*)(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil},
{`([\d]+(?:[_e]\d+)*)(\s*)([/?])?`, ByGroups(LiteralNumberInteger, Text, Operator), nil},
{`@@[a-zA-Z_]\w*`, NameVariableClass, nil},
{`@[a-zA-Z_]\w*`, NameVariableInstance, nil},
{`\$\w+`, NameVariableGlobal, nil},
@ -246,5 +250,5 @@ var Ruby = internal.Register(MustNewLexer(
{`[\\#<>]`, LiteralStringRegex, nil},
{`[^\\#<>]+`, LiteralStringRegex, nil},
},
},
))
}
}

View File

@ -6,7 +6,7 @@ import (
)
// Rust lexer.
var Rust = internal.Register(MustNewLexer(
var Rust = internal.Register(MustNewLazyLexer(
&Config{
Name: "Rust",
Aliases: []string{"rust"},
@ -14,7 +14,11 @@ var Rust = internal.Register(MustNewLexer(
MimeTypes: []string{"text/rust"},
EnsureNL: true,
},
Rules{
rustRules,
))
func rustRules() Rules {
return Rules{
"root": {
{`#![^[\r\n].*$`, CommentPreproc, nil},
Default(Push("base")),
@ -28,18 +32,18 @@ var Rust = internal.Register(MustNewLexer(
{`/\*\*(\n|[^/*])`, LiteralStringDoc, Push("doccomment")},
{`/\*!`, LiteralStringDoc, Push("doccomment")},
{`/\*`, CommentMultiline, Push("comment")},
{`r#*"(?:\\.|[^\\\r\n;])*"#*`, LiteralString, nil},
{`"(?:\\.|[^\\\r\n"])*"`, LiteralString, nil},
{`r#*"(?:\\.|[^\\;])*"#*`, LiteralString, nil},
{`"(?:\\.|[^\\"])*"`, LiteralString, nil},
{`\$([a-zA-Z_]\w*|\(,?|\),?|,?)`, CommentPreproc, nil},
{Words(``, `\b`, `as`, `box`, `const`, `crate`, `else`, `extern`, `for`, `if`, `impl`, `in`, `loop`, `match`, `move`, `mut`, `pub`, `ref`, `return`, `static`, `super`, `trait`, `unsafe`, `use`, `where`, `while`), Keyword, nil},
{Words(``, `\b`, `abstract`, `alignof`, `become`, `do`, `final`, `macro`, `offsetof`, `override`, `priv`, `proc`, `pure`, `sizeof`, `typeof`, `unsized`, `virtual`, `yield`), KeywordReserved, nil},
{Words(``, `\b`, `as`, `async`, `await`, `const`, `crate`, `else`, `extern`, `for`, `if`, `impl`, `in`, `loop`, `match`, `move`, `mut`, `pub`, `ref`, `return`, `static`, `super`, `trait`, `unsafe`, `use`, `where`, `while`), Keyword, nil},
{Words(``, `\b`, `abstract`, `become`, `box`, `do`, `final`, `macro`, `override`, `priv`, `try`, `typeof`, `unsized`, `virtual`, `yield`), KeywordReserved, nil},
{`(true|false)\b`, KeywordConstant, nil},
{`mod\b`, Keyword, Push("modname")},
{`let\b`, KeywordDeclaration, nil},
{`fn\b`, Keyword, Push("funcname")},
{`(struct|enum|type|union)\b`, Keyword, Push("typename")},
{`(default)(\s+)(type|fn)\b`, ByGroups(Keyword, Text, Keyword), nil},
{Words(``, `\b`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`, `usize`, `isize`, `f32`, `f64`, `str`, `bool`), KeywordType, nil},
{Words(``, `\b`, `u8`, `u16`, `u32`, `u64`, `u128`, `i8`, `i16`, `i32`, `i64`, `i128`, `usize`, `isize`, `f32`, `f64`, `str`, `bool`), KeywordType, nil},
{`self\b`, NameBuiltinPseudo, nil},
{Words(``, `\b`, `Copy`, `Send`, `Sized`, `Sync`, `Drop`, `Fn`, `FnMut`, `FnOnce`, `Box`, `ToOwned`, `Clone`, `PartialEq`, `PartialOrd`, `Eq`, `Ord`, `AsRef`, `AsMut`, `Into`, `From`, `Default`, `Iterator`, `Extend`, `IntoIterator`, `DoubleEndedIterator`, `ExactSizeIterator`, `Option`, `Some`, `None`, `Result`, `Ok`, `Err`, `SliceConcatExt`, `String`, `ToString`, `Vec`), NameBuiltin, nil},
{`::\b`, Text, nil},
@ -131,5 +135,5 @@ var Rust = internal.Register(MustNewLexer(
{`\);?`, CommentPreproc, Pop(1)},
{`[^")]+`, CommentPreproc, nil},
},
},
))
}
}