summaryrefslogtreecommitdiffstats
path: root/src/poem/elements/verse/logic.rs
diff options
context:
space:
mode:
authorRory Dudley2024-05-20 11:27:45 -0600
committerRory Dudley2024-05-20 11:27:45 -0600
commit8a7af4aacc0d67a9887ca1fd665b1694fd62a8ca (patch)
tree8bd0ec21d289e558925d15663b490b9873f257ea /src/poem/elements/verse/logic.rs
parent1bb25591b77a14a17bd05d79316ce703bcbcc3a6 (diff)
downloaddwarvish-8a7af4aacc0d67a9887ca1fd665b1694fd62a8ca.tar.gz
Allow aliases with the same name as their verb
Previously, when trying to add an alias that used the same name as its command, an infinite recursion loop would occur, and the program would panic after the call stack got too deep. For instance, something like: alias grep='grep --color=always' would cause it to panic. This patch adds a new field to the Environment struct called 'cs' (for call stack), which can be used to keep track of how many levels deep into the Poem::read() function we are in. At the moment, it only allows going two levels deep, but since it's just a u8 value, this could be increased in the future. The above example now works correctly, but it does mean that aliases within aliases are not possible, currently.
Diffstat (limited to 'src/poem/elements/verse/logic.rs')
0 files changed, 0 insertions, 0 deletions