koatl 0.3.11__tar.gz → 0.3.12__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 (147) hide show
  1. {koatl-0.3.11 → koatl-0.3.12}/Cargo.lock +1 -1
  2. {koatl-0.3.11 → koatl-0.3.12}/PKG-INFO +1 -1
  3. {koatl-0.3.11 → koatl-0.3.12}/koatl/Cargo.toml +1 -1
  4. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/ast.rs +2 -2
  5. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/lift_cst.rs +6 -2
  6. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/resolve_scopes.rs +2 -2
  7. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/transform.rs +13 -29
  8. {koatl-0.3.11 → koatl-0.3.12}/Cargo.toml +0 -0
  9. {koatl-0.3.11 → koatl-0.3.12}/README.md +0 -0
  10. {koatl-0.3.11 → koatl-0.3.12}/koatl/.github/workflows/CI.yml +0 -0
  11. {koatl-0.3.11 → koatl-0.3.12}/koatl/.gitignore +0 -0
  12. {koatl-0.3.11 → koatl-0.3.12}/koatl/LICENSE +0 -0
  13. {koatl-0.3.11 → koatl-0.3.12}/koatl/README.md +0 -0
  14. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/__init__.py +0 -0
  15. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/__main__.py +0 -0
  16. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/cli.py +0 -0
  17. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/notebook/__init__.py +0 -0
  18. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/notebook/magic.py +0 -0
  19. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/prelude/__init__.tl +0 -0
  20. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/runtime/__init__.py +0 -0
  21. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/runtime/meta_finder.py +0 -0
  22. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/runtime/record.py +0 -0
  23. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/runtime/vattr.py +0 -0
  24. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/__init__.tl +0 -0
  25. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/__init__.tl +0 -0
  26. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/async.tl +0 -0
  27. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/base.tl +0 -0
  28. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/do.tl +0 -0
  29. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/env.tl +0 -0
  30. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/memo.tl +0 -0
  31. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/control/result.tl +0 -0
  32. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/data/__init__.tl +0 -0
  33. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/data/list.tl +0 -0
  34. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/data/record.tl +0 -0
  35. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/ext.tl +0 -0
  36. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/io.tl +0 -0
  37. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/iter.tl +0 -0
  38. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/json.tl +0 -0
  39. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/lazy_module.tl +0 -0
  40. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/pickle.tl +0 -0
  41. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/re.tl +0 -0
  42. {koatl-0.3.11 → koatl-0.3.12}/koatl/python/koatl/std/trait.py +0 -0
  43. {koatl-0.3.11 → koatl-0.3.12}/koatl/requirements.txt +0 -0
  44. {koatl-0.3.11 → koatl-0.3.12}/koatl/src/emit_py.rs +0 -0
  45. {koatl-0.3.11 → koatl-0.3.12}/koatl/src/lib.rs +0 -0
  46. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/arguments.tl +0 -0
  47. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/containers.tl +0 -0
  48. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/data.txt +0 -0
  49. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/decorators.tl +0 -0
  50. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/destructure-for-and-fn.tl +0 -0
  51. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/destructure.tl +0 -0
  52. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/escape_ident.tl +0 -0
  53. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/fstr.tl +0 -0
  54. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/functions.tl +0 -0
  55. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/generator.tl +0 -0
  56. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/if_expr.tl +0 -0
  57. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/loops.tl +0 -0
  58. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/match.tl +0 -0
  59. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/nary-list.tl +0 -0
  60. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/placeholder.tl +0 -0
  61. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/precedence.tl +0 -0
  62. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/scopes.tl +0 -0
  63. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/semantic_whitespace.tl +0 -0
  64. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/short_circuit.tl +0 -0
  65. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/base/with.tl +0 -0
  66. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/async.tl +0 -0
  67. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/aug_assign.tl +0 -0
  68. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/coal.tl +0 -0
  69. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/env.tl +0 -0
  70. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/imports.tl +0 -0
  71. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/iterables.tl +0 -0
  72. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/list.tl +0 -0
  73. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/memo.tl +0 -0
  74. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/record.tl +0 -0
  75. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/result.tl +0 -0
  76. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/slice.tl +0 -0
  77. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/try.tl +0 -0
  78. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/prelude/virtual.tl +0 -0
  79. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/util/__init__.py +0 -0
  80. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/util/module0.tl +0 -0
  81. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/util/module1.tl +0 -0
  82. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/e2e/util/module2.tl +0 -0
  83. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_mixed_defaults.tl +0 -0
  84. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_multiple_kwargs.tl +0 -0
  85. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_multiple_kwonly_markers.tl +0 -0
  86. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_multiple_posonly_markers.tl +0 -0
  87. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_multiple_varargs.tl +0 -0
  88. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_posonly_after_kwonly.tl +0 -0
  89. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/fail-parse/arguments_vararg_and_kwonly_marker.tl +0 -0
  90. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/arith.tl +0 -0
  91. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/assign.tl +0 -0
  92. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/block-comments.tl +0 -0
  93. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/deco.tl +0 -0
  94. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/func.tl +0 -0
  95. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/matches.tl +0 -0
  96. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/mutual-recursion.tl +0 -0
  97. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/parse/numbers.tl +0 -0
  98. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/test_e2e.py +0 -0
  99. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/test_parse.py +0 -0
  100. {koatl-0.3.11 → koatl-0.3.12}/koatl/tests/test_parse_fail.py +0 -0
  101. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/Cargo.toml +0 -0
  102. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/ast_builder.rs +0 -0
  103. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/inference.rs +0 -0
  104. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/lib.rs +0 -0
  105. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/main.rs +0 -0
  106. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/py/ast.rs +0 -0
  107. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/py/ast_builder.rs +0 -0
  108. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/py/emit.rs +0 -0
  109. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/py/mod.rs +0 -0
  110. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/types.rs +0 -0
  111. {koatl-0.3.11 → koatl-0.3.12}/koatl-core/src/util.rs +0 -0
  112. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/Cargo.toml +0 -0
  113. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/src/cst.rs +0 -0
  114. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/src/lexer.rs +0 -0
  115. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/src/lib.rs +0 -0
  116. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/src/parser.rs +0 -0
  117. {koatl-0.3.11 → koatl-0.3.12}/koatl-parser/src/simple_fmt.rs +0 -0
  118. {koatl-0.3.11 → koatl-0.3.12}/pyproject.toml +0 -0
  119. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/__init__.py +0 -0
  120. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/__main__.py +0 -0
  121. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/cli.py +0 -0
  122. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/notebook/__init__.py +0 -0
  123. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/notebook/magic.py +0 -0
  124. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/prelude/__init__.tl +0 -0
  125. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/runtime/__init__.py +0 -0
  126. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/runtime/meta_finder.py +0 -0
  127. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/runtime/record.py +0 -0
  128. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/runtime/vattr.py +0 -0
  129. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/__init__.tl +0 -0
  130. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/__init__.tl +0 -0
  131. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/async.tl +0 -0
  132. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/base.tl +0 -0
  133. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/do.tl +0 -0
  134. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/env.tl +0 -0
  135. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/memo.tl +0 -0
  136. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/control/result.tl +0 -0
  137. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/data/__init__.tl +0 -0
  138. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/data/list.tl +0 -0
  139. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/data/record.tl +0 -0
  140. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/ext.tl +0 -0
  141. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/io.tl +0 -0
  142. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/iter.tl +0 -0
  143. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/json.tl +0 -0
  144. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/lazy_module.tl +0 -0
  145. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/pickle.tl +0 -0
  146. {koatl-0.3.11 → koatl-0.3.12}/python/koatl/std/re.tl +0 -0
  147. {koatl-0.3.11 → koatl-0.3.12}/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.11"
193
+ version = "0.3.12"
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.11
3
+ Version: 0.3.12
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.11"
3
+ version = "0.3.12"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -138,8 +138,8 @@ pub enum ArgDefItem<'a, TTree: Tree> {
138
138
  Arg(TTree::Pattern, Option<TTree::Expr>),
139
139
  ArgSpread(SIdent<'a>),
140
140
  KwargSpread(SIdent<'a>),
141
- PosOnlyMarker,
142
- KwOnlyMarker,
141
+ PosOnlyMarker(Spanned<()>),
142
+ KwOnlyMarker(Spanned<()>),
143
143
  }
144
144
 
145
145
  #[derive(Debug, Clone)]
@@ -555,8 +555,12 @@ impl<'src, 'tok> Lift<ast::ArgDefItem<'src, ast::STree<'src>>>
555
555
  cst::ArgDefItem::KwargSpread { name, .. } => {
556
556
  ast::ArgDefItem::KwargSpread(name.lift_as_ident())
557
557
  }
558
- cst::ArgDefItem::PosOnlyMarker { .. } => ast::ArgDefItem::PosOnlyMarker,
559
- cst::ArgDefItem::KwOnlyMarker { .. } => ast::ArgDefItem::KwOnlyMarker,
558
+ cst::ArgDefItem::PosOnlyMarker { slash } => {
559
+ ast::ArgDefItem::PosOnlyMarker(().spanned(slash.span))
560
+ }
561
+ cst::ArgDefItem::KwOnlyMarker { star } => {
562
+ ast::ArgDefItem::KwOnlyMarker(().spanned(star.span))
563
+ }
560
564
  }
561
565
  }
562
566
  }
@@ -1290,8 +1290,8 @@ impl<'src> SExprExt<'src> for Indirect<SExpr<'src>> {
1290
1290
 
1291
1291
  ArgDefItem::KwargSpread(arg)
1292
1292
  }
1293
- ArgDefItem::PosOnlyMarker => ArgDefItem::PosOnlyMarker,
1294
- ArgDefItem::KwOnlyMarker => ArgDefItem::KwOnlyMarker,
1293
+ ArgDefItem::PosOnlyMarker(spanned) => ArgDefItem::PosOnlyMarker(spanned),
1294
+ ArgDefItem::KwOnlyMarker(spanned) => ArgDefItem::KwOnlyMarker(spanned),
1295
1295
  })
1296
1296
  .collect::<Vec<_>>();
1297
1297
 
@@ -981,53 +981,37 @@ fn make_arglist<'src, 'ast>(
981
981
  ));
982
982
  }
983
983
  }
984
- ArgDefItem::PosOnlyMarker => {
985
- // Get a span - we'll use the first arg's span as a fallback
986
- let span = args
987
- .first()
988
- .and_then(|a| match a {
989
- ArgDefItem::Arg(p, _) => Some(p.span),
990
- ArgDefItem::ArgSpread(n) | ArgDefItem::KwargSpread(n) => Some(n.span),
991
- _ => None,
992
- })
993
- .unwrap_or(Span { start: 0, end: 0 });
994
-
984
+ ArgDefItem::PosOnlyMarker(spanned) => {
995
985
  if seen_posonly_marker.is_some() {
996
986
  return Err(simple_err(
997
987
  "Only one position-only marker (/) is allowed",
998
- span,
988
+ spanned.span,
999
989
  ));
1000
990
  }
1001
991
  if seen_kwonly_marker.is_some() || seen_vararg.is_some() {
1002
992
  return Err(simple_err(
1003
993
  "Position-only marker (/) must come before * or *args",
1004
- span,
994
+ spanned.span,
1005
995
  ));
1006
996
  }
1007
- seen_posonly_marker = Some(span);
997
+ seen_posonly_marker = Some(spanned.span);
1008
998
  // Reset for regular args section
1009
999
  seen_default = false;
1010
1000
  }
1011
- ArgDefItem::KwOnlyMarker => {
1012
- let span = args
1013
- .first()
1014
- .and_then(|a| match a {
1015
- ArgDefItem::Arg(p, _) => Some(p.span),
1016
- ArgDefItem::ArgSpread(n) | ArgDefItem::KwargSpread(n) => Some(n.span),
1017
- _ => None,
1018
- })
1019
- .unwrap_or(Span { start: 0, end: 0 });
1020
-
1001
+ ArgDefItem::KwOnlyMarker(spanned) => {
1021
1002
  if seen_kwonly_marker.is_some() {
1022
1003
  return Err(simple_err(
1023
1004
  "Only one keyword-only marker (*) is allowed",
1024
- span,
1005
+ spanned.span,
1025
1006
  ));
1026
1007
  }
1027
1008
  if seen_vararg.is_some() {
1028
- return Err(simple_err("Cannot have both *args and bare * marker", span));
1009
+ return Err(simple_err(
1010
+ "Cannot have both *args and bare * marker",
1011
+ spanned.span,
1012
+ ));
1029
1013
  }
1030
- seen_kwonly_marker = Some(span);
1014
+ seen_kwonly_marker = Some(spanned.span);
1031
1015
  after_kwonly_marker = true;
1032
1016
  seen_default = false;
1033
1017
  }
@@ -1088,11 +1072,11 @@ fn make_arglist<'src, 'ast>(
1088
1072
  _ => kwonlyargs.push((cursor, default)),
1089
1073
  }
1090
1074
  }
1091
- ArgDefItem::PosOnlyMarker => {
1075
+ ArgDefItem::PosOnlyMarker(..) => {
1092
1076
  // Transition from position-only to regular args
1093
1077
  state = 1;
1094
1078
  }
1095
- ArgDefItem::KwOnlyMarker => {
1079
+ ArgDefItem::KwOnlyMarker(..) => {
1096
1080
  // Bare * marker - transition to keyword-only without vararg
1097
1081
  state = 2;
1098
1082
  }
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