summaryrefslogtreecommitdiffstats
path: root/src/poem/elements
diff options
context:
space:
mode:
authorRory Dudley2024-03-28 21:01:49 -0600
committerRory Dudley2024-03-28 21:01:49 -0600
commit527cc04ffb9ea627ca678fe8fb07fe9330420eab (patch)
tree823bdf5d034def38e07c5299a8758ef616bc488a /src/poem/elements
parent9b2fcdb6bb6598786827e9f211df3db09de54567 (diff)
downloaddwarvish-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')
-rw-r--r--src/poem/elements/rune.rs4
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 => "<",