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:
44
vendor/github.com/alecthomas/chroma/lexers/s/solidity.go
generated
vendored
44
vendor/github.com/alecthomas/chroma/lexers/s/solidity.go
generated
vendored
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// Solidity lexer.
|
||||
var Solidity = internal.Register(MustNewLexer(
|
||||
var Solidity = internal.Register(MustNewLazyLexer(
|
||||
&Config{
|
||||
Name: "Solidity",
|
||||
Aliases: []string{"sol", "solidity"},
|
||||
@@ -14,7 +14,11 @@ var Solidity = internal.Register(MustNewLexer(
|
||||
MimeTypes: []string{},
|
||||
DotAll: true,
|
||||
},
|
||||
Rules{
|
||||
solidityRules,
|
||||
))
|
||||
|
||||
func solidityRules() Rules {
|
||||
return Rules{
|
||||
"assembly": {
|
||||
Include("comments"),
|
||||
Include("numbers"),
|
||||
@@ -35,17 +39,16 @@ var Solidity = internal.Register(MustNewLexer(
|
||||
{`/[*][\w\W]*`, CommentMultiline, nil},
|
||||
},
|
||||
"keywords-other": {
|
||||
{Words(``, `\b`, `for`, `in`, `while`, `do`, `break`, `return`, `returns`, `continue`, `if`, `else`, `throw`, `new`, `delete`), Keyword, nil},
|
||||
{Words(``, `\b`, `for`, `in`, `while`, `do`, `break`, `return`, `returns`, `continue`, `if`, `else`, `try`, `catch`, `throw`, `_`, `new`, `delete`, `is`, `as`, `from`, `memory`, `storage`), Keyword, nil},
|
||||
{`assembly\b`, Keyword, Push("assembly")},
|
||||
{Words(``, `\b`, `contract`, `interface`, `enum`, `event`, `function`, `library`, `mapping`, `modifier`, `struct`, `var`), KeywordDeclaration, nil},
|
||||
{`(contract|interface|enum|event|struct)(\s+)([a-zA-Z_]\w*)`, ByGroups(KeywordDeclaration, Text, NameClass), nil},
|
||||
{`(function|modifier)(\s+)([a-zA-Z_]\w*)`, ByGroups(KeywordDeclaration, Text, NameFunction), nil},
|
||||
{Words(``, `\b`, `contract`, `interface`, `enum`, `event`, `constructor`, `function`, `library`, `mapping`, `modifier`, `struct`, `var`), KeywordDeclaration, nil},
|
||||
{Words(``, `\b`, `abstract`, `external`, `internal`, `private`, `public`), Keyword, nil},
|
||||
{Words(``, `\b`, `anonymous`, `constant`, `immutable`, `indexed`, `override`, `payable`, `pure`, `view`, `virtual`), Keyword, nil},
|
||||
{`(import|using)\b`, KeywordNamespace, nil},
|
||||
{`pragma (solidity|experimental)\b`, KeywordReserved, nil},
|
||||
{`(_|as|constant|default|from|is)\b`, KeywordReserved, nil},
|
||||
{`payable\b`, KeywordReserved, nil},
|
||||
{`(memory|storage)\b`, KeywordReserved, nil},
|
||||
{`(external|internal|private|public)\b`, KeywordReserved, nil},
|
||||
{`(anonymous|indexed)\b`, KeywordReserved, nil},
|
||||
{`(abstract|pure|static|view)\b`, KeywordReserved, nil},
|
||||
{`pragma (solidity|experimental)\b`, Keyword, nil},
|
||||
{Words(``, `\b`, `after`, `alias`, `apply`, `auto`, `case`, `copyof`, `default`, `define`, `final`, `implements`, `inline`, `let`, `macro`, `match`, `mutable`, `null`, `of`, `partial`, `promise`, `reference`, `relocatable`, `sealed`, `sizeof`, `static`, `supports`, `switch`, `typedef`, `typeof`, `unchecked`), KeywordReserved, nil},
|
||||
{`(true|false)\b`, KeywordConstant, nil},
|
||||
{`(wei|finney|szabo|ether)\b`, KeywordConstant, nil},
|
||||
{`(seconds|minutes|hours|days|weeks|years)\b`, KeywordConstant, nil},
|
||||
@@ -95,16 +98,21 @@ var Solidity = internal.Register(MustNewLexer(
|
||||
{`\+\+|--|\*\*|\?|:|~|&&|\|\||=>|==?|!=?|(<<|>>>?|[-<>+*%&|^/])=?`, Operator, nil},
|
||||
{`[{(\[;,]`, Punctuation, nil},
|
||||
{`[})\].]`, Punctuation, nil},
|
||||
{`(block|msg|now|this|super|tx)\b`, NameBuiltin, nil},
|
||||
{`(sender|origin)\b`, NameBuiltin, nil},
|
||||
{`(gas|value)\b`, NameBuiltin, nil},
|
||||
{`(abi|block|msg|tx)\b`, NameBuiltin, nil},
|
||||
{`(?!abi\.)(decode|encode|encodePacked|encodeWithSelector|encodeWithSignature|encodeWithSelector)\b`, NameBuiltin, nil},
|
||||
{`(?!block\.)(chainid|coinbase|difficulty|gaslimit|number|timestamp)\b`, NameBuiltin, nil},
|
||||
{`(?!msg\.)(data|gas|sender|value)\b`, NameBuiltin, nil},
|
||||
{`(?!tx\.)(gasprice|origin)\b`, NameBuiltin, nil},
|
||||
{`(type)(\()([a-zA-Z_]\w*)(\))`, ByGroups(NameBuiltin, Punctuation, NameClass, Punctuation), nil},
|
||||
{`(?!type\([a-zA-Z_]\w*\)\.)(creationCode|interfaceId|max|min|name|runtimeCode)\b`, NameBuiltin, nil},
|
||||
{`(now|this|super|gasleft)\b`, NameBuiltin, nil},
|
||||
{`(selfdestruct|suicide)\b`, NameBuiltin, nil},
|
||||
{`(balance|send|transfer)\b`, NameBuiltin, nil},
|
||||
{`(?!0x[0-9a-fA-F]+\.)(balance|code|codehash|send|transfer)\b`, NameBuiltin, nil},
|
||||
{`(assert|revert|require)\b`, NameBuiltin, nil},
|
||||
{`(call|callcode|delegatecall)\b`, NameBuiltin, nil},
|
||||
{`selector\b`, NameBuiltin, nil},
|
||||
{`(addmod|ecrecover|keccak256|mulmod|ripemd160|sha256|sha3)\b`, NameFunction, nil},
|
||||
{`(addmod|blockhash|ecrecover|keccak256|mulmod|ripemd160|sha256|sha3)\b`, NameBuiltin, nil},
|
||||
{`[a-zA-Z_]\w*`, Name, nil},
|
||||
},
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user