magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Rework expansion logic #29

Closed yobert closed 6 years ago

yobert commented 6 years ago

The previous logic would have some bugs if you had a tree like this:

key = value
a   = ${b} ${key} ${c}
b   = ${key}
c   = ${key}

This reworks the expand() logic to use a stack which is copied at each level of recursion. This also fixes bugs when you have more than two expansions, like this:

a = b
c = ${a}${a}${a}
magiconair commented 6 years ago

Released v1.7.6.