summaryrefslogtreecommitdiffstats
path: root/src/poem.rs
Commit message (Collapse)AuthorAgeFilesLines
* Handle aliases in read()Rory Dudley2024-04-041-32/+42
| | | | | | 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.
* The anthology moduleRory Dudley2024-03-281-0/+1
| | | | | | The anthology module was added to run built-in commands. The 'cd' and 'exit' built-ins were moved from the main recite() loop to this module. Additionally, the 'export' and 'source' built-ins were added.
* Poem testingRory Dudley2024-03-241-46/+50
| | | | | | Add back tests for Rune::Read, Rune::Write, and Rune::Addendum, following the new parser output. Also, renames some tests, since Read, Write, and Addendum are no longer meters.
* Fix tests for githubRory Dudley2024-03-231-2/+2
| | | | | Fix the ~ test, so that it uses env!("HOME"), instead of my hard-coded home directory.
* read() and recite() overhaulRory Dudley2024-03-231-0/+284
Rebuilt the LR parser (i.e. read()) from the ground up. This required that some changes be made to recite(), in order to accomodate the new data structures. These data structures were each split out into their own file, in order to make working with each component a bit easier. In addition to reworking the parts of the parser already present, some new features were also added, such as: - Support for strings (' and ") - Support for environment variables ($) - Support for interpreting tild as $HOME (~) - Support for sub-reading and sub-reciting (`) Notes: This is a huge commit that changes almost the entire program (main.rs is still the same, except for imports). Ideally, huge sweeping changes like this should not occur on the codebase, but since this is still pre-alpha, I guess this is acceptable. This is far from the end of patch set, however, as there is quite a lot of cleanup that needs to be done. For instance, checking for internal poems and environment variables should get split out to their own functions/macros. There is also some defunct code (that's commented out), that is unlikely to be useful in the future.