diff --git a/go.mod b/go.mod index 5a4f653..bc6085d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ 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-20200302150141-5c8b2ff67527 // 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.2.8 diff --git a/go.sum b/go.sum index a388589..d8fc804 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,9 @@ 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.7.1 h1:G1i02OhUbRi2nJxcNkwJaY/J1gHXj9tt72qN6ZouLFQ= -github.com/alecthomas/chroma v0.7.1/go.mod h1:gHw09mkX1Qp80JlYbmN9L3+4R5o6DJJ3GRShh+AICNc= github.com/alecthomas/chroma v0.7.3 h1:NfdAERMy+esYQs8OXk0I868/qDxxCEo7FMz1WIqMAeI= github.com/alecthomas/chroma v0.7.3/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.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= @@ -16,8 +13,6 @@ github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= -github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= @@ -29,16 +24,11 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -56,13 +46,10 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 h1:YAFjXN64LMvktoUZH9zgY4lGc/msGN7HQfoSuKCgaDU= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/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= 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= diff --git a/vendor/github.com/alecthomas/chroma/.goreleaser.yml b/vendor/github.com/alecthomas/chroma/.goreleaser.yml index e90c511..99d13e3 100644 --- a/vendor/github.com/alecthomas/chroma/.goreleaser.yml +++ b/vendor/github.com/alecthomas/chroma/.goreleaser.yml @@ -3,28 +3,30 @@ release: github: owner: alecthomas name: chroma -brew: - install: bin.install "chroma" +brews: + - + install: bin.install "chroma" builds: - goos: - - linux - - darwin - - windows + - linux + - darwin + - windows goarch: - - amd64 - - "386" + - amd64 + - "386" goarm: - - "6" + - "6" main: ./cmd/chroma/main.go ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} binary: chroma -archive: - format: tar.gz - name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ +archives: + - + format: tar.gz + name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - files: - - COPYING - - README* + files: + - COPYING + - README* snapshot: name_template: SNAPSHOT-{{ .Commit }} checksum: diff --git a/vendor/github.com/alecthomas/chroma/formatters/html/html.go b/vendor/github.com/alecthomas/chroma/formatters/html/html.go index d3fef2e..ad48da1 100644 --- a/vendor/github.com/alecthomas/chroma/formatters/html/html.go +++ b/vendor/github.com/alecthomas/chroma/formatters/html/html.go @@ -22,6 +22,9 @@ func ClassPrefix(prefix string) Option { return func(f *Formatter) { f.prefix = // WithClasses emits HTML using CSS classes, rather than inline styles. func WithClasses(b bool) Option { return func(f *Formatter) { f.Classes = b } } +// WithAllClasses disables an optimisation that omits redundant CSS classes. +func WithAllClasses(b bool) Option { return func(f *Formatter) { f.allClasses = b } } + // TabWidth sets the number of characters for a tab. Defaults to 8. func TabWidth(width int) Option { return func(f *Formatter) { f.tabWidth = width } } @@ -141,6 +144,7 @@ type Formatter struct { standalone bool prefix string Classes bool // Exported field to detect when classes are being used + allClasses bool preWrapper PreWrapper tabWidth int lineNumbers bool @@ -188,7 +192,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma. wrapInTable := f.lineNumbers && f.lineNumbersInTable lines := chroma.SplitTokensIntoLines(tokens) - lineDigits := len(fmt.Sprintf("%d", len(lines))) + lineDigits := len(fmt.Sprintf("%d", f.baseLineNumber+len(lines)-1)) highlightIndex := 0 if wrapInTable { @@ -362,8 +366,12 @@ func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error { if tt == chroma.Background { continue } + class := f.class(tt) + if class == "" { + continue + } styles := css[tt] - if _, err := fmt.Fprintf(w, "/* %s */ .%schroma .%s { %s }\n", tt, f.prefix, f.class(tt), styles); err != nil { + if _, err := fmt.Fprintf(w, "/* %s */ .%schroma .%s { %s }\n", tt, f.prefix, class, styles); err != nil { return err } } @@ -379,7 +387,7 @@ func (f *Formatter) styleToCSS(style *chroma.Style) map[chroma.TokenType]string if t != chroma.Background { entry = entry.Sub(bg) } - if entry.IsZero() { + if !f.allClasses && entry.IsZero() { continue } classes[t] = StyleEntryToCSS(entry) diff --git a/vendor/github.com/alecthomas/chroma/go.mod b/vendor/github.com/alecthomas/chroma/go.mod index 38eaa00..10e6d6e 100644 --- a/vendor/github.com/alecthomas/chroma/go.mod +++ b/vendor/github.com/alecthomas/chroma/go.mod @@ -1,19 +1,18 @@ module github.com/alecthomas/chroma +go 1.13 + require ( github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 // indirect - github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae + github.com/alecthomas/kong v0.2.4 github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 - github.com/dlclark/regexp2 v1.1.6 - github.com/mattn/go-colorable v0.0.9 - github.com/mattn/go-isatty v0.0.4 + github.com/dlclark/regexp2 v1.2.0 + github.com/mattn/go-colorable v0.1.6 + github.com/mattn/go-isatty v0.0.12 + github.com/pkg/errors v0.9.1 // indirect github.com/sergi/go-diff v1.0.0 // indirect github.com/stretchr/testify v1.3.0 // indirect - golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 // indirect + golang.org/x/sys v0.0.0-20200413165638-669c56c373c4 // indirect ) - -replace github.com/GeertJohan/go.rice => github.com/alecthomas/go.rice v1.0.1-0.20190719113735-961b99d742e7 - -go 1.13 diff --git a/vendor/github.com/alecthomas/chroma/go.sum b/vendor/github.com/alecthomas/chroma/go.sum index 82643a3..fb943fc 100644 --- a/vendor/github.com/alecthomas/chroma/go.sum +++ b/vendor/github.com/alecthomas/chroma/go.sum @@ -2,8 +2,8 @@ github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= 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.1-0.20190708041108-0548c6b1afae h1:C4Q9m+oXOxcSWwYk9XzzafY2xAVAaeubZbUHJkw3PlY= -github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= +github.com/alecthomas/kong v0.2.4 h1:Y0ZBCHAvHhTHw7FFJ2FzCAAG4pkbTgA45nc7BpMhDNk= +github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= @@ -11,15 +11,16 @@ github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= -github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= +github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= @@ -29,5 +30,7 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 h1:YAFjXN64LMvktoUZH9zgY4lGc/msGN7HQfoSuKCgaDU= -golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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= diff --git a/vendor/github.com/alecthomas/chroma/lexer.go b/vendor/github.com/alecthomas/chroma/lexer.go index a6ae84b..1269d33 100644 --- a/vendor/github.com/alecthomas/chroma/lexer.go +++ b/vendor/github.com/alecthomas/chroma/lexer.go @@ -6,7 +6,8 @@ import ( var ( defaultOptions = &TokeniseOptions{ - State: "root", + State: "root", + EnsureLF: true, } ) @@ -80,6 +81,10 @@ type TokeniseOptions struct { State string // Nested tokenisation. Nested bool + + // If true, all EOLs are converted into LF + // by replacing CRLF and CR + EnsureLF bool } // A Lexer for tokenising source code. diff --git a/vendor/github.com/alecthomas/chroma/lexers/g/gherkin.go b/vendor/github.com/alecthomas/chroma/lexers/g/gherkin.go new file mode 100644 index 0000000..d19b517 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/lexers/g/gherkin.go @@ -0,0 +1,118 @@ +package g + +import ( + . "github.com/alecthomas/chroma" // nolint + "github.com/alecthomas/chroma/lexers/internal" +) + +var stepKeywords = `^(\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )` + +var featureKeywords = `^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$` + +var featureElementKeywords = `^(\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$` + +var examplesKeywords = `^(\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$` + +// Gherkin lexer. +var Gherkin = internal.Register(MustNewLexer( + &Config{ + Name: "Gherkin", + Aliases: []string{"cucumber", "Cucumber", "gherkin", "Gherkin"}, + Filenames: []string{"*.feature", "*.FEATURE"}, + MimeTypes: []string{"text/x-gherkin"}, + }, + Rules{ + "comments": { + {`\s*#.*$`, Comment, nil}, + }, + "featureElements": { + {stepKeywords, Keyword, Push("stepContentStack")}, + Include("comments"), + {`(\s|.)`, NameFunction, nil}, + }, + "featureElementsOnStack": { + {stepKeywords, Keyword, Pop(2)}, + Include("comments"), + {`(\s|.)`, NameFunction, nil}, + }, + "examplesTable": { + {`\s+\|`, Keyword, Push("examplesTableHeader")}, + Include("comments"), + {`(\s|.)`, NameFunction, nil}, + }, + "examplesTableHeader": { + {`\s+\|\s*$`, Keyword, Pop(2)}, + Include("comments"), + {`\\\|`, NameVariable, nil}, + {`\s*\|`, Keyword, nil}, + {`[^|]`, NameVariable, nil}, + }, + "scenarioSectionsOnStack": { + {featureElementKeywords, ByGroups(NameFunction, Keyword, Keyword, NameFunction), Push("featureElementsOnStack")}, + }, + "narrative": { + Include("scenarioSectionsOnStack"), + {`(\s|.)`, NameFunction, nil}, + }, + "tableVars": { + {`(<[^>]+>)`, NameVariable, nil}, + }, + "numbers": { + {`(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?`, LiteralString, nil}, + }, + "string": { + Include("tableVars"), + {`(\s|.)`, LiteralString, nil}, + }, + "pyString": { + {`"""`, Keyword, Pop(1)}, + Include("string"), + }, + "stepContentRoot": { + {`$`, Keyword, Pop(1)}, + Include("stepContent"), + }, + "stepContentStack": { + {`$`, Keyword, Pop(2)}, + Include("stepContent"), + }, + "stepContent": { + {`"`, NameFunction, Push("doubleString")}, + Include("tableVars"), + Include("numbers"), + Include("comments"), + {`(\s|.)`, NameFunction, nil}, + }, + "tableContent": { + {`\s+\|\s*$`, Keyword, Pop(1)}, + Include("comments"), + {`\\\|`, LiteralString, nil}, + {`\s*\|`, Keyword, nil}, + {`"`, LiteralString, Push("doubleStringTable")}, + Include("string"), + }, + "doubleString": { + {`"`, NameFunction, Pop(1)}, + Include("string"), + }, + "doubleStringTable": { + {`"`, LiteralString, Pop(1)}, + Include("string"), + }, + "root": { + {`\n`, NameFunction, nil}, + Include("comments"), + {`"""`, Keyword, Push("pyString")}, + {`\s+\|`, Keyword, Push("tableContent")}, + {`"`, NameFunction, Push("doubleString")}, + Include("tableVars"), + Include("numbers"), + {`(\s*)(@[^@\r\n\t ]+)`, ByGroups(NameFunction, NameTag), nil}, + {stepKeywords, ByGroups(NameFunction, Keyword), Push("stepContentRoot")}, + {featureKeywords, ByGroups(Keyword, Keyword, NameFunction), Push("narrative")}, + {featureElementKeywords, ByGroups(NameFunction, Keyword, Keyword, NameFunction), Push("featureElements")}, + {examplesKeywords, ByGroups(NameFunction, Keyword, Keyword, NameFunction), Push("examplesTable")}, + {`(\s|.)`, NameFunction, nil}, + }, + }, +)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/hlb.go b/vendor/github.com/alecthomas/chroma/lexers/hlb.go new file mode 100644 index 0000000..4dcf8ed --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/lexers/hlb.go @@ -0,0 +1,54 @@ +package lexers + +import ( + . "github.com/alecthomas/chroma" // nolint + "github.com/alecthomas/chroma/lexers/internal" +) + +// HLB lexer. +var HLB = internal.Register(MustNewLexer( + &Config{ + Name: "HLB", + Aliases: []string{"hlb"}, + Filenames: []string{"*.hlb"}, + MimeTypes: []string{}, + }, + Rules{ + "root": { + {`(#.*)`, ByGroups(CommentSingle), nil}, + {`((\b(0(b|B|o|O|x|X)[a-fA-F0-9]+)\b)|(\b(0|[1-9][0-9]*)\b))`, ByGroups(LiteralNumber), nil}, + {`((\b(true|false)\b))`, ByGroups(NameBuiltin), nil}, + {`(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)`, ByGroups(KeywordType), nil}, + {`(\b[a-zA-Z_][a-zA-Z0-9]*\b)(\()`, ByGroups(NameFunction, Punctuation), Push("params")}, + {`(\{)`, ByGroups(Punctuation), Push("block")}, + {`(\n|\r|\r\n)`, Text, nil}, + {`.`, Text, nil}, + }, + "string": { + {`"`, LiteralString, Pop(1)}, + {`\\"`, LiteralString, nil}, + {`[^\\"]+`, LiteralString, nil}, + }, + "block": { + {`(\})`, ByGroups(Punctuation), Pop(1)}, + {`(#.*)`, ByGroups(CommentSingle), nil}, + {`((\b(0(b|B|o|O|x|X)[a-fA-F0-9]+)\b)|(\b(0|[1-9][0-9]*)\b))`, ByGroups(LiteralNumber), nil}, + {`((\b(true|false)\b))`, ByGroups(KeywordConstant), nil}, + {`"`, LiteralString, Push("string")}, + {`(with)`, ByGroups(KeywordReserved), nil}, + {`(as)([\t ]+)(\b[a-zA-Z_][a-zA-Z0-9]*\b)`, ByGroups(KeywordReserved, Text, NameFunction), nil}, + {`(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)([\t ]+)(\{)`, ByGroups(KeywordType, Text, Punctuation), Push("block")}, + {`(?!\b(?:scratch|image|resolve|http|checksum|chmod|filename|git|keepGitDir|local|includePatterns|excludePatterns|followPaths|generate|frontendInput|shell|run|readonlyRootfs|env|dir|user|network|security|host|ssh|secret|mount|target|localPath|uid|gid|mode|readonly|tmpfs|sourcePath|cache|mkdir|createParents|chown|createdTime|mkfile|rm|allowNotFound|allowWildcards|copy|followSymlinks|contentsOnly|unpack|createDestPath)\b)(\b[a-zA-Z_][a-zA-Z0-9]*\b)`, ByGroups(NameOther), nil}, + {`(\n|\r|\r\n)`, Text, nil}, + {`.`, Text, nil}, + }, + "params": { + {`(\))`, ByGroups(Punctuation), Pop(1)}, + {`(variadic)`, ByGroups(Keyword), nil}, + {`(\bstring\b|\bint\b|\bbool\b|\bfs\b|\boption\b)`, ByGroups(KeywordType), nil}, + {`(\b[a-zA-Z_][a-zA-Z0-9]*\b)`, ByGroups(NameOther), nil}, + {`(\n|\r|\r\n)`, Text, nil}, + {`.`, Text, nil}, + }, + }, +)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/internal/api.go b/vendor/github.com/alecthomas/chroma/lexers/internal/api.go index 002997a..08ec6ff 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/internal/api.go +++ b/vendor/github.com/alecthomas/chroma/lexers/internal/api.go @@ -37,19 +37,20 @@ func Names(withAliases bool) []string { // Get a Lexer by name, alias or file extension. func Get(name string) chroma.Lexer { - candidates := chroma.PrioritisedLexers{} if lexer := Registry.byName[name]; lexer != nil { - candidates = append(candidates, lexer) + return lexer } if lexer := Registry.byAlias[name]; lexer != nil { - candidates = append(candidates, lexer) + return lexer } if lexer := Registry.byName[strings.ToLower(name)]; lexer != nil { - candidates = append(candidates, lexer) + return lexer } if lexer := Registry.byAlias[strings.ToLower(name)]; lexer != nil { - candidates = append(candidates, lexer) + return lexer } + + candidates := chroma.PrioritisedLexers{} // Try file extension. if lexer := Match("filename." + name); lexer != nil { candidates = append(candidates, lexer) diff --git a/vendor/github.com/alecthomas/chroma/lexers/j/jsx.go b/vendor/github.com/alecthomas/chroma/lexers/j/jsx.go index 71642d6..7c098b9 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/j/jsx.go +++ b/vendor/github.com/alecthomas/chroma/lexers/j/jsx.go @@ -69,8 +69,9 @@ var JSX = internal.Register(MustNewLexer( Include("root"), }, "jsx": { - {`(<)([\w]+)`, ByGroups(Punctuation, NameTag), Push("tag")}, - {`(<)(/)([\w]+)(>)`, ByGroups(Punctuation, Punctuation, NameTag, Punctuation), nil}, + {`(<)(/?)(>)`, ByGroups(Punctuation, Punctuation, Punctuation), nil}, + {`(<)([\w\.]+)`, ByGroups(Punctuation, NameTag), Push("tag")}, + {`(<)(/)([\w\.]+)(>)`, ByGroups(Punctuation, Punctuation, NameTag, Punctuation), nil}, }, "tag": { {`\s+`, Text, nil}, diff --git a/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go b/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go index 3720da2..dd78ec0 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go +++ b/vendor/github.com/alecthomas/chroma/lexers/m/markdown.go @@ -2,11 +2,12 @@ package m import ( . "github.com/alecthomas/chroma" // nolint + "github.com/alecthomas/chroma/lexers/h" "github.com/alecthomas/chroma/lexers/internal" ) // Markdown lexer. -var Markdown = internal.Register(MustNewLexer( +var Markdown = internal.Register(DelegatingLexer(h.HTML, MustNewLexer( &Config{ Name: "markdown", Aliases: []string{"md", "mkd"}, @@ -40,8 +41,8 @@ var Markdown = internal.Register(MustNewLexer( {"`[^`]+`", LiteralStringBacktick, nil}, {`[@#][\w/:]+`, NameEntity, nil}, {`(!?\[)([^]]+)(\])(\()([^)]+)(\))`, ByGroups(Text, NameTag, Text, Text, NameAttribute, Text), nil}, - {`[^\\\s]+`, Text, nil}, - {`.|\n`, Text, nil}, + {`[^\\\s]+`, Other, nil}, + {`.|\n`, Other, nil}, }, }, -)) +))) diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go b/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go index 50b8f35..7b25293 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go +++ b/vendor/github.com/alecthomas/chroma/lexers/p/plaintext.go @@ -11,6 +11,7 @@ var Plaintext = internal.Register(MustNewLexer( Aliases: []string{"text", "plain", "no-highlight"}, Filenames: []string{"*.txt"}, MimeTypes: []string{"text/plain"}, + Priority: 0.1, }, internal.PlaintextRules, )) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/reasonml.go b/vendor/github.com/alecthomas/chroma/lexers/r/reasonml.go new file mode 100644 index 0000000..0bceb18 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/lexers/r/reasonml.go @@ -0,0 +1,67 @@ +package r + +import ( + . "github.com/alecthomas/chroma" // nolint + "github.com/alecthomas/chroma/lexers/internal" +) + +// Reasonml lexer. +var Reasonml = internal.Register(MustNewLexer( + &Config{ + Name: "ReasonML", + Aliases: []string{"reason", "reasonml"}, + Filenames: []string{"*.re", "*.rei"}, + MimeTypes: []string{"text/x-reasonml"}, + }, + Rules{ + "escape-sequence": { + {`\\[\\"\'ntbr]`, LiteralStringEscape, nil}, + {`\\[0-9]{3}`, LiteralStringEscape, nil}, + {`\\x[0-9a-fA-F]{2}`, LiteralStringEscape, nil}, + }, + "root": { + {`\s+`, Text, nil}, + {`false|true|\(\)|\[\]`, NameBuiltinPseudo, nil}, + {`\b([A-Z][\w\']*)(?=\s*\.)`, NameNamespace, Push("dotted")}, + {`\b([A-Z][\w\']*)`, NameClass, nil}, + {`//.*?\n`, CommentSingle, nil}, + {`\/\*(?![\/])`, CommentMultiline, Push("comment")}, + {`\b(as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|false|for|fun|esfun|function|functor|if|in|include|inherit|initializer|lazy|let|switch|module|pub|mutable|new|nonrec|object|of|open|pri|rec|sig|struct|then|to|true|try|type|val|virtual|when|while|with)\b`, Keyword, nil}, + {"(~|\\}|\\|]|\\||\\|\\||\\{<|\\{|`|_|]|\\[\\||\\[>|\\[<|\\[|\\?\\?|\\?|>\\}|>]|>|=|<-|<|;;|;|:>|:=|::|:|\\.\\.\\.|\\.\\.|\\.|=>|-\\.|-|,|\\+|\\*|\\)|\\(|&&|&|#|!=)", OperatorWord, nil}, + {`([=<>@^|&+\*/$%-]|[!?~])?[!$%&*+\./:<=>?@^|~-]`, Operator, nil}, + {`\b(and|asr|land|lor|lsl|lsr|lxor|mod|or)\b`, OperatorWord, nil}, + {`\b(unit|int|float|bool|string|char|list|array)\b`, KeywordType, nil}, + {`[^\W\d][\w']*`, Name, nil}, + {`-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)`, LiteralNumberFloat, nil}, + {`0[xX][\da-fA-F][\da-fA-F_]*`, LiteralNumberHex, nil}, + {`0[oO][0-7][0-7_]*`, LiteralNumberOct, nil}, + {`0[bB][01][01_]*`, LiteralNumberBin, nil}, + {`\d[\d_]*`, LiteralNumberInteger, nil}, + {`'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'`, LiteralStringChar, nil}, + {`'.'`, LiteralStringChar, nil}, + {`'`, Keyword, nil}, + {`"`, LiteralStringDouble, Push("string")}, + {`[~?][a-z][\w\']*:`, NameVariable, nil}, + }, + "comment": { + {`[^\/*]+`, CommentMultiline, nil}, + {`\/\*`, CommentMultiline, Push()}, + {`\*\/`, CommentMultiline, Pop(1)}, + {`[\*]`, CommentMultiline, nil}, + }, + "string": { + {`[^\\"]+`, LiteralStringDouble, nil}, + Include("escape-sequence"), + {`\\\n`, LiteralStringDouble, nil}, + {`"`, LiteralStringDouble, Pop(1)}, + }, + "dotted": { + {`\s+`, Text, nil}, + {`\.`, Punctuation, nil}, + {`[A-Z][\w\']*(?=\s*\.)`, NameNamespace, nil}, + {`[A-Z][\w\']*`, NameClass, Pop(1)}, + {`[a-z_][\w\']*`, Name, Pop(1)}, + Default(Pop(1)), + }, + }, +)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/r/rust.go b/vendor/github.com/alecthomas/chroma/lexers/r/rust.go index 5e18b8f..191d1be 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/r/rust.go +++ b/vendor/github.com/alecthomas/chroma/lexers/r/rust.go @@ -58,7 +58,7 @@ var Rust = internal.Register(MustNewLexer( {`'[a-zA-Z_]\w*`, NameAttribute, nil}, {`[{}()\[\],.;]`, Punctuation, nil}, {`[+\-*/%&|<>^!~@=:?]`, Operator, nil}, - {`[a-zA-Z_]\w*`, Name, nil}, + {`(r#)?[a-zA-Z_]\w*`, Name, nil}, {`#!?\[`, CommentPreproc, Push("attribute[")}, {`([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\s*)(\{)`, ByGroups(CommentPreproc, Punctuation, TextWhitespace, Name, TextWhitespace, Punctuation), Push("macro{")}, {`([A-Za-z_]\w*)(!)(\s*)([A-Za-z_]\w*)?(\()`, ByGroups(CommentPreproc, Punctuation, TextWhitespace, Name, Punctuation), Push("macro(")}, diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/sas.go b/vendor/github.com/alecthomas/chroma/lexers/s/sas.go new file mode 100644 index 0000000..47a67ed --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/lexers/s/sas.go @@ -0,0 +1,94 @@ +package s + +import ( + . "github.com/alecthomas/chroma" // nolint + "github.com/alecthomas/chroma/lexers/internal" +) + +// Sas lexer. +var Sas = internal.Register(MustNewLexer( + &Config{ + Name: "SAS", + Aliases: []string{"sas"}, + Filenames: []string{"*.SAS", "*.sas"}, + MimeTypes: []string{"text/x-sas", "text/sas", "application/x-sas"}, + CaseInsensitive: true, + }, + Rules{ + "root": { + Include("comments"), + Include("proc-data"), + Include("cards-datalines"), + Include("logs"), + Include("general"), + {`.`, Text, nil}, + {`\\\n`, Text, nil}, + {`\n`, Text, nil}, + }, + "comments": { + {`^\s*\*.*?;`, Comment, nil}, + {`/\*.*?\*/`, Comment, nil}, + {`^\s*\*(.|\n)*?;`, CommentMultiline, nil}, + {`/[*](.|\n)*?[*]/`, CommentMultiline, nil}, + }, + "proc-data": { + {`(^|;)\s*(proc \w+|data|run|quit)[\s;]`, KeywordReserved, nil}, + }, + "cards-datalines": { + {`^\s*(datalines|cards)\s*;\s*$`, Keyword, Push("data")}, + }, + "data": { + {`(.|\n)*^\s*;\s*$`, Other, Pop(1)}, + }, + "logs": { + {`\n?^\s*%?put `, Keyword, Push("log-messages")}, + }, + "log-messages": { + {`NOTE(:|-).*`, Generic, Pop(1)}, + {`WARNING(:|-).*`, GenericEmph, Pop(1)}, + {`ERROR(:|-).*`, GenericError, Pop(1)}, + Include("general"), + }, + "general": { + Include("keywords"), + Include("vars-strings"), + Include("special"), + Include("numbers"), + }, + "keywords": { + {Words(`\b`, `\b`, `abort`, `array`, `attrib`, `by`, `call`, `cards`, `cards4`, `catname`, `continue`, `datalines`, `datalines4`, `delete`, `delim`, `delimiter`, `display`, `dm`, `drop`, `endsas`, `error`, `file`, `filename`, `footnote`, `format`, `goto`, `in`, `infile`, `informat`, `input`, `keep`, `label`, `leave`, `length`, `libname`, `link`, `list`, `lostcard`, `merge`, `missing`, `modify`, `options`, `output`, `out`, `page`, `put`, `redirect`, `remove`, `rename`, `replace`, `retain`, `return`, `select`, `set`, `skip`, `startsas`, `stop`, `title`, `update`, `waitsas`, `where`, `window`, `x`, `systask`), Keyword, nil}, + {Words(`\b`, `\b`, `add`, `and`, `alter`, `as`, `cascade`, `check`, `create`, `delete`, `describe`, `distinct`, `drop`, `foreign`, `from`, `group`, `having`, `index`, `insert`, `into`, `in`, `key`, `like`, `message`, `modify`, `msgtype`, `not`, `null`, `on`, `or`, `order`, `primary`, `references`, `reset`, `restrict`, `select`, `set`, `table`, `unique`, `update`, `validate`, `view`, `where`), Keyword, nil}, + {Words(`\b`, `\b`, `do`, `if`, `then`, `else`, `end`, `until`, `while`), Keyword, nil}, + {Words(`%`, `\b`, `bquote`, `nrbquote`, `cmpres`, `qcmpres`, `compstor`, `datatyp`, `display`, `do`, `else`, `end`, `eval`, `global`, `goto`, `if`, `index`, `input`, `keydef`, `label`, `left`, `length`, `let`, `local`, `lowcase`, `macro`, `mend`, `nrquote`, `nrstr`, `put`, `qleft`, `qlowcase`, `qscan`, `qsubstr`, `qsysfunc`, `qtrim`, `quote`, `qupcase`, `scan`, `str`, `substr`, `superq`, `syscall`, `sysevalf`, `sysexec`, `sysfunc`, `sysget`, `syslput`, `sysprod`, `sysrc`, `sysrput`, `then`, `to`, `trim`, `unquote`, `until`, `upcase`, `verify`, `while`, `window`), NameBuiltin, nil}, + {Words(`\b`, `\(`, `abs`, `addr`, `airy`, `arcos`, `arsin`, `atan`, `attrc`, `attrn`, `band`, `betainv`, `blshift`, `bnot`, `bor`, `brshift`, `bxor`, `byte`, `cdf`, `ceil`, `cexist`, `cinv`, `close`, `cnonct`, `collate`, `compbl`, `compound`, `compress`, `cos`, `cosh`, `css`, `curobs`, `cv`, `daccdb`, `daccdbsl`, `daccsl`, `daccsyd`, `dacctab`, `dairy`, `date`, `datejul`, `datepart`, `datetime`, `day`, `dclose`, `depdb`, `depdbsl`, `depsl`, `depsyd`, `deptab`, `dequote`, `dhms`, `dif`, `digamma`, `dim`, `dinfo`, `dnum`, `dopen`, `doptname`, `doptnum`, `dread`, `dropnote`, `dsname`, `erf`, `erfc`, `exist`, `exp`, `fappend`, `fclose`, `fcol`, `fdelete`, `fetch`, `fetchobs`, `fexist`, `fget`, `fileexist`, `filename`, `fileref`, `finfo`, `finv`, `fipname`, `fipnamel`, `fipstate`, `floor`, `fnonct`, `fnote`, `fopen`, `foptname`, `foptnum`, `fpoint`, `fpos`, `fput`, `fread`, `frewind`, `frlen`, `fsep`, `fuzz`, `fwrite`, `gaminv`, `gamma`, `getoption`, `getvarc`, `getvarn`, `hbound`, `hms`, `hosthelp`, `hour`, `ibessel`, `index`, `indexc`, `indexw`, `input`, `inputc`, `inputn`, `int`, `intck`, `intnx`, `intrr`, `irr`, `jbessel`, `juldate`, `kurtosis`, `lag`, `lbound`, `left`, `length`, `lgamma`, `libname`, `libref`, `log`, `log10`, `log2`, `logpdf`, `logpmf`, `logsdf`, `lowcase`, `max`, `mdy`, `mean`, `min`, `minute`, `mod`, `month`, `mopen`, `mort`, `n`, `netpv`, `nmiss`, `normal`, `note`, `npv`, `open`, `ordinal`, `pathname`, `pdf`, `peek`, `peekc`, `pmf`, `point`, `poisson`, `poke`, `probbeta`, `probbnml`, `probchi`, `probf`, `probgam`, `probhypr`, `probit`, `probnegb`, `probnorm`, `probt`, `put`, `putc`, `putn`, `qtr`, `quote`, `ranbin`, `rancau`, `ranexp`, `rangam`, `range`, `rank`, `rannor`, `ranpoi`, `rantbl`, `rantri`, `ranuni`, `repeat`, `resolve`, `reverse`, `rewind`, `right`, `round`, `saving`, `scan`, `sdf`, `second`, `sign`, `sin`, `sinh`, `skewness`, `soundex`, `spedis`, `sqrt`, `std`, `stderr`, `stfips`, `stname`, `stnamel`, `substr`, `sum`, `symget`, `sysget`, `sysmsg`, `sysprod`, `sysrc`, `system`, `tan`, `tanh`, `time`, `timepart`, `tinv`, `tnonct`, `today`, `translate`, `tranwrd`, `trigamma`, `trim`, `trimn`, `trunc`, `uniform`, `upcase`, `uss`, `var`, `varfmt`, `varinfmt`, `varlabel`, `varlen`, `varname`, `varnum`, `varray`, `varrayx`, `vartype`, `verify`, `vformat`, `vformatd`, `vformatdx`, `vformatn`, `vformatnx`, `vformatw`, `vformatwx`, `vformatx`, `vinarray`, `vinarrayx`, `vinformat`, `vinformatd`, `vinformatdx`, `vinformatn`, `vinformatnx`, `vinformatw`, `vinformatwx`, `vinformatx`, `vlabel`, `vlabelx`, `vlength`, `vlengthx`, `vname`, `vnamex`, `vtype`, `vtypex`, `weekday`, `year`, `yyq`, `zipfips`, `zipname`, `zipnamel`, `zipstate`), NameBuiltin, nil}, + }, + "vars-strings": { + {`&[a-z_]\w{0,31}\.?`, NameVariable, nil}, + {`%[a-z_]\w{0,31}`, NameFunction, nil}, + {`\'`, LiteralString, Push("string_squote")}, + {`"`, LiteralString, Push("string_dquote")}, + }, + "string_squote": { + {`'`, LiteralString, Pop(1)}, + {`\\\\|\\"|\\\n`, LiteralStringEscape, nil}, + {`[^$\'\\]+`, LiteralString, nil}, + {`[$\'\\]`, LiteralString, nil}, + }, + "string_dquote": { + {`"`, LiteralString, Pop(1)}, + {`\\\\|\\"|\\\n`, LiteralStringEscape, nil}, + {`&`, NameVariable, Push("validvar")}, + {`[^$&"\\]+`, LiteralString, nil}, + {`[$"\\]`, LiteralString, nil}, + }, + "validvar": { + {`[a-z_]\w{0,31}\.?`, NameVariable, Pop(1)}, + }, + "numbers": { + {`\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)(E[+-]?[0-9]+)?i?\b`, LiteralNumber, nil}, + }, + "special": { + {`(null|missing|_all_|_automatic_|_character_|_n_|_infile_|_name_|_null_|_numeric_|_user_|_webout_)`, KeywordConstant, nil}, + }, + }, +)) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go b/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go index 05125f7..093ee30 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go +++ b/vendor/github.com/alecthomas/chroma/lexers/t/terraform.go @@ -15,55 +15,46 @@ var Terraform = internal.Register(MustNewLexer( }, Rules{ "root": { - Include("string"), - Include("punctuation"), - Include("curly"), - Include("basic"), - Include("whitespace"), - {`[0-9]+`, LiteralNumber, nil}, + {`[\[\](),.{}]`, Punctuation, nil}, + {`-?[0-9]+`, LiteralNumber, nil}, + {`=>`, Punctuation, nil}, + {Words(``, `\b`, `true`, `false`), KeywordConstant, nil}, + {`/(?s)\*(((?!\*/).)*)\*/`, CommentMultiline, nil}, + {`\s*(#|//).*\n`, CommentSingle, nil}, + {`([a-zA-Z]\w*)(\s*)(=(?!>))`, ByGroups(NameAttribute, Text, Text), nil}, + {Words(`^\s*`, `\b`, `variable`, `data`, `resource`, `provider`, `provisioner`, `module`, `output`), KeywordReserved, nil}, + {Words(``, `\b`, `for`, `in`), Keyword, nil}, + {Words(``, ``, `count`, `data`, `var`, `module`, `each`), NameBuiltin, nil}, + {Words(``, `\b`, `abs`, `ceil`, `floor`, `log`, `max`, `min`, `parseint`, `pow`, `signum`), NameBuiltin, nil}, + {Words(``, `\b`, `chomp`, `format`, `formatlist`, `indent`, `join`, `lower`, `regex`, `regexall`, `replace`, `split`, `strrev`, `substr`, `title`, `trim`, `trimprefix`, `trimsuffix`, `trimspace`, `upper`), NameBuiltin, nil}, + {Words(`[^.]`, `\b`, `chunklist`, `coalesce`, `coalescelist`, `compact`, `concat`, `contains`, `distinct`, `element`, `flatten`, `index`, `keys`, `length`, `list`, `lookup`, `map`, `matchkeys`, `merge`, `range`, `reverse`, `setintersection`, `setproduct`, `setsubtract`, `setunion`, `slice`, `sort`, `transpose`, `values`, `zipmap`), NameBuiltin, nil}, + {Words(`[^.]`, `\b`, `base64decode`, `base64encode`, `base64gzip`, `csvdecode`, `jsondecode`, `jsonencode`, `urlencode`, `yamldecode`, `yamlencode`), NameBuiltin, nil}, + {Words(``, `\b`, `abspath`, `dirname`, `pathexpand`, `basename`, `file`, `fileexists`, `fileset`, `filebase64`, `templatefile`), NameBuiltin, nil}, + {Words(``, `\b`, `formatdate`, `timeadd`, `timestamp`), NameBuiltin, nil}, + {Words(``, `\b`, `base64sha256`, `base64sha512`, `bcrypt`, `filebase64sha256`, `filebase64sha512`, `filemd5`, `filesha1`, `filesha256`, `filesha512`, `md5`, `rsadecrypt`, `sha1`, `sha256`, `sha512`, `uuid`, `uuidv5`), NameBuiltin, nil}, + {Words(``, `\b`, `cidrhost`, `cidrnetmask`, `cidrsubnet`), NameBuiltin, nil}, + {Words(``, `\b`, `can`, `tobool`, `tolist`, `tomap`, `tonumber`, `toset`, `tostring`, `try`), NameBuiltin, nil}, + {`=(?!>)|\+|-|\*|\/|:|!|%|>|<(?!<)|>=|<=|==|!=|&&|\||\?`, Operator, nil}, + {`\n|\s+|\\\n`, Text, nil}, + {`[a-zA-Z]\w*`, NameOther, nil}, + {`"`, LiteralStringDouble, Push("string")}, + {`(?s)(<<-?)(\w+)(\n\s*(?:(?!\2).)*\s*\n\s*)(\2)`, ByGroups(Operator, Operator, String, Operator), nil}, }, - "basic": { - {Words(`\b`, `\b`, `true`, `false`), KeywordType, nil}, - {`\s*/\*`, CommentMultiline, Push("comment")}, - {`\s*#.*\n`, CommentSingle, nil}, - {`(.*?)(\s*)(=)`, ByGroups(NameAttribute, Text, Operator), nil}, - {Words(`\b`, `\b`, `variable`, `resource`, `provider`, `provisioner`, `module`), KeywordReserved, Push("function")}, - {Words(`\b`, `\b`, `ingress`, `egress`, `listener`, `default`, `connection`, `alias`), KeywordDeclaration, nil}, - {`\$\{`, LiteralStringInterpol, Push("var_builtin")}, - }, - "function": { - {`(\s+)(".*")(\s+)`, ByGroups(Text, LiteralString, Text), nil}, - Include("punctuation"), - Include("curly"), - }, - "var_builtin": { - {`\$\{`, LiteralStringInterpol, Push()}, - {Words(`\b`, `\b`, `concat`, `file`, `join`, `lookup`, `element`), NameBuiltin, nil}, - Include("string"), - Include("punctuation"), - {`\s+`, Text, nil}, - {`\}`, LiteralStringInterpol, Pop(1)}, + "declaration": { + {`(\s*)("(?:\\\\|\\"|[^"])*")(\s*)`, ByGroups(Text, NameVariable, Text), nil}, + {`\{`, Punctuation, Pop(1)}, }, "string": { - {`(".*")`, ByGroups(LiteralStringDouble), nil}, + {`"`, LiteralStringDouble, Pop(1)}, + {`\\\\`, LiteralStringDouble, nil}, + {`\\\\"`, LiteralStringDouble, nil}, + {`\$\{`, LiteralStringInterpol, Push("interp-inside")}, + {`\$`, LiteralStringDouble, nil}, + {`[^"\\\\$]+`, LiteralStringDouble, nil}, }, - "punctuation": { - {`[\[\](),.]`, Punctuation, nil}, - }, - "curly": { - {`\{`, TextPunctuation, nil}, - {`\}`, TextPunctuation, nil}, - }, - "comment": { - {`[^*/]`, CommentMultiline, nil}, - {`/\*`, CommentMultiline, Push()}, - {`\*/`, CommentMultiline, Pop(1)}, - {`[*/]`, CommentMultiline, nil}, - }, - "whitespace": { - {`\n`, Text, nil}, - {`\s+`, Text, nil}, - {`\\\n`, Text, nil}, + "interp-inside": { + {`\}`, LiteralStringInterpol, Pop(1)}, + Include("root"), }, }, )) diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go b/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go index 57d08bf..3b425ed 100644 --- a/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go +++ b/vendor/github.com/alecthomas/chroma/lexers/t/typescript.go @@ -9,7 +9,7 @@ import ( var TypeScript = internal.Register(MustNewLexer( &Config{ Name: "TypeScript", - Aliases: []string{"ts", "typescript"}, + Aliases: []string{"ts", "tsx", "typescript"}, Filenames: []string{"*.ts", "*.tsx"}, MimeTypes: []string{"text/x-typescript"}, DotAll: true, @@ -32,6 +32,7 @@ var TypeScript = internal.Register(MustNewLexer( {`\n`, Text, Pop(1)}, }, "root": { + Include("jsx"), {`^(?=\s|/|