diff options
author | Rory Dudley | 2024-03-28 21:01:49 -0600 |
---|---|---|
committer | Rory Dudley | 2024-03-28 21:01:49 -0600 |
commit | 527cc04ffb9ea627ca678fe8fb07fe9330420eab (patch) | |
tree | 823bdf5d034def38e07c5299a8758ef616bc488a /src/poem/elements/rune.rs | |
parent | 9b2fcdb6bb6598786827e9f211df3db09de54567 (diff) | |
download | dwarvish-527cc04ffb9ea627ca678fe8fb07fe9330420eab.tar.gz |
Add comments (`#`) to the parser
The parser will now interpret the '#' character as a single-line comment
string, which works on it's own line, or at the end of an existing line.
Diffstat (limited to 'src/poem/elements/rune.rs')
-rw-r--r-- | src/poem/elements/rune.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/poem/elements/rune.rs b/src/poem/elements/rune.rs index 3f53c67..1742778 100644 --- a/src/poem/elements/rune.rs +++ b/src/poem/elements/rune.rs @@ -25,7 +25,7 @@ use std::sync::{Arc, Mutex}; /// * `None` - A shell command with no additional actions (the end of a poem) /// * `Pause` - The space character, to dilineate words (` `) /// * `Path` - The forward slash character, to dilineate paths (`/`) -/// * `Env` - Indicates an environment variable (`$`) +/// * `Remark` - Indicates a single line comment (`#`) /// * `String` - Interpret all character as one large /// [Word][super::word::Word] (`'` or `"`) /// * `Poem` - A subcommand to run first (`\``) @@ -43,6 +43,7 @@ pub enum Rune { None, // No meter (the end of a poem) Pause, // A space Path, // A forward slash + Remark, // A comment String, // Interpret the following as one large [Word] Poem, // Run a sub-poem before the main one Read, // Read files into STDIN @@ -65,6 +66,7 @@ impl fmt::Display for Rune { Rune::None => "", Rune::Pause => " ", Rune::Path => "/", + Rune::Remark => "#", Rune::String => "\"", Rune::Poem => "`", Rune::Read => "<", |