dice_nom_shim 0.1.2 → 0.4.0
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.
- checksums.yaml +4 -4
- data/Cargo.lock +95 -205
- data/ext/dice_nom_shim/Cargo.toml +2 -2
- data/ext/dice_nom_shim/src/lib.rs +68 -1
- data/lib/dice_nom_shim/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d593a0a7e8b3ca9c6b063845f34e6345198bded7e222125a1fea4d89724f430b
|
4
|
+
data.tar.gz: a384c2665745f6e848a1ba9cdc7de0b5fce54c014755364576675f9ada397d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b1dddbdb2ab8bcde211f5c6d35171017a0492c164c4ce0d68b5a90f3bf2436ad64c12222e7d82ce933b269b8e0c1bb306fc82200755b05efd1b44a9a95476e
|
7
|
+
data.tar.gz: 0dd3dfa6c79cd1684d76dded4d4ba809562af5bbbe7e12fb6efe5d98c10e2f78be46742ffbff1497dc6c6a450ff9cafbf15b1e7e3f9441683950f5320b152a3e
|
data/Cargo.lock
CHANGED
@@ -13,9 +13,9 @@ dependencies = [
|
|
13
13
|
|
14
14
|
[[package]]
|
15
15
|
name = "anstream"
|
16
|
-
version = "0.6.
|
16
|
+
version = "0.6.20"
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
-
checksum = "
|
18
|
+
checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192"
|
19
19
|
dependencies = [
|
20
20
|
"anstyle",
|
21
21
|
"anstyle-parse",
|
@@ -43,37 +43,31 @@ dependencies = [
|
|
43
43
|
|
44
44
|
[[package]]
|
45
45
|
name = "anstyle-query"
|
46
|
-
version = "1.1.
|
46
|
+
version = "1.1.4"
|
47
47
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
48
|
-
checksum = "
|
48
|
+
checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
|
49
49
|
dependencies = [
|
50
50
|
"windows-sys",
|
51
51
|
]
|
52
52
|
|
53
53
|
[[package]]
|
54
54
|
name = "anstyle-wincon"
|
55
|
-
version = "3.0.
|
55
|
+
version = "3.0.10"
|
56
56
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
57
|
-
checksum = "
|
57
|
+
checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
|
58
58
|
dependencies = [
|
59
59
|
"anstyle",
|
60
60
|
"once_cell_polyfill",
|
61
61
|
"windows-sys",
|
62
62
|
]
|
63
63
|
|
64
|
-
[[package]]
|
65
|
-
name = "arrayvec"
|
66
|
-
version = "0.5.2"
|
67
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
68
|
-
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
69
|
-
|
70
64
|
[[package]]
|
71
65
|
name = "bindgen"
|
72
66
|
version = "0.69.5"
|
73
67
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
74
68
|
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
|
75
69
|
dependencies = [
|
76
|
-
"bitflags
|
70
|
+
"bitflags",
|
77
71
|
"cexpr",
|
78
72
|
"clang-sys",
|
79
73
|
"itertools",
|
@@ -89,27 +83,9 @@ dependencies = [
|
|
89
83
|
|
90
84
|
[[package]]
|
91
85
|
name = "bitflags"
|
92
|
-
version = "
|
86
|
+
version = "2.9.4"
|
93
87
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
94
|
-
checksum = "
|
95
|
-
|
96
|
-
[[package]]
|
97
|
-
name = "bitflags"
|
98
|
-
version = "2.9.1"
|
99
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
100
|
-
checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
|
101
|
-
|
102
|
-
[[package]]
|
103
|
-
name = "bitvec"
|
104
|
-
version = "0.19.6"
|
105
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
106
|
-
checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33"
|
107
|
-
dependencies = [
|
108
|
-
"funty",
|
109
|
-
"radium",
|
110
|
-
"tap",
|
111
|
-
"wyz",
|
112
|
-
]
|
88
|
+
checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
|
113
89
|
|
114
90
|
[[package]]
|
115
91
|
name = "cexpr"
|
@@ -122,9 +98,9 @@ dependencies = [
|
|
122
98
|
|
123
99
|
[[package]]
|
124
100
|
name = "cfg-if"
|
125
|
-
version = "1.0.
|
101
|
+
version = "1.0.3"
|
126
102
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
127
|
-
checksum = "
|
103
|
+
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
|
128
104
|
|
129
105
|
[[package]]
|
130
106
|
name = "clang-sys"
|
@@ -139,9 +115,9 @@ dependencies = [
|
|
139
115
|
|
140
116
|
[[package]]
|
141
117
|
name = "clap"
|
142
|
-
version = "4.5.
|
118
|
+
version = "4.5.47"
|
143
119
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
144
|
-
checksum = "
|
120
|
+
checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931"
|
145
121
|
dependencies = [
|
146
122
|
"clap_builder",
|
147
123
|
"clap_derive",
|
@@ -149,9 +125,9 @@ dependencies = [
|
|
149
125
|
|
150
126
|
[[package]]
|
151
127
|
name = "clap_builder"
|
152
|
-
version = "4.5.
|
128
|
+
version = "4.5.47"
|
153
129
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
154
|
-
checksum = "
|
130
|
+
checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6"
|
155
131
|
dependencies = [
|
156
132
|
"anstream",
|
157
133
|
"anstyle",
|
@@ -161,9 +137,9 @@ dependencies = [
|
|
161
137
|
|
162
138
|
[[package]]
|
163
139
|
name = "clap_derive"
|
164
|
-
version = "4.5.
|
140
|
+
version = "4.5.47"
|
165
141
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
166
|
-
checksum = "
|
142
|
+
checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c"
|
167
143
|
dependencies = [
|
168
144
|
"heck",
|
169
145
|
"proc-macro2",
|
@@ -185,12 +161,12 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
|
|
185
161
|
|
186
162
|
[[package]]
|
187
163
|
name = "dice-nom"
|
188
|
-
version = "0.
|
164
|
+
version = "0.4.0"
|
189
165
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
190
|
-
checksum = "
|
166
|
+
checksum = "495027bf2593bca1f1fb662059c69b43dcf0fd128031d67ac9e4ce51106744a4"
|
191
167
|
dependencies = [
|
192
168
|
"clap",
|
193
|
-
"nom
|
169
|
+
"nom 8.0.0",
|
194
170
|
"rand",
|
195
171
|
"serde",
|
196
172
|
"serde_json",
|
@@ -213,28 +189,23 @@ version = "1.15.0"
|
|
213
189
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
214
190
|
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
215
191
|
|
216
|
-
[[package]]
|
217
|
-
name = "funty"
|
218
|
-
version = "1.1.0"
|
219
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
220
|
-
checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
|
221
|
-
|
222
192
|
[[package]]
|
223
193
|
name = "getrandom"
|
224
|
-
version = "0.
|
194
|
+
version = "0.3.3"
|
225
195
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
226
|
-
checksum = "
|
196
|
+
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
|
227
197
|
dependencies = [
|
228
198
|
"cfg-if",
|
229
199
|
"libc",
|
200
|
+
"r-efi",
|
230
201
|
"wasi",
|
231
202
|
]
|
232
203
|
|
233
204
|
[[package]]
|
234
205
|
name = "glob"
|
235
|
-
version = "0.3.
|
206
|
+
version = "0.3.3"
|
236
207
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
237
|
-
checksum = "
|
208
|
+
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
238
209
|
|
239
210
|
[[package]]
|
240
211
|
name = "heck"
|
@@ -275,24 +246,11 @@ version = "1.3.0"
|
|
275
246
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
276
247
|
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
277
248
|
|
278
|
-
[[package]]
|
279
|
-
name = "lexical-core"
|
280
|
-
version = "0.7.6"
|
281
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
282
|
-
checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
|
283
|
-
dependencies = [
|
284
|
-
"arrayvec",
|
285
|
-
"bitflags 1.3.2",
|
286
|
-
"cfg-if",
|
287
|
-
"ryu",
|
288
|
-
"static_assertions",
|
289
|
-
]
|
290
|
-
|
291
249
|
[[package]]
|
292
250
|
name = "libc"
|
293
|
-
version = "0.2.
|
251
|
+
version = "0.2.175"
|
294
252
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
295
|
-
checksum = "
|
253
|
+
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
|
296
254
|
|
297
255
|
[[package]]
|
298
256
|
name = "libloading"
|
@@ -301,7 +259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
301
259
|
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
|
302
260
|
dependencies = [
|
303
261
|
"cfg-if",
|
304
|
-
"windows-targets
|
262
|
+
"windows-targets",
|
305
263
|
]
|
306
264
|
|
307
265
|
[[package]]
|
@@ -341,25 +299,21 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|
341
299
|
|
342
300
|
[[package]]
|
343
301
|
name = "nom"
|
344
|
-
version = "
|
302
|
+
version = "7.1.3"
|
345
303
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
346
|
-
checksum = "
|
304
|
+
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
347
305
|
dependencies = [
|
348
|
-
"bitvec",
|
349
|
-
"funty",
|
350
|
-
"lexical-core",
|
351
306
|
"memchr",
|
352
|
-
"
|
307
|
+
"minimal-lexical",
|
353
308
|
]
|
354
309
|
|
355
310
|
[[package]]
|
356
311
|
name = "nom"
|
357
|
-
version = "
|
312
|
+
version = "8.0.0"
|
358
313
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
359
|
-
checksum = "
|
314
|
+
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
|
360
315
|
dependencies = [
|
361
316
|
"memchr",
|
362
|
-
"minimal-lexical",
|
363
317
|
]
|
364
318
|
|
365
319
|
[[package]]
|
@@ -379,9 +333,9 @@ dependencies = [
|
|
379
333
|
|
380
334
|
[[package]]
|
381
335
|
name = "proc-macro2"
|
382
|
-
version = "1.0.
|
336
|
+
version = "1.0.101"
|
383
337
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
384
|
-
checksum = "
|
338
|
+
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
|
385
339
|
dependencies = [
|
386
340
|
"unicode-ident",
|
387
341
|
]
|
@@ -396,27 +350,26 @@ dependencies = [
|
|
396
350
|
]
|
397
351
|
|
398
352
|
[[package]]
|
399
|
-
name = "
|
400
|
-
version = "
|
353
|
+
name = "r-efi"
|
354
|
+
version = "5.3.0"
|
401
355
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
402
|
-
checksum = "
|
356
|
+
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
403
357
|
|
404
358
|
[[package]]
|
405
359
|
name = "rand"
|
406
|
-
version = "0.
|
360
|
+
version = "0.9.2"
|
407
361
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
408
|
-
checksum = "
|
362
|
+
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
409
363
|
dependencies = [
|
410
|
-
"libc",
|
411
364
|
"rand_chacha",
|
412
365
|
"rand_core",
|
413
366
|
]
|
414
367
|
|
415
368
|
[[package]]
|
416
369
|
name = "rand_chacha"
|
417
|
-
version = "0.
|
370
|
+
version = "0.9.0"
|
418
371
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
419
|
-
checksum = "
|
372
|
+
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
420
373
|
dependencies = [
|
421
374
|
"ppv-lite86",
|
422
375
|
"rand_core",
|
@@ -424,27 +377,27 @@ dependencies = [
|
|
424
377
|
|
425
378
|
[[package]]
|
426
379
|
name = "rand_core"
|
427
|
-
version = "0.
|
380
|
+
version = "0.9.3"
|
428
381
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
429
|
-
checksum = "
|
382
|
+
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
|
430
383
|
dependencies = [
|
431
384
|
"getrandom",
|
432
385
|
]
|
433
386
|
|
434
387
|
[[package]]
|
435
388
|
name = "rb-sys"
|
436
|
-
version = "0.9.
|
389
|
+
version = "0.9.117"
|
437
390
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
438
|
-
checksum = "
|
391
|
+
checksum = "f900d1ce4629a2ebffaf5de74bd8f9c1188d4c5ed406df02f97e22f77a006f44"
|
439
392
|
dependencies = [
|
440
393
|
"rb-sys-build",
|
441
394
|
]
|
442
395
|
|
443
396
|
[[package]]
|
444
397
|
name = "rb-sys-build"
|
445
|
-
version = "0.9.
|
398
|
+
version = "0.9.117"
|
446
399
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
447
|
-
checksum = "
|
400
|
+
checksum = "ef1e9c857028f631056bcd6d88cec390c751e343ce2223ddb26d23eb4a151d59"
|
448
401
|
dependencies = [
|
449
402
|
"bindgen",
|
450
403
|
"lazy_static",
|
@@ -463,9 +416,9 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
|
463
416
|
|
464
417
|
[[package]]
|
465
418
|
name = "regex"
|
466
|
-
version = "1.11.
|
419
|
+
version = "1.11.2"
|
467
420
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
468
|
-
checksum = "
|
421
|
+
checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
|
469
422
|
dependencies = [
|
470
423
|
"aho-corasick",
|
471
424
|
"memchr",
|
@@ -475,9 +428,9 @@ dependencies = [
|
|
475
428
|
|
476
429
|
[[package]]
|
477
430
|
name = "regex-automata"
|
478
|
-
version = "0.4.
|
431
|
+
version = "0.4.10"
|
479
432
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
480
|
-
checksum = "
|
433
|
+
checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
|
481
434
|
dependencies = [
|
482
435
|
"aho-corasick",
|
483
436
|
"memchr",
|
@@ -486,9 +439,9 @@ dependencies = [
|
|
486
439
|
|
487
440
|
[[package]]
|
488
441
|
name = "regex-syntax"
|
489
|
-
version = "0.8.
|
442
|
+
version = "0.8.6"
|
490
443
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
491
|
-
checksum = "
|
444
|
+
checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
|
492
445
|
|
493
446
|
[[package]]
|
494
447
|
name = "rustc-hash"
|
@@ -530,9 +483,9 @@ dependencies = [
|
|
530
483
|
|
531
484
|
[[package]]
|
532
485
|
name = "serde_json"
|
533
|
-
version = "1.0.
|
486
|
+
version = "1.0.143"
|
534
487
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
535
|
-
checksum = "
|
488
|
+
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
|
536
489
|
dependencies = [
|
537
490
|
"itoa",
|
538
491
|
"memchr",
|
@@ -552,12 +505,6 @@ version = "1.3.0"
|
|
552
505
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
553
506
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
554
507
|
|
555
|
-
[[package]]
|
556
|
-
name = "static_assertions"
|
557
|
-
version = "1.1.0"
|
558
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
559
|
-
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
560
|
-
|
561
508
|
[[package]]
|
562
509
|
name = "strsim"
|
563
510
|
version = "0.11.1"
|
@@ -566,21 +513,15 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
566
513
|
|
567
514
|
[[package]]
|
568
515
|
name = "syn"
|
569
|
-
version = "2.0.
|
516
|
+
version = "2.0.106"
|
570
517
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
571
|
-
checksum = "
|
518
|
+
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
|
572
519
|
dependencies = [
|
573
520
|
"proc-macro2",
|
574
521
|
"quote",
|
575
522
|
"unicode-ident",
|
576
523
|
]
|
577
524
|
|
578
|
-
[[package]]
|
579
|
-
name = "tap"
|
580
|
-
version = "1.0.1"
|
581
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
582
|
-
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
|
583
|
-
|
584
525
|
[[package]]
|
585
526
|
name = "unicode-ident"
|
586
527
|
version = "1.0.18"
|
@@ -593,64 +534,55 @@ version = "0.2.2"
|
|
593
534
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
594
535
|
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
595
536
|
|
596
|
-
[[package]]
|
597
|
-
name = "version_check"
|
598
|
-
version = "0.9.5"
|
599
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
600
|
-
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
601
|
-
|
602
537
|
[[package]]
|
603
538
|
name = "wasi"
|
604
|
-
version = "0.
|
539
|
+
version = "0.14.5+wasi-0.2.4"
|
605
540
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
606
|
-
checksum = "
|
541
|
+
checksum = "a4494f6290a82f5fe584817a676a34b9d6763e8d9d18204009fb31dceca98fd4"
|
542
|
+
dependencies = [
|
543
|
+
"wasip2",
|
544
|
+
]
|
607
545
|
|
608
546
|
[[package]]
|
609
|
-
name = "
|
610
|
-
version = "0.
|
547
|
+
name = "wasip2"
|
548
|
+
version = "1.0.0+wasi-0.2.4"
|
611
549
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
612
|
-
checksum = "
|
550
|
+
checksum = "03fa2761397e5bd52002cd7e73110c71af2109aca4e521a9f40473fe685b0a24"
|
613
551
|
dependencies = [
|
614
|
-
"
|
552
|
+
"wit-bindgen",
|
615
553
|
]
|
616
554
|
|
617
555
|
[[package]]
|
618
|
-
name = "windows-
|
619
|
-
version = "0.
|
556
|
+
name = "windows-link"
|
557
|
+
version = "0.1.3"
|
620
558
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
621
|
-
checksum = "
|
622
|
-
dependencies = [
|
623
|
-
"windows_aarch64_gnullvm 0.52.6",
|
624
|
-
"windows_aarch64_msvc 0.52.6",
|
625
|
-
"windows_i686_gnu 0.52.6",
|
626
|
-
"windows_i686_gnullvm 0.52.6",
|
627
|
-
"windows_i686_msvc 0.52.6",
|
628
|
-
"windows_x86_64_gnu 0.52.6",
|
629
|
-
"windows_x86_64_gnullvm 0.52.6",
|
630
|
-
"windows_x86_64_msvc 0.52.6",
|
631
|
-
]
|
559
|
+
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
632
560
|
|
633
561
|
[[package]]
|
634
|
-
name = "windows-
|
635
|
-
version = "0.
|
562
|
+
name = "windows-sys"
|
563
|
+
version = "0.60.2"
|
636
564
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
637
|
-
checksum = "
|
565
|
+
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
638
566
|
dependencies = [
|
639
|
-
"
|
640
|
-
"windows_aarch64_msvc 0.53.0",
|
641
|
-
"windows_i686_gnu 0.53.0",
|
642
|
-
"windows_i686_gnullvm 0.53.0",
|
643
|
-
"windows_i686_msvc 0.53.0",
|
644
|
-
"windows_x86_64_gnu 0.53.0",
|
645
|
-
"windows_x86_64_gnullvm 0.53.0",
|
646
|
-
"windows_x86_64_msvc 0.53.0",
|
567
|
+
"windows-targets",
|
647
568
|
]
|
648
569
|
|
649
570
|
[[package]]
|
650
|
-
name = "
|
651
|
-
version = "0.
|
571
|
+
name = "windows-targets"
|
572
|
+
version = "0.53.3"
|
652
573
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
653
|
-
checksum = "
|
574
|
+
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
|
575
|
+
dependencies = [
|
576
|
+
"windows-link",
|
577
|
+
"windows_aarch64_gnullvm",
|
578
|
+
"windows_aarch64_msvc",
|
579
|
+
"windows_i686_gnu",
|
580
|
+
"windows_i686_gnullvm",
|
581
|
+
"windows_i686_msvc",
|
582
|
+
"windows_x86_64_gnu",
|
583
|
+
"windows_x86_64_gnullvm",
|
584
|
+
"windows_x86_64_msvc",
|
585
|
+
]
|
654
586
|
|
655
587
|
[[package]]
|
656
588
|
name = "windows_aarch64_gnullvm"
|
@@ -658,84 +590,42 @@ version = "0.53.0"
|
|
658
590
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
659
591
|
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
660
592
|
|
661
|
-
[[package]]
|
662
|
-
name = "windows_aarch64_msvc"
|
663
|
-
version = "0.52.6"
|
664
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
665
|
-
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
666
|
-
|
667
593
|
[[package]]
|
668
594
|
name = "windows_aarch64_msvc"
|
669
595
|
version = "0.53.0"
|
670
596
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
671
597
|
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
672
598
|
|
673
|
-
[[package]]
|
674
|
-
name = "windows_i686_gnu"
|
675
|
-
version = "0.52.6"
|
676
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
677
|
-
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
678
|
-
|
679
599
|
[[package]]
|
680
600
|
name = "windows_i686_gnu"
|
681
601
|
version = "0.53.0"
|
682
602
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
683
603
|
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
684
604
|
|
685
|
-
[[package]]
|
686
|
-
name = "windows_i686_gnullvm"
|
687
|
-
version = "0.52.6"
|
688
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
689
|
-
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
690
|
-
|
691
605
|
[[package]]
|
692
606
|
name = "windows_i686_gnullvm"
|
693
607
|
version = "0.53.0"
|
694
608
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
695
609
|
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
696
610
|
|
697
|
-
[[package]]
|
698
|
-
name = "windows_i686_msvc"
|
699
|
-
version = "0.52.6"
|
700
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
701
|
-
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
702
|
-
|
703
611
|
[[package]]
|
704
612
|
name = "windows_i686_msvc"
|
705
613
|
version = "0.53.0"
|
706
614
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
707
615
|
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
708
616
|
|
709
|
-
[[package]]
|
710
|
-
name = "windows_x86_64_gnu"
|
711
|
-
version = "0.52.6"
|
712
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
713
|
-
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
714
|
-
|
715
617
|
[[package]]
|
716
618
|
name = "windows_x86_64_gnu"
|
717
619
|
version = "0.53.0"
|
718
620
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
719
621
|
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
720
622
|
|
721
|
-
[[package]]
|
722
|
-
name = "windows_x86_64_gnullvm"
|
723
|
-
version = "0.52.6"
|
724
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
725
|
-
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
726
|
-
|
727
623
|
[[package]]
|
728
624
|
name = "windows_x86_64_gnullvm"
|
729
625
|
version = "0.53.0"
|
730
626
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
731
627
|
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
|
732
628
|
|
733
|
-
[[package]]
|
734
|
-
name = "windows_x86_64_msvc"
|
735
|
-
version = "0.52.6"
|
736
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
737
|
-
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
738
|
-
|
739
629
|
[[package]]
|
740
630
|
name = "windows_x86_64_msvc"
|
741
631
|
version = "0.53.0"
|
@@ -743,25 +633,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
743
633
|
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
|
744
634
|
|
745
635
|
[[package]]
|
746
|
-
name = "
|
747
|
-
version = "0.
|
636
|
+
name = "wit-bindgen"
|
637
|
+
version = "0.45.1"
|
748
638
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
749
|
-
checksum = "
|
639
|
+
checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36"
|
750
640
|
|
751
641
|
[[package]]
|
752
642
|
name = "zerocopy"
|
753
|
-
version = "0.8.
|
643
|
+
version = "0.8.27"
|
754
644
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
755
|
-
checksum = "
|
645
|
+
checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c"
|
756
646
|
dependencies = [
|
757
647
|
"zerocopy-derive",
|
758
648
|
]
|
759
649
|
|
760
650
|
[[package]]
|
761
651
|
name = "zerocopy-derive"
|
762
|
-
version = "0.8.
|
652
|
+
version = "0.8.27"
|
763
653
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
764
|
-
checksum = "
|
654
|
+
checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831"
|
765
655
|
dependencies = [
|
766
656
|
"proc-macro2",
|
767
657
|
"quote",
|
@@ -1,4 +1,6 @@
|
|
1
1
|
use magnus::{function, prelude::*, Error, Ruby};
|
2
|
+
use std::collections::BTreeMap;
|
3
|
+
use std::i32::MAX;
|
2
4
|
|
3
5
|
use dice_nom::parsers::generator_parser;
|
4
6
|
|
@@ -7,7 +9,7 @@ fn roll(roll: String) -> String {
|
|
7
9
|
Ok((_, g)) => g,
|
8
10
|
Err(e) => return format!("{{\"error\": \"{}\"}}", e),
|
9
11
|
};
|
10
|
-
let mut rng = rand::
|
12
|
+
let mut rng = rand::rng();
|
11
13
|
let mut results_array = Vec::new();
|
12
14
|
let n = 1;
|
13
15
|
for _ in 0..n {
|
@@ -20,9 +22,74 @@ fn roll(roll: String) -> String {
|
|
20
22
|
}
|
21
23
|
}
|
22
24
|
|
25
|
+
#[derive(serde::Serialize)]
|
26
|
+
struct Histo {
|
27
|
+
min: i32,
|
28
|
+
max: i32,
|
29
|
+
max_cnt: u32,
|
30
|
+
map: BTreeMap<i32, u32>,
|
31
|
+
}
|
32
|
+
|
33
|
+
impl Histo {
|
34
|
+
pub fn build(roll: String, count: u32) -> String {
|
35
|
+
let mut histo = Histo {
|
36
|
+
min: MAX,
|
37
|
+
max: 0,
|
38
|
+
max_cnt: 0,
|
39
|
+
map: BTreeMap::new(),
|
40
|
+
};
|
41
|
+
let g = match generator_parser(roll.as_ref()) {
|
42
|
+
Ok((_, g)) => g,
|
43
|
+
Err(e) => return format!("{{\"error\": \"{}\"}}", e),
|
44
|
+
};
|
45
|
+
let mut rng = rand::rng();
|
46
|
+
let results = g.generate(&mut rng);
|
47
|
+
let result_json = serde_json::to_string(&results);
|
48
|
+
|
49
|
+
for _ in 0..count {
|
50
|
+
let v = g.generate(&mut rng).sum();
|
51
|
+
if v < histo.min {
|
52
|
+
histo.min = v;
|
53
|
+
}
|
54
|
+
if v > histo.max {
|
55
|
+
histo.max = v;
|
56
|
+
}
|
57
|
+
match histo.map.get(&v) {
|
58
|
+
Some(n) => {
|
59
|
+
let cnt = n + 1;
|
60
|
+
if cnt > histo.max_cnt {
|
61
|
+
histo.max_cnt = cnt;
|
62
|
+
}
|
63
|
+
histo.map.insert(v, cnt);
|
64
|
+
}
|
65
|
+
None => {
|
66
|
+
histo.map.insert(v, 1);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
let histo_json = serde_json::to_string(&histo);
|
71
|
+
|
72
|
+
let result_error = format!("{{\"error\": \"could not parse result '{}'\"}}", roll);
|
73
|
+
let histo_error = format!(
|
74
|
+
"{{\"error\": \"could not parse result '{}' count={}\"}}",
|
75
|
+
roll, count
|
76
|
+
);
|
77
|
+
format!(
|
78
|
+
"[{}, {}]",
|
79
|
+
result_json.unwrap_or(result_error),
|
80
|
+
histo_json.unwrap_or(histo_error)
|
81
|
+
)
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
fn histo(roll: String) -> String {
|
86
|
+
Histo::build(roll, 2000)
|
87
|
+
}
|
88
|
+
|
23
89
|
#[magnus::init]
|
24
90
|
fn init(ruby: &Ruby) -> Result<(), Error> {
|
25
91
|
let module = ruby.define_module("DiceNomShim")?;
|
26
92
|
module.define_singleton_method("roll", function!(roll, 1))?;
|
93
|
+
module.define_singleton_method("histo", function!(histo, 1))?;
|
27
94
|
Ok(())
|
28
95
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dice_nom_shim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- G Palmer
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 3.3.11
|
73
73
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
74
|
+
rubygems_version: 3.7.1
|
75
75
|
specification_version: 4
|
76
76
|
summary: Ruby shim to the dice-nom rust crate
|
77
77
|
test_files: []
|