Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support duplicate expansions in the same value #28

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

yobert
Copy link

@yobert yobert commented Feb 13, 2018

This enables properties like this:

a = b
c = ${a} ${a}

Previously, this would incorrectly throw a circular reference error. Now
instead this will correctly evaluate the above as "c = b b".

This enables properties like this:

    a = b
    c = ${a} ${a}

Previously, this would incorrectly throw a circular reference error. Now
instead this will correctly evaluate the above as "c = b b".
@magiconair
Copy link
Owner

Oh wow. Thanks a lot!

@magiconair magiconair merged commit 91eed35 into magiconair:master Feb 13, 2018
@magiconair
Copy link
Owner

@yobert yobert deleted the duplicate-expansions branch February 13, 2018 22:41
@yobert
Copy link
Author

yobert commented Feb 13, 2018

Yeah I'm amazed nobody else hit that yet! Thanks for the quick release :D

@yobert
Copy link
Author

yobert commented Feb 13, 2018

... I've found some more problems with this. It doesn't work with more than 2 expansions. I think the answer is to refactor that expand() function a little bit to use a stack of previously used key names instead of a shared map. I'll be sending another PR with these fixes soon if that's okay with you.

@magiconair magiconair added this to the 1.7.5 milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants