| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Instead of handling aliases in the recite() function, which requires two
loops to handle properly with the current implementation, offload
checking for aliases to the read() function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure to interpret alias values as their own poems, since aliases
can be fairly complex.
Notes:
Previously, I was doing a simple find and replace for aliases within
each verse. However, aliases can be fairly complex, containing their own
range of meters, commands, and io operations. This could cause problems,
since a verse should never have, for instance, a pipe (`|`) in the
middle of it. This patch fixes it, so that we iterate once through the
poem, generating a new poem based on aliases that are found. In order to
avoid two loops in the recite() function, it might make sense to offload
handling aliases to read().
|
|
|
|
|
|
| |
Add docstring comments for all the incant function throughout the
anthology, documenting what each function does, and an example of it's
shell command.
|
|
The shell now has support for aliases (via alias foo=bar). The 'unalias'
command is also available to remove aliases. Finally,
Environment::aliases was changed to be a HashMap<String, String>,
instead of a Vec<String>.
Since the verse's verb might change (for instance, it is an environment
variable, or an alias), add another check in Poem::recite, which simply
continues, instead of running the spellchecker, if the verb is empty.
|