update go modules, update go-pkgz/auth to latest commit

This commit is contained in:
Dmitry Verkhoturov
2024-01-11 15:57:39 -06:00
committed by Umputun
parent 884b5685eb
commit cbd73865bd
209 changed files with 9973 additions and 3357 deletions
+5 -5
View File
@@ -16,14 +16,14 @@ require (
github.com/Depado/bfchroma/v2 v2.0.0 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/alecthomas/chroma/v2 v2.8.0 // indirect
github.com/alecthomas/chroma/v2 v2.12.0 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/didip/tollbooth/v7 v7.0.1 // indirect
github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/go-chi/chi/v5 v5.0.10 // indirect
github.com/go-chi/chi/v5 v5.0.11 // indirect
github.com/go-chi/render v1.0.3 // indirect
github.com/go-pkgz/expirable-cache v1.0.0 // indirect
github.com/go-pkgz/rest v1.18.2 // indirect
@@ -35,9 +35,9 @@ require (
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+10 -10
View File
@@ -6,8 +6,8 @@ github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264=
github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw=
github.com/alecthomas/chroma/v2 v2.12.0 h1:Wh8qLEgMMsN7mgyG8/qIpegky2Hvzr4By6gEF7cmWgw=
github.com/alecthomas/chroma/v2 v2.12.0/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
@@ -26,8 +26,8 @@ github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f/go.mod h1:q9C8
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns=
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
@@ -78,8 +78,8 @@ go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -89,8 +89,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -103,8 +103,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+4 -4
View File
@@ -150,10 +150,10 @@ BKT
assert.NoError(t, err)
assert.Equal(t,
`<h1>h1</h1>
<pre class="chroma"><code><span class="line"><span class="cl">func TestRest_Preview(t *testing.T) {
</span></span><span class="line"><span class="cl">srv, ts := prep(t)
</span></span><span class="line"><span class="cl"> require.NotNil(t, srv)
</span></span><span class="line"><span class="cl">}
<pre class="chroma"><code><span class="line"><span class="cl"><span class="k">func</span> <span class="n">TestRest_Preview</span><span class="p">(</span><span class="n">t</span> <span class="o">*</span><span class="n">testing</span><span class="o">.</span><span class="n">T</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"><span class="n">srv</span><span class="p">,</span> <span class="n">ts</span> <span class="p">:</span><span class="o">=</span> <span class="n">prep</span><span class="p">(</span><span class="n">t</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="n">require</span><span class="o">.</span><span class="n">NotNil</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">srv</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>`,
string(b))
assert.NoError(t, resp.Body.Close())
+17 -15
View File
@@ -1,17 +1,19 @@
module github.com/umputun/remark42/backend
go 1.20
go 1.21
toolchain go1.21.6
require (
github.com/Depado/bfchroma/v2 v2.0.0
github.com/PuerkitoBio/goquery v1.8.1
github.com/alecthomas/chroma/v2 v2.8.0
github.com/alecthomas/chroma/v2 v2.12.0
github.com/didip/tollbooth/v7 v7.0.1
github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/chi/v5 v5.0.11
github.com/go-chi/cors v1.2.1
github.com/go-chi/render v1.0.3
github.com/go-pkgz/auth v1.22.1-0.20231219172726-eb8671b06587
github.com/go-pkgz/auth v1.22.2-0.20240110230548-7a3db006ab6e
github.com/go-pkgz/jrpc v0.3.0
github.com/go-pkgz/lcw v1.0.2
github.com/go-pkgz/lgr v0.11.1
@@ -20,8 +22,8 @@ require (
github.com/go-pkgz/rest v1.18.2
github.com/go-pkgz/syncs v1.3.2
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.3.0
github.com/gorilla/feeds v1.1.1
github.com/google/uuid v1.5.0
github.com/gorilla/feeds v1.1.2
github.com/hashicorp/go-multierror v1.1.1
github.com/jessevdk/go-flags v1.5.0
github.com/kyokomi/emoji/v2 v2.2.12
@@ -31,10 +33,10 @@ require (
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.8
go.uber.org/goleak v1.2.1
golang.org/x/crypto v0.17.0
golang.org/x/image v0.14.0
golang.org/x/net v0.19.0
go.uber.org/goleak v1.3.0
golang.org/x/crypto v0.18.0
golang.org/x/image v0.15.0
golang.org/x/net v0.20.0
)
require (
@@ -57,7 +59,7 @@ require (
github.com/gorilla/css v1.0.1 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/nullrocks/identicon v0.0.0-20180626043057-7875f45b0022 // indirect
@@ -68,11 +70,11 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+38 -28
View File
@@ -10,9 +10,11 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264=
github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma/v2 v2.12.0 h1:Wh8qLEgMMsN7mgyG8/qIpegky2Hvzr4By6gEF7cmWgw=
github.com/alecthomas/chroma/v2 v2.12.0/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo=
@@ -53,8 +55,8 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns=
@@ -62,8 +64,8 @@ github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
github.com/go-oauth2/oauth2/v4 v4.5.2 h1:CuZhD3lhGuI6aNLyUbRHXsgG2RwGRBOuCBfd4WQKqBQ=
github.com/go-oauth2/oauth2/v4 v4.5.2/go.mod h1:wk/2uLImWIa9VVQDgxz99H2GDbhmfi/9/Xr+GvkSUSQ=
github.com/go-pkgz/auth v1.22.1-0.20231219172726-eb8671b06587 h1:1cihW3uZm41ff3s6jBULVkUo/Y6FgUzXeNx4mUNpMsw=
github.com/go-pkgz/auth v1.22.1-0.20231219172726-eb8671b06587/go.mod h1:Vb92mtxdQIreeitkn/A5CoGyrEIrAmEsxD6RqJ2luy4=
github.com/go-pkgz/auth v1.22.2-0.20240110230548-7a3db006ab6e h1:p265UhLsZhoyRT2bXbkJE1MSBHoxjTTvbtSY8ZGuWHY=
github.com/go-pkgz/auth v1.22.2-0.20240110230548-7a3db006ab6e/go.mod h1:IN1y3BqIHixxr8dm8QnMK3Z3oSzg80kE0XenjedsHGw=
github.com/go-pkgz/email v0.5.0 h1:fdtMDGJ8NwyBACLR0LYHaCIK/OeUwZHMhH7Q0+oty9U=
github.com/go-pkgz/email v0.5.0/go.mod h1:BdxglsQnymzhfdbnncEE72a6DrucZHy6I+42LK2jLEc=
github.com/go-pkgz/expirable-cache v0.1.0/go.mod h1:GTrEl0X+q0mPNqN6dtcQXksACnzCBQ5k/k1SwXJsZKs=
@@ -115,17 +117,19 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY=
github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA=
github.com/gorilla/feeds v1.1.2 h1:pxzZ5PD3RJdhFH2FsJJ4x6PqMqbgFk1+Vez4XWBW8Iw=
github.com/gorilla/feeds v1.1.2/go.mod h1:WMib8uJP3BbY+X8Szd1rA5Pzhdfh+HCCAYT2z7Fza6Y=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
@@ -134,9 +138,11 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
@@ -149,11 +155,13 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
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/kyokomi/emoji/v2 v2.2.12 h1:sSVA5nH9ebR3Zji1o31wu3yOwD1zKXQA2z0zUyeit60=
github.com/kyokomi/emoji/v2 v2.2.12/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
@@ -185,6 +193,8 @@ github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5h
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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
@@ -264,8 +274,8 @@ go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk=
go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -273,10 +283,10 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
@@ -298,19 +308,19 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ=
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -335,8 +345,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -373,8 +383,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
@@ -1,4 +1,8 @@
# Binaries for programs and plugins
.git
.idea
.vscode
.hermit
*.exe
*.dll
*.so
@@ -18,3 +22,4 @@ _models/
_examples/
*.min.*
build/
+24
View File
@@ -0,0 +1,24 @@
VERSION = %(git describe --tags --dirty --always)%
export CGOENABLED = 0
tokentype_enumer.go: types.go
build: go generate
# Regenerate the list of lexers in the README
README.md: lexers/*.go lexers/*/*.xml table.py
build: ./table.py
-clean
implicit %{1}%{2}.min.%{3}: **/*.{css,js}
build: esbuild --bundle %{IN} --minify --outfile=%{OUT}
implicit build/%{1}: cmd/*
cd cmd/%{1}
inputs: cmd/%{1}/**/* **/*.go
build: go build -ldflags="-X 'main.version=%{VERSION}'" -o ../../build/%{1} .
#upload: chromad
# build:
# scp chromad root@swapoff.org:
# ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'
# touch upload
+4 -4
View File
@@ -13,11 +13,11 @@ tokentype_string.go: types.go
go generate
chromad:
rm -f chromad
rm -rf build
esbuild --bundle cmd/chromad/static/index.js --minify --outfile=cmd/chromad/static/index.min.js
esbuild --bundle cmd/chromad/static/index.css --minify --outfile=cmd/chromad/static/index.min.css
(export CGOENABLED=0 ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../chromad .)
(export CGOENABLED=0 ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../build/chromad .)
upload: chromad
scp chromad root@swapoff.org: && \
upload: build/chromad
scp build/chromad root@swapoff.org: && \
ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'
+69 -52
View File
@@ -1,7 +1,6 @@
# 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) [![CI](https://github.com/alecthomas/chroma/actions/workflows/ci.yml/badge.svg)](https://github.com/alecthomas/chroma/actions/workflows/ci.yml) [![Slack chat](https://img.shields.io/static/v1?logo=slack&style=flat&label=slack&color=green&message=gophers)](https://invite.slack.golangbridge.org/)
> **NOTE:** As Chroma has just been released, its API is still in flux. That said, the high-level interface should not change significantly.
[![Golang Documentation](https://godoc.org/github.com/alecthomas/chroma?status.svg)](https://godoc.org/github.com/alecthomas/chroma) [![CI](https://github.com/alecthomas/chroma/actions/workflows/ci.yml/badge.svg)](https://github.com/alecthomas/chroma/actions/workflows/ci.yml) [![Slack chat](https://img.shields.io/static/v1?logo=slack&style=flat&label=slack&color=green&message=gophers)](https://invite.slack.golangbridge.org/)
Chroma takes source code and other structured text and converts it into syntax
highlighted HTML, ANSI-coloured text, etc.
@@ -10,6 +9,7 @@ Chroma is based heavily on [Pygments](http://pygments.org/), and includes
translators for Pygments lexers and styles.
<a id="markdown-table-of-contents" name="table-of-contents"></a>
## Table of Contents
<!-- TOC -->
@@ -18,14 +18,14 @@ translators for Pygments lexers and styles.
2. [Supported languages](#supported-languages)
3. [Try it](#try-it)
4. [Using the library](#using-the-library)
1. [Quick start](#quick-start)
2. [Identifying the language](#identifying-the-language)
3. [Formatting the output](#formatting-the-output)
4. [The HTML formatter](#the-html-formatter)
1. [Quick start](#quick-start)
2. [Identifying the language](#identifying-the-language)
3. [Formatting the output](#formatting-the-output)
4. [The HTML formatter](#the-html-formatter)
5. [More detail](#more-detail)
1. [Lexers](#lexers)
2. [Formatters](#formatters)
3. [Styles](#styles)
1. [Lexers](#lexers)
2. [Formatters](#formatters)
3. [Styles](#styles)
6. [Command-line interface](#command-line-interface)
7. [Testing lexers](#testing-lexers)
8. [What's missing compared to Pygments?](#whats-missing-compared-to-pygments)
@@ -33,46 +33,48 @@ translators for Pygments lexers and styles.
<!-- /TOC -->
<a id="markdown-supported-languages" name="supported-languages"></a>
## Supported languages
Prefix | Language
:----: | --------
A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, Awk
B | Ballerina, Bash, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, Brainfuck, BQN
C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython
D | D, Dart, Diff, Django/Jinja, Docker, DTD, Dylan
E | EBNF, Elixir, Elm, EmacsLisp, Erlang
F | Factor, Fish, Forth, Fortran, FSharp
G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groff, Groovy
H | Handlebars, Haskell, Haxe, HCL, Hexdump, HLB, HLSL, HTML, HTTP, Hy
I | Idris, Igor, INI, Io
J | J, Java, JavaScript, JSON, Julia, Jungle
K | Kotlin
L | Lighttpd configuration file, LLVM, Lua
M | Makefile, 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, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode
P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, PromQL, Properties, Protocol Buffer, PSL, Puppet, Python 2, Python
Q | QBasic
R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust
S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Smali, Smalltalk, Smarty, Snobol, Solidity, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, 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, VHS, VimL, vue
W | WDTE
X | XML, Xorg
Y | YAML, YANG
Z | Zig
| Prefix | Language |
| :----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Agda, AL, Alloy, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, AutoHotkey, AutoIt, Awk |
| B | Ballerina, Bash, Bash Session, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, BQN, Brainfuck |
| C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython |
| D | D, Dart, Dax, Diff, Django/Jinja, dns, Docker, DTD, Dylan |
| E | EBNF, Elixir, Elm, EmacsLisp, Erlang |
| F | Factor, Fennel, Fish, Forth, Fortran, FortranFixed, FSharp |
| G | GAS, GDScript, Genshi, Genshi HTML, Genshi Text, Gherkin, GLSL, Gnuplot, Go, Go HTML Template, Go Text Template, GraphQL, Groff, Groovy |
| H | Handlebars, Hare, Haskell, Haxe, HCL, Hexdump, HLB, HLSL, HolyC, HTML, HTTP, Hy |
| I | Idris, Igor, INI, Io, ISCdhcpd |
| J | J, Java, JavaScript, JSON, Julia, Jungle |
| K | Kotlin |
| L | Lighttpd configuration file, LLVM, Lua |
| M | Makefile, Mako, markdown, Mason, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL |
| N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
| O | Objective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode |
| P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, properties, Protocol Buffer, PRQL, PSL, Puppet, Python, Python 2 |
| Q | QBasic, QML |
| R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust |
| S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog |
| T | TableGen, Tal, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData |
| V | V, V shell, Vala, VB.net, verilog, VHDL, VHS, VimL, vue |
| W | WDTE, WebGPU Shading Language, Whiley |
| X | XML, Xorg |
| Y | YAML, YANG |
| Z | Z80 Assembly, Zed, Zig |
_I will attempt to keep this section up to date, but an authoritative list can be
displayed with `chroma --list`._
<a id="markdown-try-it" name="try-it"></a>
## Try it
Try out various languages and styles on the [Chroma Playground](https://swapoff.org/chroma/playground/).
<a id="markdown-using-the-library" name="using-the-library"></a>
## Using the library
Chroma, like Pygments, has the concepts of
@@ -94,6 +96,7 @@ be returned. In this situation you may want to default to the `Fallback`
value in each respective package, which provides sane defaults.
<a id="markdown-quick-start" name="quick-start"></a>
### Quick start
A convenience function exists that can be used to simply format some source
@@ -104,6 +107,7 @@ err := quick.Highlight(os.Stdout, someSourceCode, "go", "html", "monokai")
```
<a id="markdown-identifying-the-language" name="identifying-the-language"></a>
### Identifying the language
To highlight code, you'll first have to identify what language the code is
@@ -111,21 +115,21 @@ written in. There are three primary ways to do that:
1. Detect the language from its filename.
```go
lexer := lexers.Match("foo.go")
```
```go
lexer := lexers.Match("foo.go")
```
3. Explicitly specify the language by its Chroma syntax ID (a full list is available from `lexers.Names()`).
2. Explicitly specify the language by its Chroma syntax ID (a full list is available from `lexers.Names()`).
```go
lexer := lexers.Get("go")
```
```go
lexer := lexers.Get("go")
```
3. Detect the language from its content.
```go
lexer := lexers.Analyse("package main\n\nfunc main()\n{\n}\n")
```
```go
lexer := lexers.Analyse("package main\n\nfunc main()\n{\n}\n")
```
In all cases, `nil` will be returned if the language can not be identified.
@@ -144,6 +148,7 @@ lexer = chroma.Coalesce(lexer)
```
<a id="markdown-formatting-the-output" name="formatting-the-output"></a>
### Formatting the output
Once a language is identified you will need to pick a formatter and a style (theme).
@@ -173,6 +178,7 @@ err := formatter.Format(w, style, iterator)
```
<a id="markdown-the-html-formatter" name="the-html-formatter"></a>
### The HTML formatter
By default the `html` registered formatter generates standalone HTML with
@@ -198,9 +204,11 @@ err := formatter.WriteCSS(w, style)
```
<a id="markdown-more-detail" name="more-detail"></a>
## More detail
<a id="markdown-lexers" name="lexers"></a>
### Lexers
See the [Pygments documentation](http://pygments.org/docs/lexerdevelopment/)
@@ -221,6 +229,7 @@ See notes in [pygments-lexers.txt](https://github.com/alecthomas/chroma/blob/mas
for a list of lexers, and notes on some of the issues importing them.
<a id="markdown-formatters" name="formatters"></a>
### Formatters
Chroma supports HTML output, as well as terminal output in 8 colour, 256 colour, and true-colour.
@@ -229,6 +238,7 @@ A `noop` formatter is included that outputs the token text only, and a `tokens`
formatter outputs raw tokens. The latter is useful for debugging lexers.
<a id="markdown-styles" name="styles"></a>
### Styles
Chroma styles are defined in XML. The style entries use the
@@ -237,7 +247,7 @@ Chroma styles are defined in XML. The style entries use the
All Pygments styles have been converted to Chroma using the `_tools/style.py`
script.
When you work with one of [Chroma's styles](https://github.com/alecthomas/chroma/tree/master/styles),
When you work with one of [Chroma's styles](https://github.com/alecthomas/chroma/tree/master/styles),
know that the `Background` token type provides the default style for tokens. It does so
by defining a foreground color and background color.
@@ -253,6 +263,7 @@ Also, token types in a style file are hierarchical. For instance, when `CommentS
For a quick overview of the available styles and how they look, check out the [Chroma Style Gallery](https://xyproto.github.io/splash/docs/).
<a id="markdown-command-line-interface" name="command-line-interface"></a>
## Command-line interface
A command-line interface to Chroma is included.
@@ -280,26 +291,32 @@ for that setup the `chroma` executable can be just symlinked to `~/.lessfilter`.
<a id="markdown-whats-missing-compared-to-pygments" name="whats-missing-compared-to-pygments"></a>
<a id="markdown-testing-lexers" name="testing-lexers"></a>
## Testing lexers
If you edit some lexers and want to try it, open a shell in `cmd/chromad` and run:
```shell
go run .
```
A Link will be printed. Open it in your Browser. Now you can test on the Playground with your local changes.
If you want to run the tests and the lexers, open a shell in the root directory and run:
```shell
go test ./lexers
```
When updating or adding a lexer, please add tests. See [lexers/README.md](lexers/README.md) for more.
## What's missing compared to Pygments?
- Quite a few lexers, for various reasons (pull-requests welcome):
- Pygments lexers for complex languages often include custom code to
handle certain aspects, such as Raku's ability to nest code inside
regular expressions. These require time and effort to convert.
- I mostly only converted languages I had heard of, to reduce the porting cost.
- Pygments lexers for complex languages often include custom code to
handle certain aspects, such as Raku's ability to nest code inside
regular expressions. These require time and effort to convert.
- I mostly only converted languages I had heard of, to reduce the porting cost.
- Some more esoteric features of Pygments are omitted for simplicity.
- Though the Chroma API supports content detection, very few languages support them.
I have plans to implement a statistical analyser at some point, but not enough time.
+20
View File
@@ -57,6 +57,26 @@ type Config struct {
//
// If this is 0 it will be treated as a default of 1.
Priority float32 `xml:"priority,omitempty"`
// Analyse is a list of regexes to match against the input.
//
// If a match is found, the score is returned if single attribute is set to true,
// otherwise the sum of all the score of matching patterns will be
// used as the final score.
Analyse *AnalyseConfig `xml:"analyse,omitempty"`
}
// AnalyseConfig defines the list of regexes analysers.
type AnalyseConfig struct {
Regexes []RegexConfig `xml:"regex,omitempty"`
// If true, the first matching score is returned.
First bool `xml:"first,attr"`
}
// RegexConfig defines a single regex pattern and its score in case of match.
type RegexConfig struct {
Pattern string `xml:"pattern,attr"`
Score float32 `xml:"score,attr"`
}
// Token output to formatter.
-17
View File
@@ -1,17 +0,0 @@
package lexers
import (
"regexp"
)
// TODO(moorereason): can this be factored away?
var bashAnalyserRe = regexp.MustCompile(`(?m)^#!.*/bin/(?:env |)(?:bash|zsh|sh|ksh)`)
func init() { // nolint: gochecknoinits
Get("bash").SetAnalyser(func(text string) float32 {
if bashAnalyserRe.FindString(text) != "" {
return 1.0
}
return 0.0
})
}
-62
View File
@@ -1,62 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Chapel lexer.
var Chapel = Register(MustNewLexer(
&Config{
Name: "Chapel",
Aliases: []string{"chapel", "chpl"},
Filenames: []string{"*.chpl"},
MimeTypes: []string{},
},
func() Rules {
return Rules{
"root": {
{`\n`, TextWhitespace, nil},
{`\s+`, TextWhitespace, nil},
{`\\\n`, Text, nil},
{`//(.*?)\n`, CommentSingle, nil},
{`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil},
{Words(``, `\b`, `config`, `const`, `in`, `inout`, `out`, `param`, `ref`, `type`, `var`), KeywordDeclaration, nil},
{Words(``, `\b`, `false`, `nil`, `none`, `true`), KeywordConstant, nil},
{Words(``, `\b`, `bool`, `bytes`, `complex`, `imag`, `int`, `locale`, `nothing`, `opaque`, `range`, `real`, `string`, `uint`, `void`), KeywordType, nil},
{Words(``, `\b`, `atomic`, `single`, `sync`, `borrowed`, `owned`, `shared`, `unmanaged`, `align`, `as`, `begin`, `break`, `by`, `catch`, `cobegin`, `coforall`, `continue`, `defer`, `delete`, `dmapped`, `do`, `domain`, `else`, `enum`, `except`, `export`, `extern`, `for`, `forall`, `foreach`, `forwarding`, `if`, `implements`, `import`, `index`, `init`, `inline`, `label`, `lambda`, `let`, `lifetime`, `local`, `new`, `noinit`, `on`, `only`, `otherwise`, `override`, `pragma`, `primitive`, `private`, `prototype`, `public`, `reduce`, `require`, `return`, `scan`, `select`, `serial`, `sparse`, `subdomain`, `then`, `this`, `throw`, `throws`, `try`, `use`, `when`, `where`, `while`, `with`, `yield`, `zip`), Keyword, nil},
{`(iter)(\s+)`, ByGroups(Keyword, TextWhitespace), Push("procname")},
{`(proc)(\s+)`, ByGroups(Keyword, TextWhitespace), Push("procname")},
{`(operator)(\s+)`, ByGroups(Keyword, TextWhitespace), Push("procname")},
{`(class|interface|module|record|union)(\s+)`, ByGroups(Keyword, TextWhitespace), Push("classname")},
{`\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][+-]?[0-9]+)?i?`, LiteralNumberFloat, nil},
{`\d+[eE][+-]?[0-9]+i?`, LiteralNumberFloat, nil},
{`0[bB][01]+`, LiteralNumberBin, nil},
{`0[xX][0-9a-fA-F]+`, LiteralNumberHex, nil},
{`0[oO][0-7]+`, LiteralNumberOct, nil},
{`[0-9]+`, LiteralNumberInteger, nil},
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
{`'(\\\\|\\'|[^'])*'`, LiteralString, nil},
{`(=|\+=|-=|\*=|/=|\*\*=|%=|&=|\|=|\^=|&&=|\|\|=|<<=|>>=|<=>|<~>|\.\.|by|#|\.\.\.|&&|\|\||!|&|\||\^|~|<<|>>|==|!=|<=|>=|<|>|[+\-*/%]|\*\*)`, Operator, nil},
{`[:;,.?()\[\]{}]`, Punctuation, nil},
{`[a-zA-Z_][\w$]*`, NameOther, nil},
},
"classname": {
{`[a-zA-Z_][\w$]*`, NameClass, Pop(1)},
},
"procname": {
{`([a-zA-Z_][.\w$]*|\~[a-zA-Z_][.\w$]*|[+*/!~%<>=&^|\-:]{1,2})`, NameFunction, Pop(1)},
{`\(`, Punctuation, Push("receivertype")},
{`\)+\.`, Punctuation, nil},
},
"receivertype": {
{Words(``, `\b`, `atomic`, `single`, `sync`, `borrowed`, `owned`, `shared`, `unmanaged`), Keyword, nil},
{Words(``, `\b`, `bool`, `bytes`, `complex`, `imag`, `int`, `locale`, `nothing`, `opaque`, `range`, `real`, `string`, `uint`, `void`), KeywordType, nil},
{`[^()]*`, NameOther, Pop(1)},
},
}
},
))
-39
View File
@@ -1,39 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Cheetah lexer.
var Cheetah = Register(MustNewLexer(
&Config{
Name: "Cheetah",
Aliases: []string{"cheetah", "spitfire"},
Filenames: []string{"*.tmpl", "*.spt"},
MimeTypes: []string{"application/x-cheetah", "application/x-spitfire"},
},
cheetahRules,
))
func cheetahRules() Rules {
return Rules{
"root": {
{`(##[^\n]*)$`, ByGroups(Comment), nil},
{`#[*](.|\n)*?[*]#`, Comment, nil},
{`#end[^#\n]*(?:#|$)`, CommentPreproc, nil},
{`#slurp$`, CommentPreproc, nil},
{`(#[a-zA-Z]+)([^#\n]*)(#|$)`, ByGroups(CommentPreproc, Using("Python"), CommentPreproc), nil},
{`(\$)([a-zA-Z_][\w.]*\w)`, ByGroups(CommentPreproc, Using("Python")), nil},
{`(\$\{!?)(.*?)(\})(?s)`, ByGroups(CommentPreproc, Using("Python"), CommentPreproc), nil},
{`(?sx)
(.+?) # anything, followed by:
(?:
(?=\#[#a-zA-Z]*) | # an eval comment
(?=\$[a-zA-Z_{]) | # a substitution
\Z # end of string
)
`, Other, nil},
{`\s+`, Text, nil},
},
}
}
-70
View File
@@ -1,70 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// CassandraCQL lexer.
var CassandraCQL = Register(MustNewLexer(
&Config{
Name: "Cassandra CQL",
Aliases: []string{"cassandra", "cql"},
Filenames: []string{"*.cql"},
MimeTypes: []string{"text/x-cql"},
NotMultiline: true,
CaseInsensitive: true,
},
cassandraCQLRules,
))
func cassandraCQLRules() Rules {
return Rules{
"root": {
{`\s+`, TextWhitespace, nil},
{`(--|\/\/).*\n?`, CommentSingle, nil},
{`/\*`, CommentMultiline, Push("multiline-comments")},
{`(ascii|bigint|blob|boolean|counter|date|decimal|double|float|frozen|inet|int|list|map|set|smallint|text|time|timestamp|timeuuid|tinyint|tuple|uuid|varchar|varint)\b`, NameBuiltin, nil},
{Words(``, `\b`, `ADD`, `AGGREGATE`, `ALL`, `ALLOW`, `ALTER`, `AND`, `ANY`, `APPLY`, `AS`, `ASC`, `AUTHORIZE`, `BATCH`, `BEGIN`, `BY`, `CLUSTERING`, `COLUMNFAMILY`, `COMPACT`, `CONSISTENCY`, `COUNT`, `CREATE`, `CUSTOM`, `DELETE`, `DESC`, `DISTINCT`, `DROP`, `EACH_QUORUM`, `ENTRIES`, `EXISTS`, `FILTERING`, `FROM`, `FULL`, `GRANT`, `IF`, `IN`, `INDEX`, `INFINITY`, `INSERT`, `INTO`, `KEY`, `KEYS`, `KEYSPACE`, `KEYSPACES`, `LEVEL`, `LIMIT`, `LOCAL_ONE`, `LOCAL_QUORUM`, `MATERIALIZED`, `MODIFY`, `NAN`, `NORECURSIVE`, `NOSUPERUSER`, `NOT`, `OF`, `ON`, `ONE`, `ORDER`, `PARTITION`, `PASSWORD`, `PER`, `PERMISSION`, `PERMISSIONS`, `PRIMARY`, `QUORUM`, `RENAME`, `REVOKE`, `SCHEMA`, `SELECT`, `STATIC`, `STORAGE`, `SUPERUSER`, `TABLE`, `THREE`, `TO`, `TOKEN`, `TRUNCATE`, `TTL`, `TWO`, `TYPE`, `UNLOGGED`, `UPDATE`, `USE`, `USER`, `USERS`, `USING`, `VALUES`, `VIEW`, `WHERE`, `WITH`, `WRITETIME`, `REPLICATION`, `OR`, `REPLACE`, `FUNCTION`, `CALLED`, `INPUT`, `RETURNS`, `LANGUAGE`, `ROLE`, `ROLES`, `TRIGGER`, `DURABLE_WRITES`, `LOGIN`, `OPTIONS`, `LOGGED`, `SFUNC`, `STYPE`, `FINALFUNC`, `INITCOND`, `IS`, `CONTAINS`, `JSON`, `PAGING`, `OFF`), Keyword, nil},
{"[+*/<>=~!@#%^&|`?-]+", Operator, nil},
{
`(?s)(java|javascript)(\s+)(AS)(\s+)('|\$\$)(.*?)(\5)`,
UsingByGroup(1, 6,
NameBuiltin, TextWhitespace, Keyword, TextWhitespace,
LiteralStringHeredoc, LiteralStringHeredoc, LiteralStringHeredoc),
nil,
},
{`(true|false|null)\b`, KeywordConstant, nil},
{`0x[0-9a-f]+`, LiteralNumberHex, nil},
{`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`, LiteralNumberHex, nil},
{`\.[0-9]+(e[+-]?[0-9]+)?`, Error, nil},
{`-?[0-9]+(\.[0-9])?(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil},
{`[0-9]+`, LiteralNumberInteger, nil},
{`'`, LiteralStringSingle, Push("string")},
{`"`, LiteralStringName, Push("quoted-ident")},
{`\$\$`, LiteralStringHeredoc, Push("dollar-string")},
{`[a-z_]\w*`, Name, nil},
{`:(['"]?)[a-z]\w*\b\1`, NameVariable, nil},
{`[;:()\[\]\{\},.]`, Punctuation, nil},
},
"multiline-comments": {
{`/\*`, CommentMultiline, Push("multiline-comments")},
{`\*/`, CommentMultiline, Pop(1)},
{`[^/*]+`, CommentMultiline, nil},
{`[/*]`, CommentMultiline, nil},
},
"string": {
{`[^']+`, LiteralStringSingle, nil},
{`''`, LiteralStringSingle, nil},
{`'`, LiteralStringSingle, Pop(1)},
},
"quoted-ident": {
{`[^"]+`, LiteralStringName, nil},
{`""`, LiteralStringName, nil},
{`"`, LiteralStringName, Pop(1)},
},
"dollar-string": {
{`[^\$]+`, LiteralStringHeredoc, nil},
{`\$\$`, LiteralStringHeredoc, Pop(1)},
},
}
}
-32
View File
@@ -1,32 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Docker lexer.
var Docker = Register(MustNewLexer(
&Config{
Name: "Docker",
Aliases: []string{"docker", "dockerfile"},
Filenames: []string{"Dockerfile", "Dockerfile.*", "*.docker"},
MimeTypes: []string{"text/x-dockerfile-config"},
CaseInsensitive: true,
},
dockerRules,
))
func dockerRules() Rules {
return Rules{
"root": {
{`#.*`, Comment, nil},
{`(ONBUILD)((?:\s*\\?\s*))`, ByGroups(Keyword, Using("Bash")), nil},
{`(HEALTHCHECK)(((?:\s*\\?\s*)--\w+=\w+(?:\s*\\?\s*))*)`, ByGroups(Keyword, Using("Bash")), nil},
{`(VOLUME|ENTRYPOINT|CMD|SHELL)((?:\s*\\?\s*))(\[.*?\])`, ByGroups(Keyword, Using("Bash"), Using("JSON")), nil},
{`(LABEL|ENV|ARG)((?:(?:\s*\\?\s*)\w+=\w+(?:\s*\\?\s*))*)`, ByGroups(Keyword, Using("Bash")), nil},
{`((?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)|VOLUME)\b(.*)`, ByGroups(Keyword, LiteralString), nil},
{`((?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY))`, Keyword, nil},
{`(.*\\\n)*.+`, Using("Bash"), nil},
},
}
}
@@ -0,0 +1,66 @@
<lexer>
<config>
<name>Agda</name>
<alias>agda</alias>
<filename>*.agda</filename>
<mime_type>text/x-agda</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="^(\s*)([^\s(){}]+)(\s*)(:)(\s*)"><bygroups><token type="TextWhitespace"/><token type="NameFunction"/><token type="TextWhitespace"/><token type="OperatorWord"/><token type="TextWhitespace"/></bygroups></rule>
<rule pattern="--(?![!#$%&amp;*+./&lt;=&gt;?@^|_~:\\]).*?$"><token type="CommentSingle"/></rule>
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
<rule pattern="\{!"><token type="CommentMultiline"/><push state="hole"/></rule>
<rule pattern="\b(abstract|codata|coinductive|constructor|data|do|eta-equality|field|forall|hiding|in|inductive|infix|infixl|infixr|instance|interleaved|let|macro|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|quote|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)(?!\&#x27;)\b"><token type="KeywordReserved"/></rule>
<rule pattern="(import|module)(\s+)"><bygroups><token type="KeywordReserved"/><token type="TextWhitespace"/></bygroups><push state="module"/></rule>
<rule pattern="\b(Set|Prop)[\u2080-\u2089]*\b"><token type="KeywordType"/></rule>
<rule pattern="(\(|\)|\{|\})"><token type="Operator"/></rule>
<rule pattern="(\.{1,3}|\||\u03BB|\u2200|\u2192|:|=|-&gt;)"><token type="OperatorWord"/></rule>
<rule pattern="\d+[eE][+-]?\d+"><token type="LiteralNumberFloat"/></rule>
<rule pattern="\d+\.\d+([eE][+-]?\d+)?"><token type="LiteralNumberFloat"/></rule>
<rule pattern="0[xX][\da-fA-F]+"><token type="LiteralNumberHex"/></rule>
<rule pattern="\d+"><token type="LiteralNumberInteger"/></rule>
<rule pattern="&#x27;"><token type="LiteralStringChar"/><push state="character"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><push state="string"/></rule>
<rule pattern="[^\s(){}]+"><token type="Text"/></rule>
<rule pattern="\s+?"><token type="TextWhitespace"/></rule>
</state>
<state name="hole">
<rule pattern="[^!{}]+"><token type="CommentMultiline"/></rule>
<rule pattern="\{!"><token type="CommentMultiline"/><push/></rule>
<rule pattern="!\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
<rule pattern="[!{}]"><token type="CommentMultiline"/></rule>
</state>
<state name="module">
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
<rule pattern="[a-zA-Z][\w.\&#x27;]*"><token type="Name"/><pop depth="1"/></rule>
<rule pattern="[\W0-9_]+"><token type="Text"/></rule>
</state>
<state name="comment">
<rule pattern="[^-{}]+"><token type="CommentMultiline"/></rule>
<rule pattern="\{-"><token type="CommentMultiline"/><push/></rule>
<rule pattern="-\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
<rule pattern="[-{}]"><token type="CommentMultiline"/></rule>
</state>
<state name="character">
<rule pattern="[^\\&#x27;]&#x27;"><token type="LiteralStringChar"/><pop depth="1"/></rule>
<rule pattern="\\"><token type="LiteralStringEscape"/><push state="escape"/></rule>
<rule pattern="&#x27;"><token type="LiteralStringChar"/><pop depth="1"/></rule>
</state>
<state name="string">
<rule pattern="[^\\&quot;]+"><token type="LiteralString"/></rule>
<rule pattern="\\"><token type="LiteralStringEscape"/><push state="escape"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
</state>
<state name="escape">
<rule pattern="[abfnrtv&quot;\&#x27;&amp;\\]"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="\^[][A-ZÀ-ÖØ-ÞĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİIJĴĶĹĻĽĿŁŃŅŇŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸ-ŹŻŽƁ-ƂƄƆ-ƇƉ-ƋƎ-ƑƓ-ƔƖ-ƘƜ-ƝƟ-ƠƢƤƦ-ƧƩƬƮ-ƯƱ-ƳƵƷ-ƸƼDŽLJNJǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮDZǴǶ-ǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺ-ȻȽ-ȾɁɃ-ɆɈɊɌɎͰͲͶͿΆΈ-ΊΌΎ-ΏΑ-ΡΣ-ΫϏϒ-ϔϘϚϜϞϠϢϤϦϨϪϬϮϴϷϹ-ϺϽ-ЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀ-ӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԨԪԬԮԱ-ՖႠ-ჅჇჍᎠ-ᏵᲐ-ᲺᲽ-ᲿḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈ-ἏἘ-ἝἨ-ἯἸ-ἿὈ-ὍὙὛὝὟὨ-ὯᾸ-ΆῈ-ΉῘ-ΊῨ-ῬῸ-Ώℂℇℋ-ℍℐ-ℒℕℙ-ℝℤΩℨK-ℭℰ-ℳℾ-ℿⅅↃⰀ-ⰮⱠⱢ-ⱤⱧⱩⱫⱭ-ⱰⱲⱵⱾ-ⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙠꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꚘꚚꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝽ-ꝾꞀꞂꞄꞆꞋꞍꞐꞒꞖꞘꞚꞜꞞꞠꞢꞤꞦꞨꞪ-ꞮꞰ-ꞴꞶꞸA-Z𐐀-𐐧𐒰-𐓓𐲀-𐲲𑢠-𑢿𖹀-𖹟𝐀-𝐙𝐴-𝑍𝑨-𝒁𝒜𝒞-𝒟𝒢𝒥-𝒦𝒩-𝒬𝒮-𝒵𝓐-𝓩𝔄-𝔅𝔇-𝔊𝔍-𝔔𝔖-𝔜𝔸-𝔹𝔻-𝔾𝕀-𝕄𝕆𝕊-𝕐𝕬-𝖅𝖠-𝖹𝗔-𝗭𝘈-𝘡𝘼-𝙕𝙰-𝚉𝚨-𝛀𝛢-𝛺𝜜-𝜴𝝖-𝝮𝞐-𝞨𝟊𞤀-𞤡@^_]"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="NUL|SOH|[SE]TX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|S[OI]|DLE|DC[1-4]|NAK|SYN|ETB|CAN|EM|SUB|ESC|[FGRU]S|SP|DEL"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="o[0-7]+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="x[\da-fA-F]+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="\d+"><token type="LiteralStringEscape"/><pop depth="1"/></rule>
<rule pattern="(\s+)(\\)"><bygroups><token type="TextWhitespace"/><token type="LiteralStringEscape"/></bygroups><pop depth="1"/></rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,58 @@
<lexer>
<config>
<name>Alloy</name>
<alias>alloy</alias>
<filename>*.als</filename>
<mime_type>text/x-alloy</mime_type>
<dot_all>true</dot_all>
</config>
<rules>
<state name="sig">
<rule pattern="(extends)\b"><token type="Keyword"/><pop depth="1"/></rule>
<rule pattern="[a-zA-Z_][\w]*&quot;*"><token type="Name"/></rule>
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
<rule pattern=","><token type="Punctuation"/></rule>
<rule pattern="\{"><token type="Operator"/><pop depth="1"/></rule>
</state>
<state name="module">
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
<rule pattern="[a-zA-Z_][\w]*&quot;*"><token type="Name"/><pop depth="1"/></rule>
</state>
<state name="fun">
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
<rule pattern="\{"><token type="Operator"/><pop depth="1"/></rule>
<rule pattern="[a-zA-Z_][\w]*&quot;*"><token type="Name"/><pop depth="1"/></rule>
</state>
<state name="fact">
<rule><include state="fun"/></rule>
<rule pattern="&quot;\b(\\\\|\\[^\\]|[^&quot;\\])*&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
</state>
<state name="root">
<rule pattern="--.*?$"><token type="CommentSingle"/></rule>
<rule pattern="//.*?$"><token type="CommentSingle"/></rule>
<rule pattern="/\*.*?\*/"><token type="CommentMultiline"/></rule>
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
<rule pattern="(module|open)(\s+)"><bygroups><token type="KeywordNamespace"/><token type="TextWhitespace"/></bygroups><push state="module"/></rule>
<rule pattern="(sig|enum)(\s+)"><bygroups><token type="KeywordDeclaration"/><token type="TextWhitespace"/></bygroups><push state="sig"/></rule>
<rule pattern="(iden|univ|none)\b"><token type="KeywordConstant"/></rule>
<rule pattern="(int|Int)\b"><token type="KeywordType"/></rule>
<rule pattern="(var|this|abstract|extends|set|seq|one|lone|let)\b"><token type="Keyword"/></rule>
<rule pattern="(all|some|no|sum|disj|when|else)\b"><token type="Keyword"/></rule>
<rule pattern="(run|check|for|but|exactly|expect|as|steps)\b"><token type="Keyword"/></rule>
<rule pattern="(always|after|eventually|until|release)\b"><token type="Keyword"/></rule>
<rule pattern="(historically|before|once|since|triggered)\b"><token type="Keyword"/></rule>
<rule pattern="(and|or|implies|iff|in)\b"><token type="OperatorWord"/></rule>
<rule pattern="(fun|pred|assert)(\s+)"><bygroups><token type="Keyword"/><token type="TextWhitespace"/></bygroups><push state="fun"/></rule>
<rule pattern="(fact)(\s+)"><bygroups><token type="Keyword"/><token type="TextWhitespace"/></bygroups><push state="fact"/></rule>
<rule pattern="!|#|&amp;&amp;|\+\+|&lt;&lt;|&gt;&gt;|&gt;=|&lt;=&gt;|&lt;=|\.\.|\.|-&gt;"><token type="Operator"/></rule>
<rule pattern="[-+/*%=&lt;&gt;&amp;!^|~{}\[\]().\&#x27;;]"><token type="Operator"/></rule>
<rule pattern="[a-zA-Z_][\w]*&quot;*"><token type="Name"/></rule>
<rule pattern="[:,]"><token type="Punctuation"/></rule>
<rule pattern="[0-9]+"><token type="LiteralNumberInteger"/></rule>
<rule pattern="&quot;\b(\\\\|\\[^\\]|[^&quot;\\])*&quot;"><token type="LiteralString"/></rule>
<rule pattern="\n"><token type="TextWhitespace"/></rule>
</state>
</rules>
</lexer>
@@ -4,9 +4,9 @@
<alias>aql</alias>
<filename>*.aql</filename>
<mime_type>text/x-aql</mime_type>
<case_insensitive>true</case_insensitive>
<dot_all>true</dot_all>
<ensure_nl>true</ensure_nl>
<case_insensitive>true</case_insensitive>
</config>
<rules>
<state name="comments-and-whitespace">
@@ -37,10 +37,10 @@
<rule pattern="\\.">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="[^&quot;\\]+">
<rule pattern="[^&#34;\\]+">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="&quot;">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
@@ -49,10 +49,10 @@
<rule pattern="\\.">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="[^'\\]+">
<rule pattern="[^&#39;\\]+">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="'">
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
@@ -155,15 +155,14 @@
<rule pattern="(?:to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|typename|json_stringify|json_parse|concat|concat_separator|char_length|lower|upper|substring|substring_bytes|left|right|trim|reverse|contains|log|log2|log10|exp|exp2|sin|cos|tan|asin|acos|atan|atan2|radians|degrees|pi|regex_test|regex_replace|like|floor|ceil|round|abs|rand|sqrt|pow|length|count|min|max|average|avg|sum|product|median|variance_population|variance_sample|variance|percentile|bit_and|bit_or|bit_xor|bit_negate|bit_test|bit_popcount|bit_shift_left|bit_shift_right|bit_construct|bit_deconstruct|bit_to_string|bit_from_string|first|last|unique|outersection|interleave|in_range|jaccard|matches|merge|merge_recursive|has|attributes|keys|values|unset|unset_recursive|keep|keep_recursive|near|within|within_rectangle|is_in_polygon|distance|fulltext|stddev_sample|stddev_population|stddev|slice|nth|position|contains_array|translate|zip|call|apply|push|append|pop|shift|unshift|remove_value|remove_values|remove_nth|replace_nth|date_now|date_timestamp|date_iso8601|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_isoweekyear|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_round|date_add|date_subtract|date_diff|date_compare|date_format|date_utctolocal|date_localtoutc|date_timezone|date_timezones|fail|passthru|v8|sleep|schema_get|schema_validate|shard_id|version|noopt|noeval|not_null|first_list|first_document|parse_identifier|current_user|current_database|collection_count|pregel_result|collections|document|decode_rev|range|union|union_distinct|minus|intersection|flatten|is_same_collection|check_document|ltrim|rtrim|find_first|find_last|split|substitute|ipv4_to_number|ipv4_from_number|is_ipv4|md5|sha1|sha256|sha512|crc32|fnv64|hash|random_token|to_base64|to_hex|encode_uri_component|soundex|assert|warn|is_key|sorted|sorted_unique|count_distinct|count_unique|levenshtein_distance|levenshtein_match|regex_matches|regex_split|ngram_match|ngram_similarity|ngram_positional_similarity|uuid|tokens|exists|starts_with|phrase|min_match|bm25|tfidf|boost|analyzer|offset_info|value|cosine_similarity|decay_exp|decay_gauss|decay_linear|l1_distance|l2_distance|minhash|minhash_count|minhash_error|minhash_match|geo_point|geo_multipoint|geo_polygon|geo_multipolygon|geo_linestring|geo_multilinestring|geo_contains|geo_intersects|geo_equals|geo_distance|geo_area|geo_in_range)(?=\s*\()">
<token type="NameFunction"/>
</rule>
<rule pattern="&quot;">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<push state="double-quote"/>
</rule>
<rule pattern="'">
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<push state="single-quote"/>
</rule>
<!-- not part of the language but useful for highlighting query explain outputs -->
<rule pattern="#\d+\b">
<token type="NameLabel"/>
</rule>
@@ -172,4 +171,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
@@ -26,6 +26,9 @@
<filename>PKGBUILD</filename>
<mime_type>application/x-sh</mime_type>
<mime_type>application/x-shellscript</mime_type>
<analyse first="true" >
<regex pattern="(?m)^#!.*/bin/(?:env |)(?:bash|zsh|sh|ksh)" score="1.0" />
</analyse>
</config>
<rules>
<state name="data">
@@ -1,6 +1,6 @@
<lexer>
<config>
<name>BashSession</name>
<name>Bash Session</name>
<alias>bash-session</alias>
<alias>console</alias>
<alias>shell-session</alias>
@@ -10,7 +10,7 @@
</config>
<rules>
<state name="root">
<rule pattern="^((?:\[[^]]+@[^]]+\]\s?)?[#$%>])(\s*)(.*\n?)">
<rule pattern="^((?:\[[^]]+@[^]]+\]\s?)?[#$%&gt;])(\s*)(.*\n?)">
<bygroups>
<token type="GenericPrompt"/>
<token type="Text"/>
+65 -49
View File
@@ -5,64 +5,80 @@
<filename>*.bicep</filename>
</config>
<rules>
<state name="root">
<state name="interp">
<rule pattern="'">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="\\.">
<token type="LiteralString"/>
</rule>
<rule pattern="\$\{">
<token type="LiteralStringInterpol"/>
<push state="interp-inside"/>
</rule>
<rule pattern="\$">
<token type="LiteralString"/>
</rule>
<rule pattern="[^'\\$]+">
<token type="LiteralString"/>
</rule>
</state>
<state name="interp-inside">
<rule pattern="\}">
<token type="LiteralStringInterpol"/>
<pop depth="1"/>
</rule>
<rule>
<include state="root"/>
</rule>
</state>
<state name="commentsandwhitespace">
<rule pattern="//[^\n\r]+">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline"/>
</rule>
<rule pattern="([&#39;]?\w+[&#39;]?)(:)">
<bygroups>
<token type="NameProperty"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\b(&#39;(resourceGroup|subscription|managementGroup|tenant)&#39;)\b">
<token type="KeywordNamespace"/>
</rule>
<rule pattern="&#39;[\w\$\{\(\)\}\.]{1,}?&#39;">
<token type="LiteralStringInterpol"/>
</rule>
<rule pattern="(&#39;&#39;&#39;|&#39;).*?(&#39;&#39;&#39;|&#39;)">
<token type="LiteralString"/>
</rule>
<rule pattern="\b(allowed|batchSize|description|maxLength|maxValue|metadata|minLength|minValue|secure)\b">
<token type="NameDecorator"/>
</rule>
<rule pattern="\b(az|sys)\.">
<token type="NameNamespace"/>
</rule>
<rule pattern="\b(any|array|concat|contains|empty|first|intersection|items|last|length|min|max|range|skip|take|union|dateTimeAdd|utcNow|deployment|environment|loadFileAsBase64|loadTextContent|int|json|extensionResourceId|getSecret|list|listKeys|listKeyValue|listAccountSas|listSecrets|pickZones|reference|resourceId|subscriptionResourceId|tenantResourceId|managementGroup|resourceGroup|subscription|tenant|base64|base64ToJson|base64ToString|dataUri|dataUriToString|endsWith|format|guid|indexOf|lastIndexOf|length|newGuid|padLeft|replace|split|startsWith|string|substring|toLower|toUpper|trim|uniqueString|uri|uriComponent|uriComponentToString)\b">
<token type="NameFunction"/>
</rule>
<rule pattern="\b(bool)(\()">
<bygroups>
<token type="NameFunction"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\b(for|if|in)\b">
<token type="Keyword"/>
</rule>
<rule pattern="\b(module|output|param|resource|var)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="\b(array|bool|int|object|string)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(&gt;=|&gt;|&lt;=|&lt;|==|!=|=~|!~|::|&amp;&amp;|\?\?|!|-|%|\*|\/|\+)">
<token type="Operator"/>
</rule>
<rule pattern="[\(\)\[\]\.:\?{}@=]">
<token type="Punctuation"/>
</rule>
<rule pattern="[\w_-]+">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="TextWhitespace"/>
</rule>
</state>
<state name="root">
<rule>
<include state="commentsandwhitespace"/>
</rule>
<rule pattern="'''.*?'''">
<token type="LiteralString"/>
</rule>
<rule pattern="'">
<token type="LiteralString"/>
<push state="interp"/>
</rule>
<rule pattern="#[\w-]+\b">
<token type="CommentPreproc"/>
</rule>
<rule pattern="[\w_]+(?=\()">
<token type="NameFunction"/>
</rule>
<rule pattern="\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="\b(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(&gt;=|&gt;|&lt;=|&lt;|==|!=|=~|!~|::|&amp;&amp;|\?\?|!|-|%|\*|\/|\+)">
<token type="Operator"/>
</rule>
<rule pattern="(\(|\)|\[|\]|\.|:|\?|{|}|@|,|\||=&gt;|=)">
<token type="Punctuation"/>
</rule>
<rule pattern="[\w_]+">
<token type="NameVariable"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
</state>
</rules>
</lexer>
@@ -52,7 +52,7 @@
<rule pattern="0[xX][0-9a-fA-F]+[Ll]?|\d[_\d]*(\.\d*)?([eE][+-]?\d+)?[flFLdD]?">
<token type="LiteralNumber"/>
</rule>
<rule pattern="#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma|nullable)\b[^\n\r]+">
<rule pattern="#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma|nullable)\b">
<token type="CommentPreproc"/>
</rule>
<rule pattern="\b(extern)(\s+)(alias)\b">
@@ -62,7 +62,7 @@
<token type="Keyword"/>
</bygroups>
</rule>
<rule pattern="(abstract|as|async|await|base|break|by|case|catch|checked|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|init|internal|is|let|lock|new|null|on|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|true|try|typeof|unchecked|unsafe|virtual|void|while|get|set|new|partial|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b">
<rule pattern="(as|await|base|break|by|case|catch|checked|continue|default|delegate|do|else|event|finally|fixed|for|foreach|goto|if|in|init|is|let|lock|new|on|out|params|readonly|ref|return|sizeof|stackalloc|switch|this|throw|try|typeof|unchecked|virtual|void|while|get|set|new|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(global)(::)">
@@ -71,9 +71,15 @@
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="(abstract|async|const|enum|explicit|extern|implicit|internal|operator|override|partial|private|protected|public|static|sealed|unsafe|volatile)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="(bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\b\??">
<token type="KeywordType"/>
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(class|struct|record|interface)(\s+)">
<bygroups>
<token type="Keyword"/>
+6 -1
View File
@@ -15,9 +15,14 @@
<filename>*.H</filename>
<filename>*.cp</filename>
<filename>*.CPP</filename>
<filename>*.tpp</filename>
<mime_type>text/x-c++hdr</mime_type>
<mime_type>text/x-c++src</mime_type>
<ensure_nl>true</ensure_nl>
<analyse first="true">
<regex pattern="#include &lt;[a-z_]+>" score="0.2" />
<regex pattern="using namespace " score="0.4" />
</analyse>
</config>
<rules>
<state name="classname">
@@ -79,7 +84,7 @@
</rule>
</state>
<state name="macro">
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)">
<rule pattern="(include)(\s+)(&quot;[^&quot;]+?&quot;|&lt;[^&gt;]+?&gt;)">
<bygroups>
<token type="CommentPreproc"/>
<token type="Text"/>
+4
View File
@@ -11,6 +11,10 @@
<mime_type>image/x-xbitmap</mime_type>
<mime_type>image/x-xpixmap</mime_type>
<ensure_nl>true</ensure_nl>
<analyse first="true" >
<regex pattern="(?m)^\s*#include &lt;" score="0.1" />
<regex pattern="(?m)^\s*#ifn?def " score="0.1" />
</analyse>
</config>
<rules>
<state name="statement">
@@ -0,0 +1,137 @@
<lexer>
<config>
<name>Cassandra CQL</name>
<alias>cassandra</alias>
<alias>cql</alias>
<filename>*.cql</filename>
<mime_type>text/x-cql</mime_type>
<case_insensitive>true</case_insensitive>
<not_multiline>true</not_multiline>
</config>
<rules>
<state name="string">
<rule pattern="[^&#39;]+">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="&#39;&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
</state>
<state name="quoted-ident">
<rule pattern="[^&#34;]+">
<token type="LiteralStringName"/>
</rule>
<rule pattern="&#34;&#34;">
<token type="LiteralStringName"/>
</rule>
<rule pattern="&#34;">
<token type="LiteralStringName"/>
<pop depth="1"/>
</rule>
</state>
<state name="dollar-string">
<rule pattern="[^\$]+">
<token type="LiteralStringHeredoc"/>
</rule>
<rule pattern="\$\$">
<token type="LiteralStringHeredoc"/>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern="\s+">
<token type="TextWhitespace"/>
</rule>
<rule pattern="(--|\/\/).*\n?">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*">
<token type="CommentMultiline"/>
<push state="multiline-comments"/>
</rule>
<rule pattern="(ascii|bigint|blob|boolean|counter|date|decimal|double|float|frozen|inet|int|list|map|set|smallint|text|time|timestamp|timeuuid|tinyint|tuple|uuid|varchar|varint)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(DURABLE_WRITES|LOCAL_QUORUM|MATERIALIZED|COLUMNFAMILY|REPLICATION|NORECURSIVE|NOSUPERUSER|PERMISSIONS|EACH_QUORUM|CONSISTENCY|PERMISSION|CLUSTERING|WRITETIME|SUPERUSER|KEYSPACES|AUTHORIZE|LOCAL_ONE|AGGREGATE|FINALFUNC|PARTITION|FILTERING|UNLOGGED|CONTAINS|DISTINCT|FUNCTION|LANGUAGE|INFINITY|INITCOND|TRUNCATE|KEYSPACE|PASSWORD|REPLACE|OPTIONS|TRIGGER|STORAGE|ENTRIES|RETURNS|COMPACT|PRIMARY|EXISTS|STATIC|PAGING|UPDATE|CUSTOM|VALUES|INSERT|DELETE|MODIFY|CREATE|SELECT|SCHEMA|LOGGED|REVOKE|RENAME|QUORUM|CALLED|STYPE|ORDER|ALTER|BATCH|BEGIN|COUNT|ROLES|APPLY|WHERE|SFUNC|LEVEL|INPUT|LOGIN|INDEX|TABLE|THREE|ALLOW|TOKEN|LIMIT|USING|USERS|GRANT|FROM|KEYS|JSON|USER|INTO|ROLE|TYPE|VIEW|DESC|WITH|DROP|FULL|ASC|TTL|OFF|PER|KEY|USE|ADD|NAN|ONE|ALL|ANY|TWO|AND|NOT|AS|IN|IF|OF|IS|ON|TO|BY|OR)\b">
<token type="Keyword"/>
</rule>
<rule pattern="[+*/&lt;&gt;=~!@#%^&amp;|`?-]+">
<token type="Operator"/>
</rule>
<rule pattern="(?s)(java|javascript)(\s+)(AS)(\s+)(&#39;|\$\$)(.*?)(\5)">
<usingbygroup>
<sublexer_name_group>1</sublexer_name_group>
<code_group>6</code_group>
<emitters>
<token type="NameBuiltin"/>
<token type="TextWhitespace"/>
<token type="Keyword"/>
<token type="TextWhitespace"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
</emitters>
</usingbygroup>
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="0x[0-9a-f]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="\.[0-9]+(e[+-]?[0-9]+)?">
<token type="Error"/>
</rule>
<rule pattern="-?[0-9]+(\.[0-9])?(e[+-]?[0-9]+)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<push state="string"/>
</rule>
<rule pattern="&#34;">
<token type="LiteralStringName"/>
<push state="quoted-ident"/>
</rule>
<rule pattern="\$\$">
<token type="LiteralStringHeredoc"/>
<push state="dollar-string"/>
</rule>
<rule pattern="[a-z_]\w*">
<token type="Name"/>
</rule>
<rule pattern=":([&#39;&#34;]?)[a-z]\w*\b\1">
<token type="NameVariable"/>
</rule>
<rule pattern="[;:()\[\]\{\},.]">
<token type="Punctuation"/>
</rule>
</state>
<state name="multiline-comments">
<rule pattern="/\*">
<token type="CommentMultiline"/>
<push state="multiline-comments"/>
</rule>
<rule pattern="\*/">
<token type="CommentMultiline"/>
<pop depth="1"/>
</rule>
<rule pattern="[^/*]+">
<token type="CommentMultiline"/>
</rule>
<rule pattern="[/*]">
<token type="CommentMultiline"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,143 @@
<lexer>
<config>
<name>Chapel</name>
<alias>chapel</alias>
<alias>chpl</alias>
<filename>*.chpl</filename>
</config>
<rules>
<state name="procname">
<rule pattern="([a-zA-Z_][.\w$]*|\~[a-zA-Z_][.\w$]*|[+*/!~%&lt;&gt;=&amp;^|\-:]{1,2})">
<token type="NameFunction"/>
<pop depth="1"/>
</rule>
<rule pattern="\(">
<token type="Punctuation"/>
<push state="receivertype"/>
</rule>
<rule pattern="\)+\.">
<token type="Punctuation"/>
</rule>
</state>
<state name="receivertype">
<rule pattern="(unmanaged|borrowed|atomic|single|shared|owned|sync)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(complex|nothing|opaque|string|locale|bytes|range|imag|real|bool|uint|void|int)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="[^()]*">
<token type="NameOther"/>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern="\n">
<token type="TextWhitespace"/>
</rule>
<rule pattern="\s+">
<token type="TextWhitespace"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="//(.*?)\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="/(\\\n)?[*](.|\n)*?[*](\\\n)?/">
<token type="CommentMultiline"/>
</rule>
<rule pattern="(config|const|inout|param|type|out|ref|var|in)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="(false|none|true|nil)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(complex|nothing|opaque|string|locale|bytes|range|imag|real|bool|uint|void|int)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(implements|forwarding|prototype|otherwise|subdomain|primitive|unmanaged|override|borrowed|lifetime|coforall|continue|private|require|dmapped|cobegin|foreach|lambda|sparse|shared|domain|pragma|reduce|except|export|extern|throws|forall|delete|return|noinit|single|import|select|public|inline|serial|atomic|defer|break|local|index|throw|catch|label|begin|where|while|align|yield|owned|only|this|sync|with|scan|else|enum|init|when|then|let|for|try|use|new|zip|if|by|as|on|do)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(iter)(\s+)">
<bygroups>
<token type="Keyword"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="procname"/>
</rule>
<rule pattern="(proc)(\s+)">
<bygroups>
<token type="Keyword"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="procname"/>
</rule>
<rule pattern="(operator)(\s+)">
<bygroups>
<token type="Keyword"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="procname"/>
</rule>
<rule pattern="(class|interface|module|record|union)(\s+)">
<bygroups>
<token type="Keyword"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="classname"/>
</rule>
<rule pattern="\d+i">
<token type="LiteralNumber"/>
</rule>
<rule pattern="\d+\.\d*([Ee][-+]\d+)?i">
<token type="LiteralNumber"/>
</rule>
<rule pattern="\.\d+([Ee][-+]\d+)?i">
<token type="LiteralNumber"/>
</rule>
<rule pattern="\d+[Ee][-+]\d+i">
<token type="LiteralNumber"/>
</rule>
<rule pattern="(\d*\.\d+)([eE][+-]?[0-9]+)?i?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="\d+[eE][+-]?[0-9]+i?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0[bB][01]+">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="0[xX][0-9a-fA-F]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0[oO][0-7]+">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
<token type="LiteralString"/>
</rule>
<rule pattern="&#39;(\\\\|\\&#39;|[^&#39;])*&#39;">
<token type="LiteralString"/>
</rule>
<rule pattern="(=|\+=|-=|\*=|/=|\*\*=|%=|&amp;=|\|=|\^=|&amp;&amp;=|\|\|=|&lt;&lt;=|&gt;&gt;=|&lt;=&gt;|&lt;~&gt;|\.\.|by|#|\.\.\.|&amp;&amp;|\|\||!|&amp;|\||\^|~|&lt;&lt;|&gt;&gt;|==|!=|&lt;=|&gt;=|&lt;|&gt;|[+\-*/%]|\*\*)">
<token type="Operator"/>
</rule>
<rule pattern="[:;,.?()\[\]{}]">
<token type="Punctuation"/>
</rule>
<rule pattern="[a-zA-Z_][\w$]*">
<token type="NameOther"/>
</rule>
</state>
<state name="classname">
<rule pattern="[a-zA-Z_][\w$]*">
<token type="NameClass"/>
<pop depth="1"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,55 @@
<lexer>
<config>
<name>Cheetah</name>
<alias>cheetah</alias>
<alias>spitfire</alias>
<filename>*.tmpl</filename>
<filename>*.spt</filename>
<mime_type>application/x-cheetah</mime_type>
<mime_type>application/x-spitfire</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="(##[^\n]*)$">
<bygroups>
<token type="Comment"/>
</bygroups>
</rule>
<rule pattern="#[*](.|\n)*?[*]#">
<token type="Comment"/>
</rule>
<rule pattern="#end[^#\n]*(?:#|$)">
<token type="CommentPreproc"/>
</rule>
<rule pattern="#slurp$">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(#[a-zA-Z]+)([^#\n]*)(#|$)">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="Python"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(\$)([a-zA-Z_][\w.]*\w)">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="Python"/>
</bygroups>
</rule>
<rule pattern="(\$\{!?)(.*?)(\})(?s)">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="Python"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(?sx)&#xA; (.+?) # anything, followed by:&#xA; (?:&#xA; (?=\#[#a-zA-Z]*) | # an eval comment&#xA; (?=\$[a-zA-Z_{]) | # a substitution&#xA; \Z # end of string&#xA; )&#xA; ">
<token type="Other"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
@@ -3,9 +3,12 @@
<name>Clojure</name>
<alias>clojure</alias>
<alias>clj</alias>
<alias>edn</alias>
<filename>*.clj</filename>
<filename>*.edn</filename>
<mime_type>text/x-clojure</mime_type>
<mime_type>application/x-clojure</mime_type>
<mime_type>application/edn</mime_type>
</config>
<rules>
<state name="root">
@@ -65,4 +68,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
+85
View File
@@ -0,0 +1,85 @@
<lexer>
<config>
<name>CUE</name>
<alias>cue</alias>
<filename>*.cue</filename>
<mime_type>text/x-cue</mime_type>
<dot_all>true</dot_all>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="root">
<rule pattern="[^\S\n]+">
<token type="Text"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="//[^\n\r]+">
<token type="CommentSingle"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern="(\+|&amp;&amp;|==|&lt;|=|-|\|\||!=|&gt;|:|\*|&amp;|=~|&lt;=|\?|\[|\]|,|/|\||!~|&gt;=|!|_\|_|\.\.\.)">
<token type="Operator"/>
</rule>
<rule pattern="#*&#34;+">
<token type="LiteralString"/>
<push state="string"/>
</rule>
<rule pattern="'(\\\\|\\'|[^'\n])*['\n]">
<token type="LiteralString"/>
</rule>
<rule pattern="0[boxX][0-9a-fA-F][_0-9a-fA-F]*|(\.\d+|\d[_\d]*(\.\d*)?)([eE][+-]?\d+)?[KMGTP]?i?">
<token type="LiteralNumber"/>
</rule>
<rule pattern="[~!%^&amp;*()+=|\[\]:;,.&lt;&gt;/?-]">
<token type="Punctuation"/>
</rule>
<rule pattern="[{}]">
<token type="Punctuation"/>
</rule>
<rule pattern="(import|for|if|in|let|package)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(bool|float|int|string|uint|ulong|ushort)\b\??">
<token type="KeywordType"/>
</rule>
<rule pattern="(true|false|null|_)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="[_a-zA-Z]\w*">
<token type="Name"/>
</rule>
</state>
<state name="string">
<rule pattern="\\#*\(">
<token type="LiteralStringInterpol"/>
<push state="string-intp"/>
</rule>
<rule pattern="&#34;+#*">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="\\[&#39;&#34;\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}">
<token type="LiteralStringEscape"/>
</rule>
<rule pattern="[^\\&#34;]+">
<token type="LiteralString"/>
</rule>
<rule pattern="\\">
<token type="LiteralString"/>
</rule>
</state>
<state name="string-intp">
<rule pattern="\)">
<token type="LiteralStringInterpol"/>
<pop depth="1"/>
</rule>
<rule>
<include state="root"/>
</rule>
</state>
</rules>
</lexer>
+39
View File
@@ -0,0 +1,39 @@
<lexer>
<config>
<name>Dax</name>
<alias>dax</alias>
<filename>*.dax</filename>
</config>
<rules>
<state name="root">
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
<rule pattern="--.*\n?"><token type="CommentSingle"/></rule>
<rule pattern="//.*\n?"><token type="CommentSingle"/></rule>
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
<rule pattern="(CONTAINS|CONTAINSROW|CUSTOMDATA|ISAFTER|ISBLANK|ISERROR|ISEVEN|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|LOOKUPVALUE|NONVISUAL|SELECTEDMEASURE|SELECTEDMEASURENAME|USERNAME|USEROBJECTID|USERPRINCIPALNAME|TOJSON|TOCSV|EVALUATEANDLOG|USERCULTURE|WINDOW|PARTITIONBY|ORDERBY|OFFSET|INDEX|ROWNUMBER|MATCHBY|ACCRINT|ACCRINTM|AMORDEGRC|AMORLINC|COUPDAYBS|COUPDAYS|COUPDAYSNC|COUPNCD|COUPNUM|COUPPCD|CUMIPMT|CUMPRINC|DB|DDB|DISC|DOLLARDE|DOLLARFR|DURATION|EFFECT|FV|INTRATE|IPMT|ISPMT|MDURATION|NOMINAL|NPER|ODDFPRICE|ODDFYIELD|ODDLPRICE|ODDLYIELD|PDURATION|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|CALCULATE|CALCULATETABLE|CROSSFILTER|EARLIER|EARLIEST|FILTER|FILTERS|HASONEFILTER|HASONEVALUE|ISCROSSFILTERED|ISFILTERED|KEEPFILTERS|RELATED|RELATEDTABLE|REMOVEFILTERS|SELECTEDVALUE|SUBSTITUTEWITHINDEX|USERELATIONSHIP|VALUES|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|DATEADD|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|PARALLELPERIOD|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|SAMEPERIODLASTYEAR|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|TOTALMTD|TOTALQTD|TOTALYTD|RETURN|ABS|ACOS|ACOSH|ACOT|ACOTH|ASIN|ASINH|ATAN|ATANH|CEILING|COMBIN|COMBINA|COS|COSH|COT|COTH|CURRENCY|DEGREES|DIVIDE|EVEN|EXP|FACT|FLOOR|GCD|INT|ISO.CEILING|LCM|LN|LOG|LOG10|MOD|MROUND|ODD|PI|POWER|PRODUCT|PRODUCTX|QUOTIENT|RADIANS|RAND|RANDBETWEEN|ROUND|ROUNDDOWN|ROUNDUP|SIGN|SQRT|SUM|SUMX|TRUNC|BLANK|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONTAINSSTRING|CONTAINSSTRINGEXACT|EXACT|FIND|FIXED|FORMAT|LEFT|LEN|LOWER|MID|REPLACE|REPT|RIGHT|SEARCH|SUBSTITUTE|TRIM|UNICHAR|UNICODE|UPPER|VALUE|LINEST|LINESTX|CONVERT|DATATABLE|ERROR|EXCEPT|GENERATESERIES|GROUPBY|INTERSECT|ISEMPTY|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|SELECTEDMEASUREFORMATSTRING|SUMMARIZECOLUMNS|Table Constructor|TREATAS|UNION|VAR|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|ADDCOLUMNS|ADDMISSINGITEMS|CURRENTGROUP|DETAILROWS|DISTINCT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|EXTERNALMEASURE|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|CALENDAR|CALENDARAUTO|DATE|DATEDIFF|DATEVALUE|DAY|EDATE|EOMONTH|HOUR|MINUTE|MONTH|NETWORKDAYS|NOW|QUARTER|SECOND|TIME|TIMEVALUE|TODAY|UTCNOW|UTCTODAY|WEEKDAY|WEEKNUM|YEAR|YEARFRAC|APPROXIMATEDISTINCTCOUNT|AVERAGE|AVERAGEA|AVERAGEX|BETA.DIST|BETA.INV|CHISQ.DIST|CHISQ.DIST.RT|CHISQ.INV|CHISQ.INV.RT|CONFIDENCE.NORM|CONFIDENCE.T|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSJOIN|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|EXPON.DIST|GENERATE|GENERATEALL|GEOMEAN|GEOMEANX|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MIN|MINA|MINX|NORM.DIST|NORM.INV|NORM.S.DIST|NORM.S.INV|PERCENTILE.EXC|PERCENTILE.INC|PERCENTILEX.EXC|PERCENTILEX.INC|PERMUT|POISSON.DIST|RANK.EQ|RANKX|ROW|SAMPLE|SELECTCOLUMNS|SIN|SINH|SQRTPI|STDEV.P|STDEV.S|STDEVX.P|STDEVX.S|SUMMARIZE|T.DIST|T.DIST.2T|T.DIST.RT|T.INV|T.INV.2T|TAN|TANH|TOPN|VAR|VAR.P|VAR.S|VARX.P|VARX.S|XIRR|XNPV|RANK)\b">
<token type="NameFunction"/>
</rule>
<rule pattern="(AND|BITAND|BITLSHIFT|BITOR|BITRSHIFT|BITXOR|COALESCE|FALSE|IF|IF.EAGER|IFERROR|IN|NOT|OR|SWITCH|TRUE)\b">
<token type="NameOperator"/>
</rule>
<rule pattern="[+*/&lt;&gt;=!^&amp;|,-]"><token type="Operator"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><push state="string"/></rule>
<rule pattern="&#x27;(?:[^&#x27;]|&#x27;&#x27;)*&#x27;(?!&#x27;)(?:\[[ \w]+\])?|\w+\[[ \w]+\]"><token type="NameAttribute"/></rule>
<rule pattern="\[[ \w]+\]"><token type="NameAttribute"/></rule>
<rule pattern="(?&lt;!\w)(\d+\.?\d*|\.\d+\b)"><token type="LiteralNumber"/></rule>
<rule pattern="[\[\](){}`,.]"><token type="Punctuation"/></rule>
<rule pattern=".*\n"><token type="Text"/></rule>
</state>
<state name="multiline-comments">
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
<rule pattern="\*/"><token type="CommentMultiline"/><pop depth="1"/></rule>
<rule pattern="[^/*]+"><token type="CommentMultiline"/></rule>
<rule pattern="[/*]"><token type="CommentMultiline"/></rule>
</state>
<state name="string">
<rule pattern="&quot;&quot;"><token type="LiteralStringEscape"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
<rule pattern="[^&quot;]+"><token type="LiteralString"/></rule>
</state>
</rules>
</lexer>
+4 -2
View File
@@ -4,6 +4,8 @@
<name>dns</name>
<alias>zone</alias>
<alias>bind</alias>
<filename>*.zone</filename>
<mime_type>text/dns</mime_type>
</config>
<rules>
<state name="root">
@@ -22,10 +24,10 @@
<rule pattern="\b\d+[dhwm]?">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="\b([[:alnum:].-])+\.($|\s)">
<rule pattern="\b([\w\d.-])+\.($|\s)">
<token type="NameProperty"/>
</rule>
<rule pattern="^(@|[[:alnum:]-]+)">
<rule pattern="([\w\d\.-]+\.[a-z-]{2,24}\.?|^(@|[\w\d-]+))">
<token type="NameClass"/>
</rule>
<rule pattern="^\$(TTL|GENERATE|INCLUDE|ORIGIN)">
@@ -0,0 +1,57 @@
<lexer>
<config>
<name>Docker</name>
<alias>docker</alias>
<alias>dockerfile</alias>
<filename>Dockerfile</filename>
<filename>Dockerfile.*</filename>
<filename>*.Dockerfile</filename>
<filename>*.docker</filename>
<mime_type>text/x-dockerfile-config</mime_type>
<case_insensitive>true</case_insensitive>
</config>
<rules>
<state name="root">
<rule pattern="#.*">
<token type="Comment"/>
</rule>
<rule pattern="(ONBUILD)((?:\s*\\?\s*))">
<bygroups>
<token type="Keyword"/>
<using lexer="Bash"/>
</bygroups>
</rule>
<rule pattern="(HEALTHCHECK)(((?:\s*\\?\s*)--\w+=\w+(?:\s*\\?\s*))*)">
<bygroups>
<token type="Keyword"/>
<using lexer="Bash"/>
</bygroups>
</rule>
<rule pattern="(VOLUME|ENTRYPOINT|CMD|SHELL)((?:\s*\\?\s*))(\[.*?\])">
<bygroups>
<token type="Keyword"/>
<using lexer="Bash"/>
<using lexer="JSON"/>
</bygroups>
</rule>
<rule pattern="(LABEL|ENV|ARG)((?:(?:\s*\\?\s*)\w+=\w+(?:\s*\\?\s*))*)">
<bygroups>
<token type="Keyword"/>
<using lexer="Bash"/>
</bygroups>
</rule>
<rule pattern="((?:FROM|MAINTAINER|EXPOSE|WORKDIR|USER|STOPSIGNAL)|VOLUME)\b(.*)">
<bygroups>
<token type="Keyword"/>
<token type="LiteralString"/>
</bygroups>
</rule>
<rule pattern="((?:RUN|CMD|ENTRYPOINT|ENV|ARG|LABEL|ADD|COPY))">
<token type="Keyword"/>
</rule>
<rule pattern="(.*\\\n)*.+">
<using lexer="Bash"/>
</rule>
</state>
</rules>
</lexer>
@@ -5,6 +5,7 @@
<alias>ex</alias>
<alias>exs</alias>
<filename>*.ex</filename>
<filename>*.eex</filename>
<filename>*.exs</filename>
<mime_type>text/x-elixir</mime_type>
</config>
@@ -0,0 +1,71 @@
<lexer>
<config>
<name>FortranFixed</name>
<alias>fortranfixed</alias>
<filename>*.f</filename>
<filename>*.F</filename>
<mime_type>text/x-fortran</mime_type>
<case_insensitive>true</case_insensitive>
<not_multiline>true</not_multiline>
</config>
<rules>
<state name="cont-char">
<rule pattern=" ">
<token type="TextWhitespace"/>
<push state="code"/>
</rule>
<rule pattern=".">
<token type="GenericStrong"/>
<push state="code"/>
</rule>
</state>
<state name="code">
<rule pattern="(.{66})(.*)(\n)">
<bygroups>
<using lexer="Fortran"/>
<token type="Comment"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="root"/>
</rule>
<rule pattern="(.*)(!.*)(\n)">
<bygroups>
<using lexer="Fortran"/>
<token type="Comment"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="root"/>
</rule>
<rule pattern="(.*)(\n)">
<bygroups>
<using lexer="Fortran"/>
<token type="TextWhitespace"/>
</bygroups>
<push state="root"/>
</rule>
<rule>
<mutators>
<push state="root"/>
</mutators>
</rule>
</state>
<state name="root">
<rule pattern="[C*].*\n">
<token type="Comment"/>
</rule>
<rule pattern="#.*\n">
<token type="CommentPreproc"/>
</rule>
<rule pattern=" {0,4}!.*\n">
<token type="Comment"/>
</rule>
<rule pattern="(.{5})">
<token type="NameLabel"/>
<push state="cont-char"/>
</rule>
<rule pattern=".*\n">
<using lexer="Fortran"/>
</rule>
</state>
</rules>
</lexer>
@@ -6,6 +6,7 @@
<filename>*.s</filename>
<filename>*.S</filename>
<mime_type>text/x-gas</mime_type>
<priority>0.1</priority>
</config>
<rules>
<state name="punctuation">
File diff suppressed because one or more lines are too long
@@ -0,0 +1,270 @@
<lexer>
<config>
<name>GDScript3</name>
<alias>gdscript3</alias>
<alias>gd3</alias>
<filename>*.gd</filename>
<mime_type>text/x-gdscript</mime_type>
<mime_type>application/x-gdscript</mime_type>
<analyse>
<regex pattern="func (_ready|_init|_input|_process|_unhandled_input)" score="0.8"/>
<regex pattern="(extends |class_name |onready |preload|load|setget|func [^_])" score="0.4"/>
<regex pattern="(var|const|enum|export|signal|tool)" score="0.2"/>
</analyse>
</config>
<rules>
<state name="builtins">
<rule pattern="(?&lt;!\.)(instance_from_id|nearest_po2|print_stack|type_exist|rand_range|linear2db|var2bytes|dict2inst|randomize|bytes2var|rand_seed|db2linear|inst2dict|printerr|printraw|decimals|preload|deg2rad|str2var|stepify|var2str|convert|weakref|fposmod|funcref|rad2deg|dectime|printt|is_inf|is_nan|assert|Color8|typeof|ColorN|prints|floor|atan2|yield|randf|print|range|clamp|round|randi|sqrt|tanh|cosh|ceil|ease|acos|load|fmod|lerp|seed|sign|atan|sinh|hash|asin|sin|str|cos|tan|pow|exp|min|abs|log|max)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(?&lt;!\.)(self|false|true|PI|NAN|INF)\b">
<token type="NameBuiltinPseudo"/>
</rule>
<rule pattern="(?&lt;!\.)(Physics2DShapeQueryParameters|PhysicsShapeQueryParameters|Physics2DDirectBodyStateSW|NavigationPolygonInstance|ResourceInteractiveLoader|Physics2DDirectSpaceState|Physics2DShapeQueryResult|Physics2DTestMotionResult|InputEventJoystickButton|InputEventJoystickMotion|Physics2DDirectBodyState|PhysicsDirectBodyStateSW|PhysicsShapeQueryResult|PhysicsDirectSpaceState|SpatialSound2DServerSW|PackedDataContainerRef|NavigationMeshInstance|ResourceImportMetadata|PhysicsDirectBodyState|ConcavePolygonShape2D|CanvasItemShaderGraph|EditorScenePostImport|InputEventScreenTouch|InputEventMouseButton|InputEventMouseMotion|SpatialSound2DServer|AudioStreamOGGVorbis|VisibilityNotifier2D|InputEventScreenDrag|ConvexPolygonShape2D|SpatialSoundServerSW|ParticleAttractor2D|PackedDataContainer|SpatialStreamPlayer|RenderTargetTexture|AnimationTreePlayer|ConcavePolygonShape|InstancePlaceholder|MaterialShaderGraph|AudioStreamPlayback|VisibilityEnabler2D|SpatialSamplePlayer|DampedSpringJoint2D|InterpolatedCamera|ConvexPolygonShape|ConfirmationDialog|SpatialSoundServer|BakedLightInstance|ParallaxBackground|CollisionPolygon2D|CanvasItemMaterial|VisibilityNotifier|EditorImportPlugin|VideoStreamTheora|TouchScreenButton|ResourcePreloader|OccluderPolygon2D|BakedLightSampler|CollisionObject2D|RemoteTransform2D|PolygonPathFinder|StyleBoxImageMask|NavigationPolygon|TranslationServer|MultiMeshInstance|ImmediateGeometry|Physics2DServerSW|ColorPickerButton|VisibilityEnabler|PHashTranslation|RectangleShape2D|DirectionalLight|AnimatedSprite3D|WorldEnvironment|CollisionShape2D|EventStreamChibi|InputEventAction|CollisionPolygon|AudioStreamSpeex|EditorFileDialog|GeometryInstance|Generic6DOFJoint|PacketPeerStream|CanvasItemShader|KinematicBody2D|StyleBoxTexture|PhysicsServerSW|VSplitContainer|CenterContainer|GDFunctionState|AudioStreamOpus|TextureProgress|MarginContainer|CollisionObject|LightOccluder2D|AnimationPlayer|HSplitContainer|ScrollContainer|SoundRoomParams|Physics2DServer|MaterialShader|ShaderMaterial|ViewportSprite|SplitContainer|AudioStreamMPC|VisualInstance|PanelContainer|BackBufferCopy|SamplePlayer2D|CanvasModulate|ResourceLoader|CapsuleShape2D|ReferenceFrame|NavigationMesh|CollisionShape|ConeTwistJoint|ProximityGroup|AnimatedSprite|SegmentShape2D|BoneAttachment|RichTextLabel|CircleShape2D|VBoxContainer|PacketPeerUDP|SpatialPlayer|TextureButton|KinematicBody|SoundPlayer2D|PhysicsServer|ParallaxLayer|InputEventKey|GrooveJoint2D|PhysicsBody2D|FixedMaterial|GridContainer|HBoxContainer|StreamPeerSSL|StyleBoxEmpty|StreamPeerTCP|SampleLibrary|GDNativeClass|AudioServerSW|ResourceSaver|SpriteBase3D|StreamPlayer|AtlasTexture|VisualServer|SamplePlayer|StyleBoxFlat|StaticBody2D|SpriteFrames|MeshDataTool|MeshInstance|Vector3Array|BoxContainer|TabContainer|HButtonArray|LargeTexture|Navigation2D|WindowDialog|EditorScript|EditorPlugin|TextureFrame|AcceptDialog|ImageTexture|CapsuleShape|VehicleWheel|VButtonArray|Vector2Array|InputDefault|OptionButton|PathFollow2D|VehicleBody|ColorPicker|PopupDialog|ProgressBar|CanvasLayer|Translation|Environment|EventPlayer|VideoPlayer|EventStream|VideoStream|ButtonGroup|Particles2D|Patch9Frame|ButtonArray|SurfaceTool|MeshLibrary|PackedScene|PhysicsBody|AudioStream|Performance|StringArray|AudioServer|RigidBody2D|LineShape2D|SliderJoint|SphereShape|ShaderGraph|CheckButton|StreamPeer|FileDialog|PathFollow|SceneState|RoomBounds|Dictionary|VSeparator|PacketPeer|VScrollBar|MenuButton|HTTPClient|PinJoint2D|BakedLight|PlaneShape|InputEvent|BaseButton|HSeparator|HScrollBar|Navigation|PopupPanel|StaticBody|Position2D|Position3D|ToolButton|HingeJoint|CanvasItem|RayShape2D|ColorArray|ConfigFile|TCP_Server|RayCast2D|ColorRamp|SpotLight|RealArray|GraphNode|Container|Reference|PopupMenu|Separator|Polygon2D|MultiMesh|Semaphore|Transform|OmniLight|GraphEdit|Particles|Animation|Marshalls|SceneTree|RigidBody|XMLParser|PathRemap|ScrollBar|Directory|PCKPacker|RawArray|TextEdit|MainLoop|TreeItem|StyleBox|Material|Geometry|Matrix32|Resource|UndoRedo|RayShape|TestCube|ItemList|CheckBox|Camera2D|Skeleton|Sprite3D|Viewport|NodePath|IntArray|BoxShape|PinJoint|InputMap|LineEdit|GDScript|Vector3|TileMap|HSlider|Spatial|SpinBox|World2D|IP_Unix|Curve2D|Curve3D|WeakRef|GridMap|Matrix3|VSlider|CubeMap|Joint2D|Globals|Shape2D|Texture|Control|TileSet|Light2D|FuncRef|Vector2|RayCast|Script|Node2D|Button|BitMap|Sample|Object|String|Shader|Area2D|Slider|Sprite|Thread|Path2D|Camera|Portal|float|Theme|World|YSort|Shape|Joint|Mutex|Tween|RegEx|Label|Rect2|Array|Plane|Light|Range|Color|Input|Popup|Panel|Timer|Image|Area|Quad|bool|AABB|Quat|File|Tabs|Path|Font|Tree|Room|Mesh|Node|RID|int|Nil|IP|OS)\b">
<token type="NameException"/>
</rule>
</state>
<state name="sqs">
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
<rule pattern="\\\\|\\&#39;|\\\n">
<token type="LiteralStringEscape"/>
</rule>
<rule>
<include state="strings-single"/>
</rule>
</state>
<state name="stringescape">
<rule pattern="\\([\\abfnrtv&#34;\&#39;]|\n|N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})">
<token type="LiteralStringEscape"/>
</rule>
</state>
<state name="classname">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameClass"/>
<pop depth="1"/>
</rule>
</state>
<state name="strings-single">
<rule pattern="%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]">
<token type="LiteralStringInterpol"/>
</rule>
<rule pattern="[^\\\&#39;&#34;%\n]+">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="[\&#39;&#34;\\]">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="%">
<token type="LiteralStringSingle"/>
</rule>
</state>
<state name="funcname">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameFunction"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="numbers">
<rule pattern="(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="\d+[eE][+-]?[0-9]+j?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0[xX][a-fA-F0-9]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="\d+j?">
<token type="LiteralNumberInteger"/>
</rule>
</state>
<state name="tdqs">
<rule pattern="&#34;&#34;&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
<rule>
<include state="strings-double"/>
</rule>
<rule pattern="\n">
<token type="LiteralStringDouble"/>
</rule>
</state>
<state name="name">
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
</rule>
</state>
<state name="root">
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern="^(\s*)([rRuUbB]{,2})(&#34;&#34;&#34;(?:.|\n)*?&#34;&#34;&#34;)">
<bygroups>
<token type="Text"/>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDoc"/>
</bygroups>
</rule>
<rule pattern="^(\s*)([rRuUbB]{,2})(&#39;&#39;&#39;(?:.|\n)*?&#39;&#39;&#39;)">
<bygroups>
<token type="Text"/>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDoc"/>
</bygroups>
</rule>
<rule pattern="[^\S\n]+">
<token type="Text"/>
</rule>
<rule pattern="#.*$">
<token type="CommentSingle"/>
</rule>
<rule pattern="[]{}:(),;[]">
<token type="Punctuation"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="\\">
<token type="Text"/>
</rule>
<rule pattern="(in|and|or|not)\b">
<token type="OperatorWord"/>
</rule>
<rule pattern="!=|==|&lt;&lt;|&gt;&gt;|&amp;&amp;|\+=|-=|\*=|/=|%=|&amp;=|\|=|\|\||[-~+/*%=&lt;&gt;&amp;^.!|$]">
<token type="Operator"/>
</rule>
<rule>
<include state="keywords"/>
</rule>
<rule pattern="(def)((?:\s|\\\s)+)">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
</bygroups>
<push state="funcname"/>
</rule>
<rule pattern="(class)((?:\s|\\\s)+)">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
</bygroups>
<push state="classname"/>
</rule>
<rule>
<include state="builtins"/>
</rule>
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(&#34;&#34;&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<push state="tdqs"/>
</rule>
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(&#39;&#39;&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<push state="tsqs"/>
</rule>
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<push state="dqs"/>
</rule>
<rule pattern="([rR]|[uUbB][rR]|[rR][uUbB])(&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<push state="sqs"/>
</rule>
<rule pattern="([uUbB]?)(&#34;&#34;&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<combined state="stringescape" state="tdqs"/>
</rule>
<rule pattern="([uUbB]?)(&#39;&#39;&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<combined state="stringescape" state="tsqs"/>
</rule>
<rule pattern="([uUbB]?)(&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<combined state="stringescape" state="dqs"/>
</rule>
<rule pattern="([uUbB]?)(&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<combined state="stringescape" state="sqs"/>
</rule>
<rule>
<include state="name"/>
</rule>
<rule>
<include state="numbers"/>
</rule>
</state>
<state name="keywords">
<rule pattern="(breakpoint|continue|onready|extends|signal|return|export|static|setget|switch|break|const|while|class|tool|pass|func|case|enum|else|elif|var|for|do|if)\b">
<token type="Keyword"/>
</rule>
</state>
<state name="dqs">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
<rule pattern="\\\\|\\&#34;|\\\n">
<token type="LiteralStringEscape"/>
</rule>
<rule>
<include state="strings-double"/>
</rule>
</state>
<state name="tsqs">
<rule pattern="&#39;&#39;&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
<rule>
<include state="strings-single"/>
</rule>
<rule pattern="\n">
<token type="LiteralStringSingle"/>
</rule>
</state>
<state name="strings-double">
<rule pattern="%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?[hlL]?[E-GXc-giorsux%]">
<token type="LiteralStringInterpol"/>
</rule>
<rule pattern="[^\\\&#39;&#34;%\n]+">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="[\&#39;&#34;\\]">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="%">
<token type="LiteralStringDouble"/>
</rule>
</state>
</rules>
</lexer>
@@ -1,7 +1,9 @@
<lexer>
<config>
<name>Go HTML Template</name>
<alias>go-html-template</alias>
<name>Go Template</name>
<alias>go-template</alias>
<filename>*.gotmpl</filename>
<filename>*.go.tmpl</filename>
</config>
<rules>
<state name="template">
@@ -109,4 +111,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
+4 -4
View File
@@ -41,10 +41,10 @@
<rule pattern="(as|assert|break|case|catch|continue|default|do|else|finally|for|if|in|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
<rule pattern="(abstract|const|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="(def|boolean|byte|char|double|float|int|long|short|void)\b">
<rule pattern="(def|var|boolean|byte|char|double|float|int|long|short|void)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(package)(\s+)">
@@ -56,7 +56,7 @@
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(class|interface|record)(\s+)">
<rule pattern="(class|interface|enum|trait|record)(\s+)">
<bygroups>
<token type="KeywordDeclaration"/>
<token type="Text"/>
@@ -132,4 +132,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
@@ -0,0 +1,98 @@
<lexer>
<config>
<name>Hare</name>
<alias>hare</alias>
<filename>*.ha</filename>
<mime_type>text/x-hare</mime_type>
</config>
<rules>
<state name="string">
<rule pattern="&quot;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="\\([\\0abfnrtv&quot;']|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})">
<token type="LiteralStringEscape"/>
</rule>
<rule pattern="[^\\&quot;\n]+">
<token type="LiteralString"/>
</rule>
<rule pattern="\\">
<token type="LiteralString"/>
</rule>
</state>
<state name="root">
<rule pattern="[\s\n]+">
<token type="TextWhitespace"/>
</rule>
<rule pattern="@[a-z]+">
<token type="NameDecorator"/>
</rule>
<rule pattern="//.*\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="&quot;">
<token type="LiteralString"/>
<push state="string"/>
</rule>
<rule pattern="`[^`]*`">
<token type="LiteralString"/>
</rule>
<rule pattern="'(\\[\\0abfnrtv&quot;']||\\(x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})|[^\\'])'">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="(0|[1-9]\d*)\.\d+([eE][+-]?\d+)?(f32|f64)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="(0|[1-9]\d*)([eE][+-]?\d+)?(f32|f64)">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0x[0-9a-fA-F]+\.[0-9a-fA-F]+([pP][+-]?\d+(f32|f64)?)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0x[0-9a-fA-F]+[pP][+-]?\d+(f32|f64)">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0x[0-9a-fA-F]+(z|[iu](8|16|32|64)?)?">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0o[0-7]+(z|[iu](8|16|32|64)?)?">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0b[01]+(z|[iu](8|16|32|64)?)?">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="(0|[1-9]\d*)([eE][+-]?\d+)?(z|[iu](8|16|32|64)?)?">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="[~!%^&amp;*+=|?:&lt;&gt;/-]|[ai]s\b|\.\.\.">
<token type="Operator"/>
</rule>
<rule pattern="[()\[\],.{};]">
<token type="Punctuation"/>
</rule>
<rule pattern="use\b">
<token type="KeywordNamespace"/>
</rule>
<rule pattern="(_|align|break|const|continue|else|enum|export|for|if|return|static|struct|offset|union|fn|free|assert|abort|alloc|let|len|def|type|match|switch|case|append|delete|insert|defer|yield|vastart|vaarg|vaend)\b">
<token type="Keyword"/>
</rule>
<rule pattern="(size)([\s\n]*)(\()">
<bygroups>
<token type="Keyword" />
<token type="TextWhitespace" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="(str|size|rune|bool|int|uint|uintptr|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|null|void|nullable|valist|opaque|never)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(true|false)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
</rule>
</state>
</rules>
</lexer>
+4 -1
View File
@@ -4,6 +4,9 @@
<alias>hlsl</alias>
<filename>*.hlsl</filename>
<filename>*.hlsli</filename>
<filename>*.cginc</filename>
<filename>*.fx</filename>
<filename>*.fxh</filename>
<mime_type>text/x-hlsl</mime_type>
</config>
<rules>
@@ -104,4 +107,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
+159
View File
@@ -0,0 +1,159 @@
<lexer>
<config>
<name>HTML</name>
<alias>html</alias>
<filename>*.html</filename>
<filename>*.htm</filename>
<filename>*.xhtml</filename>
<filename>*.xslt</filename>
<mime_type>text/html</mime_type>
<mime_type>application/xhtml+xml</mime_type>
<case_insensitive>true</case_insensitive>
<dot_all>true</dot_all>
<not_multiline>true</not_multiline>
</config>
<rules>
<state name="script-content">
<rule pattern="(&lt;)(\s*)(/)(\s*)(script)(\s*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
<token type="Punctuation"/>
</bygroups>
<pop depth="1"/>
</rule>
<rule pattern=".+?(?=&lt;\s*/\s*script\s*&gt;)">
<using lexer="Javascript"/>
</rule>
</state>
<state name="style-content">
<rule pattern="(&lt;)(\s*)(/)(\s*)(style)(\s*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
<token type="Punctuation"/>
</bygroups>
<pop depth="1"/>
</rule>
<rule pattern=".+?(?=&lt;\s*/\s*style\s*&gt;)">
<using lexer="CSS"/>
</rule>
</state>
<state name="attr">
<rule pattern="&#34;.*?&#34;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="&#39;.*?&#39;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="[^\s&gt;]+">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern="[^&lt;&amp;]+">
<token type="Text"/>
</rule>
<rule pattern="&amp;\S*?;">
<token type="NameEntity"/>
</rule>
<rule pattern="\&lt;\!\[CDATA\[.*?\]\]\&gt;">
<token type="CommentPreproc"/>
</rule>
<rule pattern="&lt;!--">
<token type="Comment"/>
<push state="comment"/>
</rule>
<rule pattern="&lt;\?.*?\?&gt;">
<token type="CommentPreproc"/>
</rule>
<rule pattern="&lt;![^&gt;]*&gt;">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(&lt;)(\s*)(script)(\s*)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
</bygroups>
<push state="script-content" state="tag"/>
</rule>
<rule pattern="(&lt;)(\s*)(style)(\s*)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
</bygroups>
<push state="style-content" state="tag"/>
</rule>
<rule pattern="(&lt;)(\s*)([\w:.-]+)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
</bygroups>
<push state="tag"/>
</rule>
<rule pattern="(&lt;)(\s*)(/)(\s*)([\w:.-]+)(\s*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Punctuation"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
<token type="Punctuation"/>
</bygroups>
</rule>
</state>
<state name="comment">
<rule pattern="[^-]+">
<token type="Comment"/>
</rule>
<rule pattern="--&gt;">
<token type="Comment"/>
<pop depth="1"/>
</rule>
<rule pattern="-">
<token type="Comment"/>
</rule>
</state>
<state name="tag">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="([\w:-]+\s*)(=)(\s*)">
<bygroups>
<token type="NameAttribute"/>
<token type="Operator"/>
<token type="Text"/>
</bygroups>
<push state="attr"/>
</rule>
<rule pattern="[\w:-]+">
<token type="NameAttribute"/>
</rule>
<rule pattern="(/?)(\s*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Punctuation"/>
</bygroups>
<pop depth="1"/>
</rule>
</state>
</rules>
</lexer>
@@ -15,6 +15,7 @@
<filename>.pylintrc</filename>
<mime_type>text/x-ini</mime_type>
<mime_type>text/inf</mime_type>
<priority>0.1</priority> <!-- higher priority than Inform 6 -->
</config>
<rules>
<state name="root">
@@ -2,7 +2,7 @@
<config>
<name>ISCdhcpd</name>
<alias>iscdhcpd</alias>
<filename>*.conf</filename>
<filename>dhcpd.conf</filename>
</config>
<rules>
<state name="interpol">
+167 -92
View File
@@ -5,114 +5,189 @@
<filename>*.java</filename>
<mime_type>text/x-java</mime_type>
<dot_all>true</dot_all>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="class">
<state name="root">
<rule pattern="(^\s*)((?:(?:public|private|protected|static|strictfp)(?:\s+))*)(record)\b">
<bygroups>
<token type="TextWhitespace" />
<usingself state="root" />
<token type="KeywordDeclaration" />
</bygroups>
<push state="class" />
</rule>
<rule pattern="[^\S\n]+">
<token type="TextWhitespace" />
</rule>
<rule pattern="(//.*?)(\n)">
<bygroups>
<token type="CommentSingle" />
<token type="TextWhitespace" />
</bygroups>
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline" />
</rule>
<rule
pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
<token type="Keyword" />
</rule>
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$&lt;&gt;]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
<bygroups>
<usingself state="root" />
<token type="NameFunction" />
<token type="TextWhitespace" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="@[^\W\d][\w.]*">
<token type="NameDecorator" />
</rule>
<rule
pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|sealed|static|strictfp|super|synchronized|throws|transient|volatile|yield)\b">
<token type="KeywordDeclaration" />
</rule>
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
<token type="KeywordType" />
</rule>
<rule pattern="(package)(\s+)">
<bygroups>
<token type="KeywordNamespace" />
<token type="TextWhitespace" />
</bygroups>
<push state="import" />
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant" />
</rule>
<rule pattern="(class|interface)\b">
<token type="KeywordDeclaration" />
<push state="class" />
</rule>
<rule pattern="(var)(\s+)">
<bygroups>
<token type="KeywordDeclaration" />
<token type="TextWhitespace" />
</bygroups>
<push state="var" />
</rule>
<rule pattern="(import(?:\s+static)?)(\s+)">
<bygroups>
<token type="KeywordNamespace" />
<token type="TextWhitespace" />
</bygroups>
<push state="import" />
</rule>
<rule pattern="&quot;&quot;&quot;\n">
<token type="LiteralString" />
<push state="multiline_string" />
</rule>
<rule pattern="&quot;">
<token type="LiteralString" />
<push state="string" />
</rule>
<rule pattern="&#x27;\\.&#x27;|&#x27;[^\\]&#x27;|&#x27;\\u[0-9a-fA-F]{4}&#x27;">
<token type="LiteralStringChar" />
</rule>
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
<bygroups>
<token type="Punctuation" />
<token type="NameAttribute" />
</bygroups>
</rule>
<rule pattern="^(\s*)(default)(:)">
<bygroups>
<token type="TextWhitespace" />
<token type="Keyword" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="^(\s*)((?:[^\W\d]|\$)[\w$]*)(:)">
<bygroups>
<token type="TextWhitespace" />
<token type="NameLabel" />
<token type="Punctuation" />
</bygroups>
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="NameClass"/>
<pop depth="1"/>
<token type="Name" />
</rule>
<rule
pattern="([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?">
<token type="LiteralNumberFloat" />
</rule>
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
<token type="LiteralNumberHex" />
</rule>
<rule pattern="0[bB][01][01_]*[lL]?">
<token type="LiteralNumberBin" />
</rule>
<rule pattern="0[0-7_]+[lL]?">
<token type="LiteralNumberOct" />
</rule>
<rule pattern="0|[1-9][0-9_]*[lL]?">
<token type="LiteralNumberInteger" />
</rule>
<rule pattern="[~^*!%&amp;\[\]&lt;&gt;|+=/?-]">
<token type="Operator" />
</rule>
<rule pattern="[{}();:.,]">
<token type="Punctuation" />
</rule>
<rule pattern="\n">
<token type="TextWhitespace" />
</rule>
</state>
<state name="class">
<rule pattern="\s+">
<token type="Text" />
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="NameClass" />
<pop depth="1" />
</rule>
</state>
<state name="var">
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="Name" />
<pop depth="1" />
</rule>
</state>
<state name="import">
<rule pattern="[\w.]+\*?">
<token type="NameNamespace"/>
<pop depth="1"/>
<token type="NameNamespace" />
<pop depth="1" />
</rule>
</state>
<state name="root">
<rule pattern="[^\S\n]+">
<token type="Text"/>
<state name="multiline_string">
<rule pattern="&quot;&quot;&quot;">
<token type="LiteralString" />
<pop depth="1" />
</rule>
<rule pattern="//.*?\n">
<token type="CommentSingle"/>
<rule pattern="&quot;">
<token type="LiteralString" />
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline"/>
<rule>
<include state="string" />
</rule>
<rule pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b">
<token type="Keyword"/>
</state>
<state name="string">
<rule pattern="[^\\&quot;]+">
<token type="LiteralString" />
</rule>
<rule pattern="((?:(?:[^\W\d]|\$)[\w.\[\]$&lt;&gt;]*\s+)+?)((?:[^\W\d]|\$)[\w$]*)(\s*)(\()">
<bygroups>
<usingself state="root"/>
<token type="NameFunction"/>
<token type="Text"/>
<token type="Operator"/>
</bygroups>
<rule pattern="\\\\">
<token type="LiteralString" />
</rule>
<rule pattern="@[^\W\d][\w.]*">
<token type="NameDecorator"/>
<rule pattern="\\&quot;">
<token type="LiteralString" />
</rule>
<rule pattern="(abstract|const|enum|extends|final|implements|native|private|protected|public|static|strictfp|super|synchronized|throws|transient|volatile)\b">
<token type="KeywordDeclaration"/>
<rule pattern="\\">
<token type="LiteralString" />
</rule>
<rule pattern="(boolean|byte|char|double|float|int|long|short|void)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="(package)(\s+)">
<bygroups>
<token type="KeywordNamespace"/>
<token type="Text"/>
</bygroups>
<push state="import"/>
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(class|interface)(\s+)">
<bygroups>
<token type="KeywordDeclaration"/>
<token type="Text"/>
</bygroups>
<push state="class"/>
</rule>
<rule pattern="(import(?:\s+static)?)(\s+)">
<bygroups>
<token type="KeywordNamespace"/>
<token type="Text"/>
</bygroups>
<push state="import"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
<token type="LiteralString"/>
</rule>
<rule pattern="&#39;\\.&#39;|&#39;[^\\]&#39;|&#39;\\u[0-9a-fA-F]{4}&#39;">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="(\.)((?:[^\W\d]|\$)[\w$]*)">
<bygroups>
<token type="Operator"/>
<token type="NameAttribute"/>
</bygroups>
</rule>
<rule pattern="^\s*([^\W\d]|\$)[\w$]*:">
<token type="NameLabel"/>
</rule>
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="Name"/>
</rule>
<rule pattern="([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0[bB][01][01_]*[lL]?">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="0[0-7_]+[lL]?">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0|[1-9][0-9_]*[lL]?">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="[~^*!%&amp;\[\](){}&lt;&gt;|+=:;,./?-]">
<token type="Operator"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
<rule pattern="&quot;">
<token type="LiteralString" />
<pop depth="1" />
</rule>
</state>
</rules>
</lexer>
</lexer>
@@ -0,0 +1,131 @@
<lexer>
<config>
<name>Makefile</name>
<alias>make</alias>
<alias>makefile</alias>
<alias>mf</alias>
<alias>bsdmake</alias>
<filename>*.mak</filename>
<filename>*.mk</filename>
<filename>Makefile</filename>
<filename>makefile</filename>
<filename>Makefile.*</filename>
<filename>GNUmakefile</filename>
<filename>BSDmakefile</filename>
<filename>Justfile</filename>
<filename>justfile</filename>
<filename>.justfile</filename>
<mime_type>text/x-makefile</mime_type>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="root">
<rule pattern="^(?:[\t ]+.*\n|\n)+">
<using lexer="Bash"/>
</rule>
<rule pattern="\$[&lt;@$+%?|*]">
<token type="Keyword"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="#.*?\n">
<token type="Comment"/>
</rule>
<rule pattern="(export)(\s+)(?=[\w${}\t -]+\n)">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
</bygroups>
<push state="export"/>
</rule>
<rule pattern="export\s+">
<token type="Keyword"/>
</rule>
<rule pattern="([\w${}().-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)">
<bygroups>
<token type="NameVariable"/>
<token type="Text"/>
<token type="Operator"/>
<token type="Text"/>
<using lexer="Bash"/>
</bygroups>
</rule>
<rule pattern="(?s)&#34;(\\\\|\\.|[^&#34;\\])*&#34;">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="(?s)&#39;(\\\\|\\.|[^&#39;\\])*&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="([^\n:]+)(:+)([ \t]*)">
<bygroups>
<token type="NameFunction"/>
<token type="Operator"/>
<token type="Text"/>
</bygroups>
<push state="block-header"/>
</rule>
<rule pattern="\$\(">
<token type="Keyword"/>
<push state="expansion"/>
</rule>
</state>
<state name="expansion">
<rule pattern="[^$a-zA-Z_()]+">
<token type="Text"/>
</rule>
<rule pattern="[a-zA-Z_]+">
<token type="NameVariable"/>
</rule>
<rule pattern="\$">
<token type="Keyword"/>
</rule>
<rule pattern="\(">
<token type="Keyword"/>
<push/>
</rule>
<rule pattern="\)">
<token type="Keyword"/>
<pop depth="1"/>
</rule>
</state>
<state name="export">
<rule pattern="[\w${}-]+">
<token type="NameVariable"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
<pop depth="1"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
<state name="block-header">
<rule pattern="[,|]">
<token type="Punctuation"/>
</rule>
<rule pattern="#.*?\n">
<token type="Comment"/>
<pop depth="1"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="\$\(">
<token type="Keyword"/>
<push state="expansion"/>
</rule>
<rule pattern="[a-zA-Z_]+">
<token type="Name"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
<pop depth="1"/>
</rule>
<rule pattern=".">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
+120
View File
@@ -0,0 +1,120 @@
<lexer>
<config>
<name>Mako</name>
<alias>mako</alias>
<filename>*.mao</filename>
<mime_type>application/x-mako</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="(\s*)(%)(\s*end(?:\w+))(\n|\Z)">
<bygroups>
<token type="Text"/>
<token type="CommentPreproc"/>
<token type="Keyword"/>
<token type="Other"/>
</bygroups>
</rule>
<rule pattern="(\s*)(%)([^\n]*)(\n|\Z)">
<bygroups>
<token type="Text"/>
<token type="CommentPreproc"/>
<using lexer="Python"/>
<token type="Other"/>
</bygroups>
</rule>
<rule pattern="(\s*)(##[^\n]*)(\n|\Z)">
<bygroups>
<token type="Text"/>
<token type="CommentPreproc"/>
<token type="Other"/>
</bygroups>
</rule>
<rule pattern="(?s)&lt;%doc&gt;.*?&lt;/%doc&gt;">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(&lt;%)([\w.:]+)">
<bygroups>
<token type="CommentPreproc"/>
<token type="NameBuiltin"/>
</bygroups>
<push state="tag"/>
</rule>
<rule pattern="(&lt;/%)([\w.:]+)(&gt;)">
<bygroups>
<token type="CommentPreproc"/>
<token type="NameBuiltin"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="&lt;%(?=([\w.:]+))">
<token type="CommentPreproc"/>
<push state="ondeftags"/>
</rule>
<rule pattern="(&lt;%(?:!?))(.*?)(%&gt;)(?s)">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="Python"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(\$\{)(.*?)(\})">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="Python"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(?sx)&#xA; (.+?) # anything, followed by:&#xA; (?:&#xA; (?&lt;=\n)(?=%|\#\#) | # an eval or comment line&#xA; (?=\#\*) | # multiline comment&#xA; (?=&lt;/?%) | # a python block&#xA; # call start or end&#xA; (?=\$\{) | # a substitution&#xA; (?&lt;=\n)(?=\s*%) |&#xA; # - don&#39;t consume&#xA; (\\\n) | # an escaped newline&#xA; \Z # end of string&#xA; )&#xA; ">
<bygroups>
<token type="Other"/>
<token type="Operator"/>
</bygroups>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
<state name="ondeftags">
<rule pattern="&lt;%">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(?&lt;=&lt;%)(include|inherit|namespace|page)">
<token type="NameBuiltin"/>
</rule>
<rule>
<include state="tag"/>
</rule>
</state>
<state name="tag">
<rule pattern="((?:\w+)\s*=)(\s*)(&#34;.*?&#34;)">
<bygroups>
<token type="NameAttribute"/>
<token type="Text"/>
<token type="LiteralString"/>
</bygroups>
</rule>
<rule pattern="/?\s*&gt;">
<token type="CommentPreproc"/>
<pop depth="1"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
<state name="attr">
<rule pattern="&#34;.*?&#34;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="&#39;.*?&#39;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
<rule pattern="[^\s&gt;]+">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,89 @@
<lexer>
<config>
<name>Mason</name>
<alias>mason</alias>
<filename>*.m</filename>
<filename>*.mhtml</filename>
<filename>*.mc</filename>
<filename>*.mi</filename>
<filename>autohandler</filename>
<filename>dhandler</filename>
<mime_type>application/x-mason</mime_type>
<priority>0.1</priority>
</config>
<rules>
<state name="root">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="(&lt;%doc&gt;)(.*?)(&lt;/%doc&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="CommentMultiline"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;%(?:def|method))(\s*)(.*?)(&gt;)(.*?)(&lt;/%\2\s*&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="Text"/>
<token type="NameFunction"/>
<token type="NameTag"/>
<usingself state="root"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;%\w+)(.*?)(&gt;)(.*?)(&lt;/%\2\s*&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<token type="NameTag"/>
<using lexer="Perl"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;&amp;[^|])(.*?)(,.*?)?(&amp;&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<using lexer="Perl"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;&amp;\|)(.*?)(,.*?)?(&amp;&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<using lexer="Perl"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="&lt;/&amp;&gt;">
<token type="NameTag"/>
</rule>
<rule pattern="(&lt;%!?)(.*?)(%&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<using lexer="Perl"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(?&lt;=^)#[^\n]*(\n|\Z)">
<token type="Comment"/>
</rule>
<rule pattern="(?&lt;=^)(%)([^\n]*)(\n|\Z)">
<bygroups>
<token type="NameTag"/>
<using lexer="Perl"/>
<token type="Other"/>
</bygroups>
</rule>
<rule pattern="(?sx)&#xA; (.+?) # anything, followed by:&#xA; (?:&#xA; (?&lt;=\n)(?=[%#]) | # an eval or comment line&#xA; (?=&lt;/?[%&amp;]) | # a substitution or block or&#xA; # call start or end&#xA; # - don&#39;t consume&#xA; (\\\n) | # an escaped newline&#xA; \Z # end of string&#xA; )">
<bygroups>
<using lexer="HTML"/>
<token type="Operator"/>
</bygroups>
</rule>
</state>
</rules>
</lexer>
@@ -4,10 +4,14 @@
<alias>mathematica</alias>
<alias>mma</alias>
<alias>nb</alias>
<filename>*.nb</filename>
<filename>*.cdf</filename>
<filename>*.nbp</filename>
<filename>*.m</filename>
<filename>*.ma</filename>
<filename>*.mt</filename>
<filename>*.mx</filename>
<filename>*.nb</filename>
<filename>*.nbp</filename>
<filename>*.wl</filename>
<mime_type>application/mathematica</mime_type>
<mime_type>application/vnd.wolfram.mathematica</mime_type>
<mime_type>application/vnd.wolfram.mathematica.package</mime_type>
@@ -0,0 +1,77 @@
<lexer>
<config>
<name>Myghty</name>
<alias>myghty</alias>
<filename>*.myt</filename>
<filename>autodelegate</filename>
<mime_type>application/x-myghty</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="(&lt;%(?:def|method))(\s*)(.*?)(&gt;)(.*?)(&lt;/%\2\s*&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="Text"/>
<token type="NameFunction"/>
<token type="NameTag"/>
<usingself state="root"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;%\w+)(.*?)(&gt;)(.*?)(&lt;/%\2\s*&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<token type="NameTag"/>
<using lexer="Python2"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;&amp;[^|])(.*?)(,.*?)?(&amp;&gt;)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<using lexer="Python2"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(&lt;&amp;\|)(.*?)(,.*?)?(&amp;&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<token type="NameFunction"/>
<using lexer="Python2"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="&lt;/&amp;&gt;">
<token type="NameTag"/>
</rule>
<rule pattern="(&lt;%!?)(.*?)(%&gt;)(?s)">
<bygroups>
<token type="NameTag"/>
<using lexer="Python2"/>
<token type="NameTag"/>
</bygroups>
</rule>
<rule pattern="(?&lt;=^)#[^\n]*(\n|\Z)">
<token type="Comment"/>
</rule>
<rule pattern="(?&lt;=^)(%)([^\n]*)(\n|\Z)">
<bygroups>
<token type="NameTag"/>
<using lexer="Python2"/>
<token type="Other"/>
</bygroups>
</rule>
<rule pattern="(?sx)&#xA; (.+?) # anything, followed by:&#xA; (?:&#xA; (?&lt;=\n)(?=[%#]) | # an eval or comment line&#xA; (?=&lt;/?[%&amp;]) | # a substitution or block or&#xA; # call start or end&#xA; # - don&#39;t consume&#xA; (\\\n) | # an escaped newline&#xA; \Z # end of string&#xA; )">
<bygroups>
<token type="Other"/>
<token type="Operator"/>
</bygroups>
</rule>
</state>
</rules>
</lexer>
@@ -4,8 +4,10 @@
<alias>nasm</alias>
<filename>*.asm</filename>
<filename>*.ASM</filename>
<filename>*.nasm</filename>
<mime_type>text/x-nasm</mime_type>
<case_insensitive>true</case_insensitive>
<priority>1.0</priority> <!-- TASM uses the same file endings, but TASM is not as common as NASM, so we prioritize NASM higher by default. -->
</config>
<rules>
<state name="punctuation">
@@ -132,6 +132,10 @@
<rule pattern="\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;">
<token type="Punctuation"/>
</rule>
<rule pattern="(?:[\w]+)&#34;&#34;&#34;">
<token type="LiteralString"/>
<push state="tdqs"/>
</rule>
<rule pattern="(?:[\w]+)&#34;">
<token type="LiteralString"/>
<push state="rdqs"/>
@@ -0,0 +1,145 @@
<lexer>
<config>
<name>ObjectPascal</name>
<alias>objectpascal</alias>
<filename>*.pas</filename>
<filename>*.pp</filename>
<filename>*.inc</filename>
<filename>*.dpr</filename>
<filename>*.dpk</filename>
<filename>*.lpr</filename>
<filename>*.lpk</filename>
<mime_type>text/x-pascal</mime_type>
</config>
<rules>
<state name="root">
<!-- TextWhitespace -->
<rule pattern="[^\S\n]+">
<token type="TextWhitespace" />
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<!-- Magic Number (BOM) -->
<rule pattern="[^\u0000-\u007F]+">
<token type="Text"/>
</rule>
<!-- Compiler Directive -->
<rule pattern="\{[$].*?\}|\{[-](NOD|EXT|OBJ).*?\}|\([*][$].*?[*]\)">
<token type="CommentPreproc" />
</rule>
<!-- Comment Single -->
<rule pattern="(//.*?)(\n)">
<bygroups>
<token type="CommentSingle" />
<token type="TextWhitespace" />
</bygroups>
</rule>
<!-- Comment Multiline Block -->
<rule pattern="\([*](.|\n)*?[*]\)">
<token type="CommentMultiline"/>
</rule>
<!-- Comment Multiline Source Documentation -->
<rule pattern="[{](.|\n)*?[}]">
<token type="CommentMultiline"/>
</rule>
<!-- Range Indicator -->
<rule pattern="(?i:(\.\.))">
<token type="Operator" />
</rule>
<!-- Control Character -->
<rule pattern="[\#][0-9a-fA-F]*|[0-9]+[xX][0-9a-fA-F]*">
<token type="LiteralStringEscape" />
</rule>
<!-- Numbers -->
<rule pattern="[\$][0-9a-fA-F]*[xX][0-9a-fA-F]*|[\$][0-9a-fA-F]*|([0-9]+[0-9a-fA-F]+(?=[hH]))">
<token type="LiteralNumberHex" />
</rule>
<rule pattern="[0-9]+(\&#39;[0-9]+)*\.[0-9]+(\&#39;[0-9]+)*[eE][+-]?[0-9]+(\&#39;[0-9]+)*|[0-9]+(\&#39;[0-9]+)*\.[0-9]+(\&#39;[0-9]+)*|\d+[eE][+-]?[0-9]+">
<token type="LiteralNumberFloat" />
</rule>
<rule pattern="0|[1-9][0-9_]*?">
<token type="LiteralNumberInteger" />
</rule>
<!-- Multiline string Literal -->
<rule pattern="(&#39;&#39;&#39;\s*\n)(.|\n)*?(&#39;&#39;&#39;)(?=\s*&#59;)">
<token type="LiteralString" />
</rule>
<!-- string -->
<rule pattern="(?i:(\')).*?(?i:(\'))">
<token type="LiteralString" />
</rule>
<!-- string (Special case for Delphi Assembler)-->
<rule pattern="(?i:(&#34;)).*?(?i:(&#34;))">
<token type="LiteralString" />
</rule>
<!-- Simple Types -->
<rule pattern="\b(?!=\.)(?i:(NativeInt|NativeUInt|LongInt|LongWord|Integer|Int64|Cardinal|UInt64|ShortInt|SmallInt|FixedInt|Byte|Word|FixedUInt|Int8|Int16|Int32|UInt8|UInt16|UInt32|Real48|Single|Double|Real|Extended|Comp|Currency|Char|AnsiChar|WideChar|UCS2Char|UCS4Char|string|ShortString|AnsiString|UnicodeString|WideString|RawByteString|UTF8String|File|TextFile|Text|Boolean|ByteBool|WordBool|LongBool|Pointer|Variant|OleVariant))\b(?![&#60;\/(])">
<token type="KeywordType" />
</rule>
<!-- T Types -->
<rule pattern="\b(?!=\.)(?i:(TSingleRec|TDoubleRec|TExtended80Rec|TByteArray|TTextBuf|TVarRec|TWordArray))\b(?![&#60;\/(])">
<token type="KeywordType" />
</rule>
<!-- Pointer Types -->
<rule pattern="\b(?!=\.)(?i:(PChar|PAnsiChar|PWideChar|PRawByteString|PUnicodeString|PString|PAnsiString|PShortString|PTextBuf|PWideString|PByte|PShortInt|PWord|PSmallInt|PCardinal|PLongWord|PFixedUInt|PLongint|PFixedInt|PUInt64|PInt64|PNativeUInt|PNativeInt|PByteArray|PCurrency|PDouble|PExtended|PSingle|PInteger|POleVariant|PVarRec|PVariant|PWordArray|PBoolean|PWordBool|PLongBool|PPointer))\b(?![&#60;\/(])">
<token type="KeywordType" />
</rule>
<!-- More Types -->
<rule pattern="\b(?!=\.)(?i:(IntPtr|UIntPtr|Float32|Float64|_ShortStr|_ShortString|_AnsiStr|_AnsiString|_AnsiChr|_AnsiChar|_WideStr|_WideString|_PAnsiChr|_PAnsiChar|UTF8Char|_AnsiChar|PUTF8Char|_PAnsiChar|MarshaledString|MarshaledAString))\b(?![&#60;\/(])">
<token type="KeywordType" />
</rule>
<!-- Result -->
<rule pattern="\b(?!=\.)(?i:(Result))\b(?![&#60;\/(])">
<token type="GenericEmph" />
</rule>
<!-- Result Constants -->
<rule pattern="\b(?!=\.)(?i:(True|False))\b(?![&#60;\/(])">
<token type="NameConstant" />
</rule>
<!-- Operator (Assign) -->
<rule pattern="[(\:\=)]">
<token type="Operator" />
</rule>
<!-- Operators (Arithmetic, Unary Arithmetic, String, Pointer, Set, Relational, Address) -->
<rule pattern="[\+\-\*\/\^&#60;&#62;\=\@]">
<token type="Operator" />
</rule>
<!-- Operators (Arithmetic, Boolean, Logical (Bitwise), Set) -->
<rule pattern="\b(?i:([div][mod][not][and][or][xor][shl][shr][in]))\b">
<token type="OperatorWord" />
</rule>
<!-- Special Symbols (Escape, Literal Chr, Hex Value, Binary Numeral Expression Indicator) -->
<rule pattern="[&#38;\#\$\%]">
<token type="Operator" />
</rule>
<!-- Special Symbols (Punctuation) -->
<rule pattern="[\(\)\,\.\:\;\[\]]">
<token type="Punctuation" />
</rule>
<!-- Reserved Words -->
<rule pattern="\b(?!=\.)(?i:(and|end|interface|record|var|array|except|is|repeat|while|as|exports|label|resourcestring|with|asm|file|library|set|xor|begin|finalization|mod|shl|case|finally|nil|shr|class|for|not|string|const|function|object|then|constructor|goto|of|threadvar|destructor|if|or|to|dispinterface|implementation|packed|try|div|in|procedure|type|do|inherited|program|unit|downto|initialization|property|until|else|inline|raise|uses))\b(?![&#60;\/(])">
<token type="KeywordReserved" />
</rule>
<!-- Directives -->
<rule pattern="\b(?!=\.)(?i:(absolute|export|name|public|stdcall|abstract|external|published|strict|assembler|nodefault|read|stored|automated|final|operator|readonly|unsafe|cdecl|forward|out|reference|varargs|contains|helper|overload|register|virtual|default|implements|override|reintroduce|winapi|delayed|index|package|requires|write|deprecated|inline|pascal|writeonly|dispid|library|platform|safecall|dynamic|local|private|sealed|experimental|message|protected|static))\b(?![&#60;\/(])">
<token type="Keyword" />
</rule>
<!-- Directives obsolete -->
<rule pattern="\b(?!=\.)(?i:(near|far|resident))\b(?![&#60;\/(])">
<token type="Keyword" />
</rule>
<!-- Constant Expressions -->
<rule pattern="\b(?!=\.)(?i:(Abs|High|Low|Pred|Succ|Chr|Length|Odd|Round|Swap|Hi|Lo|Ord|SizeOf|Trunc))\b(?![&#60;\/(])">
<token type="KeywordConstant" />
</rule>
<!-- everything else -->
<rule pattern="([^\W\d]|\$)[\w$]*">
<token type="Text" />
</rule>
</state>
</rules>
</lexer>
+113
View File
@@ -0,0 +1,113 @@
<lexer>
<config>
<name>Odin</name>
<alias>odin</alias>
<filename>*.odin</filename>
<mime_type>text/odin</mime_type>
</config>
<rules>
<state name="NestedComment">
<rule pattern = "/[*]">
<token type = "CommentMultiline"/>
<push/>
</rule>
<rule pattern = "[*]/">
<token type = "CommentMultiline"/>
<pop depth = "1"/>
</rule>
<rule pattern = "[\s\S]">
<token type = "CommentMultiline"/>
</rule>
</state>
<state name="root">
<rule pattern = "\n">
<token type = "TextWhitespace"/>
</rule>
<rule pattern = "\s+">
<token type = "TextWhitespace"/>
</rule>
<rule pattern = "//.*?\n">
<token type = "CommentSingle"/>
</rule>
<rule pattern = "/[*]">
<token type = "CommentMultiline"/>
<push state="NestedComment"/>
</rule>
<rule pattern = "(import|package)\b">
<token type = "KeywordNamespace"/>
</rule>
<rule pattern = "(proc|struct|map|enum|union)\b">
<token type = "KeywordDeclaration"/>
</rule>
<rule pattern = "(asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where|panic|real|imag|len|cap|append|copy|delete|new|make|clearpanic|real|imag|len|cap|append|copy|delete|new|make|clear)\b">
<token type = "Keyword"/>
</rule>
<rule pattern = "(true|false|nil)\b">
<token type = "KeywordConstant"/>
</rule>
<rule pattern = "(uint|u8|u16|u32|u64|int|i8|i16|i32|i64|i16le|i32le|i64le|i128le|u16le|u32le|u64le|u128le|i16be|i32be|i64be|i128be|u16be|u32be|u64be|u128be|f16|f32|f64|complex32|complex64|complex128|quaternion64|quaternion128|quaternion256|byte|rune|string|cstring|typeid|any|bool|b8|b16|b32|b64|uintptr|rawptr)\b">
<token type = "KeywordType"/>
</rule>
<rule pattern = "\#[a-zA-Z_]+\b">
<token type = "NameDecorator"/>
</rule>
<rule pattern = "\@(\([a-zA-Z_]+\b\s*.*\)|\(?[a-zA-Z_]+\)?)">
<token type = "NameAttribute"/>
</rule>
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
</rule>
<rule pattern="([a-zA-Z_]\w*)(\s*)(\()">
<token type="NameFunction"/>
</rule>
<rule pattern="[^\W\d]\w*">
<token type="NameOther"/>
</rule>
<rule pattern = "\d+i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+\.\d*([Ee][-+]\d+)?i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\.\d+([Ee][-+]\d+)?i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+[Ee][-+]\d+i">
<token type = "LiteralNumber"/>
</rule>
<rule pattern = "\d+(\.\d+[eE][+\-]?\d+|\.\d*|[eE][+\-]?\d+)">
<token type = "LiteralNumberFloat"/>
</rule>
<rule pattern = "\.\d+([eE][+\-]?\d+)?">
<token type = "LiteralNumberFloat"/>
</rule>
<rule pattern = "0o[0-7]+">
<token type = "LiteralNumberOct"/>
</rule>
<rule pattern = "0x[0-9a-fA-F_]+">
<token type = "LiteralNumberHex"/>
</rule>
<rule pattern = "0b[01_]+">
<token type = "LiteralNumberBin"/>
</rule>
<rule pattern = "(0|[1-9][0-9_]*)">
<token type = "LiteralNumberInteger"/>
</rule>
<rule pattern = "'(\\['&quot;\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'" >
<token type = "LiteralStringChar"/>
</rule>
<rule pattern = "(`)([^`]*)(`)" >
<token type = "LiteralString"/>
</rule>
<rule pattern = "&quot;(\\\\|\\&quot;|[^&quot;])*&quot;" >
<token type = "LiteralString"/>
</rule>
<rule pattern = "(&lt;&lt;=|&gt;&gt;=|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|&amp;=|&amp;|\+=|-=|\*=|/=|%=|\||\^|=|&amp;&amp;|\|\||--|-&gt;|=|==|!=|:=|:|::|\.\.\&lt;|\.\.=|[&lt;&gt;+\-*/%&amp;])" >
<token type = "Operator"/>
</rule>
<rule pattern="[{}()\[\],.;]">
<token type="Punctuation"/>
</rule>
</state>
</rules>
</lexer>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,329 @@
<lexer>
<config>
<name>Org Mode</name>
<alias>org</alias>
<alias>orgmode</alias>
<filename>*.org</filename>
<mime_type>text/org</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="^# .*$">
<token type="Comment"/>
</rule>
<rule pattern="^(\*)( COMMENT)( .*)$">
<bygroups>
<token type="GenericHeading"/>
<token type="NameEntity"/>
<token type="GenericStrong"/>
</bygroups>
</rule>
<rule pattern="^(\*\*+)( COMMENT)( .*)$">
<bygroups>
<token type="GenericSubheading"/>
<token type="NameEntity"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^(\*)( DONE)( .*)$">
<bygroups>
<token type="GenericHeading"/>
<token type="LiteralStringRegex"/>
<token type="GenericStrong"/>
</bygroups>
</rule>
<rule pattern="^(\*\*+)( DONE)( .*)$">
<bygroups>
<token type="GenericSubheading"/>
<token type="LiteralStringRegex"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^(\*)( TODO)( .*)$">
<bygroups>
<token type="GenericHeading"/>
<token type="Error"/>
<token type="GenericStrong"/>
</bygroups>
</rule>
<rule pattern="^(\*\*+)( TODO)( .*)$">
<bygroups>
<token type="GenericSubheading"/>
<token type="Error"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^(\*)( .+?)( :[a-zA-Z0-9_@:]+:)$">
<bygroups>
<token type="GenericHeading"/>
<token type="GenericStrong"/>
<token type="GenericEmph"/>
</bygroups>
</rule>
<rule pattern="^(\*)( .+)$">
<bygroups>
<token type="GenericHeading"/>
<token type="GenericStrong"/>
</bygroups>
</rule>
<rule pattern="^(\*\*+)( .+?)( :[a-zA-Z0-9_@:]+:)$">
<bygroups>
<token type="GenericSubheading"/>
<token type="Text"/>
<token type="GenericEmph"/>
</bygroups>
</rule>
<rule pattern="^(\*\*+)( .+)$">
<bygroups>
<token type="GenericSubheading"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^( *)([+-] )(\[[ X]\])( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( +)(\* )(\[[ X]\])( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( *)([+-] )([^ \n]+ ::)( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( +)(\* )([^ \n]+ ::)( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( *)([+-] )(.+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( +)(\* )(.+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( *)([0-9]+[.)])( \[@[0-9]+\])( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<token type="GenericEmph"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="^( *)([0-9]+[.)])( .+)$">
<bygroups>
<token type="Text"/>
<token type="Keyword"/>
<usingself state="inline"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *#\+begin: )([^ ]+)([\w\W]*?\n)([\w\W]*?)(^ *#\+end: *$)">
<bygroups>
<token type="Comment"/>
<token type="CommentSpecial"/>
<token type="Comment"/>
<usingself state="inline"/>
<token type="Comment"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *#\+begin_comment *\n)([\w\W]*?)(^ *#\+end_comment *$)">
<bygroups>
<token type="Comment"/>
<token type="Comment"/>
<token type="Comment"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *#\+begin_src )([^ \n]+)(.*?\n)([\w\W]*?)(^ *#\+end_src *$)">
<usingbygroup>
<sublexer_name_group>2</sublexer_name_group>
<code_group>4</code_group>
<emitters>
<token type="Comment"/>
<token type="CommentSpecial"/>
<token type="Comment"/>
<token type="Text"/>
<token type="Comment"/>
</emitters>
</usingbygroup>
</rule>
<rule pattern="(?i)^( *#\+begin_export )(\w+)( *\n)([\w\W]*?)(^ *#\+end_export *$)">
<usingbygroup>
<sublexer_name_group>2</sublexer_name_group>
<code_group>4</code_group>
<emitters>
<token type="Comment"/>
<token type="CommentSpecial"/>
<token type="Text"/>
<token type="Text"/>
<token type="Comment"/>
</emitters>
</usingbygroup>
</rule>
<rule pattern="(?i)^( *#\+begin_)(\w+)( *\n)([\w\W]*?)(^ *#\+end_\2)( *$)">
<bygroups>
<token type="Comment"/>
<token type="Comment"/>
<token type="Text"/>
<token type="Text"/>
<token type="Comment"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^(#\+\w+)(:.*)$">
<bygroups>
<token type="CommentSpecial"/>
<token type="Comment"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *:\w+: *\n)([\w\W]*?)(^ *:end: *$)">
<bygroups>
<token type="Comment"/>
<token type="CommentSpecial"/>
<token type="Comment"/>
</bygroups>
</rule>
<rule pattern="^(.*)(\\\\)$">
<bygroups>
<usingself state="inline"/>
<token type="Operator"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *(?:DEADLINE|SCHEDULED): )(&lt;[^&lt;&gt;]+?&gt; *)$">
<bygroups>
<token type="Comment"/>
<token type="CommentSpecial"/>
</bygroups>
</rule>
<rule pattern="(?i)^( *CLOSED: )(\[[^][]+?\] *)$">
<bygroups>
<token type="Comment"/>
<token type="CommentSpecial"/>
</bygroups>
</rule>
<rule>
<include state="inline"/>
</rule>
</state>
<state name="inline">
<rule pattern="(\s)*(\*[^ \n*][^*]+?[^ \n*]\*)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericStrong"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(/[^/]+?/)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericEmph"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(=[^\n=]+?=)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="NameClass"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(~[^\n~]+?~)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="NameClass"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(\+[^+]+?\+)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericDeleted"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(_[^_]+?_)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericUnderline"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(&lt;)([^&lt;&gt;]+?)(&gt;)">
<bygroups>
<token type="Text"/>
<token type="LiteralString"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="[{]{3}[^}]+[}]{3}">
<token type="NameBuiltin"/>
</rule>
<rule pattern="([^[])(\[fn:)([^]]+?)(\])([^]])">
<bygroups>
<token type="Text"/>
<token type="NameBuiltinPseudo"/>
<token type="LiteralString"/>
<token type="NameBuiltinPseudo"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\[\[)([^][]+?)(\]\[)([^][]+)(\]\])">
<bygroups>
<token type="Text"/>
<token type="NameAttribute"/>
<token type="Text"/>
<token type="NameTag"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\[\[)([^][]+?)(\]\])">
<bygroups>
<token type="Text"/>
<token type="NameAttribute"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(&lt;&lt;)([^&lt;&gt;]+?)(&gt;&gt;)">
<bygroups>
<token type="Text"/>
<token type="NameAttribute"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^( *)(\|[ -].*?[ -]\|)$">
<bygroups>
<token type="Text"/>
<token type="LiteralString"/>
</bygroups>
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern=".">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,21 @@
<lexer>
<config>
<name>plaintext</name>
<alias>text</alias>
<alias>plain</alias>
<alias>no-highlight</alias>
<filename>*.txt</filename>
<mime_type>text/plain</mime_type>
<priority>-1</priority>
</config>
<rules>
<state name="root">
<rule pattern=".+">
<token type="Text"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,155 @@
<lexer>
<config>
<name>PostgreSQL SQL dialect</name>
<alias>postgresql</alias>
<alias>postgres</alias>
<mime_type>text/x-postgresql</mime_type>
<case_insensitive>true</case_insensitive>
<not_multiline>true</not_multiline>
</config>
<rules>
<state name="root">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="--.*\n?">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*">
<token type="CommentMultiline"/>
<push state="multiline-comments"/>
</rule>
<rule pattern="(bigint|bigserial|bit|bit\s+varying|bool|boolean|box|bytea|char|character|character\s+varying|cidr|circle|date|decimal|double\s+precision|float4|float8|inet|int|int2|int4|int8|integer|interval|json|jsonb|line|lseg|macaddr|money|numeric|path|pg_lsn|point|polygon|real|serial|serial2|serial4|serial8|smallint|smallserial|text|time|timestamp|timestamptz|timetz|tsquery|tsvector|txid_snapshot|uuid|varbit|varchar|with\s+time\s+zone|without\s+time\s+zone|xml|anyarray|anyelement|anyenum|anynonarray|anyrange|cstring|fdw_handler|internal|language_handler|opaque|record|void)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(?s)(DO)(\s+)(?:(LANGUAGE)?(\s+)(&#39;?)(\w+)?(&#39;?)(\s+))?(\$)([^$]*)(\$)(.*?)(\$)(\10)(\$)">
<usingbygroup>
<sublexer_name_group>6</sublexer_name_group>
<code_group>12</code_group>
<emitters>
<token type="Keyword"/>
<token type="Text"/>
<token type="Keyword"/>
<token type="Text"/>
<token type="LiteralStringSingle"/>
<token type="LiteralStringSingle"/>
<token type="LiteralStringSingle"/>
<token type="Text"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
</emitters>
</usingbygroup>
</rule>
<rule pattern="(CURRENT_TIMESTAMP|CHARACTERISTICS|CURRENT_CATALOG|CURRENT_SCHEMA|LOCALTIMESTAMP|CONFIGURATION|AUTHORIZATION|XMLATTRIBUTES|MATERIALIZED|SERIALIZABLE|CURRENT_DATE|XMLSERIALIZE|SESSION_USER|CURRENT_ROLE|CURRENT_USER|CONCURRENTLY|CURRENT_TIME|UNENCRYPTED|UNCOMMITTED|TRANSACTION|INSENSITIVE|CONSTRAINTS|ASSIGNMENT|ASYMMETRIC|DEALLOCATE|ORDINALITY|PRIVILEGES|DEFERRABLE|PROCEDURAL|CONVERSION|REFERENCES|WHITESPACE|TABLESPACE|CONSTRAINT|CONNECTION|STATISTICS|DELIMITERS|STANDALONE|DICTIONARY|REPEATABLE|CHECKPOINT|XMLELEMENT|LC_COLLATE|SYMMETRIC|PARTITION|SEQUENCES|FUNCTIONS|IMMEDIATE|IMMUTABLE|SAVEPOINT|EXTENSION|INCLUDING|RETURNING|COLLATION|INCREMENT|EXCLUSIVE|EXCLUDING|INITIALLY|COMMITTED|INTERSECT|STATEMENT|SUBSTRING|FOLLOWING|ISOLATION|TEMPORARY|ENCRYPTED|TIMESTAMP|RECURSIVE|LEAKPROOF|PROCEDURE|LOCALTIME|XMLFOREST|XMLEXISTS|AGGREGATE|ATTRIBUTE|UNBOUNDED|ASSERTION|XMLCONCAT|DELIMITER|CHARACTER|VALIDATOR|PRECISION|PRECEDING|LC_CTYPE|SECURITY|PREPARED|PASSWORD|VALIDATE|OVERLAPS|VARIADIC|DEFAULTS|VOLATILE|DEFERRED|OPERATOR|NATIONAL|UNLOGGED|UNLISTEN|TRAILING|BACKWARD|MAXVALUE|PRESERVE|DISTINCT|LOCATION|DOCUMENT|TRUNCATE|MINVALUE|POSITION|ABSOLUTE|XMLPARSE|LANGUAGE|ENCODING|CONTINUE|TEMPLATE|INTERVAL|CASCADED|DATABASE|RELATIVE|INHERITS|COMMENTS|SNAPSHOT|RESTRICT|COALESCE|IMPLICIT|ROLLBACK|EXTERNAL|REASSIGN|SMALLINT|IDENTITY|GREATEST|SEQUENCE|FUNCTION|DISCARD|CASCADE|DECIMAL|XMLROOT|FOREIGN|FORWARD|PARTIAL|PLACING|WRAPPER|WITHOUT|OVERLAY|DECLARE|PREPARE|GRANTED|CURRENT|DEFAULT|HANDLER|PRIMARY|OPTIONS|VERSION|VERBOSE|DEFINER|VARYING|ANALYSE|VARCHAR|EXTRACT|EXPLAIN|PROGRAM|RECHECK|EXECUTE|ANALYZE|INDEXES|INHERIT|EXCLUDE|CONTENT|REFRESH|REINDEX|NUMERIC|UNKNOWN|RELEASE|NOTNULL|INSTEAD|TRUSTED|INTEGER|NOTHING|COMMENT|TRIGGER|INVOKER|BETWEEN|REPLACE|REPLICA|RESTART|BOOLEAN|NATURAL|COLLATE|RETURNS|CLUSTER|LATERAL|STORAGE|DISABLE|LEADING|MAPPING|PASSING|SESSION|CATALOG|SIMILAR|SIMPLE|LISTEN|STABLE|SERVER|DOUBLE|DOMAIN|SELECT|SECOND|CALLED|SEARCH|SCROLL|STDOUT|MINUTE|SCHEMA|STRICT|REVOKE|SYSTEM|ENABLE|COLUMN|DELETE|TABLES|BINARY|BIGINT|ISNULL|BEFORE|RENAME|ESCAPE|NOTIFY|INSERT|NOWAIT|UNIQUE|NULLIF|COMMIT|UPDATE|OBJECT|VACUUM|INLINE|OFFSET|EXCEPT|EXISTS|VALUES|FAMILY|OPTION|HEADER|CREATE|HAVING|ALWAYS|WINDOW|CURSOR|WITHIN|GLOBAL|FILTER|POLICY|ACTION|PARSER|FREEZE|ACCESS|LOCAL|LEAST|OWNER|PLANS|OWNED|FORCE|XMLPI|CYCLE|ADMIN|OUTER|AFTER|ORDER|PRIOR|WRITE|CROSS|FIRST|GRANT|QUOTE|RANGE|FETCH|ALTER|WHERE|GROUP|VIEWS|ILIKE|FALSE|VALUE|INDEX|NULLS|VALID|INNER|USING|INOUT|UNTIL|RESET|NCHAR|NAMES|ARRAY|INPUT|MONTH|RIGHT|EVENT|UNION|TYPES|TREAT|BEGIN|CLOSE|LABEL|ABORT|MATCH|TABLE|CLASS|LARGE|CHECK|SYSID|CHAIN|FLOAT|STRIP|LIMIT|STDIN|SETOF|SHARE|CACHE|START|LEVEL|NAME|MOVE|SOME|LEFT|CAST|LIKE|DROP|SHOW|ZONE|EACH|ELSE|LAST|LOAD|YEAR|BOTH|CHAR|DATA|LOCK|DESC|FROM|TEMP|OVER|JOIN|TEXT|THEN|TIME|ALSO|FULL|WORK|RULE|ROWS|INTO|TRIM|TRUE|ENUM|ONLY|TYPE|WITH|READ|REAL|COST|MODE|ROLE|CASE|WHEN|COPY|NEXT|VIEW|USER|NONE|HOLD|NULL|HOUR|OIDS|BIT|ADD|SET|YES|FOR|AND|NOT|DAY|ANY|KEY|DEC|END|ASC|OFF|ROW|INT|REF|OUT|ALL|CSV|XML|ON|AT|NO|TO|AS|IN|DO|IS|IF|BY|OR|OF)\b">
<token type="Keyword"/>
</rule>
<rule pattern="[+*/&lt;&gt;=~!@#%^&amp;|`?-]+">
<token type="Operator"/>
</rule>
<rule pattern="::">
<token type="Operator"/>
</rule>
<rule pattern="\$\d+">
<token type="NameVariable"/>
</rule>
<rule pattern="([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="((?:E|U&amp;)?)(&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<push state="string"/>
</rule>
<rule pattern="((?:U&amp;)?)(&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringName"/>
</bygroups>
<push state="quoted-ident"/>
</rule>
<rule pattern="(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)(\s+)(LANGUAGE)?(\s+)(&#39;?)(\w+)?(&#39;?)">
<usingbygroup>
<sublexer_name_group>12</sublexer_name_group>
<code_group>4</code_group>
<emitters>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="LiteralStringHeredoc"/>
<token type="Text"/>
<token type="Keyword"/>
<token type="Text"/>
<token type="LiteralStringSingle"/>
<token type="LiteralStringSingle"/>
<token type="LiteralStringSingle"/>
</emitters>
</usingbygroup>
</rule>
<rule pattern="(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)">
<token type="LiteralStringHeredoc"/>
</rule>
<rule pattern="[a-z_]\w*">
<token type="Name"/>
</rule>
<rule pattern=":([&#39;&#34;]?)[a-z]\w*\b\1">
<token type="NameVariable"/>
</rule>
<rule pattern="[;:()\[\]{},.]">
<token type="Punctuation"/>
</rule>
</state>
<state name="multiline-comments">
<rule pattern="/\*">
<token type="CommentMultiline"/>
<push state="multiline-comments"/>
</rule>
<rule pattern="\*/">
<token type="CommentMultiline"/>
<pop depth="1"/>
</rule>
<rule pattern="[^/*]+">
<token type="CommentMultiline"/>
</rule>
<rule pattern="[/*]">
<token type="CommentMultiline"/>
</rule>
</state>
<state name="string">
<rule pattern="[^&#39;]+">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="&#39;&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
</state>
<state name="quoted-ident">
<rule pattern="[^&#34;]+">
<token type="LiteralStringName"/>
</rule>
<rule pattern="&#34;&#34;">
<token type="LiteralStringName"/>
</rule>
<rule pattern="&#34;">
<token type="LiteralStringName"/>
<pop depth="1"/>
</rule>
</state>
</rules>
</lexer>
@@ -6,6 +6,33 @@
<filename>*.proto</filename>
</config>
<rules>
<state name="package">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameNamespace"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="message">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameClass"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="type">
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern="[ \t]+">
<token type="Text"/>
@@ -87,32 +114,5 @@
<token type="Name"/>
</rule>
</state>
<state name="package">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameNamespace"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="message">
<rule pattern="[a-zA-Z_]\w*">
<token type="NameClass"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="type">
<rule pattern="[a-zA-Z_]\w*">
<token type="Name"/>
<pop depth="1"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
</rules>
</lexer>
+161
View File
@@ -0,0 +1,161 @@
<lexer>
<config>
<name>PRQL</name>
<alias>prql</alias>
<filename>*.prql</filename>
<mime_type>application/prql</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="#!.*"><token type="LiteralStringDoc"/></rule>
<rule pattern="#.*"><token type="CommentSingle"/></rule>
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
<rule pattern="^(\s*)(module)(\s*)"><bygroups><token type="TextWhitespace"/><token type="KeywordNamespace"/><token type="TextWhitespace"/></bygroups><push state="imports"/></rule>
<rule pattern="(bool|int|int8|int16|int32|int64|int128|float|text|set)\b"><token type="KeywordType"/></rule>
<rule pattern="^prql "><token type="KeywordReserved"/></rule>
<rule pattern="let"><token type="KeywordDeclaration"/></rule>
<rule><include state="keywords"/></rule>
<rule><include state="expr"/></rule>
<rule pattern="^[A-Za-z_][a-zA-Z0-9_]*"><token type="Keyword"/></rule>
</state>
<state name="expr">
<rule pattern="(f)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="tdqf"/></rule>
<rule pattern="(f)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="tsqf"/></rule>
<rule pattern="(f)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="fstringescape" state="dqf"/></rule>
<rule pattern="(f)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="fstringescape" state="sqf"/></rule>
<rule pattern="(s)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="tdqf"/></rule>
<rule pattern="(s)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="tsqf"/></rule>
<rule pattern="(s)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><combined state="stringescape" state="dqf"/></rule>
<rule pattern="(s)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><combined state="stringescape" state="sqf"/></rule>
<rule pattern="(?i)(r)(&quot;&quot;&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="tdqs"/></rule>
<rule pattern="(?i)(r)(&#x27;&#x27;&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="tsqs"/></rule>
<rule pattern="(?i)(r)(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringDouble"/></bygroups><push state="dqs"/></rule>
<rule pattern="(?i)(r)(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringSingle"/></bygroups><push state="sqs"/></rule>
<rule pattern="&quot;&quot;&quot;"><token type="LiteralStringDouble"/><combined state="stringescape" state="tdqs"/></rule>
<rule pattern="&#x27;&#x27;&#x27;"><token type="LiteralStringSingle"/><combined state="stringescape" state="tsqs"/></rule>
<rule pattern="&quot;"><token type="LiteralStringDouble"/><combined state="stringescape" state="dqs"/></rule>
<rule pattern="&#x27;"><token type="LiteralStringSingle"/><combined state="stringescape" state="sqs"/></rule>
<rule pattern="@\d{4}-\d{2}-\d{2}T\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?"><token type="LiteralDate"/></rule>
<rule pattern="@\d{4}-\d{2}-\d{2}"><token type="LiteralDate"/></rule>
<rule pattern="@\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?"><token type="LiteralDate"/></rule>
<rule pattern="[^\S\n]+"><token type="Text"/></rule>
<rule><include state="numbers"/></rule>
<rule pattern="-&gt;|=&gt;|==|!=|&gt;=|&lt;=|~=|&amp;&amp;|\|\||\?\?|\/\/"><token type="Operator"/></rule>
<rule pattern="[-~+/*%=&lt;&gt;&amp;^|.@]"><token type="Operator"/></rule>
<rule pattern="[]{}:(),;[]"><token type="Punctuation"/></rule>
<rule><include state="functions"/></rule>
<rule pattern="[A-Za-z_][a-zA-Z0-9_]*"><token type="NameVariable"/></rule>
</state>
<state name="numbers">
<rule pattern="(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)([eE][+-]?\d(?:_?\d)*)?"><token type="LiteralNumberFloat"/></rule>
<rule pattern="\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?"><token type="LiteralNumberFloat"/></rule>
<rule pattern="0[oO](?:_?[0-7])+"><token type="LiteralNumberOct"/></rule>
<rule pattern="0[bB](?:_?[01])+"><token type="LiteralNumberBin"/></rule>
<rule pattern="0[xX](?:_?[a-fA-F0-9])+"><token type="LiteralNumberHex"/></rule>
<rule pattern="\d(?:_?\d)*"><token type="LiteralNumberInteger"/></rule>
</state>
<state name="fstringescape">
<rule><include state="stringescape"/></rule>
</state>
<state name="bytesescape">
<rule pattern="\\([\\bfnrt&quot;\&#x27;]|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})"><token type="LiteralStringEscape"/></rule>
</state>
<state name="stringescape">
<rule pattern="\\(N\{.*?\}|u\{[a-fA-F0-9]{1,6}\})"><token type="LiteralStringEscape"/></rule>
<rule><include state="bytesescape"/></rule>
</state>
<state name="fstrings-single">
<rule pattern="\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="\{"><token type="LiteralStringInterpol"/><push state="expr-inside-fstring"/></rule>
<rule pattern="[^\\\&#x27;&quot;{}\n]+"><token type="LiteralStringSingle"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringSingle"/></rule>
</state>
<state name="fstrings-double">
<rule pattern="\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="\{"><token type="LiteralStringInterpol"/><push state="expr-inside-fstring"/></rule>
<rule pattern="[^\\\&#x27;&quot;{}\n]+"><token type="LiteralStringDouble"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringDouble"/></rule>
</state>
<state name="strings-single">
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[&lt;&gt;=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="[^\\\&#x27;&quot;%{\n]+"><token type="LiteralStringSingle"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringSingle"/></rule>
<rule pattern="%|(\{{1,2})"><token type="LiteralStringSingle"/></rule>
</state>
<state name="strings-double">
<rule pattern="\{((\w+)((\.\w+)|(\[[^\]]+\]))*)?(\:(.?[&lt;&gt;=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?\}"><token type="LiteralStringInterpol"/></rule>
<rule pattern="[^\\\&#x27;&quot;%{\n]+"><token type="LiteralStringDouble"/></rule>
<rule pattern="[\&#x27;&quot;\\]"><token type="LiteralStringDouble"/></rule>
<rule pattern="%|(\{{1,2})"><token type="LiteralStringDouble"/></rule>
</state>
<state name="dqf">
<rule pattern="&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&quot;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="fstrings-double"/></rule>
</state>
<state name="sqf">
<rule pattern="&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&#x27;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="fstrings-single"/></rule>
</state>
<state name="dqs">
<rule pattern="&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&quot;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="strings-double"/></rule>
</state>
<state name="sqs">
<rule pattern="&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule pattern="\\\\|\\&#x27;|\\\n"><token type="LiteralStringEscape"/></rule>
<rule><include state="strings-single"/></rule>
</state>
<state name="tdqf">
<rule pattern="&quot;&quot;&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule><include state="fstrings-double"/></rule>
<rule pattern="\n"><token type="LiteralStringDouble"/></rule>
</state>
<state name="tsqf">
<rule pattern="&#x27;&#x27;&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule><include state="fstrings-single"/></rule>
<rule pattern="\n"><token type="LiteralStringSingle"/></rule>
</state>
<state name="tdqs">
<rule pattern="&quot;&quot;&quot;"><token type="LiteralStringDouble"/><pop depth="1"/></rule>
<rule><include state="strings-double"/></rule>
<rule pattern="\n"><token type="LiteralStringDouble"/></rule>
</state>
<state name="tsqs">
<rule pattern="&#x27;&#x27;&#x27;"><token type="LiteralStringSingle"/><pop depth="1"/></rule>
<rule><include state="strings-single"/></rule>
<rule pattern="\n"><token type="LiteralStringSingle"/></rule>
</state>
<state name="expr-inside-fstring">
<rule pattern="[{([]"><token type="Punctuation"/><push state="expr-inside-fstring-inner"/></rule>
<rule pattern="(=\s*)?\}"><token type="LiteralStringInterpol"/><pop depth="1"/></rule>
<rule pattern="(=\s*)?:"><token type="LiteralStringInterpol"/><pop depth="1"/></rule>
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
<rule><include state="expr"/></rule>
</state>
<state name="expr-inside-fstring-inner">
<rule pattern="[{([]"><token type="Punctuation"/><push state="expr-inside-fstring-inner"/></rule>
<rule pattern="[])}]"><token type="Punctuation"/><pop depth="1"/></rule>
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
<rule><include state="expr"/></rule>
</state>
<state name="keywords">
<rule pattern="(into|case|type|module|internal)\b"><token type="Keyword"/></rule>
<rule pattern="(true|false|null)\b"><token type="KeywordConstant"/></rule>
</state>
<state name="functions">
<rule pattern="(min|max|sum|average|stddev|every|any|concat_array|count|lag|lead|first|last|rank|rank_dense|row_number|round|as|in|tuple_every|tuple_map|tuple_zip|_eq|_is_null|from_text|lower|upper|read_parquet|read_csv)\b"><token type="NameFunction"/></rule>
</state>
<state name="comment">
<rule pattern="-(?!\})"><token type="CommentMultiline"/></rule>
<rule pattern="\{-"><token type="CommentMultiline"/><push state="comment"/></rule>
<rule pattern="[^-}]"><token type="CommentMultiline"/></rule>
<rule pattern="-\}"><token type="CommentMultiline"/><pop depth="1"/></rule>
</state>
<state name="imports">
<rule pattern="\w+(\.\w+)*"><token type="NameClass"/><pop depth="1"/></rule>
</state>
</rules>
</lexer>
+4 -3
View File
@@ -17,6 +17,7 @@
<mime_type>text/x-R</mime_type>
<mime_type>text/x-r-history</mime_type>
<mime_type>text/x-r-profile</mime_type>
<priority>0.1</priority> <!-- higher priority than Rebol -->
</config>
<rules>
<state name="numbers">
@@ -36,6 +37,9 @@
</rule>
</state>
<state name="root">
<rule>
<include state="keywords"/>
</rule>
<rule pattern="((?:`[^`\\]*(?:\\.[^`\\]*)*`)|(?:(?:[a-zA-z]|[_.][^0-9])[\w_.]*))\s*(?=\()">
<token type="NameFunction"/>
</rule>
@@ -107,9 +111,6 @@
<rule>
<include state="numbers"/>
</rule>
<rule>
<include state="keywords"/>
</rule>
<rule>
<include state="punctuation"/>
</rule>
@@ -12,6 +12,7 @@
<filename>*.rbx</filename>
<filename>*.duby</filename>
<filename>Gemfile</filename>
<filename>Vagrantfile</filename>
<mime_type>text/x-ruby</mime_type>
<mime_type>application/x-ruby</mime_type>
<dot_all>true</dot_all>
@@ -0,0 +1,79 @@
<lexer>
<config>
<name>Smarty</name>
<alias>smarty</alias>
<filename>*.tpl</filename>
<mime_type>application/x-smarty</mime_type>
<dot_all>true</dot_all>
</config>
<rules>
<state name="root">
<rule pattern="[^{]+">
<token type="Other"/>
</rule>
<rule pattern="(\{)(\*.*?\*)(\})">
<bygroups>
<token type="CommentPreproc"/>
<token type="Comment"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(\{php\})(.*?)(\{/php\})">
<bygroups>
<token type="CommentPreproc"/>
<using lexer="PHP"/>
<token type="CommentPreproc"/>
</bygroups>
</rule>
<rule pattern="(\{)(/?[a-zA-Z_]\w*)(\s*)">
<bygroups>
<token type="CommentPreproc"/>
<token type="NameFunction"/>
<token type="Text"/>
</bygroups>
<push state="smarty"/>
</rule>
<rule pattern="\{">
<token type="CommentPreproc"/>
<push state="smarty"/>
</rule>
</state>
<state name="smarty">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="\{">
<token type="CommentPreproc"/>
<push/>
</rule>
<rule pattern="\}">
<token type="CommentPreproc"/>
<pop depth="1"/>
</rule>
<rule pattern="#[a-zA-Z_]\w*#">
<token type="NameVariable"/>
</rule>
<rule pattern="\$[a-zA-Z_]\w*(\.\w+)*">
<token type="NameVariable"/>
</rule>
<rule pattern="[~!%^&amp;*()+=|\[\]:;,.&lt;&gt;/?@-]">
<token type="Operator"/>
</rule>
<rule pattern="(true|false|null)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?">
<token type="LiteralNumber"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="&#39;(\\\\|\\&#39;|[^&#39;])*&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="[a-zA-Z_]\w*">
<token type="NameAttribute"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,59 @@
<lexer>
<config>
<name>SourcePawn</name>
<alias>sp</alias>
<filename>*.sp</filename>
<filename>*.inc</filename>
<mime_type>text/x-sourcepawn</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="^#if\s+0"><token type="CommentPreproc"/><push state="if0"/></rule>
<rule pattern="^#"><token type="CommentPreproc"/><push state="macro"/></rule>
<rule pattern="^\s*(?:/[*].*?[*]/\s*)*#if\s+0"><token type="CommentPreproc"/><push state="if0"/></rule>
<rule pattern="^\s*(?:/[*].*?[*]/\s*)*#"><token type="CommentPreproc"/><push state="macro"/></rule>
<rule pattern="\n"><token type="Text"/></rule>
<rule pattern="\s+"><token type="Text"/></rule>
<rule pattern="\\\n"><token type="Text"/></rule>
<rule pattern="/(\\\n)?/(\n|(.|\n)*?[^\\]\n)"><token type="CommentSingle"/></rule>
<rule pattern="/(\\\n)?\*(.|\n)*?\*(\\\n)?/"><token type="CommentMultiline"/></rule>
<rule pattern="[{}]"><token type="Punctuation"/></rule>
<rule pattern="L?&quot;"><token type="LiteralString"/><push state="string"/></rule>
<rule pattern="L?&#x27;(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\&#x27;\n])&#x27;"><token type="LiteralStringChar"/></rule>
<rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*"><token type="LiteralNumberFloat"/></rule>
<rule pattern="(\d+\.\d*|\.\d+|\d+[fF])[fF]?"><token type="LiteralNumberFloat"/></rule>
<rule pattern="0x[0-9a-fA-F]+[LlUu]*"><token type="LiteralNumberHex"/></rule>
<rule pattern="0[0-7]+[LlUu]*"><token type="LiteralNumberOct"/></rule>
<rule pattern="\d+[LlUu]*"><token type="LiteralNumberInteger"/></rule>
<rule pattern="[~!%^&amp;*+=|?:&lt;&gt;/-]"><token type="Operator"/></rule>
<rule pattern="[()\[\],.;]"><token type="Punctuation"/></rule>
<rule pattern="(case|const|continue|native|default|else|enum|for|if|new|operator|public|return|sizeof|static|decl|struct|switch)\b"><token type="Keyword"/></rule>
<rule pattern="(bool|float|void|int|char)\b"><token type="KeywordType"/></rule>
<rule pattern="(true|false)\b"><token type="KeywordConstant"/></rule>
<rule pattern="[a-zA-Z_]\w*"><token type="Name"/></rule>
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;{]*)(\{)"><bygroups><usingself state="root"/><token type="NameFunction"/><usingself state="root"/><usingself state="root"/><token type="Punctuation"/></bygroups><push state="function"/></rule>
<rule pattern="((?:[\w*\s])+?(?:\s|[*]))([a-zA-Z_]\w*)(\s*\([^;]*?\))([^;]*)(;)"><bygroups><usingself state="root"/><token type="NameFunction"/><usingself state="root"/><usingself state="root"/><token type="Punctuation"/></bygroups></rule>
</state>
<state name="string">
<rule pattern="&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
<rule pattern="\\([\\abfnrtv&quot;\&#x27;]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})"><token type="LiteralStringEscape"/></rule>
<rule pattern="[^\\&quot;\n]+"><token type="LiteralString"/></rule>
<rule pattern="\\\n"><token type="LiteralString"/></rule>
<rule pattern="\\"><token type="LiteralString"/></rule>
</state>
<state name="macro">
<rule pattern="(include)(\s*(?:/[*].*?[*]/\s*)?)([^\n]+)"><bygroups><token type="CommentPreproc"/><token type="Text"/><token type="CommentPreprocFile"/></bygroups></rule>
<rule pattern="[^/\n]+"><token type="CommentPreproc"/></rule>
<rule pattern="/\*(.|\n)*?\*/"><token type="CommentMultiline"/></rule>
<rule pattern="//.*?\n"><token type="CommentSingle"/><pop depth="1"/></rule>
<rule pattern="/"><token type="CommentPreproc"/></rule>
<rule pattern="(?&lt;=\\)\n"><token type="CommentPreproc"/></rule>
<rule pattern="\n"><token type="CommentPreproc"/><pop depth="1"/></rule>
</state>
<state name="if0">
<rule pattern="^\s*#if.*?(?&lt;!\\)\n"><token type="CommentPreproc"/><push/></rule>
<rule pattern="^\s*#endif.*?(?&lt;!\\)\n"><token type="CommentPreproc"/><pop depth="1"/></rule>
<rule pattern=".*?\n"><token type="Comment"/></rule>
</state>
</rules>
</lexer>
@@ -3,6 +3,8 @@
<name>TOML</name>
<alias>toml</alias>
<filename>*.toml</filename>
<filename>Pipfile</filename>
<filename>poetry.lock</filename>
<mime_type>text/x-toml</mime_type>
</config>
<rules>
@@ -2,6 +2,7 @@
<config>
<name>Twig</name>
<alias>twig</alias>
<filename>*.twig</filename>
<mime_type>application/x-twig</mime_type>
<dot_all>true</dot_all>
</config>
@@ -0,0 +1,178 @@
<lexer>
<config>
<name>TypoScript</name>
<alias>typoscript</alias>
<filename>*.ts</filename>
<mime_type>text/x-typoscript</mime_type>
<dot_all>true</dot_all>
<priority>0.1</priority>
</config>
<rules>
<state name="whitespace">
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
<state name="html">
<rule pattern="&lt;\S[^\n&gt;]*&gt;">
<using lexer="TypoScriptHTMLData"/>
</rule>
<rule pattern="&amp;[^;\n]*;">
<token type="LiteralString"/>
</rule>
<rule pattern="(_CSS_DEFAULT_STYLE)(\s*)(\()(?s)(.*(?=\n\)))">
<bygroups>
<token type="NameClass"/>
<token type="Text"/>
<token type="LiteralStringSymbol"/>
<using lexer="TypoScriptCSSData"/>
</bygroups>
</rule>
</state>
<state name="operator">
<rule pattern="[&lt;&gt;,:=.*%+|]">
<token type="Operator"/>
</rule>
</state>
<state name="structure">
<rule pattern="[{}()\[\]\\]">
<token type="LiteralStringSymbol"/>
</rule>
</state>
<state name="constant">
<rule pattern="(\{)(\$)((?:[\w\-]+\.)*)([\w\-]+)(\})">
<bygroups>
<token type="LiteralStringSymbol"/>
<token type="Operator"/>
<token type="NameConstant"/>
<token type="NameConstant"/>
<token type="LiteralStringSymbol"/>
</bygroups>
</rule>
<rule pattern="(\{)([\w\-]+)(\s*:\s*)([\w\-]+)(\})">
<bygroups>
<token type="LiteralStringSymbol"/>
<token type="NameConstant"/>
<token type="Operator"/>
<token type="NameConstant"/>
<token type="LiteralStringSymbol"/>
</bygroups>
</rule>
<rule pattern="(#[a-fA-F0-9]{6}\b|#[a-fA-F0-9]{3}\b)">
<token type="LiteralStringChar"/>
</rule>
</state>
<state name="comment">
<rule pattern="(?&lt;!(#|\&#39;|&#34;))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|//[^\n]*)">
<token type="Comment"/>
</rule>
<rule pattern="/\*(?:(?!\*/).)*\*/">
<token type="Comment"/>
</rule>
<rule pattern="(\s*#\s*\n)">
<token type="Comment"/>
</rule>
</state>
<state name="root">
<rule>
<include state="comment"/>
</rule>
<rule>
<include state="constant"/>
</rule>
<rule>
<include state="html"/>
</rule>
<rule>
<include state="label"/>
</rule>
<rule>
<include state="whitespace"/>
</rule>
<rule>
<include state="keywords"/>
</rule>
<rule>
<include state="punctuation"/>
</rule>
<rule>
<include state="operator"/>
</rule>
<rule>
<include state="structure"/>
</rule>
<rule>
<include state="literal"/>
</rule>
<rule>
<include state="other"/>
</rule>
</state>
<state name="literal">
<rule pattern="0x[0-9A-Fa-f]+t?">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="(###\w+###)">
<token type="NameConstant"/>
</rule>
</state>
<state name="label">
<rule pattern="(EXT|FILE|LLL):[^}\n&#34;]*">
<token type="LiteralString"/>
</rule>
<rule pattern="(?![^\w\-])([\w\-]+(?:/[\w\-]+)+/?)(\S*\n)">
<bygroups>
<token type="LiteralString"/>
<token type="LiteralString"/>
</bygroups>
</rule>
</state>
<state name="punctuation">
<rule pattern="[,.]">
<token type="Punctuation"/>
</rule>
</state>
<state name="other">
<rule pattern="[\w&#34;\-!/&amp;;]+">
<token type="Text"/>
</rule>
</state>
<state name="keywords">
<rule pattern="(\[)(?i)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|device|ELSE|END|GLOBAL|globalString|globalVar|hostname|hour|IP|language|loginUser|loginuser|minute|month|page|PIDinRootline|PIDupinRootline|system|treeLevel|useragent|userFunc|usergroup|version)([^\]]*)(\])">
<bygroups>
<token type="LiteralStringSymbol"/>
<token type="NameConstant"/>
<token type="Text"/>
<token type="LiteralStringSymbol"/>
</bygroups>
</rule>
<rule pattern="(?=[\w\-])(HTMLparser|HTMLparser_tags|addParams|cache|encapsLines|filelink|if|imageLinkWrap|imgResource|makelinks|numRows|numberFormat|parseFunc|replacement|round|select|split|stdWrap|strPad|tableStyle|tags|textStyle|typolink)(?![\w\-])">
<token type="NameFunction"/>
</rule>
<rule pattern="(?:(=?\s*&lt;?\s+|^\s*))(cObj|field|config|content|constants|FEData|file|frameset|includeLibs|lib|page|plugin|register|resources|sitemap|sitetitle|styles|temp|tt_[^:.\s]*|types|xmlnews|INCLUDE_TYPOSCRIPT|_CSS_DEFAULT_STYLE|_DEFAULT_PI_VARS|_LOCAL_LANG)(?![\w\-])">
<bygroups>
<token type="Operator"/>
<token type="NameBuiltin"/>
</bygroups>
</rule>
<rule pattern="(?=[\w\-])(CASE|CLEARGIF|COA|COA_INT|COBJ_ARRAY|COLUMNS|CONTENT|CTABLE|EDITPANEL|FILE|FILES|FLUIDTEMPLATE|FORM|HMENU|HRULER|HTML|IMAGE|IMGTEXT|IMG_RESOURCE|LOAD_REGISTER|MEDIA|MULTIMEDIA|OTABLE|PAGE|QTOBJECT|RECORDS|RESTORE_REGISTER|SEARCHRESULT|SVG|SWFOBJECT|TEMPLATE|TEXT|USER|USER_INT)(?![\w\-])">
<token type="NameClass"/>
</rule>
<rule pattern="(?=[\w\-])(ACTIFSUBRO|ACTIFSUB|ACTRO|ACT|CURIFSUBRO|CURIFSUB|CURRO|CUR|IFSUBRO|IFSUB|NO|SPC|USERDEF1RO|USERDEF1|USERDEF2RO|USERDEF2|USRRO|USR)">
<token type="NameClass"/>
</rule>
<rule pattern="(?=[\w\-])(GMENU_FOLDOUT|GMENU_LAYERS|GMENU|IMGMENUITEM|IMGMENU|JSMENUITEM|JSMENU|TMENUITEM|TMENU_LAYERS|TMENU)">
<token type="NameClass"/>
</rule>
<rule pattern="(?=[\w\-])(PHP_SCRIPT(_EXT|_INT)?)">
<token type="NameClass"/>
</rule>
<rule pattern="(?=[\w\-])(userFunc)(?![\w\-])">
<token type="NameFunction"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,147 @@
<lexer>
<config>
<name>ucode</name>
<filename>*.uc</filename>
<mime_type>application/x.ucode</mime_type>
<mime_type>text/x.ucode</mime_type>
<dot_all>true</dot_all>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="interp">
<rule pattern="`">
<token type="LiteralStringBacktick"/>
<pop depth="1"/>
</rule>
<rule pattern="\\\\">
<token type="LiteralStringBacktick"/>
</rule>
<rule pattern="\\`">
<token type="LiteralStringBacktick"/>
</rule>
<rule pattern="\\[^`\\]">
<token type="LiteralStringBacktick"/>
</rule>
<rule pattern="\$\{">
<token type="LiteralStringInterpol"/>
<push state="interp-inside"/>
</rule>
<rule pattern="\$">
<token type="LiteralStringBacktick"/>
</rule>
<rule pattern="[^`\\$]+">
<token type="LiteralStringBacktick"/>
</rule>
</state>
<state name="interp-inside">
<rule pattern="\}">
<token type="LiteralStringInterpol"/>
<pop depth="1"/>
</rule>
<rule>
<include state="root"/>
</rule>
</state>
<state name="commentsandwhitespace">
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="&lt;!--">
<token type="Comment"/>
</rule>
<rule pattern="//.*?\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*.*?\*/">
<token type="CommentMultiline"/>
</rule>
</state>
<state name="slashstartsregex">
<rule>
<include state="commentsandwhitespace"/>
</rule>
<rule pattern="/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gimuy]+\b|\B)">
<token type="LiteralStringRegex"/>
<pop depth="1"/>
</rule>
<rule pattern="(?=/)">
<token type="Text"/>
<push state="#pop" state="badregex"/>
</rule>
<rule>
<pop depth="1"/>
</rule>
</state>
<state name="badregex">
<rule pattern="\n">
<token type="Text"/>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern="\A#! ?/.*?\n">
<token type="CommentHashbang"/>
</rule>
<rule pattern="^(?=\s|/|&lt;!--)">
<token type="Text"/>
<push state="slashstartsregex"/>
</rule>
<rule>
<include state="commentsandwhitespace"/>
</rule>
<rule pattern="\d+(\.\d*|[eE][+\-]?\d+)">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0[bB][01]+">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="0[oO][0-7]+">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0[xX][0-9a-fA-F]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="[0-9][0-9_]*">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="\.\.\.|=&gt;">
<token type="Punctuation"/>
</rule>
<rule pattern="\+\+|--|~|&amp;&amp;|\?|:|\|\||\\(?=\n)|(&lt;&lt;|&gt;&gt;&gt;?|==?|!=?|[-&lt;&gt;+*%&amp;|^/])=?">
<token type="Operator"/>
<push state="slashstartsregex"/>
</rule>
<rule pattern="[{(\[;,]">
<token type="Punctuation"/>
<push state="slashstartsregex"/>
</rule>
<rule pattern="[})\].]">
<token type="Punctuation"/>
</rule>
<rule pattern="(import|export|from|as|for|in|while|break|return|continue|switch|case|default|if|else|try|catch|delete|this)\b">
<token type="Keyword"/>
<push state="slashstartsregex"/>
</rule>
<rule pattern="(const|let|function)\b">
<token type="KeywordDeclaration"/>
<push state="slashstartsregex"/>
</rule>
<rule pattern="(true|false|null|NaN|Infinity)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="(?:[$_\p{L}\p{N}]|\\u[a-fA-F0-9]{4})(?:(?:[$\p{L}\p{N}]|\\u[a-fA-F0-9]{4}))*">
<token type="NameOther"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="&#39;(\\\\|\\&#39;|[^&#39;])*&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="`">
<token type="LiteralStringBacktick"/>
<push state="interp"/>
</rule>
</state>
</rules>
</lexer>
+355
View File
@@ -0,0 +1,355 @@
<lexer>
<config>
<name>V</name>
<alias>v</alias>
<alias>vlang</alias>
<filename>*.v</filename>
<filename>*.vv</filename>
<filename>v.mod</filename>
<mime_type>text/x-v</mime_type>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="root">
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="(?&lt;=module\s+\w[^\n]*\s+)(//[^\n]+\n)+(?=\n)">
<token type="LiteralStringDoc"/>
</rule>
<rule pattern="(// *)(\w+)([^\n]+\n)(?=(?://[^\n]*\n)* *(?:pub +)?(?:fn|struct|union|type|interface|enum|const) +\2\b)">
<bygroups>
<token type="LiteralStringDoc"/>
<token type="GenericEmph"/>
<token type="LiteralStringDoc"/>
</bygroups>
<push state="string-doc"/>
</rule>
<rule pattern="//[^\n]*\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*(?:(?:/\*(?:.|\n)*?\*/)*|.|\n)*\*/">
<token type="CommentMultiline"/>
</rule>
<rule pattern="\b(import|module)\b">
<token type="KeywordNamespace"/>
</rule>
<rule pattern="\b(fn|struct|union|map|chan|type|interface|enum|const|mut|shared|pub|__global)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="\?">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="(?&lt;=\)\s*)!">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="[ \t]*#include[^\n]+">
<using lexer="c"/>
</rule>
<rule pattern="[ \t]*#\w[^\n]*">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(sql)(\s+)(\w+)(\s+)({)([^}]*?)(})">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
<token type="Name"/>
<token type="Text"/>
<token type="Punctuation"/>
<using lexer="sql"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\$(?=\w)">
<token type="Operator"/>
</rule>
<rule pattern="(?&lt;=\$)(?:embed_file|pkgconfig|tmpl|env|compile_error|compile_warn)">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(asm)(\s+)(\w+)(\s*)({)([^}]*?)(})">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
<token type="KeywordType"/>
<token type="Text"/>
<token type="Punctuation"/>
<using lexer="nasm"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\b_(?:un)?likely_(?=\()">
<token type="NameFunctionMagic"/>
</rule>
<rule pattern="(?&lt;=\$if.+?(?:&amp;&amp;|\|\|)?)((no_segfault_handler|no_bounds_checking|little_endian|freestanding|no_backtrace|big_endian|cplusplus|dragonfly|prealloc|android|windows|no_main|solaris|darwin|clang|tinyc|glibc|mingw|haiku|macos|amd64|arm64|debug|linux|prod|msvc|test|hpux|mach|x32|x64|gcc|qnx|gnu|ios|mac|js))+">
<token type="NameBuiltin"/>
</rule>
<rule pattern="@(VMOD_FILE|VEXEROOT|VMODROOT|METHOD|STRUCT|COLUMN|VHASH|FILE|LINE|VEXE|MOD|FN)\b">
<token type="NameVariableMagic"/>
</rule>
<rule pattern="\b(?&lt;!@)(__offsetof|isreftype|continue|volatile|typeof|static|unsafe|return|assert|sizeof|atomic|select|match|break|defer|rlock|lock|else|goto|for|in|is|as|or|if|go)\b">
<token type="Keyword"/>
</rule>
<rule pattern="\b(?&lt;!@)(none|true|false|si_s_code|si_g32_code|si_g64_code)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="\b(?&lt;!@)(vstring_literal_with_len|utf8_str_visible_length|get_str_intp_u64_format|get_str_intp_u32_format|utf32_decode_to_buffer|utf32_to_str_no_malloc|panic_optional_not_set|panic_result_not_set|contains_any_substr|strip_margin_custom|starts_with_capital|cstring_to_vstring|winapi_lasterr_str|c_error_number_str|panic_error_number|substr_with_check|string_from_wide2|sort_with_compare|trim_string_right|string_from_wide|sort_ignore_case|trim_string_left|reverse_in_place|split_into_lines|vstring_with_len|compare_strings|all_before_last|print_backtrace|repeat_to_depth|length_in_bytes|error_with_code|vstring_literal|gc_check_leaks|clone_to_depth|vcalloc_noscan|all_after_last|utf8_char_len|panic_lasterr|memdup_noscan|malloc_noscan|str_intp_rune|last_index_u8|utf8_to_utf32|flush_stderr|flush_stdout|str_intp_sub|replace_each|replace_once|vstrlen_char|utf8_getchar|str_intp_g64|contains_any|find_between|realloc_data|strip_margin|utf32_to_str|is_bin_digit|is_hex_digit|is_oct_digit|proc_pidpath|str_intp_g32|delete_many|delete_last|str_escaped|index_after|sort_by_len|str_intp_sq|starts_with|trim_space|last_index|parse_uint|is_capital|trim_right|join_lines|capitalize|all_before|after_char|match_glob|utf32_code|eq_epsilon|tos_clone|substr_ni|v_realloc|push_many|is_letter|split_nth|split_any|trim_left|index_any|ascii_str|parse_int|all_after|ends_with|is_title|contains|eprintln|is_space|index_u8|is_digit|vmemmove|byterune|is_alnum|pointers|grow_len|is_lower|grow_cap|str_intp|to_upper|hex_full|len_utf8|is_upper|try_push|to_lower|compare|vmemset|try_pop|vcalloc|reverse|vmemcmp|vstring|replace|ptr_str|strlong|to_wide|bytestr|f32_abs|f32_max|println|f32_min|f64_max|vmemcpy|vstrlen|prepend|vbytes|strsci|substr|string|insert|eprint|filter|delete|repeat|malloc|memdup|fields|before|reduce|string|isize|count|index|title|bytes|clone|usize|error|after|split|runes|print|panic|first|close|limit|isnil|bool|rune|tos3|u128|hex2|i128|hash|code|tos4|free|exit|keys|tos2|last|trim|strg|tos5|move|copy|drop|sort|dump|join|free|cap|int|any|all|any|len|map|pop|hex|f64|f32|u16|msg|i64|i16|u32|str|tos|u64|i8|u8)(?=\()">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b(?&lt;!@)(StrIntpCgenData|VAssertMetaInfo|StructAttribute|AttributeKind|FunctionData|StrIntpData|StrIntpType|MethodArgs|StrIntpMem|ArrayFlags|FieldData|SortedMap|ChanState|string|array|Error|map)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b(?&lt;!@)(voidptr|string|error|isize|usize|i128|u128|bool|rune|int|f32|f64|i64|i16|u64|any|u32|u16|i8|u8)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="\bit\b">
<token type="NameVariableMagic"/>
</rule>
<rule pattern="(?&lt;!fn\s+)(?&lt;=\w+\s+|^)\[(?=:if +)?(?=\w+)">
<token type="Punctuation"/>
<push state="attribute"/>
</rule>
<rule pattern="(&lt;&lt;=|&gt;&gt;=|&gt;&gt;&gt;=|&gt;&gt;&gt;|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|\^=|\+=|-=|\*=|/=|%=|&amp;=|\|=|&amp;&amp;|\|\||&lt;-|\+\+|--|==|!=|:=|\.\.\.|\.\.|[+\-*/%&amp;|^~=#@!])">
<token type="Operator"/>
</rule>
<rule pattern="[\d_]+(\.\d+e[+\-]?\d+|\.\d+|e[+\-]?\d+)">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="\.\d+(e[+\-]?\d+)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0o[0-7_]+">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0x[0-9a-fA-F_]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0b[01_]+">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="(0|[1-9][0-9_]*)">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="`">
<token type="LiteralStringChar"/>
<push state="char"/>
</rule>
<rule>
<include state="strings"/>
</rule>
<rule pattern="@?[A-Z]\w*">
<token type="NameClass"/>
</rule>
<rule pattern="(?&lt;=[^\W\d]\w*)(&lt;)([A-Z]\w*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="NameClass"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="@?[^\W\d]\w*(?=\()">
<token type="NameFunction"/>
</rule>
<rule pattern="(?&lt;=fn\s+)@?[^\W\d]\w*(?=\s*\()">
<token type="NameFunction"/>
</rule>
<rule pattern="(?&lt;=(?:continue|break|goto)\s+)\w+">
<token type="NameLabel"/>
</rule>
<rule pattern="\b[^\W\d]\w*(?=:(?:$|\s+for))">
<token type="NameLabel"/>
</rule>
<rule pattern="[&lt;&gt;()\[\]{}.,;:]">
<token type="Punctuation"/>
</rule>
<rule pattern="@?[^\W\d]\w*">
<token type="NameVariable"/>
</rule>
</state>
<state name="char">
<rule pattern="`">
<token type="LiteralStringChar"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="[^\\]">
<token type="LiteralStringChar"/>
</rule>
</state>
<state name="string-doc">
<rule pattern="(// *)(#+ [^\n]+)(\n)">
<bygroups>
<token type="LiteralStringDoc"/>
<token type="GenericHeading"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="// *([=_*~-])\1{2,}\n">
<token type="LiteralStringDelimiter"/>
</rule>
<rule pattern="//[^\n]*\n">
<token type="LiteralStringDoc"/>
</rule>
<rule>
<mutators>
<pop depth="1"/>
</mutators>
</rule>
</state>
<state name="string-curly-interpolation">
<rule pattern="}">
<token type="Punctuation"/>
<pop depth="1"/>
</rule>
<rule>
<include state="strings"/>
</rule>
<rule pattern="(:)( *?)([ 0&#39;#+-])?(?:(\.)?([0-9]+))?([fFgeEGxXobsd])?">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Operator"/>
<token type="Punctuation"/>
<token type="LiteralNumber"/>
<token type="LiteralStringAffix"/>
</bygroups>
</rule>
<rule pattern="[^}&#34;&#39;:]+">
<usingself state="root"/>
</rule>
</state>
<state name="attribute">
<rule pattern="\]">
<token type="Punctuation"/>
<pop depth="1"/>
</rule>
<rule pattern="&#39;">
<token type="Punctuation"/>
<push state="string-single"/>
</rule>
<rule pattern="&#34;">
<token type="Punctuation"/>
<push state="string-double"/>
</rule>
<rule pattern="[;:]">
<token type="Punctuation"/>
</rule>
<rule pattern="(?&lt;=\[)if\b">
<token type="Keyword"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="(?&lt;=: *)\w+">
<token type="LiteralString"/>
</rule>
<rule pattern="[^\W\d]\w*">
<token type="NameAttribute"/>
</rule>
</state>
<state name="strings">
<rule pattern="(c)?(&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<push state="string-double"/>
</rule>
<rule pattern="(c)?(&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<push state="string-single"/>
</rule>
<rule pattern="(r)(&#34;[^&#34;]+&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralString"/>
</bygroups>
</rule>
<rule pattern="(r)(&#39;[^&#39;]+&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralString"/>
</bygroups>
</rule>
</state>
<state name="string-double">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="(\$)((?!\\){)">
<bygroups>
<token type="Operator"/>
<token type="Punctuation"/>
</bygroups>
<push state="string-curly-interpolation"/>
</rule>
<rule pattern="\$">
<token type="Operator"/>
<push state="string-interpolation"/>
</rule>
<rule pattern="[^&#34;]+?">
<token type="LiteralStringDouble"/>
</rule>
</state>
<state name="string-single">
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="(\$)((?!\\){)">
<bygroups>
<token type="Operator"/>
<token type="Punctuation"/>
</bygroups>
<push state="string-curly-interpolation"/>
</rule>
<rule pattern="\$">
<token type="Operator"/>
<push state="string-interpolation"/>
</rule>
<rule pattern="[^&#39;]+?">
<token type="LiteralStringSingle"/>
</rule>
</state>
<state name="char-escape">
<rule pattern="\\[`&#39;&#34;\\abfnrtv$]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}">
<token type="LiteralStringEscape"/>
</rule>
</state>
<state name="string-interpolation">
<rule pattern="(\.)?(@)?(?:([^\W\d]\w*)(\()([^)]*)(\))|([^\W\d]\w*))">
<bygroups>
<token type="Punctuation"/>
<token type="Operator"/>
<token type="NameFunction"/>
<token type="Punctuation"/>
<usingself state="root"/>
<token type="Punctuation"/>
<token type="NameVariable"/>
</bygroups>
</rule>
<rule>
<mutators>
<pop depth="1"/>
</mutators>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,365 @@
<lexer>
<config>
<name>V shell</name>
<alias>vsh</alias>
<alias>vshell</alias>
<filename>*.vsh</filename>
<mime_type>text/x-vsh</mime_type>
<ensure_nl>true</ensure_nl>
</config>
<rules>
<state name="attribute">
<rule pattern="\]">
<token type="Punctuation"/>
<pop depth="1"/>
</rule>
<rule pattern="&#39;">
<token type="Punctuation"/>
<push state="string-single"/>
</rule>
<rule pattern="&#34;">
<token type="Punctuation"/>
<push state="string-double"/>
</rule>
<rule pattern="[;:]">
<token type="Punctuation"/>
</rule>
<rule pattern="(?&lt;=\[)if\b">
<token type="Keyword"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="(?&lt;=: *)\w+">
<token type="LiteralString"/>
</rule>
<rule pattern="[^\W\d]\w*">
<token type="NameAttribute"/>
</rule>
</state>
<state name="string-double">
<rule pattern="&#34;">
<token type="LiteralStringDouble"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="(\$)((?!\\){)">
<bygroups>
<token type="Operator"/>
<token type="Punctuation"/>
</bygroups>
<push state="string-curly-interpolation"/>
</rule>
<rule pattern="\$">
<token type="Operator"/>
<push state="string-interpolation"/>
</rule>
<rule pattern="[^&#34;]+?">
<token type="LiteralStringDouble"/>
</rule>
</state>
<state name="char">
<rule pattern="`">
<token type="LiteralStringChar"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="[^\\]">
<token type="LiteralStringChar"/>
</rule>
</state>
<state name="string-doc">
<rule pattern="(// *)(#+ [^\n]+)(\n)">
<bygroups>
<token type="LiteralStringDoc"/>
<token type="GenericHeading"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="// *([=_*~-])\1{2,}\n">
<token type="LiteralStringDelimiter"/>
</rule>
<rule pattern="//[^\n]*\n">
<token type="LiteralStringDoc"/>
</rule>
<rule>
<mutators>
<pop depth="1"/>
</mutators>
</rule>
</state>
<state name="string-interpolation">
<rule pattern="(\.)?(@)?(?:([^\W\d]\w*)(\()([^)]*)(\))|([^\W\d]\w*))">
<bygroups>
<token type="Punctuation"/>
<token type="Operator"/>
<token type="NameFunction"/>
<token type="Punctuation"/>
<usingself state="root"/>
<token type="Punctuation"/>
<token type="NameVariable"/>
</bygroups>
</rule>
<rule>
<mutators>
<pop depth="1"/>
</mutators>
</rule>
</state>
<state name="string-curly-interpolation">
<rule pattern="}">
<token type="Punctuation"/>
<pop depth="1"/>
</rule>
<rule>
<include state="strings"/>
</rule>
<rule pattern="(:)( *?)([ 0&#39;#+-])?(?:(\.)?([0-9]+))?([fFgeEGxXobsd])?">
<bygroups>
<token type="Punctuation"/>
<token type="Text"/>
<token type="Operator"/>
<token type="Punctuation"/>
<token type="LiteralNumber"/>
<token type="LiteralStringAffix"/>
</bygroups>
</rule>
<rule pattern="[^}&#34;&#39;:]+">
<usingself state="root"/>
</rule>
</state>
<state name="root">
<rule pattern="^#![^\n]*\n">
<token type="CommentHashbang"/>
</rule>
<rule pattern="\b(path_delimiter|path_separator|wd_at_startup|max_path_len|sys_write|sys_close|sys_mkdir|sys_creat|sys_open|s_iflnk|s_irusr|s_ifdir|s_ixoth|s_isuid|s_isgid|s_isvtx|s_iwoth|s_iwusr|s_ixusr|s_irgrp|s_iwgrp|s_ixgrp|s_iroth|s_ifmt|args)\b">
<token type="NameConstant"/>
</rule>
<rule pattern="\b(ExecutableNotFoundError|FileNotOpenedError|SizeOfTypeIs0Error|ProcessState|SeekMode|Command|Process|Signal|Result|Uname|File)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b(find_abs_path_of_executable|posix_set_permission_bit|read_bytes_into_newline|sigint_to_signal_name|exists_in_system_path|get_raw_lines_joined|expand_tilde_to_home|posix_get_error_msg|set_redirect_stdio|is_writable_folder|file_last_mod_unix|walk_with_context|resource_abs_path|debugger_present|write_file_array|join_path_single|execute_or_panic|get_lines_joined|set_environment|read_bytes_into|read_file_array|execute_or_exit|signal_continue|write_struct_at|read_struct_at|vmodules_paths|get_error_msg|signal_pgkill|read_into_ptr|read_bytes_at|existing_path|is_executable|get_raw_stdin|is_dir_empty|write_struct|vmodules_dir|stdout_slurp|write_raw_at|write_string|get_raw_line|stderr_slurp|signal_kill|stderr_read|signal_stop|quoted_path|stdin_write|stdout_read|open_append|new_process|args_before|read_struct|is_writable|is_readable|is_abs_path|read_raw_at|write_file|getenv_opt|args_after|read_lines|read_bytes|signal_opt|config_dir|last_error|executable|file_name|file_size|rmdir_all|write_raw|real_path|join_path|input_opt|norm_path|read_from|get_lines|loginname|read_file|cache_dir|mkdir_all|read_line|open_file|home_dir|hostname|fd_slurp|fd_close|mv_by_cp|open_uri|file_ext|walk_ext|unsetenv|write_to|fd_write|abs_path|read_raw|is_alive|get_line|truncate|temp_dir|set_args|geteuid|is_file|getppid|bitmask|is_atty|execute|symlink|environ|fd_read|is_link|writeln|getegid|user_os|is_dir|stdout|create|fileno|cp_all|system|getenv|vfopen|execve|getgid|stderr|getuid|execvp|exists|setenv|getpid|flush|getwd|input|stdin|mkdir|chdir|chmod|start|chown|rmdir|uname|write|close|utime|inode|wait|seek|base|fork|open|link|glob|read|tell|walk|msg|dir|run|log|cp|mv|rm|ls)(?=\()">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
<rule pattern="\\\n">
<token type="Text"/>
</rule>
<rule pattern="(?&lt;=module\s+\w[^\n]*\s+)(//[^\n]+\n)+(?=\n)">
<token type="LiteralStringDoc"/>
</rule>
<rule pattern="(// *)(\w+)([^\n]+\n)(?=(?://[^\n]*\n)* *(?:pub +)?(?:fn|struct|union|type|interface|enum|const) +\2\b)">
<bygroups>
<token type="LiteralStringDoc"/>
<token type="GenericEmph"/>
<token type="LiteralStringDoc"/>
</bygroups>
<push state="string-doc"/>
</rule>
<rule pattern="//[^\n]*\n">
<token type="CommentSingle"/>
</rule>
<rule pattern="/\*(?:(?:/\*(?:.|\n)*?\*/)*|.|\n)*\*/">
<token type="CommentMultiline"/>
</rule>
<rule pattern="\b(import|module)\b">
<token type="KeywordNamespace"/>
</rule>
<rule pattern="\b(fn|struct|union|map|chan|type|interface|enum|const|mut|shared|pub|__global)\b">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="\?">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="(?&lt;=\)\s*)!">
<token type="KeywordDeclaration"/>
</rule>
<rule pattern="[ \t]*#include[^\n]+">
<using lexer="c"/>
</rule>
<rule pattern="[ \t]*#\w[^\n]*">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(sql)(\s+)(\w+)(\s+)({)([^}]*?)(})">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
<token type="Name"/>
<token type="Text"/>
<token type="Punctuation"/>
<using lexer="sql"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\$(?=\w)">
<token type="Operator"/>
</rule>
<rule pattern="(?&lt;=\$)(?:embed_file|pkgconfig|tmpl|env|compile_error|compile_warn)">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(asm)(\s+)(\w+)(\s*)({)([^}]*?)(})">
<bygroups>
<token type="Keyword"/>
<token type="Text"/>
<token type="KeywordType"/>
<token type="Text"/>
<token type="Punctuation"/>
<using lexer="nasm"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="\b_(?:un)?likely_(?=\()">
<token type="NameFunctionMagic"/>
</rule>
<rule pattern="(?&lt;=\$if.+?(?:&amp;&amp;|\|\|)?)((no_segfault_handler|no_bounds_checking|little_endian|freestanding|no_backtrace|big_endian|cplusplus|dragonfly|prealloc|android|windows|no_main|solaris|darwin|clang|tinyc|glibc|mingw|haiku|macos|amd64|arm64|debug|linux|prod|msvc|test|hpux|mach|x32|x64|gcc|qnx|gnu|ios|mac|js))+">
<token type="NameBuiltin"/>
</rule>
<rule pattern="@(VMOD_FILE|VEXEROOT|VMODROOT|METHOD|STRUCT|COLUMN|VHASH|FILE|LINE|VEXE|MOD|FN)\b">
<token type="NameVariableMagic"/>
</rule>
<rule pattern="\b(?&lt;!@)(__offsetof|isreftype|continue|volatile|typeof|static|unsafe|return|assert|sizeof|atomic|select|match|break|defer|rlock|lock|else|goto|for|in|is|as|or|if|go)\b">
<token type="Keyword"/>
</rule>
<rule pattern="\b(?&lt;!@)(none|true|false|si_s_code|si_g32_code|si_g64_code)\b">
<token type="KeywordConstant"/>
</rule>
<rule pattern="\b(?&lt;!@)(vstring_literal_with_len|utf8_str_visible_length|get_str_intp_u64_format|get_str_intp_u32_format|utf32_decode_to_buffer|utf32_to_str_no_malloc|panic_optional_not_set|panic_result_not_set|contains_any_substr|strip_margin_custom|starts_with_capital|cstring_to_vstring|winapi_lasterr_str|c_error_number_str|panic_error_number|substr_with_check|string_from_wide2|sort_with_compare|trim_string_right|string_from_wide|sort_ignore_case|trim_string_left|reverse_in_place|split_into_lines|vstring_with_len|compare_strings|all_before_last|print_backtrace|repeat_to_depth|length_in_bytes|error_with_code|vstring_literal|gc_check_leaks|clone_to_depth|vcalloc_noscan|all_after_last|utf8_char_len|panic_lasterr|memdup_noscan|malloc_noscan|str_intp_rune|last_index_u8|utf8_to_utf32|flush_stderr|flush_stdout|str_intp_sub|replace_each|replace_once|vstrlen_char|utf8_getchar|str_intp_g64|contains_any|find_between|realloc_data|strip_margin|utf32_to_str|is_bin_digit|is_hex_digit|is_oct_digit|proc_pidpath|str_intp_g32|delete_many|delete_last|str_escaped|index_after|sort_by_len|str_intp_sq|starts_with|trim_space|last_index|parse_uint|is_capital|trim_right|join_lines|capitalize|all_before|after_char|match_glob|utf32_code|eq_epsilon|tos_clone|substr_ni|v_realloc|push_many|is_letter|split_nth|split_any|trim_left|index_any|ascii_str|parse_int|all_after|ends_with|is_title|contains|eprintln|is_space|index_u8|is_digit|vmemmove|byterune|is_alnum|pointers|grow_len|is_lower|grow_cap|str_intp|to_upper|hex_full|len_utf8|is_upper|try_push|to_lower|compare|vmemset|try_pop|vcalloc|reverse|vmemcmp|vstring|replace|ptr_str|strlong|to_wide|bytestr|f32_abs|f32_max|println|f32_min|f64_max|vmemcpy|vstrlen|prepend|vbytes|strsci|substr|string|insert|eprint|filter|delete|repeat|malloc|memdup|fields|before|reduce|string|isize|count|index|title|bytes|clone|usize|error|after|split|runes|print|panic|first|close|limit|isnil|bool|rune|tos3|u128|hex2|i128|hash|code|tos4|free|exit|keys|tos2|last|trim|strg|tos5|move|copy|drop|sort|dump|join|free|cap|int|any|all|any|len|map|pop|hex|f64|f32|u16|msg|i64|i16|u32|str|tos|u64|i8|u8)(?=\()">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b(?&lt;!@)(StrIntpCgenData|VAssertMetaInfo|StructAttribute|AttributeKind|FunctionData|StrIntpData|StrIntpType|MethodArgs|StrIntpMem|ArrayFlags|FieldData|SortedMap|ChanState|string|array|Error|map)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b(?&lt;!@)(voidptr|string|error|isize|usize|i128|u128|bool|rune|int|f32|f64|i64|i16|u64|any|u32|u16|i8|u8)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="\bit\b">
<token type="NameVariableMagic"/>
</rule>
<rule pattern="(?&lt;!fn\s+)(?&lt;=\w+\s+|^)\[(?=:if +)?(?=\w+)">
<token type="Punctuation"/>
<push state="attribute"/>
</rule>
<rule pattern="(&lt;&lt;=|&gt;&gt;=|&gt;&gt;&gt;=|&gt;&gt;&gt;|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|\^=|\+=|-=|\*=|/=|%=|&amp;=|\|=|&amp;&amp;|\|\||&lt;-|\+\+|--|==|!=|:=|\.\.\.|\.\.|[+\-*/%&amp;|^~=#@!])">
<token type="Operator"/>
</rule>
<rule pattern="[\d_]+(\.\d+e[+\-]?\d+|\.\d+|e[+\-]?\d+)">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="\.\d+(e[+\-]?\d+)?">
<token type="LiteralNumberFloat"/>
</rule>
<rule pattern="0o[0-7_]+">
<token type="LiteralNumberOct"/>
</rule>
<rule pattern="0x[0-9a-fA-F_]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="0b[01_]+">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="(0|[1-9][0-9_]*)">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="`">
<token type="LiteralStringChar"/>
<push state="char"/>
</rule>
<rule>
<include state="strings"/>
</rule>
<rule pattern="@?[A-Z]\w*">
<token type="NameClass"/>
</rule>
<rule pattern="(?&lt;=[^\W\d]\w*)(&lt;)([A-Z]\w*)(&gt;)">
<bygroups>
<token type="Punctuation"/>
<token type="NameClass"/>
<token type="Punctuation"/>
</bygroups>
</rule>
<rule pattern="@?[^\W\d]\w*(?=\()">
<token type="NameFunction"/>
</rule>
<rule pattern="(?&lt;=fn\s+)@?[^\W\d]\w*(?=\s*\()">
<token type="NameFunction"/>
</rule>
<rule pattern="(?&lt;=(?:continue|break|goto)\s+)\w+">
<token type="NameLabel"/>
</rule>
<rule pattern="\b[^\W\d]\w*(?=:(?:$|\s+for))">
<token type="NameLabel"/>
</rule>
<rule pattern="[&lt;&gt;()\[\]{}.,;:]">
<token type="Punctuation"/>
</rule>
<rule pattern="@?[^\W\d]\w*">
<token type="NameVariable"/>
</rule>
</state>
<state name="strings">
<rule pattern="(c)?(&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringDouble"/>
</bygroups>
<push state="string-double"/>
</rule>
<rule pattern="(c)?(&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralStringSingle"/>
</bygroups>
<push state="string-single"/>
</rule>
<rule pattern="(r)(&#34;[^&#34;]+&#34;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralString"/>
</bygroups>
</rule>
<rule pattern="(r)(&#39;[^&#39;]+&#39;)">
<bygroups>
<token type="LiteralStringAffix"/>
<token type="LiteralString"/>
</bygroups>
</rule>
</state>
<state name="string-single">
<rule pattern="&#39;">
<token type="LiteralStringSingle"/>
<pop depth="1"/>
</rule>
<rule>
<include state="char-escape"/>
</rule>
<rule pattern="(\$)((?!\\){)">
<bygroups>
<token type="Operator"/>
<token type="Punctuation"/>
</bygroups>
<push state="string-curly-interpolation"/>
</rule>
<rule pattern="\$">
<token type="Operator"/>
<push state="string-interpolation"/>
</rule>
<rule pattern="[^&#39;]+?">
<token type="LiteralStringSingle"/>
</rule>
</state>
<state name="char-escape">
<rule pattern="\\[`&#39;&#34;\\abfnrtv$]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}">
<token type="LiteralStringEscape"/>
</rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,85 @@
<lexer>
<config>
<name>VimL</name>
<alias>vim</alias>
<filename>*.vim</filename>
<filename>.vimrc</filename>
<filename>.exrc</filename>
<filename>.gvimrc</filename>
<filename>_vimrc</filename>
<filename>_exrc</filename>
<filename>_gvimrc</filename>
<filename>vimrc</filename>
<filename>gvimrc</filename>
<mime_type>text/x-vim</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="^([ \t:]*)(py(?:t(?:h(?:o(?:n)?)?)?)?)([ \t]*)(&lt;&lt;)([ \t]*)(.*)((?:\n|.)*)(\6)">
<bygroups>
<usingself state="root"/>
<token type="Keyword"/>
<token type="Text"/>
<token type="Operator"/>
<token type="Text"/>
<token type="Text"/>
<using lexer="Python"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="^([ \t:]*)(py(?:t(?:h(?:o(?:n)?)?)?)?)([ \t])(.*)">
<bygroups>
<usingself state="root"/>
<token type="Keyword"/>
<token type="Text"/>
<using lexer="Python"/>
</bygroups>
</rule>
<rule pattern="^\s*&#34;.*">
<token type="Comment"/>
</rule>
<rule pattern="[ \t]+">
<token type="Text"/>
</rule>
<rule pattern="/(\\\\|\\/|[^\n/])*/">
<token type="LiteralStringRegex"/>
</rule>
<rule pattern="&#34;(\\\\|\\&#34;|[^\n&#34;])*&#34;">
<token type="LiteralStringDouble"/>
</rule>
<rule pattern="&#39;(&#39;&#39;|[^\n&#39;])*&#39;">
<token type="LiteralStringSingle"/>
</rule>
<rule pattern="(?&lt;=\s)&#34;[^\-:.%#=*].*">
<token type="Comment"/>
</rule>
<rule pattern="-?\d+">
<token type="LiteralNumber"/>
</rule>
<rule pattern="#[0-9a-f]{6}">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="^:">
<token type="Punctuation"/>
</rule>
<rule pattern="[()&lt;&gt;+=!|,~-]">
<token type="Punctuation"/>
</rule>
<rule pattern="\b(let|if|else|endif|elseif|fun|function|endfunction|set|map|autocmd|filetype|hi(ghlight)?|execute|syntax|colorscheme)\b">
<token type="Keyword"/>
</rule>
<rule pattern="\b(NONE|bold|italic|underline|dark|light)\b">
<token type="NameBuiltin"/>
</rule>
<rule pattern="\b\w+\b">
<token type="NameOther"/>
</rule>
<rule pattern="\n">
<token type="Text"/>
</rule>
<rule pattern=".">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
-36
View File
@@ -1,36 +0,0 @@
<lexer>
<config>
<name>Z80 Assembly</name>
<alias>z80</alias>
<filename>*.z80</filename>
<filename>*.asm</filename>
<case_insensitive>true</case_insensitive>
</config>
<rules>
<state name="root">
<rule pattern=";.*?$"><token type="CommentSingle"/></rule>
<rule pattern="^[.\w]+:"><token type="NameLabel"/></rule>
<rule pattern="((0x)|\$)[0-9a-fA-F]+"><token type="LiteralNumberHex"/></rule>
<rule pattern="[0-9][0-9a-fA-F]+h"><token type="LiteralNumberHex"/></rule>
<rule pattern="((0b)|%)[01]+"><token type="LiteralNumberBin"/></rule>
<rule pattern="-?[0-9]+"><token type="LiteralNumberInteger"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><push state="string"/></rule>
<rule pattern="&#x27;\\?.&#x27;"><token type="LiteralStringChar"/></rule>
<rule pattern="[,=()\\]"><token type="Punctuation"/></rule>
<rule pattern="^\s*#\w+"><token type="CommentPreproc"/></rule>
<rule pattern="\.(db|dw|end|org|byte|word|fill|block|addinstr|echo|error|list|nolist|equ|show|option|seek)"><token type="NameBuiltin"/></rule>
<rule pattern="(ex|exx|ld|ldd|lddr|ldi|ldir|pop|push|adc|add|cp|cpd|cpdr|cpi|cpir|cpl|daa|dec|inc|neg|sbc|sub|and|bit|ccf|or|res|scf|set|xor|rl|rla|rlc|rlca|rld|rr|rra|rrc|rrca|rrd|sla|sra|srl|call|djnz|jp|jr|ret|rst|nop|reti|retn|di|ei|halt|im|in|ind|indr|ini|inir|out|outd|otdr|outi|otir)"><token type="Keyword"/></rule>
<rule pattern="(z|nz|c|nc|po|pe|p|m)"><token type="Keyword"/></rule>
<rule pattern="[+-/*~\^&amp;|]"><token type="Operator"/></rule>
<rule pattern="\w+"><token type="Text"/></rule>
<rule pattern="\s+"><token type="Text"/></rule>
</state>
<state name="string">
<rule pattern="[^&quot;\\]+"><token type="LiteralString"/></rule>
<rule pattern="\\."><token type="LiteralStringEscape"/></rule>
<rule pattern="&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
</state>
</rules>
</lexer>
@@ -0,0 +1,74 @@
<lexer>
<config>
<name>Z80 Assembly</name>
<alias>z80</alias>
<filename>*.z80</filename>
<filename>*.asm</filename>
<case_insensitive>true</case_insensitive>
</config>
<rules>
<state name="string">
<rule pattern="[^&#34;\\]+">
<token type="LiteralString"/>
</rule>
<rule pattern="\\.">
<token type="LiteralStringEscape"/>
</rule>
<rule pattern="&#34;">
<token type="LiteralString"/>
<pop depth="1"/>
</rule>
</state>
<state name="root">
<rule pattern=";.*?$">
<token type="CommentSingle"/>
</rule>
<rule pattern="^[.\w]+:">
<token type="NameLabel"/>
</rule>
<rule pattern="((0x)|\$)[0-9a-fA-F]+">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="[0-9][0-9a-fA-F]+h">
<token type="LiteralNumberHex"/>
</rule>
<rule pattern="((0b)|%)[01]+">
<token type="LiteralNumberBin"/>
</rule>
<rule pattern="-?[0-9]+">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="&#34;">
<token type="LiteralString"/>
<push state="string"/>
</rule>
<rule pattern="&#39;\\?.&#39;">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="[,=()\\]">
<token type="Punctuation"/>
</rule>
<rule pattern="^\s*#\w+">
<token type="CommentPreproc"/>
</rule>
<rule pattern="\.(db|dw|end|org|byte|word|fill|block|addinstr|echo|error|list|nolist|equ|show|option|seek)">
<token type="NameBuiltin"/>
</rule>
<rule pattern="(ex|exx|ld|ldd|lddr|ldi|ldir|pop|push|adc|add|cp|cpd|cpdr|cpi|cpir|cpl|daa|dec|inc|neg|sbc|sub|and|bit|ccf|or|res|scf|set|xor|rl|rla|rlc|rlca|rld|rr|rra|rrc|rrca|rrd|sla|sra|srl|call|djnz|jp|jr|ret|rst|nop|reti|retn|di|ei|halt|im|in|ind|indr|ini|inir|out|outd|otdr|outi|otir)">
<token type="Keyword"/>
</rule>
<rule pattern="(z|nz|c|nc|po|pe|p|m)">
<token type="Keyword"/>
</rule>
<rule pattern="[+-/*~\^&amp;|]">
<token type="Operator"/>
</rule>
<rule pattern="\w+">
<token type="Text"/>
</rule>
<rule pattern="\s+">
<token type="Text"/>
</rule>
</state>
</rules>
</lexer>
-38
View File
@@ -1,38 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// FortranFixed lexer.
var FortranFixed = Register(MustNewLexer(
&Config{
Name: "FortranFixed",
Aliases: []string{"fortranfixed"},
Filenames: []string{"*.f", "*.F"},
MimeTypes: []string{"text/x-fortran"},
NotMultiline: true,
CaseInsensitive: true,
},
func() Rules {
return Rules{
"root": {
{`[C*].*\n`, Comment, nil},
{`#.*\n`, CommentPreproc, nil},
{` {0,4}!.*\n`, Comment, nil},
{`(.{5})`, NameLabel, Push("cont-char")},
{`.*\n`, Using("Fortran"), nil},
},
"cont-char": {
{` `, TextWhitespace, Push("code")},
{`.`, GenericStrong, Push("code")},
},
"code": {
{`(.{66})(.*)(\n)`, ByGroups(Using("Fortran"), Comment, TextWhitespace), Push("root")},
{`(.*)(!.*)(\n)`, ByGroups(Using("Fortran"), Comment, TextWhitespace), Push("root")},
{`(.*)(\n)`, ByGroups(Using("Fortran"), TextWhitespace), Push("root")},
Default(Push("root")),
},
}
},
))
+1 -1
View File
@@ -38,7 +38,7 @@ func goRules() Rules {
{`(var|func|struct|map|chan|type|interface|const)\b`, KeywordDeclaration, nil},
{Words(``, `\b`, `break`, `default`, `select`, `case`, `defer`, `go`, `else`, `goto`, `switch`, `fallthrough`, `if`, `range`, `continue`, `for`, `return`), Keyword, nil},
{`(true|false|iota|nil)\b`, KeywordConstant, nil},
{Words(``, `\b(\()`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `int`, `int8`, `int16`, `int32`, `int64`, `float`, `float32`, `float64`, `complex64`, `complex128`, `byte`, `rune`, `string`, `bool`, `error`, `uintptr`, `print`, `println`, `panic`, `recover`, `close`, `complex`, `real`, `imag`, `len`, `cap`, `append`, `copy`, `delete`, `new`, `make`), ByGroups(NameBuiltin, Punctuation), nil},
{Words(``, `\b(\()`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `int`, `int8`, `int16`, `int32`, `int64`, `float`, `float32`, `float64`, `complex64`, `complex128`, `byte`, `rune`, `string`, `bool`, `error`, `uintptr`, `print`, `println`, `panic`, `recover`, `close`, `complex`, `real`, `imag`, `len`, `cap`, `append`, `copy`, `delete`, `new`, `make`, `clear`, `min`, `max`), ByGroups(NameBuiltin, Punctuation), nil},
{Words(``, `\b`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `int`, `int8`, `int16`, `int32`, `int64`, `float`, `float32`, `float64`, `complex64`, `complex128`, `byte`, `rune`, `string`, `bool`, `error`, `uintptr`), KeywordType, nil},
{`\d+i`, LiteralNumber, nil},
{`\d+\.\d*([Ee][-+]\d+)?i`, LiteralNumber, nil},
+3 -1
View File
@@ -630,7 +630,9 @@ func haxePreProcMutator(state *LexerState) error {
state.Stack = stack[len(stack)-1]
}
case "end":
stack = stack[:len(stack)-1]
if len(stack) > 0 {
stack = stack[:len(stack)-1]
}
}
if proc == "if" || proc == "elseif" {
+2 -54
View File
@@ -1,60 +1,8 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
"github.com/alecthomas/chroma/v2"
)
// HTML lexer.
var HTML = Register(MustNewLexer(
&Config{
Name: "HTML",
Aliases: []string{"html"},
Filenames: []string{"*.html", "*.htm", "*.xhtml", "*.xslt"},
MimeTypes: []string{"text/html", "application/xhtml+xml"},
NotMultiline: true,
DotAll: true,
CaseInsensitive: true,
},
htmlRules,
))
func htmlRules() Rules {
return Rules{
"root": {
{`[^<&]+`, Text, nil},
{`&\S*?;`, NameEntity, nil},
{`\<\!\[CDATA\[.*?\]\]\>`, CommentPreproc, nil},
{`<!--`, Comment, Push("comment")},
{`<\?.*?\?>`, CommentPreproc, nil},
{`<![^>]*>`, CommentPreproc, nil},
{`(<)(\s*)(script)(\s*)`, ByGroups(Punctuation, Text, NameTag, Text), Push("script-content", "tag")},
{`(<)(\s*)(style)(\s*)`, ByGroups(Punctuation, Text, NameTag, Text), Push("style-content", "tag")},
{`(<)(\s*)([\w:.-]+)`, ByGroups(Punctuation, Text, NameTag), Push("tag")},
{`(<)(\s*)(/)(\s*)([\w:.-]+)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation, Text, NameTag, Text, Punctuation), nil},
},
"comment": {
{`[^-]+`, Comment, nil},
{`-->`, Comment, Pop(1)},
{`-`, Comment, nil},
},
"tag": {
{`\s+`, Text, nil},
{`([\w:-]+\s*)(=)(\s*)`, ByGroups(NameAttribute, Operator, Text), Push("attr")},
{`[\w:-]+`, NameAttribute, nil},
{`(/?)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation), Pop(1)},
},
"script-content": {
{`(<)(\s*)(/)(\s*)(script)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation, Text, NameTag, Text, Punctuation), Pop(1)},
{`.+?(?=<\s*/\s*script\s*>)`, Using("Javascript"), nil},
},
"style-content": {
{`(<)(\s*)(/)(\s*)(style)(\s*)(>)`, ByGroups(Punctuation, Text, Punctuation, Text, NameTag, Text, Punctuation), Pop(1)},
{`.+?(?=<\s*/\s*style\s*>)`, Using("CSS"), nil},
},
"attr": {
{`".*?"`, LiteralString, Pop(1)},
{`'.*?'`, LiteralString, Pop(1)},
{`[^\s>]+`, LiteralString, Pop(1)},
},
}
}
var HTML = chroma.MustNewXMLLexer(embedded, "embedded/html.xml")
+6
View File
@@ -30,6 +30,9 @@ func Names(withAliases bool) []string {
}
// Get a Lexer by name, alias or file extension.
//
// Note that this if there isn't an exact match on name or alias, this will
// call Match(), so it is not efficient.
func Get(name string) chroma.Lexer {
return GlobalLexerRegistry.Get(name)
}
@@ -40,6 +43,9 @@ func MatchMimeType(mimeType string) chroma.Lexer {
}
// Match returns the first lexer matching filename.
//
// Note that this iterates over all file patterns in all lexers, so it's not
// particularly efficient.
func Match(filename string) chroma.Lexer {
return GlobalLexerRegistry.Match(filename)
}
-56
View File
@@ -1,56 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Makefile lexer.
var Makefile = Register(MustNewLexer(
&Config{
Name: "Makefile",
Aliases: []string{"make", "makefile", "mf", "bsdmake"},
Filenames: []string{"*.mak", "*.mk", "Makefile", "makefile", "Makefile.*", "GNUmakefile", "BSDmakefile"},
MimeTypes: []string{"text/x-makefile"},
EnsureNL: true,
},
makefileRules,
))
func makefileRules() Rules {
return Rules{
"root": {
{`^(?:[\t ]+.*\n|\n)+`, Using("Bash"), nil},
{`\$[<@$+%?|*]`, Keyword, nil},
{`\s+`, Text, nil},
{`#.*?\n`, Comment, nil},
{`(export)(\s+)(?=[\w${}\t -]+\n)`, ByGroups(Keyword, Text), Push("export")},
{`export\s+`, Keyword, nil},
{`([\w${}().-]+)(\s*)([!?:+]?=)([ \t]*)((?:.*\\\n)+|.*\n)`, ByGroups(NameVariable, Text, Operator, Text, Using("Bash")), nil},
{`(?s)"(\\\\|\\.|[^"\\])*"`, LiteralStringDouble, nil},
{`(?s)'(\\\\|\\.|[^'\\])*'`, LiteralStringSingle, nil},
{`([^\n:]+)(:+)([ \t]*)`, ByGroups(NameFunction, Operator, Text), Push("block-header")},
{`\$\(`, Keyword, Push("expansion")},
},
"expansion": {
{`[^$a-zA-Z_()]+`, Text, nil},
{`[a-zA-Z_]+`, NameVariable, nil},
{`\$`, Keyword, nil},
{`\(`, Keyword, Push()},
{`\)`, Keyword, Pop(1)},
},
"export": {
{`[\w${}-]+`, NameVariable, nil},
{`\n`, Text, Pop(1)},
{`\s+`, Text, nil},
},
"block-header": {
{`[,|]`, Punctuation, nil},
{`#.*?\n`, Comment, Pop(1)},
{`\\\n`, Text, nil},
{`\$\(`, Keyword, Push("expansion")},
{`[a-zA-Z_]+`, Name, nil},
{`\n`, Text, Pop(1)},
{`.`, Text, nil},
},
}
}
-62
View File
@@ -1,62 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Mako lexer.
var Mako = Register(MustNewLexer(
&Config{
Name: "Mako",
Aliases: []string{"mako"},
Filenames: []string{"*.mao"},
MimeTypes: []string{"application/x-mako"},
},
makoRules,
))
func makoRules() Rules {
return Rules{
"root": {
{`(\s*)(%)(\s*end(?:\w+))(\n|\Z)`, ByGroups(Text, CommentPreproc, Keyword, Other), nil},
{`(\s*)(%)([^\n]*)(\n|\Z)`, ByGroups(Text, CommentPreproc, Using("Python"), Other), nil},
{`(\s*)(##[^\n]*)(\n|\Z)`, ByGroups(Text, CommentPreproc, Other), nil},
{`(?s)<%doc>.*?</%doc>`, CommentPreproc, nil},
{`(<%)([\w.:]+)`, ByGroups(CommentPreproc, NameBuiltin), Push("tag")},
{`(</%)([\w.:]+)(>)`, ByGroups(CommentPreproc, NameBuiltin, CommentPreproc), nil},
{`<%(?=([\w.:]+))`, CommentPreproc, Push("ondeftags")},
{`(<%(?:!?))(.*?)(%>)(?s)`, ByGroups(CommentPreproc, Using("Python"), CommentPreproc), nil},
{`(\$\{)(.*?)(\})`, ByGroups(CommentPreproc, Using("Python"), CommentPreproc), nil},
{`(?sx)
(.+?) # anything, followed by:
(?:
(?<=\n)(?=%|\#\#) | # an eval or comment line
(?=\#\*) | # multiline comment
(?=</?%) | # a python block
# call start or end
(?=\$\{) | # a substitution
(?<=\n)(?=\s*%) |
# - don't consume
(\\\n) | # an escaped newline
\Z # end of string
)
`, ByGroups(Other, Operator), nil},
{`\s+`, Text, nil},
},
"ondeftags": {
{`<%`, CommentPreproc, nil},
{`(?<=<%)(include|inherit|namespace|page)`, NameBuiltin, nil},
Include("tag"),
},
"tag": {
{`((?:\w+)\s*=)(\s*)(".*?")`, ByGroups(NameAttribute, Text, LiteralString), nil},
{`/?\s*>`, CommentPreproc, Pop(1)},
{`\s+`, Text, nil},
},
"attr": {
{`".*?"`, LiteralString, Pop(1)},
{`'.*?'`, LiteralString, Pop(1)},
{`[^\s>]+`, LiteralString, Pop(1)},
},
}
}
-44
View File
@@ -1,44 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Mason lexer.
var Mason = Register(MustNewLexer(
&Config{
Name: "Mason",
Aliases: []string{"mason"},
Filenames: []string{"*.m", "*.mhtml", "*.mc", "*.mi", "autohandler", "dhandler"},
MimeTypes: []string{"application/x-mason"},
Priority: 0.1,
},
masonRules,
))
func masonRules() Rules {
return Rules{
"root": {
{`\s+`, Text, nil},
{`(<%doc>)(.*?)(</%doc>)(?s)`, ByGroups(NameTag, CommentMultiline, NameTag), nil},
{`(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil},
{`(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using("Perl"), NameTag), nil},
{`(<&[^|])(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using("Perl"), NameTag), nil},
{`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using("Perl"), NameTag), nil},
{`</&>`, NameTag, nil},
{`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using("Perl"), NameTag), nil},
{`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil},
{`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using("Perl"), Other), nil},
{`(?sx)
(.+?) # anything, followed by:
(?:
(?<=\n)(?=[%#]) | # an eval or comment line
(?=</?[%&]) | # a substitution or block or
# call start or end
# - don't consume
(\\\n) | # an escaped newline
\Z # end of string
)`, ByGroups(Using("HTML"), Operator), nil},
},
}
}
-42
View File
@@ -1,42 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Myghty lexer.
var Myghty = Register(MustNewLexer(
&Config{
Name: "Myghty",
Aliases: []string{"myghty"},
Filenames: []string{"*.myt", "autodelegate"},
MimeTypes: []string{"application/x-myghty"},
},
myghtyRules,
))
func myghtyRules() Rules {
return Rules{
"root": {
{`\s+`, Text, nil},
{`(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, Text, NameFunction, NameTag, UsingSelf("root"), NameTag), nil},
{`(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)`, ByGroups(NameTag, NameFunction, NameTag, Using("Python2"), NameTag), nil},
{`(<&[^|])(.*?)(,.*?)?(&>)`, ByGroups(NameTag, NameFunction, Using("Python2"), NameTag), nil},
{`(<&\|)(.*?)(,.*?)?(&>)(?s)`, ByGroups(NameTag, NameFunction, Using("Python2"), NameTag), nil},
{`</&>`, NameTag, nil},
{`(<%!?)(.*?)(%>)(?s)`, ByGroups(NameTag, Using("Python2"), NameTag), nil},
{`(?<=^)#[^\n]*(\n|\Z)`, Comment, nil},
{`(?<=^)(%)([^\n]*)(\n|\Z)`, ByGroups(NameTag, Using("Python2"), Other), nil},
{`(?sx)
(.+?) # anything, followed by:
(?:
(?<=\n)(?=[%#]) | # an eval or comment line
(?=</?[%&]) | # a substitution or block or
# call start or end
# - don't consume
(\\\n) | # an escaped newline
\Z # end of string
)`, ByGroups(Other, Operator), nil},
},
}
}
File diff suppressed because one or more lines are too long
-99
View File
@@ -1,99 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Org mode lexer.
var Org = Register(MustNewLexer(
&Config{
Name: "Org Mode",
Aliases: []string{"org", "orgmode"},
Filenames: []string{"*.org"},
MimeTypes: []string{"text/org"}, // https://lists.gnu.org/r/emacs-orgmode/2017-09/msg00087.html
},
orgRules,
))
func orgRules() Rules {
return Rules{
"root": {
{`^# .*$`, Comment, nil},
// Headings
{`^(\*)( COMMENT)( .*)$`, ByGroups(GenericHeading, NameEntity, GenericStrong), nil},
{`^(\*\*+)( COMMENT)( .*)$`, ByGroups(GenericSubheading, NameEntity, Text), nil},
{`^(\*)( DONE)( .*)$`, ByGroups(GenericHeading, LiteralStringRegex, GenericStrong), nil},
{`^(\*\*+)( DONE)( .*)$`, ByGroups(GenericSubheading, LiteralStringRegex, Text), nil},
{`^(\*)( TODO)( .*)$`, ByGroups(GenericHeading, Error, GenericStrong), nil},
{`^(\*\*+)( TODO)( .*)$`, ByGroups(GenericSubheading, Error, Text), nil},
{`^(\*)( .+?)( :[a-zA-Z0-9_@:]+:)$`, ByGroups(GenericHeading, GenericStrong, GenericEmph), nil}, // Level 1 heading with tags
{`^(\*)( .+)$`, ByGroups(GenericHeading, GenericStrong), nil}, // // Level 1 heading with NO tags
{`^(\*\*+)( .+?)( :[a-zA-Z0-9_@:]+:)$`, ByGroups(GenericSubheading, Text, GenericEmph), nil}, // Level 2+ heading with tags
{`^(\*\*+)( .+)$`, ByGroups(GenericSubheading, Text), nil}, // Level 2+ heading with NO tags
// Checkbox lists
{`^( *)([+-] )(\[[ X]\])( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil},
{`^( +)(\* )(\[[ X]\])( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil},
// Definition lists
{`^( *)([+-] )([^ \n]+ ::)( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil},
{`^( +)(\* )([^ \n]+ ::)( .+)$`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil},
// Unordered lists
{`^( *)([+-] )(.+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil},
{`^( +)(\* )(.+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil},
// Ordered lists
{`^( *)([0-9]+[.)])( \[@[0-9]+\])( .+)$`, ByGroups(Text, Keyword, GenericEmph, UsingSelf("inline")), nil},
{`^( *)([0-9]+[.)])( .+)$`, ByGroups(Text, Keyword, UsingSelf("inline")), nil},
// Dynamic Blocks
{`(?i)^( *#\+begin: )([^ ]+)([\w\W]*?\n)([\w\W]*?)(^ *#\+end: *$)`, ByGroups(Comment, CommentSpecial, Comment, UsingSelf("inline"), Comment), nil},
// Blocks
// - Comment Blocks
{`(?i)^( *#\+begin_comment *\n)([\w\W]*?)(^ *#\+end_comment *$)`, ByGroups(Comment, Comment, Comment), nil},
// - Src Blocks
{
`(?i)^( *#\+begin_src )([^ \n]+)(.*?\n)([\w\W]*?)(^ *#\+end_src *$)`,
UsingByGroup(2, 4, Comment, CommentSpecial, Comment, Text, Comment),
nil,
},
// - Export Blocks
{
`(?i)^( *#\+begin_export )(\w+)( *\n)([\w\W]*?)(^ *#\+end_export *$)`,
UsingByGroup(2, 4, Comment, CommentSpecial, Text, Text, Comment),
nil,
},
// - Org Special, Example, Verse, etc. Blocks
{`(?i)^( *#\+begin_)(\w+)( *\n)([\w\W]*?)(^ *#\+end_\2)( *$)`, ByGroups(Comment, Comment, Text, Text, Comment, Text), nil},
// Keywords
{`^(#\+\w+)(:.*)$`, ByGroups(CommentSpecial, Comment), nil}, // Other Org keywords like #+title
// Properties and Drawers
{`(?i)^( *:\w+: *\n)([\w\W]*?)(^ *:end: *$)`, ByGroups(Comment, CommentSpecial, Comment), nil},
// Line break operator
{`^(.*)(\\\\)$`, ByGroups(UsingSelf("inline"), Operator), nil},
// Deadline/Scheduled
{`(?i)^( *(?:DEADLINE|SCHEDULED): )(<[^<>]+?> *)$`, ByGroups(Comment, CommentSpecial), nil}, // DEADLINE/SCHEDULED: <datestamp>
// DONE state CLOSED
{`(?i)^( *CLOSED: )(\[[^][]+?\] *)$`, ByGroups(Comment, CommentSpecial), nil}, // CLOSED: [datestamp]
// All other lines
Include("inline"),
},
"inline": {
{`(\s)*(\*[^ \n*][^*]+?[^ \n*]\*)((?=\W|\n|$))`, ByGroups(Text, GenericStrong, Text), nil}, // Bold
{`(\s)*(/[^/]+?/)((?=\W|\n|$))`, ByGroups(Text, GenericEmph, Text), nil}, // Italic
{`(\s)*(=[^\n=]+?=)((?=\W|\n|$))`, ByGroups(Text, NameClass, Text), nil}, // Verbatim
{`(\s)*(~[^\n~]+?~)((?=\W|\n|$))`, ByGroups(Text, NameClass, Text), nil}, // Code
{`(\s)*(\+[^+]+?\+)((?=\W|\n|$))`, ByGroups(Text, GenericDeleted, Text), nil}, // Strikethrough
{`(\s)*(_[^_]+?_)((?=\W|\n|$))`, ByGroups(Text, GenericUnderline, Text), nil}, // Underline
{`(<)([^<>]+?)(>)`, ByGroups(Text, String, Text), nil}, // <datestamp>
{`[{]{3}[^}]+[}]{3}`, NameBuiltin, nil}, // {{{macro(foo,1)}}}
{`([^[])(\[fn:)([^]]+?)(\])([^]])`, ByGroups(Text, NameBuiltinPseudo, LiteralString, NameBuiltinPseudo, Text), nil}, // [fn:1]
// Links
{`(\[\[)([^][]+?)(\]\[)([^][]+)(\]\])`, ByGroups(Text, NameAttribute, Text, NameTag, Text), nil}, // [[link][descr]]
{`(\[\[)([^][]+?)(\]\])`, ByGroups(Text, NameAttribute, Text), nil}, // [[link]]
{`(<<)([^<>]+?)(>>)`, ByGroups(Text, NameAttribute, Text), nil}, // <<targetlink>>
// Tables
{`^( *)(\|[ -].*?[ -]\|)$`, ByGroups(Text, String), nil},
// Blank lines, newlines
{`\n`, Text, nil},
// Any other text
{`.`, Text, nil},
},
}
}
-16
View File
@@ -1,16 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
var Plaintext = Register(MustNewLexer(
&Config{
Name: "plaintext",
Aliases: []string{"text", "plain", "no-highlight"},
Filenames: []string{"*.txt"},
MimeTypes: []string{"text/plain"},
Priority: -1,
},
PlaintextRules,
))
-77
View File
@@ -1,77 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Postgresql Sql Dialect lexer.
var PostgreSQL = Register(MustNewLexer(
&Config{
Name: "PostgreSQL SQL dialect",
Aliases: []string{"postgresql", "postgres"},
Filenames: []string{},
MimeTypes: []string{"text/x-postgresql"},
NotMultiline: true,
CaseInsensitive: true,
},
postgreSQLRules,
))
func postgreSQLRules() Rules {
return Rules{
"root": {
{`\s+`, Text, nil},
{`--.*\n?`, CommentSingle, nil},
{`/\*`, CommentMultiline, Push("multiline-comments")},
{`(bigint|bigserial|bit|bit\s+varying|bool|boolean|box|bytea|char|character|character\s+varying|cidr|circle|date|decimal|double\s+precision|float4|float8|inet|int|int2|int4|int8|integer|interval|json|jsonb|line|lseg|macaddr|money|numeric|path|pg_lsn|point|polygon|real|serial|serial2|serial4|serial8|smallint|smallserial|text|time|timestamp|timestamptz|timetz|tsquery|tsvector|txid_snapshot|uuid|varbit|varchar|with\s+time\s+zone|without\s+time\s+zone|xml|anyarray|anyelement|anyenum|anynonarray|anyrange|cstring|fdw_handler|internal|language_handler|opaque|record|void)\b`, NameBuiltin, nil},
{
`(?s)(DO)(\s+)(?:(LANGUAGE)?(\s+)('?)(\w+)?('?)(\s+))?(\$)([^$]*)(\$)(.*?)(\$)(\10)(\$)`,
UsingByGroup(6, 12,
Keyword, Text, Keyword, Text, // DO LANGUAGE
StringSingle, StringSingle, StringSingle, Text, // 'plpgsql'
StringHeredoc, StringHeredoc, StringHeredoc, // $tag$
StringHeredoc, // (code block)
StringHeredoc, StringHeredoc, StringHeredoc), // $tag$
nil,
},
{Words(``, `\b`, `ABORT`, `ABSOLUTE`, `ACCESS`, `ACTION`, `ADD`, `ADMIN`, `AFTER`, `AGGREGATE`, `ALL`, `ALSO`, `ALTER`, `ALWAYS`, `ANALYSE`, `ANALYZE`, `AND`, `ANY`, `ARRAY`, `AS`, `ASC`, `ASSERTION`, `ASSIGNMENT`, `ASYMMETRIC`, `AT`, `ATTRIBUTE`, `AUTHORIZATION`, `BACKWARD`, `BEFORE`, `BEGIN`, `BETWEEN`, `BIGINT`, `BINARY`, `BIT`, `BOOLEAN`, `BOTH`, `BY`, `CACHE`, `CALLED`, `CASCADE`, `CASCADED`, `CASE`, `CAST`, `CATALOG`, `CHAIN`, `CHAR`, `CHARACTER`, `CHARACTERISTICS`, `CHECK`, `CHECKPOINT`, `CLASS`, `CLOSE`, `CLUSTER`, `COALESCE`, `COLLATE`, `COLLATION`, `COLUMN`, `COMMENT`, `COMMENTS`, `COMMIT`, `COMMITTED`, `CONCURRENTLY`, `CONFIGURATION`, `CONNECTION`, `CONSTRAINT`, `CONSTRAINTS`, `CONTENT`, `CONTINUE`, `CONVERSION`, `COPY`, `COST`, `CREATE`, `CROSS`, `CSV`, `CURRENT`, `CURRENT_CATALOG`, `CURRENT_DATE`, `CURRENT_ROLE`, `CURRENT_SCHEMA`, `CURRENT_TIME`, `CURRENT_TIMESTAMP`, `CURRENT_USER`, `CURSOR`, `CYCLE`, `DATA`, `DATABASE`, `DAY`, `DEALLOCATE`, `DEC`, `DECIMAL`, `DECLARE`, `DEFAULT`, `DEFAULTS`, `DEFERRABLE`, `DEFERRED`, `DEFINER`, `DELETE`, `DELIMITER`, `DELIMITERS`, `DESC`, `DICTIONARY`, `DISABLE`, `DISCARD`, `DISTINCT`, `DO`, `DOCUMENT`, `DOMAIN`, `DOUBLE`, `DROP`, `EACH`, `ELSE`, `ENABLE`, `ENCODING`, `ENCRYPTED`, `END`, `ENUM`, `ESCAPE`, `EVENT`, `EXCEPT`, `EXCLUDE`, `EXCLUDING`, `EXCLUSIVE`, `EXECUTE`, `EXISTS`, `EXPLAIN`, `EXTENSION`, `EXTERNAL`, `EXTRACT`, `FALSE`, `FAMILY`, `FETCH`, `FILTER`, `FIRST`, `FLOAT`, `FOLLOWING`, `FOR`, `FORCE`, `FOREIGN`, `FORWARD`, `FREEZE`, `FROM`, `FULL`, `FUNCTION`, `FUNCTIONS`, `GLOBAL`, `GRANT`, `GRANTED`, `GREATEST`, `GROUP`, `HANDLER`, `HAVING`, `HEADER`, `HOLD`, `HOUR`, `IDENTITY`, `IF`, `ILIKE`, `IMMEDIATE`, `IMMUTABLE`, `IMPLICIT`, `IN`, `INCLUDING`, `INCREMENT`, `INDEX`, `INDEXES`, `INHERIT`, `INHERITS`, `INITIALLY`, `INLINE`, `INNER`, `INOUT`, `INPUT`, `INSENSITIVE`, `INSERT`, `INSTEAD`, `INT`, `INTEGER`, `INTERSECT`, `INTERVAL`, `INTO`, `INVOKER`, `IS`, `ISNULL`, `ISOLATION`, `JOIN`, `KEY`, `LABEL`, `LANGUAGE`, `LARGE`, `LAST`, `LATERAL`, `LC_COLLATE`, `LC_CTYPE`, `LEADING`, `LEAKPROOF`, `LEAST`, `LEFT`, `LEVEL`, `LIKE`, `LIMIT`, `LISTEN`, `LOAD`, `LOCAL`, `LOCALTIME`, `LOCALTIMESTAMP`, `LOCATION`, `LOCK`, `MAPPING`, `MATCH`, `MATERIALIZED`, `MAXVALUE`, `MINUTE`, `MINVALUE`, `MODE`, `MONTH`, `MOVE`, `NAME`, `NAMES`, `NATIONAL`, `NATURAL`, `NCHAR`, `NEXT`, `NO`, `NONE`, `NOT`, `NOTHING`, `NOTIFY`, `NOTNULL`, `NOWAIT`, `NULL`, `NULLIF`, `NULLS`, `NUMERIC`, `OBJECT`, `OF`, `OFF`, `OFFSET`, `OIDS`, `ON`, `ONLY`, `OPERATOR`, `OPTION`, `OPTIONS`, `OR`, `ORDER`, `ORDINALITY`, `OUT`, `OUTER`, `OVER`, `OVERLAPS`, `OVERLAY`, `OWNED`, `OWNER`, `PARSER`, `PARTIAL`, `PARTITION`, `PASSING`, `PASSWORD`, `PLACING`, `PLANS`, `POLICY`, `POSITION`, `PRECEDING`, `PRECISION`, `PREPARE`, `PREPARED`, `PRESERVE`, `PRIMARY`, `PRIOR`, `PRIVILEGES`, `PROCEDURAL`, `PROCEDURE`, `PROGRAM`, `QUOTE`, `RANGE`, `READ`, `REAL`, `REASSIGN`, `RECHECK`, `RECURSIVE`, `REF`, `REFERENCES`, `REFRESH`, `REINDEX`, `RELATIVE`, `RELEASE`, `RENAME`, `REPEATABLE`, `REPLACE`, `REPLICA`, `RESET`, `RESTART`, `RESTRICT`, `RETURNING`, `RETURNS`, `REVOKE`, `RIGHT`, `ROLE`, `ROLLBACK`, `ROW`, `ROWS`, `RULE`, `SAVEPOINT`, `SCHEMA`, `SCROLL`, `SEARCH`, `SECOND`, `SECURITY`, `SELECT`, `SEQUENCE`, `SEQUENCES`, `SERIALIZABLE`, `SERVER`, `SESSION`, `SESSION_USER`, `SET`, `SETOF`, `SHARE`, `SHOW`, `SIMILAR`, `SIMPLE`, `SMALLINT`, `SNAPSHOT`, `SOME`, `STABLE`, `STANDALONE`, `START`, `STATEMENT`, `STATISTICS`, `STDIN`, `STDOUT`, `STORAGE`, `STRICT`, `STRIP`, `SUBSTRING`, `SYMMETRIC`, `SYSID`, `SYSTEM`, `TABLE`, `TABLES`, `TABLESPACE`, `TEMP`, `TEMPLATE`, `TEMPORARY`, `TEXT`, `THEN`, `TIME`, `TIMESTAMP`, `TO`, `TRAILING`, `TRANSACTION`, `TREAT`, `TRIGGER`, `TRIM`, `TRUE`, `TRUNCATE`, `TRUSTED`, `TYPE`, `TYPES`, `UNBOUNDED`, `UNCOMMITTED`, `UNENCRYPTED`, `UNION`, `UNIQUE`, `UNKNOWN`, `UNLISTEN`, `UNLOGGED`, `UNTIL`, `UPDATE`, `USER`, `USING`, `VACUUM`, `VALID`, `VALIDATE`, `VALIDATOR`, `VALUE`, `VALUES`, `VARCHAR`, `VARIADIC`, `VARYING`, `VERBOSE`, `VERSION`, `VIEW`, `VIEWS`, `VOLATILE`, `WHEN`, `WHERE`, `WHITESPACE`, `WINDOW`, `WITH`, `WITHIN`, `WITHOUT`, `WORK`, `WRAPPER`, `WRITE`, `XML`, `XMLATTRIBUTES`, `XMLCONCAT`, `XMLELEMENT`, `XMLEXISTS`, `XMLFOREST`, `XMLPARSE`, `XMLPI`, `XMLROOT`, `XMLSERIALIZE`, `YEAR`, `YES`, `ZONE`), Keyword, nil},
{"[+*/<>=~!@#%^&|`?-]+", Operator, nil},
{`::`, Operator, nil},
{`\$\d+`, NameVariable, nil},
{`([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?`, LiteralNumberFloat, nil},
{`[0-9]+`, LiteralNumberInteger, nil},
{`((?:E|U&)?)(')`, ByGroups(LiteralStringAffix, LiteralStringSingle), Push("string")},
{`((?:U&)?)(")`, ByGroups(LiteralStringAffix, LiteralStringName), Push("quoted-ident")},
{
`(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)(\s+)(LANGUAGE)?(\s+)('?)(\w+)?('?)`,
UsingByGroup(12, 4,
StringHeredoc, StringHeredoc, StringHeredoc, // $tag$
StringHeredoc, // (code block)
StringHeredoc, StringHeredoc, StringHeredoc, // $tag$
Text, Keyword, Text, // <space> LANGUAGE <space>
StringSingle, StringSingle, StringSingle), // 'type'
nil,
},
{`(?s)(\$)([^$]*)(\$)(.*?)(\$)(\2)(\$)`, LiteralStringHeredoc, nil},
{`[a-z_]\w*`, Name, nil},
{`:(['"]?)[a-z]\w*\b\1`, NameVariable, nil},
{`[;:()\[\]{},.]`, Punctuation, nil},
},
"multiline-comments": {
{`/\*`, CommentMultiline, Push("multiline-comments")},
{`\*/`, CommentMultiline, Pop(1)},
{`[^/*]+`, CommentMultiline, nil},
{`[/*]`, CommentMultiline, nil},
},
"string": {
{`[^']+`, LiteralStringSingle, nil},
{`''`, LiteralStringSingle, nil},
{`'`, LiteralStringSingle, Pop(1)},
},
"quoted-ident": {
{`[^"]+`, LiteralStringName, nil},
{`""`, LiteralStringName, nil},
{`"`, LiteralStringName, Pop(1)},
},
}
}
-42
View File
@@ -1,42 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Smarty lexer.
var Smarty = Register(MustNewLexer(
&Config{
Name: "Smarty",
Aliases: []string{"smarty"},
Filenames: []string{"*.tpl"},
MimeTypes: []string{"application/x-smarty"},
DotAll: true,
},
smartyRules,
))
func smartyRules() Rules {
return Rules{
"root": {
{`[^{]+`, Other, nil},
{`(\{)(\*.*?\*)(\})`, ByGroups(CommentPreproc, Comment, CommentPreproc), nil},
{`(\{php\})(.*?)(\{/php\})`, ByGroups(CommentPreproc, Using("PHP"), CommentPreproc), nil},
{`(\{)(/?[a-zA-Z_]\w*)(\s*)`, ByGroups(CommentPreproc, NameFunction, Text), Push("smarty")},
{`\{`, CommentPreproc, Push("smarty")},
},
"smarty": {
{`\s+`, Text, nil},
{`\{`, CommentPreproc, Push()},
{`\}`, CommentPreproc, Pop(1)},
{`#[a-zA-Z_]\w*#`, NameVariable, nil},
{`\$[a-zA-Z_]\w*(\.\w+)*`, NameVariable, nil},
{`[~!%^&*()+=|\[\]:;,.<>/?@-]`, Operator, nil},
{`(true|false|null)\b`, KeywordConstant, nil},
{`[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?`, LiteralNumber, nil},
{`"(\\\\|\\"|[^"])*"`, LiteralStringDouble, nil},
{`'(\\\\|\\'|[^'])*'`, LiteralStringSingle, nil},
{`[a-zA-Z_]\w*`, NameAttribute, nil},
},
}
}
-173
View File
@@ -1,173 +0,0 @@
package lexers
import (
"strings"
. "github.com/alecthomas/chroma/v2" // nolint
)
// V lexer.
var V = Register(MustNewLexer(
&Config{
Name: "V",
Aliases: []string{"v", "vlang"},
Filenames: []string{"*.v", "*.vv", "v.mod"},
MimeTypes: []string{"text/x-v"},
EnsureNL: true,
},
vRules,
).SetAnalyser(func(text string) float32 {
if strings.Contains(text, "import ") && strings.Contains(text, "module ") {
return 0.2
}
if strings.Contains(text, "module ") {
return 0.1
}
return 0.0
}))
const (
namePattern = `[^\W\d]\w*`
typeNamePattern = `[A-Z]\w*`
multiLineCommentPattern = `/\*(?:.|\n)*?\*/`
)
func vRules() Rules {
return Rules{
"root": {
{`\n`, Text, nil},
{`\s+`, Text, nil},
{`\\\n`, Text, nil},
{`(?<=module\s+\w[^\n]*\s+)(//[^\n]+\n)+(?=\n)`, StringDoc, nil},
{`(// *)(\w+)([^\n]+\n)(?=(?://[^\n]*\n)* *(?:pub +)?(?:fn|struct|union|type|interface|enum|const) +\2\b)`, ByGroups(StringDoc, GenericEmph, StringDoc), Push(`string-doc`)},
{`//[^\n]*\n`, CommentSingle, nil},
{`/\*(?:(?:` + multiLineCommentPattern + `)*|.|\n)*\*/`, CommentMultiline, nil},
{`\b(import|module)\b`, KeywordNamespace, nil},
{`\b(fn|struct|union|map|chan|type|interface|enum|const|mut|shared|pub|__global)\b`, KeywordDeclaration, nil},
{`\?`, KeywordDeclaration, nil},
{`(?<=\)\s*)!`, KeywordDeclaration, nil},
{`[ \t]*#include[^\n]+`, Using(`c`), nil},
{`[ \t]*#\w[^\n]*`, CommentPreproc, nil},
{`(sql)(\s+)(\w+)(\s+)({)([^}]*?)(})`, ByGroups(Keyword, Text, Name, Text, Punctuation, Using(`sql`), Punctuation), nil},
{`\$(?=\w)`, Operator, nil},
{`(?<=\$)(?:embed_file|pkgconfig|tmpl|env|compile_error|compile_warn)`, NameBuiltin, nil},
{`(asm)(\s+)(\w+)(\s*)({)([^}]*?)(})`, ByGroups(Keyword, Text, KeywordType, Text, Punctuation, Using(`nasm`), Punctuation), nil},
{`\b_(?:un)?likely_(?=\()`, NameFunctionMagic, nil},
{`(?<=\$if.+?(?:&&|\|\|)?)(` + Words(``, ``, `windows`, `linux`, `macos`, `mac`, `darwin`, `ios`, `android`, `mach`, `dragonfly`, `gnu`, `hpux`, `haiku`, `qnx`, `solaris`, `gcc`, `tinyc`, `clang`, `mingw`, `msvc`, `cplusplus`, `amd64`, `arm64`, `x64`, `x32`, `little_endian`, `big_endian`, `debug`, `prod`, `test`, `js`, `glibc`, `prealloc`, `no_bounds_checking`, `freestanding`, `no_segfault_handler`, `no_backtrace`, `no_main`) + `)+`, NameBuiltin, nil},
{`@` + Words(``, `\b`, `FN`, `METHOD`, `MOD`, `STRUCT`, `FILE`, `LINE`, `COLUMN`, `VEXE`, `VEXEROOT`, `VHASH`, `VMOD_FILE`, `VMODROOT`), NameVariableMagic, nil},
{Words(`\b(?<!@)`, `\b`, `break`, `select`, `match`, `defer`, `go`, `goto`, `else`, `if`, `continue`, `for`, `return`, `assert`, `or`, `as`, `atomic`, `isreftype`, `is`, `in`, `lock`, `rlock`, `sizeof`, `typeof`, `unsafe`, `volatile`, `static`, `__offsetof`), Keyword, nil},
{`\b(?<!@)(none|true|false|si_s_code|si_g32_code|si_g64_code)\b`, KeywordConstant, nil},
{Words(`\b(?<!@)`, `(?=\()`, `u8`, `u16`, `u32`, `u64`, `u128`, `int`, `i8`, `i16`, `i64`, `i128`, `f32`, `f64`, `rune`, `string`, `bool`, `usize`, `isize`, `any`, `error`, `print`, `println`, `dump`, `panic`, `eprint`, `eprintln`, `copy`, `close`, `len`, `map`, `filter`, `cap`, `delete`, `delete_many`, `delete_last`, `c_error_number_str`, `compare_strings`, `cstring_to_vstring`, `error_with_code`, `exit`, `f32_abs`, `f32_max`, `f32_min`, `f64_max`, `flush_stderr`, `flush_stdout`, `free`, `gc_check_leaks`, `get_str_intp_u32_format`, `get_str_intp_u64_format`, `isnil`, `malloc`, `malloc_noscan`, `memdup`, `memdup_noscan`, `panic_error_number`, `panic_lasterr`, `panic_optional_not_set`, `panic_result_not_set`, `print_backtrace`, `proc_pidpath`, `ptr_str`, `realloc_data`, `str_intp`, `str_intp_g32`, `str_intp_g64`, `str_intp_rune`, `str_intp_sq`, `str_intp_sub`, `string_from_wide`, `string_from_wide2`, `tos`, `tos2`, `tos3`, `tos4`, `tos5`, `tos_clone`, `utf32_decode_to_buffer`, `utf32_to_str`, `utf32_to_str_no_malloc`, `utf8_char_len`, `utf8_getchar`, `utf8_str_visible_length`, `v_realloc`, `vcalloc`, `vcalloc_noscan`, `vmemcmp`, `vmemcpy`, `vmemmove`, `vmemset`, `vstrlen`, `vstrlen_char`, `winapi_lasterr_str`, `reduce`, `string`, `join`, `free`, `join_lines`, `sort_by_len`, `sort_ignore_case`, `str`, `byterune`, `bytestr`, `clone`, `hex`, `utf8_to_utf32`, `vbytes`, `vstring`, `vstring_literal`, `vstring_literal_with_len`, `vstring_with_len`, `try_pop`, `try_push`, `strg`, `strsci`, `strlong`, `eq_epsilon`, `hex_full`, `hex2`, `msg`, `code`, `repeat`, `bytes`, `length_in_bytes`, `ascii_str`, `is_alnum`, `is_bin_digit`, `is_capital`, `is_digit`, `is_hex_digit`, `is_letter`, `is_oct_digit`, `is_space`, `str_escaped`, `repeat_to_depth`, `insert`, `prepend`, `trim`, `drop`, `first`, `last`, `pop`, `clone_to_depth`, `push_many`, `reverse_in_place`, `reverse`, `any`, `all`, `sort`, `sort_with_compare`, `contains`, `index`, `grow_cap`, `grow_len`, `pointers`, `move`, `keys`, `after`, `after_char`, `all_after`, `all_after_last`, `all_before`, `all_before_last`, `before`, `capitalize`, `compare`, `contains_any`, `contains_any_substr`, `count`, `ends_with`, `fields`, `find_between`, `hash`, `index_after`, `index_any`, `index_u8`, `is_lower`, `is_title`, `is_upper`, `last_index`, `last_index_u8`, `len_utf8`, `limit`, `match_glob`, `parse_int`, `parse_uint`, `replace`, `replace_each`, `replace_once`, `runes`, `split`, `split_any`, `split_into_lines`, `split_nth`, `starts_with`, `starts_with_capital`, `strip_margin`, `strip_margin_custom`, `substr`, `substr_ni`, `substr_with_check`, `title`, `to_lower`, `to_upper`, `to_wide`, `trim_left`, `trim_right`, `trim_space`, `trim_string_left`, `trim_string_right`, `utf32_code`), NameBuiltin, nil},
{Words(`\b(?<!@)`, `\b`, `ArrayFlags`, `AttributeKind`, `ChanState`, `StrIntpType`, `array`, `Error`, `FieldData`, `FunctionData`, `map`, `MethodArgs`, `SortedMap`, `string`, `StrIntpCgenData`, `StrIntpData`, `StrIntpMem`, `StructAttribute`, `VAssertMetaInfo`), NameBuiltin, nil},
{Words(`\b(?<!@)`, `\b`, `u8`, `u16`, `u32`, `u64`, `u128`, `int`, `i8`, `i16`, `i64`, `i128`, `f32`, `f64`, `rune`, `string`, `bool`, `usize`, `isize`, `any`, `error`, `voidptr`), KeywordType, nil},
{`\bit\b`, NameVariableMagic, nil},
{`(?<!fn\s+)(?<=\w+\s+|^)\[(?=:if +)?(?=\w+)`, Punctuation, Push(`attribute`)},
{`(<<=|>>=|>>>=|>>>|<<|>>|<=|>=|\^=|\+=|-=|\*=|/=|%=|&=|\|=|&&|\|\||<-|\+\+|--|==|!=|:=|\.\.\.|\.\.|[+\-*/%&|^~=#@!])`, Operator, nil},
{`[\d_]+(\.\d+e[+\-]?\d+|\.\d+|e[+\-]?\d+)`, LiteralNumberFloat, nil},
{`\.\d+(e[+\-]?\d+)?`, LiteralNumberFloat, nil},
{`0o[0-7_]+`, LiteralNumberOct, nil},
{`0x[0-9a-fA-F_]+`, LiteralNumberHex, nil},
{`0b[01_]+`, LiteralNumberBin, nil},
{`(0|[1-9][0-9_]*)`, LiteralNumberInteger, nil},
{"`", StringChar, Push(`char`)},
Include(`strings`),
{`@?` + typeNamePattern, NameClass, nil},
{`(?<=` + namePattern + `)(<)(` + typeNamePattern + `)(>)`, ByGroups(Punctuation, NameClass, Punctuation), nil},
{`@?` + namePattern + `(?=\()`, NameFunction, nil},
{`(?<=fn\s+)@?` + namePattern + `(?=\s*\()`, NameFunction, nil},
{`(?<=(?:continue|break|goto)\s+)\w+`, NameLabel, nil},
{`\b` + namePattern + `(?=:(?:$|\s+for))`, NameLabel, nil},
{`[<>()\[\]{}.,;:]`, Punctuation, nil},
{`@?` + namePattern, NameVariable, nil},
},
"strings": {
{`(c)?(")`, ByGroups(StringAffix, StringDouble), Push(`string-double`)},
{`(c)?(')`, ByGroups(StringAffix, StringSingle), Push(`string-single`)},
{`(r)("[^"]+")`, ByGroups(StringAffix, String), nil},
{`(r)('[^']+')`, ByGroups(StringAffix, String), nil},
},
"string-double": {
{`"`, StringDouble, Pop(1)},
Include(`char-escape`),
{`(\$)((?!\\){)`, ByGroups(Operator, Punctuation), Push(`string-curly-interpolation`)},
{`\$`, Operator, Push(`string-interpolation`)},
{`[^"]+?`, StringDouble, nil},
},
"string-single": {
{`'`, StringSingle, Pop(1)},
Include(`char-escape`),
{`(\$)((?!\\){)`, ByGroups(Operator, Punctuation), Push(`string-curly-interpolation`)},
{`\$`, Operator, Push(`string-interpolation`)},
{`[^']+?`, StringSingle, nil},
},
"char": {
{"`", StringChar, Pop(1)},
Include(`char-escape`),
{`[^\\]`, StringChar, nil},
},
"char-escape": {
{"\\\\[`'\"\\\\abfnrtv$]|\\\\x[0-9a-fA-F]{2}|\\\\[0-7]{1,3}|\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}", StringEscape, nil},
},
"string-doc": {
{`(// *)(#+ [^\n]+)(\n)`, ByGroups(StringDoc, GenericHeading, Text), nil},
{`// *([=_*~-])\1{2,}\n`, StringDelimiter, nil},
{`//[^\n]*\n`, StringDoc, nil},
Default(Pop(1)),
},
"string-interpolation": {
{`(\.)?(@)?(?:(` + namePattern + `)(\()([^)]*)(\))|(` + namePattern + `))`, ByGroups(Punctuation, Operator, NameFunction, Punctuation, UsingSelf(`root`), Punctuation, NameVariable), nil},
Default(Pop(1)),
},
"string-curly-interpolation": {
{`}`, Punctuation, Pop(1)},
Include(`strings`),
{`(:)( *?)([ 0'#+-])?(?:(\.)?([0-9]+))?([fFgeEGxXobsd])?`, ByGroups(Punctuation, Text, Operator, Punctuation, Number, StringAffix), nil},
{`[^}"':]+`, UsingSelf(`root`), nil},
},
"attribute": {
{`\]`, Punctuation, Pop(1)},
{`'`, Punctuation, Push(`string-single`)},
{`"`, Punctuation, Push(`string-double`)},
{`[;:]`, Punctuation, nil},
{`(?<=\[)if\b`, Keyword, nil},
{`\s+`, Text, nil},
{`(?<=: *)\w+`, String, nil},
{namePattern, NameAttribute, nil},
},
}
}
// V shell lexer.
var VSH = Register(MustNewLexer(
&Config{
Name: "V shell",
Aliases: []string{"vsh", "vshell"},
Filenames: []string{"*.vsh"},
MimeTypes: []string{"text/x-vsh"},
EnsureNL: true,
},
vshRules,
).SetAnalyser(func(text string) float32 {
firstLine := strings.Split(text, "\n")[0]
if strings.Contains(firstLine, "#!/usr/bin/env") && strings.Contains(firstLine, "v run") {
return 1.0
}
if strings.Contains(firstLine, "#!/") && strings.Contains(firstLine, "/v run") {
return 1.0
}
return 0.0
}))
func vshRules() Rules {
vshRules := vRules()
vshRoot := []Rule{
{`^#![^\n]*\n`, CommentHashbang, nil},
{Words(`\b`, `\b`, `args`, `max_path_len`, `wd_at_startup`, `sys_write`, `sys_open`, `sys_close`, `sys_mkdir`, `sys_creat`, `path_separator`, `path_delimiter`, `s_ifmt`, `s_ifdir`, `s_iflnk`, `s_isuid`, `s_isgid`, `s_isvtx`, `s_irusr`, `s_iwusr`, `s_ixusr`, `s_irgrp`, `s_iwgrp`, `s_ixgrp`, `s_iroth`, `s_iwoth`, `s_ixoth`), NameConstant, nil},
{Words(`\b`, `\b`, `ProcessState`, `SeekMode`, `Signal`, `Command`, `ExecutableNotFoundError`, `File`, `FileNotOpenedError`, `Process`, `Result`, `SizeOfTypeIs0Error`, `Uname`), NameBuiltin, nil},
{Words(`\b`, `(?=\()`, `abs_path`, `args_after`, `args_before`, `base`, `cache_dir`, `chdir`, `chmod`, `chown`, `config_dir`, `cp`, `cp_all`, `create`, `debugger_present`, `dir`, `environ`, `executable`, `execute`, `execute_or_exit`, `execute_or_panic`, `execve`, `execvp`, `existing_path`, `exists`, `exists_in_system_path`, `expand_tilde_to_home`, `fd_close`, `fd_read`, `fd_slurp`, `fd_write`, `file_ext`, `file_last_mod_unix`, `file_name`, `file_size`, `fileno`, `find_abs_path_of_executable`, `flush`, `fork`, `get_error_msg`, `get_line`, `get_lines`, `get_lines_joined`, `get_raw_line`, `get_raw_lines_joined`, `get_raw_stdin`, `getegid`, `getenv`, `getenv_opt`, `geteuid`, `getgid`, `getpid`, `getppid`, `getuid`, `getwd`, `glob`, `home_dir`, `hostname`, `inode`, `input`, `input_opt`, `is_abs_path`, `is_atty`, `is_dir`, `is_dir_empty`, `is_executable`, `is_file`, `is_link`, `is_readable`, `is_writable`, `is_writable_folder`, `join_path`, `join_path_single`, `last_error`, `link`, `log`, `loginname`, `ls`, `mkdir`, `mkdir_all`, `mv`, `mv_by_cp`, `new_process`, `norm_path`, `open`, `open_append`, `open_file`, `open_uri`, `posix_get_error_msg`, `posix_set_permission_bit`, `quoted_path`, `read_bytes`, `read_file`, `read_file_array`, `read_lines`, `real_path`, `resource_abs_path`, `rm`, `rmdir`, `rmdir_all`, `setenv`, `sigint_to_signal_name`, `signal_opt`, `stderr`, `stdin`, `stdout`, `symlink`, `system`, `temp_dir`, `truncate`, `uname`, `unsetenv`, `user_os`, `utime`, `vfopen`, `vmodules_dir`, `vmodules_paths`, `wait`, `walk`, `walk_ext`, `walk_with_context`, `write_file`, `write_file_array`, `bitmask`, `close`, `read_line`, `start`, `msg`, `read`, `read_bytes_at`, `read_bytes_into`, `read_bytes_into_newline`, `read_from`, `read_into_ptr`, `read_raw`, `read_raw_at`, `read_struct`, `read_struct_at`, `seek`, `tell`, `write`, `write_raw`, `write_raw_at`, `write_string`, `write_struct`, `write_struct_at`, `write_to`, `writeln`, `is_alive`, `run`, `set_args`, `set_environment`, `set_redirect_stdio`, `signal_continue`, `signal_kill`, `signal_pgkill`, `signal_stop`, `stderr_read`, `stderr_slurp`, `stdin_write`, `stdout_read`, `stdout_slurp`), NameBuiltin, nil},
}
vshRules[`root`] = append(vshRoot, vshRules[`root`]...)
return vshRules
}
-39
View File
@@ -1,39 +0,0 @@
package lexers
import (
. "github.com/alecthomas/chroma/v2" // nolint
)
// Viml lexer.
var Viml = Register(MustNewLexer(
&Config{
Name: "VimL",
Aliases: []string{"vim"},
Filenames: []string{"*.vim", ".vimrc", ".exrc", ".gvimrc", "_vimrc", "_exrc", "_gvimrc", "vimrc", "gvimrc"},
MimeTypes: []string{"text/x-vim"},
},
vimlRules,
))
func vimlRules() Rules {
return Rules{
"root": {
{`^([ \t:]*)(py(?:t(?:h(?:o(?:n)?)?)?)?)([ \t]*)(<<)([ \t]*)(.*)((?:\n|.)*)(\6)`, ByGroups(UsingSelf("root"), Keyword, Text, Operator, Text, Text, Using("Python"), Text), nil},
{`^([ \t:]*)(py(?:t(?:h(?:o(?:n)?)?)?)?)([ \t])(.*)`, ByGroups(UsingSelf("root"), Keyword, Text, Using("Python")), nil},
{`^\s*".*`, Comment, nil},
{`[ \t]+`, Text, nil},
{`/(\\\\|\\/|[^\n/])*/`, LiteralStringRegex, nil},
{`"(\\\\|\\"|[^\n"])*"`, LiteralStringDouble, nil},
{`'(''|[^\n'])*'`, LiteralStringSingle, nil},
{`(?<=\s)"[^\-:.%#=*].*`, Comment, nil},
{`-?\d+`, LiteralNumber, nil},
{`#[0-9a-f]{6}`, LiteralNumberHex, nil},
{`^:`, Punctuation, nil},
{`[()<>+=!|,~-]`, Punctuation, nil},
{`\b(let|if|else|endif|elseif|fun|function|endfunction)\b`, Keyword, nil},
{`\b(NONE|bold|italic|underline|dark|light)\b`, NameBuiltin, nil},
{`\b\w+\b`, NameOther, nil},
{`.`, Text, nil},
},
}
}
+1 -1
View File
@@ -69,7 +69,7 @@ func (m *multiMutator) MarshalXML(e *xml.Encoder, start xml.StartElement) error
return e.EncodeToken(xml.EndElement{Name: name})
}
func (m *multiMutator) MutatorKind() string { return "multiple" }
func (m *multiMutator) MutatorKind() string { return "mutators" }
func (m *multiMutator) Mutate(state *LexerState) error {
for _, modifier := range m.Mutators {
+10 -7
View File
@@ -76,8 +76,8 @@ func (r Rules) Merge(rules Rules) Rules {
}
// MustNewLexer creates a new Lexer with deferred rules generation or panics.
func MustNewLexer(config *Config, rulesFunc func() Rules) *RegexLexer {
lexer, err := NewLexer(config, rulesFunc)
func MustNewLexer(config *Config, rules func() Rules) *RegexLexer {
lexer, err := NewLexer(config, rules)
if err != nil {
panic(err)
}
@@ -298,11 +298,12 @@ func (r *RegexLexer) SetAnalyser(analyser func(text string) float32) Lexer {
return r
}
func (r *RegexLexer) AnalyseText(text string) float32 { // nolint
// AnalyseText scores how likely a fragment of text is to match this lexer, between 0.0 and 1.0.
func (r *RegexLexer) AnalyseText(text string) float32 {
if r.analyser != nil {
return r.analyser(text)
}
return 0.0
return 0
}
// SetConfig replaces the Config for this Lexer.
@@ -311,7 +312,8 @@ func (r *RegexLexer) SetConfig(config *Config) *RegexLexer {
return r
}
func (r *RegexLexer) Config() *Config { // nolint
// Config returns the Config for this Lexer.
func (r *RegexLexer) Config() *Config {
return r.config
}
@@ -330,7 +332,7 @@ func (r *RegexLexer) maybeCompile() (err error) {
pattern = "(?" + rule.flags + ")" + pattern
}
pattern = `\G` + pattern
rule.Regexp, err = regexp2.Compile(pattern, regexp2.RE2)
rule.Regexp, err = regexp2.Compile(pattern, 0)
if err != nil {
return fmt.Errorf("failed to compile rule %s.%d: %s", state, i, err)
}
@@ -406,7 +408,8 @@ func (r *RegexLexer) needRules() error {
return err
}
func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { // nolint
// Tokenise text using lexer, returning an iterator.
func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) {
err := r.needRules()
if err != nil {
return nil, err
+25 -2
View File
@@ -97,6 +97,8 @@ func (l *LexerRegistry) MatchMimeType(mimeType string) Lexer {
}
// Match returns the first lexer matching filename.
//
// Note that this iterates over all file patterns in all lexers, so is not fast.
func (l *LexerRegistry) Match(filename string) Lexer {
filename = filepath.Base(filename)
matched := PrioritisedLexers{}
@@ -172,16 +174,37 @@ func (l *LexerRegistry) Analyse(text string) Lexer {
return picked
}
// Register a Lexer with the LexerRegistry.
// Register a Lexer with the LexerRegistry. If the lexer is already registered
// it will be replaced.
func (l *LexerRegistry) Register(lexer Lexer) Lexer {
lexer.SetRegistry(l)
config := lexer.Config()
l.byName[config.Name] = lexer
l.byName[strings.ToLower(config.Name)] = lexer
for _, alias := range config.Aliases {
l.byAlias[alias] = lexer
l.byAlias[strings.ToLower(alias)] = lexer
}
l.Lexers = append(l.Lexers, lexer)
l.Lexers = add(l.Lexers, lexer)
return lexer
}
// add adds a lexer to a slice of lexers if it doesn't already exist, or if found will replace it.
func add(lexers Lexers, lexer Lexer) Lexers {
for i, val := range lexers {
if val == nil {
continue
}
if val.Config().Name == lexer.Config().Name {
lexers[i] = lexer
return lexers
}
}
return append(lexers, lexer)
}
+11
View File
@@ -0,0 +1,11 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:recommended",
":semanticCommits",
":semanticCommitTypeAll(chore)",
":semanticCommitScope(deps)",
"group:allNonMajor",
"schedule:earlyMondays", // Run once a week.
],
}
+49 -2
View File
@@ -7,10 +7,13 @@ import (
"fmt"
"io"
"io/fs"
"math"
"path/filepath"
"reflect"
"regexp"
"strings"
"github.com/dlclark/regexp2"
)
// Serialisation of Chroma rules to XML. The format is:
@@ -107,7 +110,7 @@ func fastUnmarshalConfig(from fs.FS, path string) (*Config, error) {
var config Config
err = dec.DecodeElement(&config, &se)
if err != nil {
panic(err)
return nil, fmt.Errorf("%s: %w", path, err)
}
return &config, nil
}
@@ -129,14 +132,58 @@ func NewXMLLexer(from fs.FS, path string) (*RegexLexer, error) {
if err != nil {
return nil, err
}
for _, glob := range append(config.Filenames, config.AliasFilenames...) {
_, err := filepath.Match(glob, "")
if err != nil {
return nil, fmt.Errorf("%s: %q is not a valid glob: %w", config.Name, glob, err)
}
}
var analyserFn func(string) float32
if config.Analyse != nil {
type regexAnalyse struct {
re *regexp2.Regexp
score float32
}
regexAnalysers := make([]regexAnalyse, 0, len(config.Analyse.Regexes))
for _, ra := range config.Analyse.Regexes {
re, err := regexp2.Compile(ra.Pattern, regexp2.None)
if err != nil {
return nil, fmt.Errorf("%s: %q is not a valid analyser regex: %w", config.Name, ra.Pattern, err)
}
regexAnalysers = append(regexAnalysers, regexAnalyse{re, ra.Score})
}
analyserFn = func(text string) float32 {
var score float32
for _, ra := range regexAnalysers {
ok, err := ra.re.MatchString(text)
if err != nil {
return 0
}
if ok && config.Analyse.First {
return float32(math.Min(float64(ra.score), 1.0))
}
if ok {
score += ra.score
}
}
return float32(math.Min(float64(score), 1.0))
}
}
return &RegexLexer{
config: config,
config: config,
analyser: analyserFn,
fetchRulesFunc: func() (Rules, error) {
var lexer struct {
Config
+71 -34
View File
@@ -1,46 +1,83 @@
<style name="catppuccin-frappe">
<entry type="Background" style="bg:#303446 #c6d0f5"/>
<entry type="CodeLine" style="#c6d0f5"/>
<entry type="Error" style="#e78284"/>
<entry type="Background" style="#ef9f76 bg:#303446"/>
<entry type="Other" style="#c6d0f5"/>
<entry type="LineTableTD" style=""/>
<entry type="LineTable" style=""/>
<entry type="LineHighlight" style="#51576d"/>
<entry type="LineNumbersTable" style="#838ba7"/>
<entry type="LineNumbers" style="#838ba7"/>
<entry type="Keyword" style="#ca9ee6"/>
<entry type="KeywordConstant" style="italic #ca9ee6"/>
<entry type="KeywordPseudo" style="bold #ca9ee6"/>
<entry type="KeywordType" style="#e5c890"/>
<entry type="Name" style="#babbf1"/>
<entry type="NameAttribute" style="#e5c890"/>
<entry type="NameBuiltin" style="italic #c6d0f5"/>
<entry type="KeywordReserved" style="#ca9ee6"/>
<entry type="KeywordPseudo" style="#ca9ee6"/>
<entry type="KeywordConstant" style="#ef9f76"/>
<entry type="KeywordDeclaration" style="#e78284"/>
<entry type="KeywordNamespace" style="#81c8be"/>
<entry type="KeywordType" style="#e78284"/>
<entry type="Name" style="#c6d0f5"/>
<entry type="NameClass" style="#e5c890"/>
<entry type="NameConstant" style="#e5c890"/>
<entry type="NameDecorator" style="#f4b8e4"/>
<entry type="NameEntity" style="#f4b8e4"/>
<entry type="NameException" style="#ea999c"/>
<entry type="NameFunction" style="#99d1db"/>
<entry type="NameLabel" style="#e5c890"/>
<entry type="NameNamespace" style="#e5c890"/>
<entry type="NameOther" style="#ef9f76"/>
<entry type="NameDecorator" style="bold #8caaee"/>
<entry type="NameEntity" style="#81c8be"/>
<entry type="NameException" style="#ef9f76"/>
<entry type="NameFunction" style="#8caaee"/>
<entry type="NameFunctionMagic" style="#8caaee"/>
<entry type="NameLabel" style="#99d1db"/>
<entry type="NameNamespace" style="#ef9f76"/>
<entry type="NameProperty" style="#ef9f76"/>
<entry type="NameTag" style="#ca9ee6"/>
<entry type="NameVariable" style="#ef9f76"/>
<entry type="NameVariable" style="#f2d5cf"/>
<entry type="NameVariableClass" style="#f2d5cf"/>
<entry type="NameVariableGlobal" style="#f2d5cf"/>
<entry type="NameVariableInstance" style="#f2d5cf"/>
<entry type="NameVariableMagic" style="#f2d5cf"/>
<entry type="NameAttribute" style="#8caaee"/>
<entry type="NameBuiltin" style="#99d1db"/>
<entry type="NameBuiltinPseudo" style="#99d1db"/>
<entry type="NameOther" style="#c6d0f5"/>
<entry type="Literal" style="#c6d0f5"/>
<entry type="LiteralDate" style="#c6d0f5"/>
<entry type="LiteralString" style="#a6d189"/>
<entry type="LiteralStringDoc" style="#a6d189"/>
<entry type="LiteralStringEscape" style="#8caaee"/>
<entry type="LiteralStringInterpol" style="#a6d189"/>
<entry type="LiteralStringChar" style="#a6d189"/>
<entry type="LiteralStringSingle" style="#a6d189"/>
<entry type="LiteralStringDouble" style="#a6d189"/>
<entry type="LiteralStringBacktick" style="#a6d189"/>
<entry type="LiteralStringOther" style="#a6d189"/>
<entry type="LiteralStringRegex" style="#8caaee"/>
<entry type="LiteralStringSymbol" style="#a6d189"/>
<entry type="LiteralStringInterpol" style="#a6d189"/>
<entry type="LiteralStringAffix" style="#e78284"/>
<entry type="LiteralStringDelimiter" style="#8caaee"/>
<entry type="LiteralStringEscape" style="#8caaee"/>
<entry type="LiteralStringRegex" style="#81c8be"/>
<entry type="LiteralStringDoc" style="#737994"/>
<entry type="LiteralStringHeredoc" style="#737994"/>
<entry type="LiteralNumber" style="#ef9f76"/>
<entry type="Operator" style="#99d1db"/>
<entry type="LiteralNumberBin" style="#ef9f76"/>
<entry type="LiteralNumberHex" style="#ef9f76"/>
<entry type="LiteralNumberInteger" style="#ef9f76"/>
<entry type="LiteralNumberFloat" style="#ef9f76"/>
<entry type="LiteralNumberIntegerLong" style="#ef9f76"/>
<entry type="LiteralNumberOct" style="#ef9f76"/>
<entry type="Operator" style="bold #99d1db"/>
<entry type="OperatorWord" style="bold #99d1db"/>
<entry type="Punctuation" style="#c6d0f5"/>
<entry type="Comment" style="italic #626880"/>
<entry type="CommentPreproc" style="#8caaee"/>
<entry type="GenericDeleted" style="#ea999c"/>
<entry type="GenericEmph" style="italic"/>
<entry type="GenericError" style="#ea999c"/>
<entry type="GenericHeading" style="bold #99d1db"/>
<entry type="GenericInserted" style="#a6d189"/>
<entry type="GenericOutput" style="#ef9f76"/>
<entry type="GenericPrompt" style="bold #737994"/>
<entry type="GenericStrong" style="bold"/>
<entry type="GenericSubheading" style="bold #99d1db"/>
<entry type="GenericTraceback" style="#ea999c"/>
<entry type="TextWhitespace" style="#414559"/>
<entry type="Comment" style="italic #737994"/>
<entry type="CommentSingle" style="italic #737994"/>
<entry type="CommentMultiline" style="italic #737994"/>
<entry type="CommentSpecial" style="italic #737994"/>
<entry type="CommentHashbang" style="italic #737994"/>
<entry type="CommentPreproc" style="italic #737994"/>
<entry type="CommentPreprocFile" style="bold #737994"/>
<entry type="Generic" style="#c6d0f5"/>
<entry type="GenericInserted" style="bg:#414559 #a6d189"/>
<entry type="GenericDeleted" style="#e78284 bg:#414559"/>
<entry type="GenericEmph" style="italic #c6d0f5"/>
<entry type="GenericStrong" style="bold #c6d0f5"/>
<entry type="GenericUnderline" style="underline #c6d0f5"/>
<entry type="GenericHeading" style="bold #ef9f76"/>
<entry type="GenericSubheading" style="bold #ef9f76"/>
<entry type="GenericOutput" style="#c6d0f5"/>
<entry type="GenericPrompt" style="#c6d0f5"/>
<entry type="GenericError" style="#e78284"/>
<entry type="GenericTraceback" style="#e78284"/>
</style>
+71 -34
View File
@@ -1,46 +1,83 @@
<style name="catppuccin-latte">
<entry type="Background" style="bg:#eff1f5 #4c4f69"/>
<entry type="CodeLine" style="#4c4f69"/>
<entry type="Error" style="#d20f39"/>
<entry type="Background" style="#fe640b bg:#eff1f5"/>
<entry type="Other" style="#4c4f69"/>
<entry type="LineTableTD" style=""/>
<entry type="LineTable" style=""/>
<entry type="LineHighlight" style="#bcc0cc"/>
<entry type="LineNumbersTable" style="#8c8fa1"/>
<entry type="LineNumbers" style="#8c8fa1"/>
<entry type="Keyword" style="#8839ef"/>
<entry type="KeywordConstant" style="italic #8839ef"/>
<entry type="KeywordPseudo" style="bold #8839ef"/>
<entry type="KeywordType" style="#df8e1d"/>
<entry type="Name" style="#7287fd"/>
<entry type="NameAttribute" style="#df8e1d"/>
<entry type="NameBuiltin" style="italic #fe640b"/>
<entry type="KeywordReserved" style="#8839ef"/>
<entry type="KeywordPseudo" style="#8839ef"/>
<entry type="KeywordConstant" style="#fe640b"/>
<entry type="KeywordDeclaration" style="#d20f39"/>
<entry type="KeywordNamespace" style="#179299"/>
<entry type="KeywordType" style="#d20f39"/>
<entry type="Name" style="#4c4f69"/>
<entry type="NameClass" style="#df8e1d"/>
<entry type="NameConstant" style="#df8e1d"/>
<entry type="NameDecorator" style="#ea76cb"/>
<entry type="NameEntity" style="#ea76cb"/>
<entry type="NameException" style="#e64553"/>
<entry type="NameFunction" style="#04a5e5"/>
<entry type="NameLabel" style="#df8e1d"/>
<entry type="NameNamespace" style="#df8e1d"/>
<entry type="NameOther" style="#fe640b"/>
<entry type="NameDecorator" style="bold #1e66f5"/>
<entry type="NameEntity" style="#179299"/>
<entry type="NameException" style="#fe640b"/>
<entry type="NameFunction" style="#1e66f5"/>
<entry type="NameFunctionMagic" style="#1e66f5"/>
<entry type="NameLabel" style="#04a5e5"/>
<entry type="NameNamespace" style="#fe640b"/>
<entry type="NameProperty" style="#fe640b"/>
<entry type="NameTag" style="#8839ef"/>
<entry type="NameVariable" style="#fe640b"/>
<entry type="NameVariable" style="#dc8a78"/>
<entry type="NameVariableClass" style="#dc8a78"/>
<entry type="NameVariableGlobal" style="#dc8a78"/>
<entry type="NameVariableInstance" style="#dc8a78"/>
<entry type="NameVariableMagic" style="#dc8a78"/>
<entry type="NameAttribute" style="#1e66f5"/>
<entry type="NameBuiltin" style="#04a5e5"/>
<entry type="NameBuiltinPseudo" style="#04a5e5"/>
<entry type="NameOther" style="#4c4f69"/>
<entry type="Literal" style="#4c4f69"/>
<entry type="LiteralDate" style="#4c4f69"/>
<entry type="LiteralString" style="#40a02b"/>
<entry type="LiteralStringDoc" style="#40a02b"/>
<entry type="LiteralStringEscape" style="#1e66f5"/>
<entry type="LiteralStringInterpol" style="#40a02b"/>
<entry type="LiteralStringChar" style="#40a02b"/>
<entry type="LiteralStringSingle" style="#40a02b"/>
<entry type="LiteralStringDouble" style="#40a02b"/>
<entry type="LiteralStringBacktick" style="#40a02b"/>
<entry type="LiteralStringOther" style="#40a02b"/>
<entry type="LiteralStringRegex" style="#1e66f5"/>
<entry type="LiteralStringSymbol" style="#40a02b"/>
<entry type="LiteralStringInterpol" style="#40a02b"/>
<entry type="LiteralStringAffix" style="#d20f39"/>
<entry type="LiteralStringDelimiter" style="#1e66f5"/>
<entry type="LiteralStringEscape" style="#1e66f5"/>
<entry type="LiteralStringRegex" style="#179299"/>
<entry type="LiteralStringDoc" style="#9ca0b0"/>
<entry type="LiteralStringHeredoc" style="#9ca0b0"/>
<entry type="LiteralNumber" style="#fe640b"/>
<entry type="Operator" style="#04a5e5"/>
<entry type="LiteralNumberBin" style="#fe640b"/>
<entry type="LiteralNumberHex" style="#fe640b"/>
<entry type="LiteralNumberInteger" style="#fe640b"/>
<entry type="LiteralNumberFloat" style="#fe640b"/>
<entry type="LiteralNumberIntegerLong" style="#fe640b"/>
<entry type="LiteralNumberOct" style="#fe640b"/>
<entry type="Operator" style="bold #04a5e5"/>
<entry type="OperatorWord" style="bold #04a5e5"/>
<entry type="Punctuation" style="#4c4f69"/>
<entry type="Comment" style="italic #acb0be"/>
<entry type="CommentPreproc" style="#1e66f5"/>
<entry type="GenericDeleted" style="#e64553"/>
<entry type="GenericEmph" style="italic"/>
<entry type="GenericError" style="#e64553"/>
<entry type="GenericHeading" style="bold #04a5e5"/>
<entry type="GenericInserted" style="#40a02b"/>
<entry type="GenericOutput" style="#fe640b"/>
<entry type="GenericPrompt" style="bold #9ca0b0"/>
<entry type="GenericStrong" style="bold"/>
<entry type="GenericSubheading" style="bold #04a5e5"/>
<entry type="GenericTraceback" style="#e64553"/>
<entry type="TextWhitespace" style="#ccd0da"/>
<entry type="Comment" style="italic #9ca0b0"/>
<entry type="CommentSingle" style="italic #9ca0b0"/>
<entry type="CommentMultiline" style="italic #9ca0b0"/>
<entry type="CommentSpecial" style="italic #9ca0b0"/>
<entry type="CommentHashbang" style="italic #9ca0b0"/>
<entry type="CommentPreproc" style="italic #9ca0b0"/>
<entry type="CommentPreprocFile" style="bold #9ca0b0"/>
<entry type="Generic" style="#4c4f69"/>
<entry type="GenericInserted" style="bg:#ccd0da #40a02b"/>
<entry type="GenericDeleted" style="#d20f39 bg:#ccd0da"/>
<entry type="GenericEmph" style="italic #4c4f69"/>
<entry type="GenericStrong" style="bold #4c4f69"/>
<entry type="GenericUnderline" style="underline #4c4f69"/>
<entry type="GenericHeading" style="bold #fe640b"/>
<entry type="GenericSubheading" style="bold #fe640b"/>
<entry type="GenericOutput" style="#4c4f69"/>
<entry type="GenericPrompt" style="#4c4f69"/>
<entry type="GenericError" style="#d20f39"/>
<entry type="GenericTraceback" style="#d20f39"/>
</style>
@@ -1,46 +1,83 @@
<style name="catppuccin-macchiato">
<entry type="Background" style="bg:#24273a #cad3f5"/>
<entry type="CodeLine" style="#cad3f5"/>
<entry type="Error" style="#ed8796"/>
<entry type="Background" style="#f5a97f bg:#24273a"/>
<entry type="Other" style="#cad3f5"/>
<entry type="LineTableTD" style=""/>
<entry type="LineTable" style=""/>
<entry type="LineHighlight" style="#494d64"/>
<entry type="LineNumbersTable" style="#8087a2"/>
<entry type="LineNumbers" style="#8087a2"/>
<entry type="Keyword" style="#c6a0f6"/>
<entry type="KeywordConstant" style="italic #c6a0f6"/>
<entry type="KeywordPseudo" style="bold #c6a0f6"/>
<entry type="KeywordType" style="#eed49f"/>
<entry type="Name" style="#b7bdf8"/>
<entry type="NameAttribute" style="#eed49f"/>
<entry type="NameBuiltin" style="italic #f5a97f"/>
<entry type="KeywordReserved" style="#c6a0f6"/>
<entry type="KeywordPseudo" style="#c6a0f6"/>
<entry type="KeywordConstant" style="#f5a97f"/>
<entry type="KeywordDeclaration" style="#ed8796"/>
<entry type="KeywordNamespace" style="#8bd5ca"/>
<entry type="KeywordType" style="#ed8796"/>
<entry type="Name" style="#cad3f5"/>
<entry type="NameClass" style="#eed49f"/>
<entry type="NameConstant" style="#eed49f"/>
<entry type="NameDecorator" style="#f5bde6"/>
<entry type="NameEntity" style="#f5bde6"/>
<entry type="NameException" style="#ee99a0"/>
<entry type="NameFunction" style="#91d7e3"/>
<entry type="NameLabel" style="#eed49f"/>
<entry type="NameNamespace" style="#eed49f"/>
<entry type="NameOther" style="#f5a97f"/>
<entry type="NameDecorator" style="bold #8aadf4"/>
<entry type="NameEntity" style="#8bd5ca"/>
<entry type="NameException" style="#f5a97f"/>
<entry type="NameFunction" style="#8aadf4"/>
<entry type="NameFunctionMagic" style="#8aadf4"/>
<entry type="NameLabel" style="#91d7e3"/>
<entry type="NameNamespace" style="#f5a97f"/>
<entry type="NameProperty" style="#f5a97f"/>
<entry type="NameTag" style="#c6a0f6"/>
<entry type="NameVariable" style="#f5a97f"/>
<entry type="NameVariable" style="#f4dbd6"/>
<entry type="NameVariableClass" style="#f4dbd6"/>
<entry type="NameVariableGlobal" style="#f4dbd6"/>
<entry type="NameVariableInstance" style="#f4dbd6"/>
<entry type="NameVariableMagic" style="#f4dbd6"/>
<entry type="NameAttribute" style="#8aadf4"/>
<entry type="NameBuiltin" style="#91d7e3"/>
<entry type="NameBuiltinPseudo" style="#91d7e3"/>
<entry type="NameOther" style="#cad3f5"/>
<entry type="Literal" style="#cad3f5"/>
<entry type="LiteralDate" style="#cad3f5"/>
<entry type="LiteralString" style="#a6da95"/>
<entry type="LiteralStringDoc" style="#a6da95"/>
<entry type="LiteralStringEscape" style="#8aadf4"/>
<entry type="LiteralStringInterpol" style="#a6da95"/>
<entry type="LiteralStringChar" style="#a6da95"/>
<entry type="LiteralStringSingle" style="#a6da95"/>
<entry type="LiteralStringDouble" style="#a6da95"/>
<entry type="LiteralStringBacktick" style="#a6da95"/>
<entry type="LiteralStringOther" style="#a6da95"/>
<entry type="LiteralStringRegex" style="#8aadf4"/>
<entry type="LiteralStringSymbol" style="#a6da95"/>
<entry type="LiteralStringInterpol" style="#a6da95"/>
<entry type="LiteralStringAffix" style="#ed8796"/>
<entry type="LiteralStringDelimiter" style="#8aadf4"/>
<entry type="LiteralStringEscape" style="#8aadf4"/>
<entry type="LiteralStringRegex" style="#8bd5ca"/>
<entry type="LiteralStringDoc" style="#6e738d"/>
<entry type="LiteralStringHeredoc" style="#6e738d"/>
<entry type="LiteralNumber" style="#f5a97f"/>
<entry type="Operator" style="#91d7e3"/>
<entry type="LiteralNumberBin" style="#f5a97f"/>
<entry type="LiteralNumberHex" style="#f5a97f"/>
<entry type="LiteralNumberInteger" style="#f5a97f"/>
<entry type="LiteralNumberFloat" style="#f5a97f"/>
<entry type="LiteralNumberIntegerLong" style="#f5a97f"/>
<entry type="LiteralNumberOct" style="#f5a97f"/>
<entry type="Operator" style="bold #91d7e3"/>
<entry type="OperatorWord" style="bold #91d7e3"/>
<entry type="Punctuation" style="#cad3f5"/>
<entry type="Comment" style="italic #5b6078"/>
<entry type="CommentPreproc" style="#8aadf4"/>
<entry type="GenericDeleted" style="#ee99a0"/>
<entry type="GenericEmph" style="italic"/>
<entry type="GenericError" style="#ee99a0"/>
<entry type="GenericHeading" style="bold #91d7e3"/>
<entry type="GenericInserted" style="#a6da95"/>
<entry type="GenericOutput" style="#f5a97f"/>
<entry type="GenericPrompt" style="bold #6e738d"/>
<entry type="GenericStrong" style="bold"/>
<entry type="GenericSubheading" style="bold #91d7e3"/>
<entry type="GenericTraceback" style="#ee99a0"/>
<entry type="TextWhitespace" style="#363a4f"/>
<entry type="Comment" style="italic #6e738d"/>
<entry type="CommentSingle" style="italic #6e738d"/>
<entry type="CommentMultiline" style="italic #6e738d"/>
<entry type="CommentSpecial" style="italic #6e738d"/>
<entry type="CommentHashbang" style="italic #6e738d"/>
<entry type="CommentPreproc" style="italic #6e738d"/>
<entry type="CommentPreprocFile" style="bold #6e738d"/>
<entry type="Generic" style="#cad3f5"/>
<entry type="GenericInserted" style="bg:#363a4f #a6da95"/>
<entry type="GenericDeleted" style="#ed8796 bg:#363a4f"/>
<entry type="GenericEmph" style="italic #cad3f5"/>
<entry type="GenericStrong" style="bold #cad3f5"/>
<entry type="GenericUnderline" style="underline #cad3f5"/>
<entry type="GenericHeading" style="bold #f5a97f"/>
<entry type="GenericSubheading" style="bold #f5a97f"/>
<entry type="GenericOutput" style="#cad3f5"/>
<entry type="GenericPrompt" style="#cad3f5"/>
<entry type="GenericError" style="#ed8796"/>
<entry type="GenericTraceback" style="#ed8796"/>
</style>

Some files were not shown because too many files have changed in this diff Show More