koatl 0.3.16__tar.gz → 0.3.18__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 (153) hide show
  1. {koatl-0.3.16 → koatl-0.3.18}/Cargo.lock +1 -1
  2. {koatl-0.3.16 → koatl-0.3.18}/PKG-INFO +1 -1
  3. {koatl-0.3.16 → koatl-0.3.18}/koatl/Cargo.toml +1 -1
  4. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/iter.tl +6 -0
  5. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/placeholder.tl +5 -1
  6. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/coal.tl +2 -2
  7. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/try.tl +2 -2
  8. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/ast.rs +0 -2
  9. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/ast_builder.rs +0 -4
  10. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/inference.rs +2 -3
  11. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/lift_cst.rs +7 -3
  12. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/resolve_scopes.rs +0 -4
  13. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/transform.rs +0 -8
  14. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/cst.rs +2 -3
  15. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/parser.rs +6 -6
  16. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/simple_fmt.rs +1 -1
  17. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/iter.tl +6 -0
  18. {koatl-0.3.16 → koatl-0.3.18}/Cargo.toml +0 -0
  19. {koatl-0.3.16 → koatl-0.3.18}/README.md +0 -0
  20. {koatl-0.3.16 → koatl-0.3.18}/koatl/.github/workflows/CI.yml +0 -0
  21. {koatl-0.3.16 → koatl-0.3.18}/koatl/.gitignore +0 -0
  22. {koatl-0.3.16 → koatl-0.3.18}/koatl/LICENSE +0 -0
  23. {koatl-0.3.16 → koatl-0.3.18}/koatl/README.md +0 -0
  24. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/__init__.py +0 -0
  25. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/__main__.py +0 -0
  26. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/cli.py +0 -0
  27. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/notebook/__init__.py +0 -0
  28. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/notebook/magic.py +0 -0
  29. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/prelude/__init__.tl +0 -0
  30. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/__init__.py +0 -0
  31. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/meta_finder.py +0 -0
  32. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/record.py +0 -0
  33. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/vattr.py +0 -0
  34. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/__init__.tl +0 -0
  35. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/__init__.tl +0 -0
  36. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/async.tl +0 -0
  37. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/base.tl +0 -0
  38. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/do.tl +0 -0
  39. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/env.tl +0 -0
  40. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/memo.tl +0 -0
  41. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/result.tl +0 -0
  42. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/__init__.tl +0 -0
  43. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/list.tl +0 -0
  44. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/record.tl +0 -0
  45. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/ext.tl +0 -0
  46. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/io.tl +0 -0
  47. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/json.tl +0 -0
  48. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/lazy_module.tl +0 -0
  49. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/pickle.tl +0 -0
  50. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/re.tl +0 -0
  51. {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/trait.py +0 -0
  52. {koatl-0.3.16 → koatl-0.3.18}/koatl/requirements.txt +0 -0
  53. {koatl-0.3.16 → koatl-0.3.18}/koatl/src/emit_py.rs +0 -0
  54. {koatl-0.3.16 → koatl-0.3.18}/koatl/src/lib.rs +0 -0
  55. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/conftest.py +0 -0
  56. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/arguments.tl +0 -0
  57. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/containers.tl +0 -0
  58. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/data.txt +0 -0
  59. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/decorators.tl +0 -0
  60. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/destructure-for-and-fn.tl +0 -0
  61. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/destructure.tl +0 -0
  62. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/escape_ident.tl +0 -0
  63. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/fstr.tl +0 -0
  64. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/functions.tl +0 -0
  65. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/generator.tl +0 -0
  66. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/if_expr.tl +0 -0
  67. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/imports.tl +0 -0
  68. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/imports2.tl +0 -0
  69. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/loops.tl +0 -0
  70. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/match.tl +0 -0
  71. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/nary-list.tl +0 -0
  72. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/precedence.tl +0 -0
  73. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/scopes.tl +0 -0
  74. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/semantic_whitespace.tl +0 -0
  75. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/short_circuit.tl +0 -0
  76. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/with.tl +0 -0
  77. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/async.tl +0 -0
  78. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/aug_assign.tl +0 -0
  79. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/env.tl +0 -0
  80. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/iterables.tl +0 -0
  81. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/list.tl +0 -0
  82. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/memo.tl +0 -0
  83. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/record.tl +0 -0
  84. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/result.tl +0 -0
  85. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/slice.tl +0 -0
  86. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/virtual.tl +0 -0
  87. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module0.tl +0 -0
  88. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module1.tl +0 -0
  89. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module2.tl +0 -0
  90. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_mixed_defaults.tl +0 -0
  91. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_kwargs.tl +0 -0
  92. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_kwonly_markers.tl +0 -0
  93. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_posonly_markers.tl +0 -0
  94. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_varargs.tl +0 -0
  95. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_posonly_after_kwonly.tl +0 -0
  96. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_vararg_and_kwonly_marker.tl +0 -0
  97. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/unmatched_closing_delimiter.tl +0 -0
  98. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/arith.tl +0 -0
  99. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/assign.tl +0 -0
  100. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/block-comments.tl +0 -0
  101. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/deco.tl +0 -0
  102. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/func.tl +0 -0
  103. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/matches.tl +0 -0
  104. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/mutual-recursion.tl +0 -0
  105. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/numbers.tl +0 -0
  106. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/operators.tl +0 -0
  107. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_e2e.py +0 -0
  108. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_iterable.tl +0 -0
  109. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_parse.py +0 -0
  110. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_parse_fail.py +0 -0
  111. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_re.tl +0 -0
  112. {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/util/__init__.py +0 -0
  113. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/Cargo.toml +0 -0
  114. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/lib.rs +0 -0
  115. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/main.rs +0 -0
  116. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/ast.rs +0 -0
  117. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/ast_builder.rs +0 -0
  118. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/emit.rs +0 -0
  119. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/mod.rs +0 -0
  120. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/types.rs +0 -0
  121. {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/util.rs +0 -0
  122. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/Cargo.toml +0 -0
  123. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/lexer.rs +0 -0
  124. {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/lib.rs +0 -0
  125. {koatl-0.3.16 → koatl-0.3.18}/pyproject.toml +0 -0
  126. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/__init__.py +0 -0
  127. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/__main__.py +0 -0
  128. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/cli.py +0 -0
  129. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/notebook/__init__.py +0 -0
  130. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/notebook/magic.py +0 -0
  131. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/prelude/__init__.tl +0 -0
  132. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/__init__.py +0 -0
  133. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/meta_finder.py +0 -0
  134. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/record.py +0 -0
  135. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/vattr.py +0 -0
  136. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/__init__.tl +0 -0
  137. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/__init__.tl +0 -0
  138. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/async.tl +0 -0
  139. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/base.tl +0 -0
  140. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/do.tl +0 -0
  141. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/env.tl +0 -0
  142. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/memo.tl +0 -0
  143. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/result.tl +0 -0
  144. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/__init__.tl +0 -0
  145. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/list.tl +0 -0
  146. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/record.tl +0 -0
  147. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/ext.tl +0 -0
  148. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/io.tl +0 -0
  149. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/json.tl +0 -0
  150. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/lazy_module.tl +0 -0
  151. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/pickle.tl +0 -0
  152. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/re.tl +0 -0
  153. {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/trait.py +0 -0
@@ -190,7 +190,7 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
190
190
 
191
191
  [[package]]
192
192
  name = "koatl"
193
- version = "0.3.16"
193
+ version = "0.3.18"
194
194
  dependencies = [
195
195
  "ariadne",
196
196
  "koatl-core",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: koatl
3
- Version: 0.3.16
3
+ Version: 0.3.18
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "koatl"
3
- version = "0.3.16"
3
+ version = "0.3.18"
4
4
  edition = "2021"
5
5
  homepage = "https://koatl.org"
6
6
 
@@ -260,6 +260,12 @@ export Iterable = class(Traversable, Trait):
260
260
  list = self =>
261
261
  list(self.iter)
262
262
 
263
+ set = self =>
264
+ set(self.iter)
265
+
266
+ tuple = self =>
267
+ tuple(self.iter)
268
+
263
269
  dict = self =>
264
270
  dict(self.iter)
265
271
 
@@ -34,4 +34,8 @@ assert_eq(3 | f($), 6)
34
34
 
35
35
  assert_eq(3 | [$, 2, 3], [3, 2, 3])
36
36
  f = [$, 2, 3]
37
- assert_eq(f(3), [3, 2, 3])
37
+ assert_eq(f(3), [3, 2, 3])
38
+
39
+ # placeholder guard regression
40
+
41
+ assert_eq({}.($.__or__({1: 2}).__or__({3: 4})), {1: 2, 3: 4})
@@ -4,7 +4,7 @@ none = None
4
4
  assert_eq(none?(1)?(2), None)
5
5
  assert_eq(none?[1]?.a, None)
6
6
  assert_eq(none?.a, None)
7
- assert_eq(none?. (a), None)
7
+ assert_eq(none?.(a), None)
8
8
 
9
9
  obj = (class:
10
10
  a = 1
@@ -13,7 +13,7 @@ obj = (class:
13
13
  assert_eq((x => x)?(1), 1)
14
14
  assert_eq([1]?[0], 1)
15
15
  assert_eq(obj?.a, 1)
16
- assert_eq(1?. ($ + 1), 2)
16
+ assert_eq(1?.($ + 1), 2)
17
17
 
18
18
  assert_eq(None ?? 1, 1)
19
19
  assert_eq(int(5) ?? 1, 5)
@@ -24,5 +24,5 @@ except _ =>
24
24
 
25
25
  assert_eq(check 1 matches Ok(1), True)
26
26
 
27
- assert_eq((check 5)?.($+1), Ok(6))
28
- assert_eq((check x)?.($+1) matches Err(), True)
27
+ assert_eq((check 5)?.($ + 1), Ok(6))
28
+ assert_eq((check x)?.($ + 1) matches Err(), True)
@@ -205,8 +205,6 @@ pub enum Expr<'a, TTree: Tree> {
205
205
  Fn(Vec<ArgDefItem<'a, TTree>>, TTree::Expr),
206
206
  Fstr(Spanned<String>, Vec<(FmtExpr<TTree>, Spanned<String>)>),
207
207
 
208
- // these are removed during desugaring
209
- Decorated(TTree::Expr, TTree::Expr),
210
208
  Placeholder,
211
209
  }
212
210
 
@@ -162,10 +162,6 @@ impl AstBuilder {
162
162
  Expr::RawAttribute(value.indirect(), attr.into().spanned(self.span)).spanned(self.span)
163
163
  }
164
164
 
165
- pub fn then<'src>(&self, left: SExpr<'src>, right: SExpr<'src>) -> SExpr<'src> {
166
- Expr::ScopedAttribute(left.indirect(), right.indirect()).spanned(self.span)
167
- }
168
-
169
165
  pub fn function<'src>(&self, args: Vec<SArgDefItem<'src>>, body: SExpr<'src>) -> SExpr<'src> {
170
166
  Expr::Fn(args, body.indirect()).spanned(self.span)
171
167
  }
@@ -235,9 +235,9 @@ impl<'src, 'ast> SExprExt<'src, 'ast> for Indirect<SExpr<'src>> {
235
235
  expr.traverse(ctx);
236
236
  Type::Any
237
237
  }
238
- Expr::ScopedAttribute(expr, other) | Expr::MappedScopedAttribute(expr, other) => {
238
+ Expr::ScopedAttribute(expr, func) | Expr::MappedScopedAttribute(expr, func) => {
239
239
  expr.traverse(ctx);
240
- other.traverse(ctx);
240
+ func.traverse(ctx);
241
241
  Type::Any
242
242
  }
243
243
  Expr::Checked(expr, _pattern) => {
@@ -265,7 +265,6 @@ impl<'src, 'ast> SExprExt<'src, 'ast> for Indirect<SExpr<'src>> {
265
265
  Type::Any
266
266
  }
267
267
  Expr::Literal(..) | Expr::Ident(..) => Type::Any,
268
- Expr::Decorated(_, _) => panic!("Decorated expressions should not be traversed"),
269
268
  Expr::Placeholder => panic!("Placeholder expression should not be traversed"),
270
269
  };
271
270
 
@@ -274,9 +274,6 @@ impl<'src, 'tok> Lift<Indirect<ast::SExpr<'src>>> for cst::SExpr<'src, 'tok> {
274
274
  ast::Expr::Fn(args_list, body.lift())
275
275
  }
276
276
  cst::Expr::Fstr { head, parts, .. } => lift_fstr(head, parts),
277
- cst::Expr::Decorated {
278
- expr, decorator, ..
279
- } => ast::Expr::Decorated(expr.lift(), decorator.lift()),
280
277
  cst::Expr::Memo { async_kw, body, .. } => {
281
278
  ast::Expr::Memo(body.lift(), async_kw.is_some())
282
279
  }
@@ -387,6 +384,13 @@ impl<'src, 'tok> Lift<Indirect<ast::SExpr<'src>>> for cst::SExpr<'src, 'tok> {
387
384
  ast::Expr::ScopedAttribute(expr.lift(), rhs.lift())
388
385
  }
389
386
  }
387
+ cst::Expr::Decorated {
388
+ expr, decorator, ..
389
+ } => {
390
+ let func = decorator.lift();
391
+ let arg = ast::CallItem::Arg(expr.lift());
392
+ ast::Expr::Call(func, vec![arg])
393
+ }
390
394
  cst::Expr::Checked { expr, pattern, .. } => {
391
395
  ast::Expr::Checked(expr.lift(), pattern.as_ref().map(|p| p.lift()))
392
396
  }
@@ -1055,10 +1055,6 @@ impl<'src> SExprExt<'src> for Indirect<SExpr<'src>> {
1055
1055
 
1056
1056
  Expr::Checked(expr.traverse_guarded(state), pattern)
1057
1057
  }
1058
- Expr::Decorated(deco, expr) => Expr::Call(
1059
- deco.traverse(state),
1060
- vec![CallItem::Arg(expr.traverse(state))],
1061
- ),
1062
1058
  Expr::Matches(x, pattern) => {
1063
1059
  let (pattern, meta) = pattern.traverse(state, false);
1064
1060
  if !meta.captures.is_empty() {
@@ -319,10 +319,6 @@ fn transform_assignment<'src, 'ast>(
319
319
  cur_node = left;
320
320
  decorators.push(right);
321
321
  }
322
- Expr::Decorated(deco, right) => {
323
- cur_node = right;
324
- decorators.push(deco);
325
- }
326
322
  Expr::Call(left, right) => {
327
323
  if right.len() != 1 {
328
324
  break;
@@ -2024,10 +2020,6 @@ impl<'src, 'ast> SExprExt<'src, 'ast> for SExpr<'src> {
2024
2020
 
2025
2021
  a.load_ident(name)
2026
2022
  }
2027
- Expr::Decorated(deco, expr) => a.call(
2028
- pre.bind(deco.transform(ctx)?),
2029
- vec![PyCallItem::Arg(pre.bind(expr.transform(ctx)?))],
2030
- ),
2031
2023
  Expr::Literal(lit) => a.literal(lit.value.transform(ctx)?),
2032
2024
  Expr::Ident(_) => {
2033
2025
  let ident = ctx.py_ident(self);
@@ -509,11 +509,10 @@ pub enum Expr<TTree: Tree> {
509
509
  end: TTree::Token,
510
510
  },
511
511
 
512
- // these are removed during desugaring
513
512
  Decorated {
514
- expr: TTree::Expr,
515
- op: TTree::Token,
516
513
  decorator: TTree::Expr,
514
+ op: TTree::Token,
515
+ expr: TTree::Expr,
517
516
  },
518
517
  Placeholder {
519
518
  token: TTree::Token,
@@ -1289,7 +1289,7 @@ impl<'src: 'tok, 'tok> ParseCtx<'src, 'tok> {
1289
1289
  },
1290
1290
  Decorator {
1291
1291
  op: &'tok SToken<'src>,
1292
- decorator: SExpr<'src, 'tok>,
1292
+ decorated: SExpr<'src, 'tok>,
1293
1293
  },
1294
1294
  }
1295
1295
 
@@ -1332,8 +1332,8 @@ impl<'src: 'tok, 'tok> ParseCtx<'src, 'tok> {
1332
1332
 
1333
1333
  let decorator = |ctx: &mut Self| {
1334
1334
  let op = ctx.symbol("!")?;
1335
- let decorator = ctx.expr()?;
1336
- Ok(Postfix::Decorator { op, decorator })
1335
+ let decorated = ctx.expr()?;
1336
+ Ok(Postfix::Decorator { op, decorated })
1337
1337
  };
1338
1338
 
1339
1339
  let dot_attribute = |ctx: &mut Self| {
@@ -1438,7 +1438,7 @@ impl<'src: 'tok, 'tok> ParseCtx<'src, 'tok> {
1438
1438
  question2,
1439
1439
  attr,
1440
1440
  },
1441
- Postfix::Decorator { op, decorator } => {
1441
+ Postfix::Decorator { op, decorated } => {
1442
1442
  if question.is_some() {
1443
1443
  return Err(self.set_error(
1444
1444
  start,
@@ -1446,9 +1446,9 @@ impl<'src: 'tok, 'tok> ParseCtx<'src, 'tok> {
1446
1446
  ));
1447
1447
  }
1448
1448
  Expr::Decorated {
1449
- expr: expr.boxed(),
1449
+ expr: decorated.boxed(),
1450
1450
  op,
1451
- decorator: decorator.boxed(),
1451
+ decorator: expr.boxed(),
1452
1452
  }
1453
1453
  }
1454
1454
  }
@@ -350,7 +350,7 @@ impl<'src, 'tok> SimpleFmt for SExprInner<'src, 'tok> {
350
350
  Expr::Decorated {
351
351
  expr, decorator, ..
352
352
  } => {
353
- format!("{} & {}", expr.simple_fmt(), decorator.simple_fmt())
353
+ format!("{}! {}", expr.simple_fmt(), decorator.simple_fmt())
354
354
  }
355
355
  }
356
356
  }
@@ -260,6 +260,12 @@ export Iterable = class(Traversable, Trait):
260
260
  list = self =>
261
261
  list(self.iter)
262
262
 
263
+ set = self =>
264
+ set(self.iter)
265
+
266
+ tuple = self =>
267
+ tuple(self.iter)
268
+
263
269
  dict = self =>
264
270
  dict(self.iter)
265
271
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes