snail-lang 0.6.3__tar.gz → 0.7.1__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 (63) hide show
  1. {snail_lang-0.6.3 → snail_lang-0.7.1}/Cargo.lock +7 -277
  2. {snail_lang-0.6.3 → snail_lang-0.7.1}/Cargo.toml +6 -0
  3. {snail_lang-0.6.3 → snail_lang-0.7.1}/PKG-INFO +9 -11
  4. {snail_lang-0.6.3 → snail_lang-0.7.1}/README.md +6 -9
  5. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-ast/Cargo.toml +1 -1
  6. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-ast/README.md +1 -1
  7. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-ast/src/ast.rs +53 -3
  8. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-error/Cargo.toml +1 -1
  9. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-error/README.md +0 -1
  10. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/Cargo.toml +1 -1
  11. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/README.md +1 -1
  12. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/expr.rs +56 -3
  13. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/lib.rs +42 -4
  14. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/literal.rs +14 -11
  15. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/snail.pest +23 -6
  16. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/stmt.rs +100 -18
  17. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/string.rs +466 -20
  18. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/util.rs +4 -0
  19. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/errors.rs +18 -4
  20. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/parser.rs +235 -12
  21. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/statements.rs +13 -0
  22. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/syntax_expressions.rs +38 -0
  23. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/syntax_strings.rs +88 -3
  24. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-python/Cargo.toml +6 -4
  25. snail_lang-0.7.1/crates/snail-python/src/compiler.rs +119 -0
  26. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-python/src/lib.rs +27 -89
  27. snail_lang-0.7.1/crates/snail-python/src/linecache.rs +51 -0
  28. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/awk.rs +5 -5
  29. snail_lang-0.7.1/crates/snail-python/src/lower/desugar.rs +906 -0
  30. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/expr.rs +299 -83
  31. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/helpers.rs +1 -1
  32. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/map.rs +24 -7
  33. snail_lang-0.6.3/crates/snail-lower/src/lib.rs → snail_lang-0.7.1/crates/snail-python/src/lower/mod.rs +2 -3
  34. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/operators.rs +1 -1
  35. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/program.rs +13 -5
  36. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/py_ast.rs +28 -0
  37. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/stmt.rs +115 -45
  38. snail_lang-0.7.1/crates/snail-python/src/lower/validate.rs +381 -0
  39. snail_lang-0.7.1/crates/snail-python/src/profiling.rs +15 -0
  40. {snail_lang-0.6.3 → snail_lang-0.7.1}/pyproject.toml +3 -2
  41. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/__init__.py +2 -0
  42. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/cli.py +20 -6
  43. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/__init__.py +2 -1
  44. snail_lang-0.6.3/crates/snail-core/Cargo.toml +0 -12
  45. snail_lang-0.6.3/crates/snail-core/README.md +0 -58
  46. snail_lang-0.6.3/crates/snail-core/src/lib.rs +0 -101
  47. snail_lang-0.6.3/crates/snail-lower/Cargo.toml +0 -10
  48. snail_lang-0.6.3/crates/snail-lower/README.md +0 -55
  49. {snail_lang-0.6.3 → snail_lang-0.7.1}/LICENSE +0 -0
  50. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-ast/src/awk.rs +0 -0
  51. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-ast/src/lib.rs +0 -0
  52. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-error/src/lib.rs +0 -0
  53. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/src/awk.rs +0 -0
  54. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-parser/tests/common.rs +0 -0
  55. {snail_lang-0.6.3 → snail_lang-0.7.1}/crates/snail-python/build.rs +0 -0
  56. {snail_lang-0.6.3/crates/snail-lower/src → snail_lang-0.7.1/crates/snail-python/src/lower}/constants.rs +0 -0
  57. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/augmented.py +0 -0
  58. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/compact_try.py +0 -0
  59. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/lazy_file.py +0 -0
  60. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/lazy_text.py +0 -0
  61. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/regex.py +0 -0
  62. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/structured_accessor.py +0 -0
  63. {snail_lang-0.6.3 → snail_lang-0.7.1}/python/snail/runtime/subprocess.py +0 -0
@@ -8,21 +8,6 @@ version = "1.5.0"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
9
  checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
10
10
 
11
- [[package]]
12
- name = "bit-set"
13
- version = "0.8.0"
14
- source = "registry+https://github.com/rust-lang/crates.io-index"
15
- checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
16
- dependencies = [
17
- "bit-vec",
18
- ]
19
-
20
- [[package]]
21
- name = "bit-vec"
22
- version = "0.8.0"
23
- source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
25
-
26
11
  [[package]]
27
12
  name = "bitflags"
28
13
  version = "2.10.0"
@@ -73,28 +58,6 @@ dependencies = [
73
58
  "crypto-common",
74
59
  ]
75
60
 
76
- [[package]]
77
- name = "errno"
78
- version = "0.3.14"
79
- source = "registry+https://github.com/rust-lang/crates.io-index"
80
- checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
81
- dependencies = [
82
- "libc",
83
- "windows-sys",
84
- ]
85
-
86
- [[package]]
87
- name = "fastrand"
88
- version = "2.3.0"
89
- source = "registry+https://github.com/rust-lang/crates.io-index"
90
- checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
91
-
92
- [[package]]
93
- name = "fnv"
94
- version = "1.0.7"
95
- source = "registry+https://github.com/rust-lang/crates.io-index"
96
- checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
97
-
98
61
  [[package]]
99
62
  name = "generic-array"
100
63
  version = "0.14.7"
@@ -105,18 +68,6 @@ dependencies = [
105
68
  "version_check",
106
69
  ]
107
70
 
108
- [[package]]
109
- name = "getrandom"
110
- version = "0.3.4"
111
- source = "registry+https://github.com/rust-lang/crates.io-index"
112
- checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
113
- dependencies = [
114
- "cfg-if",
115
- "libc",
116
- "r-efi",
117
- "wasip2",
118
- ]
119
-
120
71
  [[package]]
121
72
  name = "heck"
122
73
  version = "0.4.1"
@@ -138,12 +89,6 @@ version = "0.2.180"
138
89
  source = "registry+https://github.com/rust-lang/crates.io-index"
139
90
  checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
140
91
 
141
- [[package]]
142
- name = "linux-raw-sys"
143
- version = "0.11.0"
144
- source = "registry+https://github.com/rust-lang/crates.io-index"
145
- checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
146
-
147
92
  [[package]]
148
93
  name = "lock_api"
149
94
  version = "0.4.14"
@@ -168,15 +113,6 @@ dependencies = [
168
113
  "autocfg",
169
114
  ]
170
115
 
171
- [[package]]
172
- name = "num-traits"
173
- version = "0.2.19"
174
- source = "registry+https://github.com/rust-lang/crates.io-index"
175
- checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
176
- dependencies = [
177
- "autocfg",
178
- ]
179
-
180
116
  [[package]]
181
117
  name = "once_cell"
182
118
  version = "1.21.3"
@@ -255,15 +191,6 @@ version = "1.13.0"
255
191
  source = "registry+https://github.com/rust-lang/crates.io-index"
256
192
  checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
257
193
 
258
- [[package]]
259
- name = "ppv-lite86"
260
- version = "0.2.21"
261
- source = "registry+https://github.com/rust-lang/crates.io-index"
262
- checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
263
- dependencies = [
264
- "zerocopy",
265
- ]
266
-
267
194
  [[package]]
268
195
  name = "proc-macro2"
269
196
  version = "1.0.105"
@@ -273,25 +200,6 @@ dependencies = [
273
200
  "unicode-ident",
274
201
  ]
275
202
 
276
- [[package]]
277
- name = "proptest"
278
- version = "1.9.0"
279
- source = "registry+https://github.com/rust-lang/crates.io-index"
280
- checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40"
281
- dependencies = [
282
- "bit-set",
283
- "bit-vec",
284
- "bitflags",
285
- "num-traits",
286
- "rand",
287
- "rand_chacha",
288
- "rand_xorshift",
289
- "regex-syntax",
290
- "rusty-fork",
291
- "tempfile",
292
- "unarray",
293
- ]
294
-
295
203
  [[package]]
296
204
  name = "pyo3"
297
205
  version = "0.21.2"
@@ -355,12 +263,6 @@ dependencies = [
355
263
  "syn",
356
264
  ]
357
265
 
358
- [[package]]
359
- name = "quick-error"
360
- version = "1.2.3"
361
- source = "registry+https://github.com/rust-lang/crates.io-index"
362
- checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
363
-
364
266
  [[package]]
365
267
  name = "quote"
366
268
  version = "1.0.43"
@@ -370,50 +272,6 @@ dependencies = [
370
272
  "proc-macro2",
371
273
  ]
372
274
 
373
- [[package]]
374
- name = "r-efi"
375
- version = "5.3.0"
376
- source = "registry+https://github.com/rust-lang/crates.io-index"
377
- checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
378
-
379
- [[package]]
380
- name = "rand"
381
- version = "0.9.2"
382
- source = "registry+https://github.com/rust-lang/crates.io-index"
383
- checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
384
- dependencies = [
385
- "rand_chacha",
386
- "rand_core",
387
- ]
388
-
389
- [[package]]
390
- name = "rand_chacha"
391
- version = "0.9.0"
392
- source = "registry+https://github.com/rust-lang/crates.io-index"
393
- checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
394
- dependencies = [
395
- "ppv-lite86",
396
- "rand_core",
397
- ]
398
-
399
- [[package]]
400
- name = "rand_core"
401
- version = "0.9.3"
402
- source = "registry+https://github.com/rust-lang/crates.io-index"
403
- checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
404
- dependencies = [
405
- "getrandom",
406
- ]
407
-
408
- [[package]]
409
- name = "rand_xorshift"
410
- version = "0.4.0"
411
- source = "registry+https://github.com/rust-lang/crates.io-index"
412
- checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
413
- dependencies = [
414
- "rand_core",
415
- ]
416
-
417
275
  [[package]]
418
276
  name = "redox_syscall"
419
277
  version = "0.5.18"
@@ -423,43 +281,12 @@ dependencies = [
423
281
  "bitflags",
424
282
  ]
425
283
 
426
- [[package]]
427
- name = "regex-syntax"
428
- version = "0.8.8"
429
- source = "registry+https://github.com/rust-lang/crates.io-index"
430
- checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
431
-
432
- [[package]]
433
- name = "rustix"
434
- version = "1.1.3"
435
- source = "registry+https://github.com/rust-lang/crates.io-index"
436
- checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
437
- dependencies = [
438
- "bitflags",
439
- "errno",
440
- "libc",
441
- "linux-raw-sys",
442
- "windows-sys",
443
- ]
444
-
445
284
  [[package]]
446
285
  name = "rustversion"
447
286
  version = "1.0.22"
448
287
  source = "registry+https://github.com/rust-lang/crates.io-index"
449
288
  checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
450
289
 
451
- [[package]]
452
- name = "rusty-fork"
453
- version = "0.3.1"
454
- source = "registry+https://github.com/rust-lang/crates.io-index"
455
- checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"
456
- dependencies = [
457
- "fnv",
458
- "quick-error",
459
- "tempfile",
460
- "wait-timeout",
461
- ]
462
-
463
290
  [[package]]
464
291
  name = "scopeguard"
465
292
  version = "1.2.0"
@@ -485,38 +312,25 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
485
312
 
486
313
  [[package]]
487
314
  name = "snail-ast"
488
- version = "0.6.3"
489
-
490
- [[package]]
491
- name = "snail-core"
492
- version = "0.6.3"
493
- dependencies = [
494
- "pyo3",
495
- "snail-ast",
496
- "snail-error",
497
- "snail-lower",
498
- "snail-parser",
499
- ]
315
+ version = "0.7.1"
500
316
 
501
317
  [[package]]
502
318
  name = "snail-error"
503
- version = "0.6.3"
319
+ version = "0.7.1"
504
320
  dependencies = [
505
321
  "snail-ast",
506
322
  ]
507
323
 
508
324
  [[package]]
509
325
  name = "snail-lower"
510
- version = "0.6.3"
326
+ version = "0.7.1"
511
327
  dependencies = [
512
- "pyo3",
513
- "snail-ast",
514
- "snail-error",
328
+ "snail-python",
515
329
  ]
516
330
 
517
331
  [[package]]
518
332
  name = "snail-parser"
519
- version = "0.6.3"
333
+ version = "0.7.1"
520
334
  dependencies = [
521
335
  "pest",
522
336
  "pest_derive",
@@ -525,25 +339,13 @@ dependencies = [
525
339
  ]
526
340
 
527
341
  [[package]]
528
- name = "snail-proptest"
529
- version = "0.6.3"
342
+ name = "snail-python"
343
+ version = "0.7.1"
530
344
  dependencies = [
531
- "proptest",
532
345
  "pyo3",
533
346
  "snail-ast",
534
- "snail-core",
535
347
  "snail-error",
536
- "snail-lower",
537
348
  "snail-parser",
538
- "tempfile",
539
- ]
540
-
541
- [[package]]
542
- name = "snail-python"
543
- version = "0.6.3"
544
- dependencies = [
545
- "pyo3",
546
- "snail-core",
547
349
  ]
548
350
 
549
351
  [[package]]
@@ -563,19 +365,6 @@ version = "0.12.16"
563
365
  source = "registry+https://github.com/rust-lang/crates.io-index"
564
366
  checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
565
367
 
566
- [[package]]
567
- name = "tempfile"
568
- version = "3.24.0"
569
- source = "registry+https://github.com/rust-lang/crates.io-index"
570
- checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
571
- dependencies = [
572
- "fastrand",
573
- "getrandom",
574
- "once_cell",
575
- "rustix",
576
- "windows-sys",
577
- ]
578
-
579
368
  [[package]]
580
369
  name = "typenum"
581
370
  version = "1.19.0"
@@ -588,12 +377,6 @@ version = "0.1.7"
588
377
  source = "registry+https://github.com/rust-lang/crates.io-index"
589
378
  checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
590
379
 
591
- [[package]]
592
- name = "unarray"
593
- version = "0.1.4"
594
- source = "registry+https://github.com/rust-lang/crates.io-index"
595
- checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
596
-
597
380
  [[package]]
598
381
  name = "unicode-ident"
599
382
  version = "1.0.22"
@@ -612,61 +395,8 @@ version = "0.9.5"
612
395
  source = "registry+https://github.com/rust-lang/crates.io-index"
613
396
  checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
614
397
 
615
- [[package]]
616
- name = "wait-timeout"
617
- version = "0.2.1"
618
- source = "registry+https://github.com/rust-lang/crates.io-index"
619
- checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
620
- dependencies = [
621
- "libc",
622
- ]
623
-
624
- [[package]]
625
- name = "wasip2"
626
- version = "1.0.1+wasi-0.2.4"
627
- source = "registry+https://github.com/rust-lang/crates.io-index"
628
- checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
629
- dependencies = [
630
- "wit-bindgen",
631
- ]
632
-
633
398
  [[package]]
634
399
  name = "windows-link"
635
400
  version = "0.2.1"
636
401
  source = "registry+https://github.com/rust-lang/crates.io-index"
637
402
  checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
638
-
639
- [[package]]
640
- name = "windows-sys"
641
- version = "0.61.2"
642
- source = "registry+https://github.com/rust-lang/crates.io-index"
643
- checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
644
- dependencies = [
645
- "windows-link",
646
- ]
647
-
648
- [[package]]
649
- name = "wit-bindgen"
650
- version = "0.46.0"
651
- source = "registry+https://github.com/rust-lang/crates.io-index"
652
- checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
653
-
654
- [[package]]
655
- name = "zerocopy"
656
- version = "0.8.33"
657
- source = "registry+https://github.com/rust-lang/crates.io-index"
658
- checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
659
- dependencies = [
660
- "zerocopy-derive",
661
- ]
662
-
663
- [[package]]
664
- name = "zerocopy-derive"
665
- version = "0.8.33"
666
- source = "registry+https://github.com/rust-lang/crates.io-index"
667
- checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
668
- dependencies = [
669
- "proc-macro2",
670
- "quote",
671
- "syn",
672
- ]
@@ -4,3 +4,9 @@ members = ["crates/snail-python"]
4
4
 
5
5
  [workspace.package]
6
6
  edition = "2024"
7
+
8
+ [workspace.lints.rust]
9
+ warnings = "deny"
10
+
11
+ [workspace.lints.clippy]
12
+ all = "deny"
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snail-lang
3
- Version: 0.6.3
3
+ Version: 0.7.1
4
+ Requires-Dist: astunparse>=1.6.3 ; python_full_version < '3.9'
4
5
  Requires-Dist: jmespath>=1.0.1
5
6
  Requires-Dist: maturin>=1.5 ; extra == 'dev'
6
7
  Requires-Dist: pytest ; extra == 'dev'
7
8
  Provides-Extra: dev
8
9
  License-File: LICENSE
9
10
  Summary: Snail programming language interpreter
10
- Requires-Python: >=3.10
11
+ Requires-Python: >=3.8
11
12
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
13
 
13
14
  <p align="center">
@@ -26,10 +27,10 @@ way into something good, but its certainly not there yet.
26
27
 
27
28
  ## Installing Snail
28
29
 
29
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and then run:
30
-
31
30
  ```bash
32
- uv tool install -p 3.12 snail-lang
31
+ pip install snail-lang
32
+ -or-
33
+ uv tool install snail-lang
33
34
  ```
34
35
 
35
36
  That installs the `snail` CLI for your user; try it with `snail "print('hello')"` once the install completes.
@@ -124,7 +125,7 @@ err = risky()?
124
125
  err = risky():$e?
125
126
 
126
127
  # Provide a fallback value (exception available as $e)
127
- value = js("malformed json"):{"error": "invalid json"}?
128
+ value = js("malformed json"):%{"error": "invalid json"}?
128
129
  details = fetch_url("foo.com"):"default html"?
129
130
  exception_info = fetch_url("example.com"):$e.http_response_code?
130
131
 
@@ -243,7 +244,7 @@ names = js('{{"name": "Ada"}}\n{{"name": "Lin"}}') | $[[*].name]
243
244
  ### Full Python Interoperability
244
245
 
245
246
  Snail compiles to Python AST—import any Python module, use any library, in any
246
- environment. Assuming that you are using Python 3.10 or later.
247
+ environment. Assuming that you are using Python 3.8 or later.
247
248
 
248
249
  ## 🚀 Quick Start
249
250
 
@@ -294,7 +295,7 @@ machine snail adds 5 ms of overhead above the regular python3 interpreter.
294
295
 
295
296
  ### Prerequisites
296
297
 
297
- **Python 3.10+** (required at runtime)
298
+ **Python 3.8+** (required at runtime)
298
299
 
299
300
  Snail runs in-process via a Pyo3 extension module, so it uses the active Python environment.
300
301
 
@@ -315,6 +316,3 @@ make test
315
316
  make install
316
317
  ```
317
318
 
318
-
319
- **Note on Proptests**: The `snail-proptest` crate contains property-based tests that are skipped by default to keep development iteration fast.
320
-
@@ -14,10 +14,10 @@ way into something good, but its certainly not there yet.
14
14
 
15
15
  ## Installing Snail
16
16
 
17
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and then run:
18
-
19
17
  ```bash
20
- uv tool install -p 3.12 snail-lang
18
+ pip install snail-lang
19
+ -or-
20
+ uv tool install snail-lang
21
21
  ```
22
22
 
23
23
  That installs the `snail` CLI for your user; try it with `snail "print('hello')"` once the install completes.
@@ -112,7 +112,7 @@ err = risky()?
112
112
  err = risky():$e?
113
113
 
114
114
  # Provide a fallback value (exception available as $e)
115
- value = js("malformed json"):{"error": "invalid json"}?
115
+ value = js("malformed json"):%{"error": "invalid json"}?
116
116
  details = fetch_url("foo.com"):"default html"?
117
117
  exception_info = fetch_url("example.com"):$e.http_response_code?
118
118
 
@@ -231,7 +231,7 @@ names = js('{{"name": "Ada"}}\n{{"name": "Lin"}}') | $[[*].name]
231
231
  ### Full Python Interoperability
232
232
 
233
233
  Snail compiles to Python AST—import any Python module, use any library, in any
234
- environment. Assuming that you are using Python 3.10 or later.
234
+ environment. Assuming that you are using Python 3.8 or later.
235
235
 
236
236
  ## 🚀 Quick Start
237
237
 
@@ -282,7 +282,7 @@ machine snail adds 5 ms of overhead above the regular python3 interpreter.
282
282
 
283
283
  ### Prerequisites
284
284
 
285
- **Python 3.10+** (required at runtime)
285
+ **Python 3.8+** (required at runtime)
286
286
 
287
287
  Snail runs in-process via a Pyo3 extension module, so it uses the active Python environment.
288
288
 
@@ -302,6 +302,3 @@ cd snail
302
302
  make test
303
303
  make install
304
304
  ```
305
-
306
-
307
- **Note on Proptests**: The `snail-proptest` crate contains property-based tests that are skipped by default to keep development iteration fast.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "snail-ast"
3
- version = "0.6.3"
3
+ version = "0.7.1"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -24,7 +24,7 @@ None - this crate has no dependencies and provides pure data structures.
24
24
  - **snail-error**: Uses `SourceSpan` for error reporting with source locations
25
25
  - **snail-parser**: Produces `Program` and `AwkProgram` as output
26
26
  - **snail-lower**: Consumes Snail AST and transforms it to Python `ast` nodes via pyo3
27
- - **snail-core**: Re-exports all types for the unified API
27
+ - **snail-python**: Uses AST types as part of the compilation pipeline
28
28
 
29
29
  ## Design
30
30
 
@@ -94,8 +94,9 @@ pub enum Stmt {
94
94
  span: SourceSpan,
95
95
  },
96
96
  ImportFrom {
97
- module: Vec<String>,
98
- items: Vec<ImportItem>,
97
+ level: usize,
98
+ module: Option<Vec<String>>,
99
+ items: ImportFromItems,
99
100
  span: SourceSpan,
100
101
  },
101
102
  Assign {
@@ -132,6 +133,12 @@ pub struct ImportItem {
132
133
  pub span: SourceSpan,
133
134
  }
134
135
 
136
+ #[derive(Debug, Clone, PartialEq)]
137
+ pub enum ImportFromItems {
138
+ Names(Vec<ImportItem>),
139
+ Star { span: SourceSpan },
140
+ }
141
+
135
142
  #[derive(Debug, Clone, PartialEq)]
136
143
  pub enum AssignTarget {
137
144
  Name {
@@ -249,6 +256,19 @@ pub enum Expr {
249
256
  fallback: Option<Box<Expr>>,
250
257
  span: SourceSpan,
251
258
  },
259
+ Yield {
260
+ value: Option<Box<Expr>>,
261
+ span: SourceSpan,
262
+ },
263
+ YieldFrom {
264
+ expr: Box<Expr>,
265
+ span: SourceSpan,
266
+ },
267
+ Lambda {
268
+ params: Vec<Parameter>,
269
+ body: Vec<Stmt>,
270
+ span: SourceSpan,
271
+ },
252
272
  Compound {
253
273
  expressions: Vec<Expr>,
254
274
  span: SourceSpan,
@@ -302,6 +322,10 @@ pub enum Expr {
302
322
  elements: Vec<Expr>,
303
323
  span: SourceSpan,
304
324
  },
325
+ Set {
326
+ elements: Vec<Expr>,
327
+ span: SourceSpan,
328
+ },
305
329
  Dict {
306
330
  entries: Vec<(Expr, Expr)>,
307
331
  span: SourceSpan,
@@ -328,10 +352,36 @@ pub enum Expr {
328
352
  },
329
353
  }
330
354
 
355
+ #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
356
+ pub enum FStringConversion {
357
+ #[default]
358
+ None,
359
+ Str,
360
+ Repr,
361
+ Ascii,
362
+ }
363
+
364
+ #[derive(Debug, Clone, PartialEq)]
365
+ pub struct FStringExpr {
366
+ pub expr: Box<Expr>,
367
+ pub conversion: FStringConversion,
368
+ pub format_spec: Option<Vec<FStringPart>>,
369
+ }
370
+
371
+ impl FStringExpr {
372
+ pub fn new(expr: Box<Expr>) -> Self {
373
+ Self {
374
+ expr,
375
+ conversion: FStringConversion::None,
376
+ format_spec: None,
377
+ }
378
+ }
379
+ }
380
+
331
381
  #[derive(Debug, Clone, PartialEq)]
332
382
  pub enum FStringPart {
333
383
  Text(String),
334
- Expr(Box<Expr>),
384
+ Expr(FStringExpr),
335
385
  }
336
386
 
337
387
  #[derive(Debug, Clone, PartialEq)]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "snail-error"
3
- version = "0.6.3"
3
+ version = "0.7.1"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -22,7 +22,6 @@ This crate provides unified error handling across all stages of Snail compilatio
22
22
 
23
23
  - **snail-parser**: Returns `ParseError` when parsing fails
24
24
  - **snail-lower**: Returns `LowerError` when transformation fails
25
- - **snail-core**: Uses `SnailError` as the unified Result type for compilation
26
25
  - **snail-python**: Uses `format_snail_error()` to display errors to users
27
26
 
28
27
  ## Error Format
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "snail-parser"
3
- version = "0.6.3"
3
+ version = "0.7.1"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -32,7 +32,7 @@ The `snail.pest` file defines all of Snail's syntax rules including:
32
32
 
33
33
  ## Used By
34
34
 
35
- - **snail-core**: Calls `parse_program()` or `parse_awk_program()` as the first compilation stage
35
+ - **snail-python**: Calls `parse_program()` or `parse_awk_program()` as the first compilation stage
36
36
  - Tests validate AST structure from various Snail source inputs
37
37
 
38
38
  ## Design