Skip to content

Commit

Permalink
fix: bump to latest dclark/regexp2
Browse files Browse the repository at this point in the history
Fixes #805
  • Loading branch information
alecthomas committed Sep 9, 2023
1 parent a242abf commit 4dd2cbe
Show file tree
Hide file tree
Showing 26 changed files with 542 additions and 166 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,4 +1,8 @@
# Binaries for programs and plugins
.git
.idea
.vscode
.hermit
*.exe
*.dll
*.so
Expand Down
24 changes: 24 additions & 0 deletions Bitfile
@@ -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 %{1}: cmd/*
cd cmd/%{1}
inputs: cmd/%{1}/**/* **/*.go
build: go build -ldflags="-X 'main.version=%{VERSION}'" -o ../../%{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
121 changes: 69 additions & 52 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bin/.bit-0.0.1.pkg
1 change: 1 addition & 0 deletions bin/.python3-3.11.4.pkg
1 change: 1 addition & 0 deletions bin/bit
1 change: 1 addition & 0 deletions bin/pip
1 change: 1 addition & 0 deletions bin/pip3
1 change: 1 addition & 0 deletions bin/pip3.11
1 change: 1 addition & 0 deletions bin/pydoc3
1 change: 1 addition & 0 deletions bin/pydoc3.11
1 change: 1 addition & 0 deletions bin/python
1 change: 1 addition & 0 deletions bin/python3
1 change: 1 addition & 0 deletions bin/python3-config
1 change: 1 addition & 0 deletions bin/python3.11
1 change: 1 addition & 0 deletions bin/python3.11-config
2 changes: 1 addition & 1 deletion cmd/chroma/go.mod
Expand Up @@ -12,6 +12,6 @@ require (
)

require (
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
golang.org/x/sys v0.6.0 // indirect
)
4 changes: 2 additions & 2 deletions cmd/chroma/go.sum
Expand Up @@ -2,8 +2,8 @@ github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2
github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s=
github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
Expand Down
2 changes: 1 addition & 1 deletion cmd/chromad/go.mod
Expand Up @@ -12,7 +12,7 @@ require (
)

require (
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cmd/chromad/go.sum
Expand Up @@ -7,8 +7,8 @@ github.com/alecthomas/kong-hcl v1.0.1/go.mod h1:6Y+MaMTZ/KQe9Qme6aSlKtql65FJE0/1
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/gorilla/csrf v1.7.1 h1:Ir3o2c1/Uzj6FBxMlAUB6SivgVMy1ONXwYgXn+/aHPE=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/alecthomas/assert/v2 v2.2.1
github.com/alecthomas/repr v0.2.0
github.com/dlclark/regexp2 v1.4.0
github.com/dlclark/regexp2 v1.10.0
)

require github.com/hexops/gotextdiff v1.0.3 // indirect
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -2,7 +2,7 @@ github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
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/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
4 changes: 2 additions & 2 deletions lexers/embedded/dns.xml
Expand Up @@ -24,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-]+)">
<token type="NameClass"/>
</rule>
<rule pattern="^\$(TTL|GENERATE|INCLUDE|ORIGIN)">
Expand Down
2 changes: 1 addition & 1 deletion regexp.go
Expand Up @@ -332,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)
}
Expand Down
3 changes: 1 addition & 2 deletions table.py
Expand Up @@ -5,8 +5,7 @@

README_FILE = "README.md"


lines = check_output(["go", "run", "./cmd/chroma/main.go", "--list"]).decode("utf-8").splitlines()
lines = check_output(["chroma", "--list"]).decode("utf-8").splitlines()
lines = [line.strip() for line in lines if line.startswith(" ") and not line.startswith(" ")]
lines = sorted(lines, key=lambda l: l.lower())

Expand Down

0 comments on commit 4dd2cbe

Please sign in to comment.