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.
- {koatl-0.3.16 → koatl-0.3.18}/Cargo.lock +1 -1
- {koatl-0.3.16 → koatl-0.3.18}/PKG-INFO +1 -1
- {koatl-0.3.16 → koatl-0.3.18}/koatl/Cargo.toml +1 -1
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/iter.tl +6 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/placeholder.tl +5 -1
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/coal.tl +2 -2
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/try.tl +2 -2
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/ast.rs +0 -2
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/ast_builder.rs +0 -4
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/inference.rs +2 -3
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/lift_cst.rs +7 -3
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/resolve_scopes.rs +0 -4
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/transform.rs +0 -8
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/cst.rs +2 -3
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/parser.rs +6 -6
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/simple_fmt.rs +1 -1
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/iter.tl +6 -0
- {koatl-0.3.16 → koatl-0.3.18}/Cargo.toml +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/README.md +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/.github/workflows/CI.yml +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/.gitignore +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/LICENSE +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/README.md +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/__main__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/cli.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/notebook/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/notebook/magic.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/prelude/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/meta_finder.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/record.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/runtime/vattr.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/async.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/base.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/do.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/env.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/memo.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/control/result.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/list.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/data/record.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/ext.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/io.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/json.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/lazy_module.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/pickle.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/re.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/python/koatl/std/trait.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/requirements.txt +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/src/emit_py.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/src/lib.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/conftest.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/arguments.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/containers.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/data.txt +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/decorators.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/destructure-for-and-fn.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/destructure.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/escape_ident.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/fstr.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/functions.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/generator.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/if_expr.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/imports.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/imports2.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/loops.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/match.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/nary-list.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/precedence.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/scopes.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/semantic_whitespace.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/short_circuit.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/base/with.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/async.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/aug_assign.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/env.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/iterables.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/list.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/memo.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/record.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/result.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/slice.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/prelude/virtual.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module0.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module1.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/e2e/test_modules/module2.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_mixed_defaults.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_kwargs.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_kwonly_markers.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_posonly_markers.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_multiple_varargs.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_posonly_after_kwonly.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/arguments_vararg_and_kwonly_marker.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/fail-parse/unmatched_closing_delimiter.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/arith.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/assign.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/block-comments.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/deco.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/func.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/matches.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/mutual-recursion.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/numbers.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/parse/operators.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_e2e.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_iterable.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_parse.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_parse_fail.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/test_re.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl/tests/util/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/Cargo.toml +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/lib.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/main.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/ast.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/ast_builder.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/emit.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/py/mod.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/types.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-core/src/util.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/Cargo.toml +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/lexer.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/koatl-parser/src/lib.rs +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/pyproject.toml +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/__main__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/cli.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/notebook/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/notebook/magic.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/prelude/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/__init__.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/meta_finder.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/record.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/runtime/vattr.py +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/async.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/base.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/do.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/env.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/memo.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/control/result.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/__init__.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/list.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/data/record.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/ext.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/io.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/json.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/lazy_module.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/pickle.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/re.tl +0 -0
- {koatl-0.3.16 → koatl-0.3.18}/python/koatl/std/trait.py +0 -0
|
@@ -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?.
|
|
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?.
|
|
16
|
+
assert_eq(1?.($ + 1), 2)
|
|
17
17
|
|
|
18
18
|
assert_eq(None ?? 1, 1)
|
|
19
19
|
assert_eq(int(5) ?? 1, 5)
|
|
@@ -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,
|
|
238
|
+
Expr::ScopedAttribute(expr, func) | Expr::MappedScopedAttribute(expr, func) => {
|
|
239
239
|
expr.traverse(ctx);
|
|
240
|
-
|
|
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
|
-
|
|
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
|
|
1336
|
-
Ok(Postfix::Decorator { op,
|
|
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,
|
|
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:
|
|
1449
|
+
expr: decorated.boxed(),
|
|
1450
1450
|
op,
|
|
1451
|
-
decorator:
|
|
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!("{}
|
|
353
|
+
format!("{}! {}", expr.simple_fmt(), decorator.simple_fmt())
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}
|
|
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
|
|
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
|
|
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
|
|
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
|