macropy icon indicating copy to clipboard operation
macropy copied to clipboard

Fix handling of multiple block macros in the same with statement

Open Technologicat opened this issue 6 years ago • 4 comments

See issue #21 for details.

Technologicat avatar Oct 27 '18 20:10 Technologicat

Can you please add a testcase for this? thanks

azazel75 avatar Oct 28 '18 13:10 azazel75

Sure, I'll add a test for this too.

Since I originally posted this PR, I've discovered that my fix still doesn't handle the fully general case correctly, but I haven't had time to investigate it further or to create a minimal example that reproduces the bug.

What I've noticed is problems may occur with two-pass macros (that both yield and return stuff), for an example see namedlambda in unpythonic.syntax. (The macro itself works fine, when using a separate with block for it.)

Technologicat avatar May 15 '19 13:05 Technologicat

Here's a test for the basic case for two block macros in the same with, where both macros operate only in the second pass.

I think the more complex cases could be handled at some later time?

Technologicat avatar May 15 '19 13:05 Technologicat

Ping? Need more complex test cases, or is this fine now?

Technologicat avatar Aug 18 '20 11:08 Technologicat