diff --git a/go.mod b/go.mod
index ac07047..1fd9289 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/cheat/cheat
go 1.14
require (
- github.com/alecthomas/chroma v0.8.1
+ github.com/alecthomas/chroma v0.8.2
github.com/davecgh/go-spew v1.1.1
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
@@ -12,8 +12,8 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/sergi/go-diff v1.1.0 // indirect
- golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 // indirect
+ golang.org/x/sys v0.0.0-20201126233918-771906719818 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
- gopkg.in/yaml.v2 v2.3.0
+ gopkg.in/yaml.v2 v2.4.0
)
diff --git a/go.sum b/go.sum
index b4a6ebc..3941e9e 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
-github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE=
-github.com/alecthomas/chroma v0.8.1/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
+github.com/alecthomas/chroma v0.8.2 h1:x3zkuE2lUk/RIekyAJ3XRqSCP4zwWDfcw/YJCuCAACg=
+github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE=
@@ -53,8 +53,8 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 h1:opSr2sbRXk5X5/givKrrKj9HXxFpW2sdCiP8MJSKLQY=
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 h1:a/mKvvZr9Jcc8oKfcmgzyp7OwF73JPWsQLvH1z2Kxck=
-golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201126233918-771906719818 h1:f1CIuDlJhwANEC2MM87MBEVMr3jl5bifgsfj90XAF9c=
+golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -64,5 +64,5 @@ gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+p
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
diff --git a/vendor/github.com/alecthomas/chroma/.goreleaser.yml b/vendor/github.com/alecthomas/chroma/.goreleaser.yml
index 99d13e3..f8abfdd 100644
--- a/vendor/github.com/alecthomas/chroma/.goreleaser.yml
+++ b/vendor/github.com/alecthomas/chroma/.goreleaser.yml
@@ -6,6 +6,8 @@ release:
brews:
-
install: bin.install "chroma"
+env:
+ - CGO_ENABLED=0
builds:
- goos:
- linux
diff --git a/vendor/github.com/alecthomas/chroma/.travis.yml b/vendor/github.com/alecthomas/chroma/.travis.yml
deleted file mode 100644
index 4850b0c..0000000
--- a/vendor/github.com/alecthomas/chroma/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-sudo: false
-language: go
-go:
- - "1.13.x"
-script:
- - go test -v ./...
- - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.26.0
- - ./bin/golangci-lint run
- - git clean -fdx .
-after_success:
- curl -sL https://git.io/goreleaser | bash && goreleaser
-
diff --git a/vendor/github.com/alecthomas/chroma/README.md b/vendor/github.com/alecthomas/chroma/README.md
index 490adea..42af02e 100644
--- a/vendor/github.com/alecthomas/chroma/README.md
+++ b/vendor/github.com/alecthomas/chroma/README.md
@@ -1,4 +1,4 @@
-# Chroma — A general purpose syntax highlighter in pure Go [![Golang Documentation](https://godoc.org/github.com/alecthomas/chroma?status.svg)](https://godoc.org/github.com/alecthomas/chroma) [![Build Status](https://travis-ci.org/alecthomas/chroma.svg)](https://travis-ci.org/alecthomas/chroma) [![Gitter chat](https://badges.gitter.im/alecthomas.svg)](https://gitter.im/alecthomas/Lobby)
+# Chroma — A general purpose syntax highlighter in pure Go [![Golang Documentation](https://godoc.org/github.com/alecthomas/chroma?status.svg)](https://godoc.org/github.com/alecthomas/chroma) [![CircleCI](https://img.shields.io/circleci/project/github/alecthomas/chroma.svg)](https://circleci.com/gh/alecthomas/chroma) [![Go Report Card](https://goreportcard.com/badge/github.com/alecthomas/chroma)](https://goreportcard.com/report/github.com/alecthomas/chroma) [![Slack chat](https://img.shields.io/static/v1?logo=slack&style=flat&label=slack&color=green&message=gophers)](https://gophers.slack.com/messages/CN9DS8YF3)
> **NOTE:** As Chroma has just been released, its API is still in flux. That said, the high-level interface should not change significantly.
@@ -36,29 +36,30 @@ translators for Pygments lexers and styles.
Prefix | Language
:----: | --------
A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Angular2, ANTLR, ApacheConf, APL, AppleScript, Arduino, Awk
-B | Ballerina, Base Makefile, Bash, Batchfile, BlitzBasic, BNF, Brainfuck
-C | C, C#, C++, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython
+B | Ballerina, Base Makefile, Bash, Batchfile, BibTeX, BlitzBasic, BNF, Brainfuck
+C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython
D | D, Dart, Diff, Django/Jinja, Docker, DTD
E | EBNF, Elixir, Elm, EmacsLisp, Erlang
F | Factor, Fish, Forth, Fortran, FSharp
-G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groovy
-H | Handlebars, Haskell, Haxe, HCL, Hexdump, HTML, HTTP, Hy
-I | Idris, INI, Io
+G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groovy
+H | Handlebars, Haskell, Haxe, HCL, Hexdump, HLB, HTML, HTTP, Hy
+I | Idris, Igor, INI, Io
J | J, Java, JavaScript, JSON, Julia, Jungle
K | Kotlin
L | Lighttpd configuration file, LLVM, Lua
M | Mako, markdown, Mason, Mathematica, Matlab, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL
N | NASM, Newspeak, Nginx configuration file, Nim, Nix
O | Objective-C, OCaml, Octave, OpenSCAD, Org Mode
-P | PacmanConf, Perl, PHP, Pig, PkgConfig, PL/pgSQL, plaintext, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, Protocol Buffer, Puppet, Python, Python 3
+P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, PromQL, Protocol Buffer, Puppet, Python, Python 3
Q | QBasic
-R | R, Racket, Ragel, react, reg, reStructuredText, Rexx, Ruby, Rust
-S | Sass, Scala, Scheme, Scilab, SCSS, Smalltalk, Smarty, SML, Snobol, Solidity, SPARQL, SQL, SquidConf, Swift, SYSTEMD, systemverilog
+R | R, Racket, Ragel, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust
+S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Smalltalk, Smarty, Snobol, Solidity, SPARQL, SQL, SquidConf, Standard ML, Stylus, Swift, SYSTEMD, systemverilog
T | TableGen, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData
V | VB.net, verilog, VHDL, VimL, vue
W | WDTE
X | XML, Xorg
-Y | YAML
+Y | YAML, YANG
+Z | Zig
_I will attempt to keep this section up to date, but an authoritative list can be
@@ -183,7 +184,7 @@ following constructor options:
- `ClassPrefix(prefix)` - prefix each generated CSS class.
- `TabWidth(width)` - Set the rendered tab width, in characters.
- `WithLineNumbers()` - Render line numbers (style with `LineNumbers`).
-- `LinkableLineNumbers()` - Make the line numbers linkable.
+- `LinkableLineNumbers()` - Make the line numbers linkable and be a link to themselves.
- `HighlightLines(ranges)` - Highlight lines in these ranges (style with `LineHighlight`).
- `LineNumbersInTable()` - Use a table for formatting line numbers and code, rather than spans.
diff --git a/vendor/github.com/alecthomas/chroma/formatters/html/html.go b/vendor/github.com/alecthomas/chroma/formatters/html/html.go
index ad48da1..a0854af 100644
--- a/vendor/github.com/alecthomas/chroma/formatters/html/html.go
+++ b/vendor/github.com/alecthomas/chroma/formatters/html/html.go
@@ -211,7 +211,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
fmt.Fprintf(w, "", f.styleAttr(css, chroma.LineHighlight))
}
- fmt.Fprintf(w, "%*d\n", f.styleAttr(css, chroma.LineNumbersTable), f.lineIDAttribute(line), lineDigits, line)
+ fmt.Fprintf(w, "%s\n", f.styleAttr(css, chroma.LineNumbersTable), f.lineIDAttribute(line), f.lineTitleWithLinkIfNeeded(lineDigits, line))
if highlight {
fmt.Fprintf(w, "")
@@ -237,7 +237,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
}
if f.lineNumbers && !wrapInTable {
- fmt.Fprintf(w, "%*d", f.styleAttr(css, chroma.LineNumbers), f.lineIDAttribute(line), lineDigits, line)
+ fmt.Fprintf(w, "%s", f.styleAttr(css, chroma.LineNumbers), f.lineIDAttribute(line), f.lineTitleWithLinkIfNeeded(lineDigits, line))
}
for _, token := range tokens {
@@ -272,7 +272,19 @@ func (f *Formatter) lineIDAttribute(line int) string {
if !f.linkableLineNumbers {
return ""
}
- return fmt.Sprintf(" id=\"%s%d\"", f.lineNumbersIDPrefix, line)
+ return fmt.Sprintf(" id=\"%s\"", f.lineID(line))
+}
+
+func (f *Formatter) lineTitleWithLinkIfNeeded(lineDigits, line int) string {
+ title := fmt.Sprintf("%*d", lineDigits, line)
+ if !f.linkableLineNumbers {
+ return title
+ }
+ return fmt.Sprintf("%s", f.lineID(line), title)
+}
+
+func (f *Formatter) lineID(line int) string {
+ return fmt.Sprintf("%s%d", f.lineNumbersIDPrefix, line)
}
func (f *Formatter) shouldHighlight(highlightIndex, line int) (bool, bool) {
diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bash.go b/vendor/github.com/alecthomas/chroma/lexers/b/bash.go
index 33f6cd8..7eac38e 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/b/bash.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/b/bash.go
@@ -14,7 +14,7 @@ var Bash = internal.Register(MustNewLexer(
&Config{
Name: "Bash",
Aliases: []string{"bash", "sh", "ksh", "zsh", "shell"},
- Filenames: []string{"*.sh", "*.ksh", "*.bash", "*.ebuild", "*.eclass", "*.exheres-0", "*.exlib", "*.zsh", "*.zshrc", ".bashrc", "bashrc", ".bash_*", "bash_*", "zshrc", ".zshrc", "PKGBUILD"},
+ Filenames: []string{"*.sh", "*.ksh", "*.bash", "*.ebuild", "*.eclass", ".env", "*.env", "*.exheres-0", "*.exlib", "*.zsh", "*.zshrc", ".bashrc", "bashrc", ".bash_*", "bash_*", "zshrc", ".zshrc", "PKGBUILD"},
MimeTypes: []string{"application/x-sh", "application/x-shellscript"},
},
Rules{
diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/go.go b/vendor/github.com/alecthomas/chroma/lexers/g/go.go
index 33077e0..8eced07 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/g/go.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/g/go.go
@@ -60,13 +60,13 @@ var Go = internal.Register(MustNewLexer(
var goTemplateRules = Rules{
"root": {
+ {`{{(- )?/\*(.|\n)*?\*/( -)?}}`, CommentMultiline, nil},
{`{{[-]?`, CommentPreproc, Push("template")},
{`[^{]+`, Other, nil},
{`{`, Other, nil},
},
"template": {
{`[-]?}}`, CommentPreproc, Pop(1)},
- {`/\*.*?\*/`, Comment, nil},
{`(?=}})`, CommentPreproc, Pop(1)}, // Terminate the pipeline
{`\(`, Operator, Push("subexpression")},
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
@@ -80,19 +80,19 @@ var goTemplateRules = Rules{
{`\s+`, Whitespace, nil},
{`\(`, Operator, Push("subexpression")},
{`(range|if|else|while|with|template|end|true|false|nil|and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\b`, Keyword, nil},
- {`\||:=`, Operator, nil},
+ {`\||:?=|,`, Operator, nil},
{`[$]?[^\W\d]\w*`, NameOther, nil},
{`[$]?\.(?:[^\W\d]\w*)?`, NameAttribute, nil},
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
- {`\d+i`, LiteralNumber, nil},
- {`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil},
+ {`-?\d+i`, LiteralNumber, nil},
+ {`-?\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil},
{`\.\d+([Ee][-+]\d+)?i`, LiteralNumber, nil},
- {`\d+[Ee][-+]\d+i`, LiteralNumber, nil},
- {`\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil},
- {`\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil},
- {`0[0-7]+`, LiteralNumberOct, nil},
- {`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil},
- {`(0|[1-9][0-9]*)`, LiteralNumberInteger, nil},
+ {`-?\d+[Ee][-+]\d+i`, LiteralNumber, nil},
+ {`-?\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)`, LiteralNumberFloat, nil},
+ {`-?\.\d+([eE][+\-]?\d+)?`, LiteralNumberFloat, nil},
+ {`-?0[0-7]+`, LiteralNumberOct, nil},
+ {`-?0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil},
+ {`-?(0|[1-9][0-9]*)`, LiteralNumberInteger, nil},
{`'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'`, LiteralStringChar, nil},
{"`[^`]*`", LiteralString, nil},
},
diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go b/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go
index a50cb24..ffa20c3 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/j/javascript.go
@@ -49,6 +49,7 @@ var JavascriptRules = Rules{
{"`", LiteralStringBacktick, Pop(1)},
{`\\\\`, LiteralStringBacktick, nil},
{"\\\\`", LiteralStringBacktick, nil},
+ {"\\\\[^`\\\\]", LiteralStringBacktick, nil},
{`\$\{`, LiteralStringInterpol, Push("interp-inside")},
{`\$`, LiteralStringBacktick, nil},
{"[^`\\\\$]+", LiteralStringBacktick, nil},
diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/promql.go b/vendor/github.com/alecthomas/chroma/lexers/p/promql.go
new file mode 100644
index 0000000..38982e1
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/p/promql.go
@@ -0,0 +1,55 @@
+package p
+
+import (
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// Promql lexer.
+var Promql = internal.Register(MustNewLexer(
+ &Config{
+ Name: "PromQL",
+ Aliases: []string{"promql"},
+ Filenames: []string{"*.promql"},
+ MimeTypes: []string{},
+ },
+ Rules{
+ "root": {
+ {`\n`, TextWhitespace, nil},
+ {`\s+`, TextWhitespace, nil},
+ {`,`, Punctuation, nil},
+ {Words(``, `\b`, `bool`, `by`, `group_left`, `group_right`, `ignoring`, `offset`, `on`, `without`), Keyword, nil},
+ {Words(``, `\b`, `sum`, `min`, `max`, `avg`, `group`, `stddev`, `stdvar`, `count`, `count_values`, `bottomk`, `topk`, `quantile`), Keyword, nil},
+ {Words(``, `\b`, `abs`, `absent`, `absent_over_time`, `avg_over_time`, `ceil`, `changes`, `clamp_max`, `clamp_min`, `count_over_time`, `day_of_month`, `day_of_week`, `days_in_month`, `delta`, `deriv`, `exp`, `floor`, `histogram_quantile`, `holt_winters`, `hour`, `idelta`, `increase`, `irate`, `label_join`, `label_replace`, `ln`, `log10`, `log2`, `max_over_time`, `min_over_time`, `minute`, `month`, `predict_linear`, `quantile_over_time`, `rate`, `resets`, `round`, `scalar`, `sort`, `sort_desc`, `sqrt`, `stddev_over_time`, `stdvar_over_time`, `sum_over_time`, `time`, `timestamp`, `vector`, `year`), KeywordReserved, nil},
+ {`[1-9][0-9]*[smhdwy]`, LiteralString, nil},
+ {`-?[0-9]+\.[0-9]+`, LiteralNumberFloat, nil},
+ {`-?[0-9]+`, LiteralNumberInteger, nil},
+ {`#.*?$`, CommentSingle, nil},
+ {`(\+|\-|\*|\/|\%|\^)`, Operator, nil},
+ {`==|!=|>=|<=|<|>`, Operator, nil},
+ {`and|or|unless`, OperatorWord, nil},
+ {`[_a-zA-Z][a-zA-Z0-9_]+`, NameVariable, nil},
+ {`(["\'])(.*?)(["\'])`, ByGroups(Punctuation, LiteralString, Punctuation), nil},
+ {`\(`, Operator, Push("function")},
+ {`\)`, Operator, nil},
+ {`\{`, Punctuation, Push("labels")},
+ {`\[`, Punctuation, Push("range")},
+ },
+ "labels": {
+ {`\}`, Punctuation, Pop(1)},
+ {`\n`, TextWhitespace, nil},
+ {`\s+`, TextWhitespace, nil},
+ {`,`, Punctuation, nil},
+ {`([_a-zA-Z][a-zA-Z0-9_]*?)(\s*?)(=~|!=|=|~!)(\s*?)(")(.*?)(")`, ByGroups(NameLabel, TextWhitespace, Operator, TextWhitespace, Punctuation, LiteralString, Punctuation), nil},
+ },
+ "range": {
+ {`\]`, Punctuation, Pop(1)},
+ {`[1-9][0-9]*[smhdwy]`, LiteralString, nil},
+ },
+ "function": {
+ {`\)`, Operator, Pop(1)},
+ {`\(`, Operator, Push()},
+ Default(Pop(1)),
+ },
+ },
+))
diff --git a/vendor/github.com/alecthomas/chroma/lexers/qml.go b/vendor/github.com/alecthomas/chroma/lexers/qml.go
new file mode 100644
index 0000000..9d2f2fb
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/qml.go
@@ -0,0 +1,54 @@
+package lexers
+
+import (
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// Qml lexer.
+var Qml = internal.Register(MustNewLexer(
+ &Config{
+ Name: "QML",
+ Aliases: []string{"qml", "qbs"},
+ Filenames: []string{"*.qml", "*.qbs"},
+ MimeTypes: []string{"application/x-qml", "application/x-qt.qbs+qml"},
+ DotAll: true,
+ },
+ Rules{
+ "commentsandwhitespace": {
+ {`\s+`, Text, nil},
+ {`