mirror of
https://github.com/go-gitea/gitea
synced 2024-11-02 00:04:25 +00:00
fae07cbc8f
* Add Dependencie Update Script * update gitea.com/lunny/levelqueue * 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-redis/redis/v8 * update github.com/hashicorp/golang-lru * update github.com/klauspost/compress * update github.com/markbates/goth * update github.com/mholt/archiver/v3 * update github.com/microcosm-cc/bluemonday * update github.com/minio/minio-go/v7 * update github.com/olivere/elastic/v7 * update github.com/xanzy/go-gitlab * update github.com/yuin/goldmark
39 lines
1.2 KiB
Go
Vendored
39 lines
1.2 KiB
Go
Vendored
package p
|
|
|
|
import (
|
|
. "github.com/alecthomas/chroma" // nolint
|
|
"github.com/alecthomas/chroma/lexers/internal"
|
|
)
|
|
|
|
// PowerQuery lexer.
|
|
var PowerQuery = internal.Register(MustNewLazyLexer(
|
|
&Config{
|
|
Name: "PowerQuery",
|
|
Aliases: []string{"powerquery", "pq"},
|
|
Filenames: []string{"*.pq"},
|
|
MimeTypes: []string{"text/x-powerquery"},
|
|
DotAll: true,
|
|
CaseInsensitive: true,
|
|
},
|
|
powerqueryRules,
|
|
))
|
|
|
|
func powerqueryRules() Rules {
|
|
return Rules{
|
|
"root": {
|
|
{`\s+`, Text, nil},
|
|
{`//.*?\n`, CommentSingle, nil},
|
|
{`/\*.*?\*/`, CommentMultiline, nil},
|
|
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
|
|
{`(and|as|each|else|error|false|if|in|is|let|meta|not|null|or|otherwise|section|shared|then|true|try|type)\b`, Keyword, nil},
|
|
{`(#binary|#date|#datetime|#datetimezone|#duration|#infinity|#nan|#sections|#shared|#table|#time)\b`, KeywordType, nil},
|
|
{`(([a-zA-Z]|_)[\w|._]*|#"[^"]+")`, Name, nil},
|
|
{`0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?`, LiteralNumberHex, nil},
|
|
{`([0-9]+\.[0-9]+|\.[0-9]+)([eE][0-9]+)?`, LiteralNumberFloat, nil},
|
|
{`[0-9]+`, LiteralNumberInteger, nil},
|
|
{`[\(\)\[\]\{\}]`, Punctuation, nil},
|
|
{`\.\.|\.\.\.|=>|<=|>=|<>|[@!?,;=<>\+\-\*\/&]`, Operator, nil},
|
|
},
|
|
}
|
|
}
|