rustgments 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. rustgments-0.1.0/.gitattributes +3 -0
  2. rustgments-0.1.0/.github/workflows/wheels.yml +130 -0
  3. rustgments-0.1.0/.gitignore +9 -0
  4. rustgments-0.1.0/Cargo.lock +334 -0
  5. rustgments-0.1.0/Cargo.toml +30 -0
  6. rustgments-0.1.0/LICENSE +25 -0
  7. rustgments-0.1.0/LICENSE-pygments +25 -0
  8. rustgments-0.1.0/LICENSE-third-party.txt +566 -0
  9. rustgments-0.1.0/PKG-INFO +123 -0
  10. rustgments-0.1.0/README.md +104 -0
  11. rustgments-0.1.0/bench/bench.ps1 +84 -0
  12. rustgments-0.1.0/bench/bench_one.py +56 -0
  13. rustgments-0.1.0/bench/cases.example.txt +5 -0
  14. rustgments-0.1.0/bench/docs_bench.ps1 +75 -0
  15. rustgments-0.1.0/bench/docs_build.py +87 -0
  16. rustgments-0.1.0/bench/many_blocks.ps1 +52 -0
  17. rustgments-0.1.0/bench/many_blocks.py +43 -0
  18. rustgments-0.1.0/bench/results/docs-django-20261108-175419.csv +11 -0
  19. rustgments-0.1.0/bench/results/many-blocks-20261108-191722.csv +11 -0
  20. rustgments-0.1.0/bench/results/summary-20261108-142655.csv +17 -0
  21. rustgments-0.1.0/bench/results/summary-20261108-145522-recheck.csv +13 -0
  22. rustgments-0.1.0/bench/results/summary-20261108-192122.csv +17 -0
  23. rustgments-0.1.0/bench/tree_hash.py +28 -0
  24. rustgments-0.1.0/build_ir/build_all.py +37 -0
  25. rustgments-0.1.0/build_ir/extract.py +822 -0
  26. rustgments-0.1.0/build_ir/merge_variants.py +93 -0
  27. rustgments-0.1.0/build_ir/native_gate.json +611 -0
  28. rustgments-0.1.0/examples/build_dfas.rs +83 -0
  29. rustgments-0.1.0/examples/cold.rs +28 -0
  30. rustgments-0.1.0/ir/LICENSE-pygments +25 -0
  31. rustgments-0.1.0/ir/dfa.bin +0 -0
  32. rustgments-0.1.0/ir/pygments_ir.bulk +1 -0
  33. rustgments-0.1.0/ir/pygments_ir.json +1 -0
  34. rustgments-0.1.0/pyproject.toml +33 -0
  35. rustgments-0.1.0/python/rustgments/__init__.py +203 -0
  36. rustgments-0.1.0/python/rustgments/_dropin.py +279 -0
  37. rustgments-0.1.0/python/rustgments/mkdocs_plugin.py +15 -0
  38. rustgments-0.1.0/python/rustgments/sphinxext.py +12 -0
  39. rustgments-0.1.0/python/rustgments-autoinstall.pth +1 -0
  40. rustgments-0.1.0/src/engine.rs +1508 -0
  41. rustgments-0.1.0/src/html.rs +172 -0
  42. rustgments-0.1.0/src/ir.rs +129 -0
  43. rustgments-0.1.0/src/json.rs +273 -0
  44. rustgments-0.1.0/src/lib.rs +314 -0
  45. rustgments-0.1.0/src/prebuilt.rs +122 -0
  46. rustgments-0.1.0/tests/dropin_check.py +202 -0
  47. rustgments-0.1.0/tests/gate.py +334 -0
  48. rustgments-0.1.0/tests/independent_check.py +240 -0
  49. rustgments-0.1.0/tests/parity.py +230 -0
  50. rustgments-0.1.0/tests/run_matrix.py +59 -0
  51. rustgments-0.1.0/tests/stress.py +103 -0
  52. rustgments-0.1.0/tests/test_api.py +86 -0
  53. rustgments-0.1.0/tests/unicode_check.py +174 -0
@@ -0,0 +1,3 @@
1
+ ir/dfa.bin binary
2
+ ir/pygments_ir.json -diff
3
+ ir/pygments_ir.bulk -diff
@@ -0,0 +1,130 @@
1
+ # Build abi3 wheels (one per platform, Python >= 3.9) and an sdist, test every
2
+ # wheel against Pygments on the supported Pythons, and on a v* tag publish to
3
+ # PyPI (trusted publishing) and attach the files to a GitHub release.
4
+ name: wheels
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ pull_request:
9
+ push:
10
+ tags: ['v*']
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+ name: ${{ matrix.name }}
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ include:
23
+ - { name: windows-x86_64, os: windows-latest, target: x86_64-pc-windows-msvc }
24
+ - { name: linux-x86_64-manylinux, os: ubuntu-latest, target: x86_64-unknown-linux-gnu, manylinux: '2_28' }
25
+ - { name: linux-aarch64-manylinux, os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, manylinux: '2_28' }
26
+ - { name: linux-x86_64-musllinux, os: ubuntu-latest, target: x86_64-unknown-linux-musl, manylinux: musllinux_1_2 }
27
+ - { name: linux-aarch64-musllinux, os: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl, manylinux: musllinux_1_2 }
28
+ - { name: macos-x86_64, os: macos-15-intel, target: x86_64-apple-darwin }
29
+ - { name: macos-arm64, os: macos-15, target: aarch64-apple-darwin }
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: actions/setup-python@v5
33
+ with:
34
+ python-version: '3.12'
35
+ - name: Build wheel
36
+ uses: PyO3/maturin-action@v1
37
+ with:
38
+ target: ${{ matrix.target }}
39
+ manylinux: ${{ matrix.manylinux || 'off' }}
40
+ args: --release --out dist
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ name: wheel-${{ matrix.name }}
44
+ path: dist/*.whl
45
+
46
+ sdist:
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: PyO3/maturin-action@v1
51
+ with:
52
+ command: sdist
53
+ args: --out dist
54
+ - uses: actions/upload-artifact@v4
55
+ with:
56
+ name: sdist
57
+ path: dist/*.tar.gz
58
+
59
+ # The abi3 wheel must select the right table variant on every interpreter
60
+ # and match Pygments there (glibc/macOS/Windows; musl wheels are only built).
61
+ test:
62
+ needs: build
63
+ runs-on: ${{ matrix.os }}
64
+ strategy:
65
+ fail-fast: false
66
+ matrix:
67
+ os: [windows-latest, ubuntu-24.04, ubuntu-24.04-arm, macos-15-intel, macos-15]
68
+ python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
69
+ exclude:
70
+ # macOS runners are slow to come by: oldest and newest are enough.
71
+ - { os: macos-15-intel, python: '3.10' }
72
+ - { os: macos-15-intel, python: '3.11' }
73
+ - { os: macos-15-intel, python: '3.12' }
74
+ - { os: macos-15-intel, python: '3.13' }
75
+ - { os: macos-15, python: '3.10' }
76
+ - { os: macos-15, python: '3.11' }
77
+ - { os: macos-15, python: '3.12' }
78
+ - { os: macos-15, python: '3.13' }
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+ - uses: actions/setup-python@v5
82
+ with:
83
+ python-version: ${{ matrix.python }}
84
+ - uses: actions/download-artifact@v4
85
+ with:
86
+ pattern: wheel-*
87
+ path: dist
88
+ merge-multiple: true
89
+ - name: Install the wheel for this platform
90
+ shell: bash
91
+ run: |
92
+ python -m pip install pygments==2.21.0
93
+ python -m pip install --no-index --find-links dist rustgments
94
+ - name: API and drop-in smoke test
95
+ shell: bash
96
+ run: |
97
+ python -I -c "import rustgments as r, sys; assert r._VERSION_OK, r._INFO; print(sys.version, r._INFO['variant_pythons'], r._INFO['unicode_version'])"
98
+ python -I tests/test_api.py
99
+ - name: Token and HTML parity on Pygments' own test inputs
100
+ shell: bash
101
+ run: |
102
+ git clone -q --depth 1 -b 2.21.0 https://github.com/pygments/pygments corpus-pygments
103
+ python -I tests/parity.py examplefiles --pygments-src corpus-pygments
104
+ python -I tests/parity.py snippets --pygments-src corpus-pygments
105
+ - name: Parity gate for every native lexer
106
+ shell: bash
107
+ run: |
108
+ python -I tests/gate.py run gate.json --mutants 5 --pygments-src corpus-pygments
109
+ python -I -c "import json; l=json.load(open('gate.json',encoding='utf-8'))['lexers']; bad={k:v for k,v in l.items() if not v['verdict'].startswith('tables:') and v['verdict']!='pass'}; print(len(l),'lexers, failures:',bad); assert not bad"
110
+
111
+ publish:
112
+ if: startsWith(github.ref, 'refs/tags/v')
113
+ needs: [build, sdist, test]
114
+ runs-on: ubuntu-latest
115
+ environment: pypi
116
+ permissions:
117
+ id-token: write # PyPI trusted publishing
118
+ contents: write # GitHub release
119
+ steps:
120
+ - uses: actions/download-artifact@v4
121
+ with:
122
+ path: dist
123
+ merge-multiple: true
124
+ - uses: pypa/gh-action-pypi-publish@release/v1
125
+ with:
126
+ packages-dir: dist
127
+ - name: GitHub release
128
+ env:
129
+ GH_TOKEN: ${{ github.token }}
130
+ run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --generate-notes
@@ -0,0 +1,9 @@
1
+ /.venv/
2
+ /target/
3
+ __pycache__/
4
+ *.pyd
5
+ *.so
6
+ /python/rustgments/_native*
7
+ /bench/results/*.tmp
8
+ /corpus/
9
+ /dist/
@@ -0,0 +1,334 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.5"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
+
20
+ [[package]]
21
+ name = "bit-set"
22
+ version = "0.8.0"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
25
+ dependencies = [
26
+ "bit-vec",
27
+ ]
28
+
29
+ [[package]]
30
+ name = "bit-vec"
31
+ version = "0.8.0"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
34
+
35
+ [[package]]
36
+ name = "cc"
37
+ version = "1.11.1"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "4ff2a8126fff0f8c839080d619675a585e61720bb12d2baceae45769fd66f155"
40
+ dependencies = [
41
+ "find-msvc-tools",
42
+ "shlex",
43
+ ]
44
+
45
+ [[package]]
46
+ name = "fancy-regex"
47
+ version = "0.18.0"
48
+ source = "registry+https://github.com/rust-lang/crates.io-index"
49
+ checksum = "e1e1dacd0d2082dfcf1351c4bdd566bbe89a2b263235a2b50058f1e130a47277"
50
+ dependencies = [
51
+ "bit-set",
52
+ "regex-automata",
53
+ "regex-syntax",
54
+ ]
55
+
56
+ [[package]]
57
+ name = "find-msvc-tools"
58
+ version = "0.1.15"
59
+ source = "registry+https://github.com/rust-lang/crates.io-index"
60
+ checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
61
+
62
+ [[package]]
63
+ name = "heck"
64
+ version = "0.5.0"
65
+ source = "registry+https://github.com/rust-lang/crates.io-index"
66
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
67
+
68
+ [[package]]
69
+ name = "indoc"
70
+ version = "2.0.8"
71
+ source = "registry+https://github.com/rust-lang/crates.io-index"
72
+ checksum = "a37b2691796cffeb8a8cd305ac66e65841559f147f4e63231d0eafa4db5384d1"
73
+ dependencies = [
74
+ "rustversion",
75
+ ]
76
+
77
+ [[package]]
78
+ name = "itoa"
79
+ version = "1.0.18"
80
+ source = "registry+https://github.com/rust-lang/crates.io-index"
81
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
82
+
83
+ [[package]]
84
+ name = "libc"
85
+ version = "0.2.191"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
88
+
89
+ [[package]]
90
+ name = "memchr"
91
+ version = "2.8.3"
92
+ source = "registry+https://github.com/rust-lang/crates.io-index"
93
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
94
+
95
+ [[package]]
96
+ name = "memoffset"
97
+ version = "0.9.1"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
100
+ dependencies = [
101
+ "autocfg",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "once_cell"
106
+ version = "1.21.4"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
109
+
110
+ [[package]]
111
+ name = "portable-atomic"
112
+ version = "1.15.0"
113
+ source = "registry+https://github.com/rust-lang/crates.io-index"
114
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
115
+
116
+ [[package]]
117
+ name = "proc-macro2"
118
+ version = "1.0.107"
119
+ source = "registry+https://github.com/rust-lang/crates.io-index"
120
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
121
+ dependencies = [
122
+ "unicode-ident",
123
+ ]
124
+
125
+ [[package]]
126
+ name = "pyo3"
127
+ version = "0.25.1"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
130
+ dependencies = [
131
+ "indoc",
132
+ "libc",
133
+ "memoffset",
134
+ "once_cell",
135
+ "portable-atomic",
136
+ "pyo3-build-config",
137
+ "pyo3-ffi",
138
+ "pyo3-macros",
139
+ "unindent",
140
+ ]
141
+
142
+ [[package]]
143
+ name = "pyo3-build-config"
144
+ version = "0.25.1"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
147
+ dependencies = [
148
+ "once_cell",
149
+ "python3-dll-a",
150
+ "target-lexicon",
151
+ ]
152
+
153
+ [[package]]
154
+ name = "pyo3-ffi"
155
+ version = "0.25.1"
156
+ source = "registry+https://github.com/rust-lang/crates.io-index"
157
+ checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
158
+ dependencies = [
159
+ "libc",
160
+ "pyo3-build-config",
161
+ ]
162
+
163
+ [[package]]
164
+ name = "pyo3-macros"
165
+ version = "0.25.1"
166
+ source = "registry+https://github.com/rust-lang/crates.io-index"
167
+ checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
168
+ dependencies = [
169
+ "proc-macro2",
170
+ "pyo3-macros-backend",
171
+ "quote",
172
+ "syn 2.0.119",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "pyo3-macros-backend"
177
+ version = "0.25.1"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+ checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
180
+ dependencies = [
181
+ "heck",
182
+ "proc-macro2",
183
+ "pyo3-build-config",
184
+ "quote",
185
+ "syn 2.0.119",
186
+ ]
187
+
188
+ [[package]]
189
+ name = "python3-dll-a"
190
+ version = "0.2.15"
191
+ source = "registry+https://github.com/rust-lang/crates.io-index"
192
+ checksum = "d80ba7540edb18890d444c5aa8e1f1f99b1bdf26fb26ae383135325f4a36042b"
193
+ dependencies = [
194
+ "cc",
195
+ ]
196
+
197
+ [[package]]
198
+ name = "quote"
199
+ version = "1.0.47"
200
+ source = "registry+https://github.com/rust-lang/crates.io-index"
201
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
202
+ dependencies = [
203
+ "proc-macro2",
204
+ ]
205
+
206
+ [[package]]
207
+ name = "regex-automata"
208
+ version = "0.4.18"
209
+ source = "registry+https://github.com/rust-lang/crates.io-index"
210
+ checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
211
+ dependencies = [
212
+ "aho-corasick",
213
+ "memchr",
214
+ "regex-syntax",
215
+ ]
216
+
217
+ [[package]]
218
+ name = "regex-syntax"
219
+ version = "0.8.11"
220
+ source = "registry+https://github.com/rust-lang/crates.io-index"
221
+ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
222
+
223
+ [[package]]
224
+ name = "rustgments"
225
+ version = "0.1.0"
226
+ dependencies = [
227
+ "fancy-regex",
228
+ "pyo3",
229
+ "regex-automata",
230
+ "regex-syntax",
231
+ "serde",
232
+ "serde_json",
233
+ ]
234
+
235
+ [[package]]
236
+ name = "rustversion"
237
+ version = "1.0.23"
238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
239
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
240
+
241
+ [[package]]
242
+ name = "serde"
243
+ version = "1.0.229"
244
+ source = "registry+https://github.com/rust-lang/crates.io-index"
245
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
246
+ dependencies = [
247
+ "serde_core",
248
+ "serde_derive",
249
+ ]
250
+
251
+ [[package]]
252
+ name = "serde_core"
253
+ version = "1.0.229"
254
+ source = "registry+https://github.com/rust-lang/crates.io-index"
255
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
256
+ dependencies = [
257
+ "serde_derive",
258
+ ]
259
+
260
+ [[package]]
261
+ name = "serde_derive"
262
+ version = "1.0.229"
263
+ source = "registry+https://github.com/rust-lang/crates.io-index"
264
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
265
+ dependencies = [
266
+ "proc-macro2",
267
+ "quote",
268
+ "syn 3.0.9",
269
+ ]
270
+
271
+ [[package]]
272
+ name = "serde_json"
273
+ version = "1.0.154"
274
+ source = "registry+https://github.com/rust-lang/crates.io-index"
275
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
276
+ dependencies = [
277
+ "itoa",
278
+ "memchr",
279
+ "serde",
280
+ "serde_core",
281
+ "zmij",
282
+ ]
283
+
284
+ [[package]]
285
+ name = "shlex"
286
+ version = "2.0.1"
287
+ source = "registry+https://github.com/rust-lang/crates.io-index"
288
+ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
289
+
290
+ [[package]]
291
+ name = "syn"
292
+ version = "2.0.119"
293
+ source = "registry+https://github.com/rust-lang/crates.io-index"
294
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
295
+ dependencies = [
296
+ "proc-macro2",
297
+ "quote",
298
+ "unicode-ident",
299
+ ]
300
+
301
+ [[package]]
302
+ name = "syn"
303
+ version = "3.0.9"
304
+ source = "registry+https://github.com/rust-lang/crates.io-index"
305
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
306
+ dependencies = [
307
+ "proc-macro2",
308
+ "quote",
309
+ "unicode-ident",
310
+ ]
311
+
312
+ [[package]]
313
+ name = "target-lexicon"
314
+ version = "0.13.5"
315
+ source = "registry+https://github.com/rust-lang/crates.io-index"
316
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
317
+
318
+ [[package]]
319
+ name = "unicode-ident"
320
+ version = "1.0.27"
321
+ source = "registry+https://github.com/rust-lang/crates.io-index"
322
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
323
+
324
+ [[package]]
325
+ name = "unindent"
326
+ version = "0.2.4"
327
+ source = "registry+https://github.com/rust-lang/crates.io-index"
328
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
329
+
330
+ [[package]]
331
+ name = "zmij"
332
+ version = "1.0.23"
333
+ source = "registry+https://github.com/rust-lang/crates.io-index"
334
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,30 @@
1
+ [package]
2
+ name = "rustgments"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ license = "BSD-2-Clause"
6
+ publish = false
7
+ description = "A Rust engine for Pygments lexers: byte-identical output"
8
+ repository = "https://github.com/b84330808/rustgments"
9
+ readme = "README.md"
10
+
11
+ [lib]
12
+ name = "rustgments"
13
+ crate-type = ["cdylib", "rlib"]
14
+
15
+ [features]
16
+ default = []
17
+ python = ["dep:pyo3"]
18
+
19
+ [dependencies]
20
+ regex-automata = "0.4.13"
21
+ regex-syntax = "0.8.5"
22
+ fancy-regex = "=0.18.0"
23
+ serde = { version = "1", features = ["derive"] }
24
+ serde_json = { version = "1", features = ["raw_value"] }
25
+ pyo3 = { version = "0.25", optional = true, features = ["extension-module", "abi3-py39", "generate-import-lib"] }
26
+
27
+ [profile.release]
28
+ lto = "thin"
29
+ codegen-units = 4
30
+ debug = false
@@ -0,0 +1,25 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2026, rustgments contributors
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,25 @@
1
+ Copyright (c) 2006-2022 by the respective authors (see AUTHORS file).
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions and the following disclaimer in the
13
+ documentation and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.