Skip to content

Commit 07ad087

Browse files
committed
expand macros in @dlet args too
1 parent b215a71 commit 07ad087

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

unpythonic/syntax/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def count():
524524
if syntax != "decorator":
525525
raise SyntaxError("dlet is a decorator macro only")
526526

527+
args = expander.visit(args)
527528
tree = expander.visit(tree)
528529

529530
return _destructure_and_apply_let(tree, args, expander, _dlet)
@@ -546,6 +547,7 @@ def g(a):
546547
if syntax != "decorator":
547548
raise SyntaxError("dletseq is a decorator macro only")
548549

550+
args = expander.visit(args)
549551
tree = expander.visit(tree)
550552

551553
return _destructure_and_apply_let(tree, args, expander, _dletseq)
@@ -568,6 +570,7 @@ def f(x):
568570
if syntax != "decorator":
569571
raise SyntaxError("dletrec is a decorator macro only")
570572

573+
args = expander.visit(args)
571574
tree = expander.visit(tree)
572575

573576
return _destructure_and_apply_let(tree, args, expander, _dletrec)
@@ -586,6 +589,7 @@ def result():
586589
if syntax != "decorator":
587590
raise SyntaxError("blet is a decorator macro only")
588591

592+
args = expander.visit(args)
589593
tree = expander.visit(tree)
590594

591595
return _destructure_and_apply_let(tree, args, expander, _blet)
@@ -606,6 +610,7 @@ def result():
606610
if syntax != "decorator":
607611
raise SyntaxError("bletseq is a decorator macro only")
608612

613+
args = expander.visit(args)
609614
tree = expander.visit(tree)
610615

611616
return _destructure_and_apply_let(tree, args, expander, _bletseq)
@@ -637,6 +642,7 @@ def result():
637642
if syntax != "decorator":
638643
raise SyntaxError("bletrec is a decorator macro only")
639644

645+
args = expander.visit(args)
640646
tree = expander.visit(tree)
641647

642648
return _destructure_and_apply_let(tree, args, expander, _bletrec)

0 commit comments

Comments
 (0)