From 5a7718698373d07a29fffcb792acdb81aa7712d7 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 23 Mar 2024 02:45:54 -0600 Subject: read() and recite() overhaul 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 (`) --- src/poem/elements/stanza.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/poem/elements/stanza.rs (limited to 'src/poem/elements/stanza.rs') diff --git a/src/poem/elements/stanza.rs b/src/poem/elements/stanza.rs new file mode 100644 index 0000000..d58d080 --- /dev/null +++ b/src/poem/elements/stanza.rs @@ -0,0 +1,10 @@ +/// The actionable part of a [Verse][super::verse::Verse] +/// +/// Each [Stanza] has two parts, a `verb()` and a `clause()`. The `verb()` is +/// the program, or path to the program to call, while the `clause()` contains +/// arguments to pass to that program. +/// +/// The [Stanza] is just stored as a [Vec] of [String]s, where the verb is the +/// first entry in the vector (i.e. `stanza[0]`) and the clause the the +/// remainder of the vector (i.e. `stanza[1..]`). +pub type Stanza = Vec; -- cgit v1.2.3