Skip to content

Commit

Permalink
;merlin command
Browse files Browse the repository at this point in the history
  • Loading branch information
geremachek committed Jun 27, 2021
1 parent e630053 commit cc89c3b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "merlin"
version = "1.0.3"
version = "1.0.4"
authors = ["geremachek <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion spellbook.mn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
merlin ;nomen
M ;nomen

;scribe
Welcome to Merlin!
Expand Down
6 changes: 4 additions & 2 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub enum Command {
Scribe,
Adieu,
Nomen,
Merlin,
Summon,
Dub,
Carve,
Expand Down Expand Up @@ -98,6 +99,7 @@ impl FromStr for Command {
"scribe" => Ok(Command::Scribe),
"adieu" => Ok(Command::Adieu),
"nomen" => Ok(Command::Nomen),
"merlin" => Ok(Command::Merlin),
"summon" => Ok(Command::Summon),
"dub" => Ok(Command::Dub),
"carve" => Ok(Command::Carve),
Expand All @@ -116,7 +118,7 @@ impl Command {
Command::Decay | Command::Destroy | Command::Mirror | Command::Atom | Command::Scribe | Command::Adieu | Command::Carve | Command::Burn | Command::Volume |
Command::Volumes | Command::Carved => true,
Command::Focus | Command::Traverse | Command::Appear | Command::Shave | Command::Shelve | Command::Incant | Command::Inscribe | Command::Trample | Command::Summon |
Command::Dub | Command::Spellbook | Command::Shift | Command::Infix | Command::Spine | Command::Nomen => args >= 1,
Command::Dub | Command::Spellbook | Command::Shift | Command::Infix | Command::Spine | Command::Nomen | Command::Merlin => args >= 1,
Command::Infuse | Command::Tether | Command::Fray | Command::Peer => args >= 2,
}
}
Expand All @@ -139,7 +141,7 @@ impl Command {
Command::Atom | Command::Scribe | Command::Adieu | Command::Carve | Command::Pin | Command::Columns | Command::Burn | Command::Volume |
Command::Volumes | Command::Carved => return Ok(0),
Command::Focus | Command::Traverse | Command::Appear | Command::Shave | Command::Shelve | Command::Inscribe | Command::Trample | Command::Incant |
Command::Summon | Command::Dub | Command::Spellbook | Command::Shift | Command::Infix | Command::Spine => return Ok(1),
Command::Summon | Command::Dub | Command::Spellbook | Command::Shift | Command::Infix | Command::Spine | Command::Merlin => return Ok(1),
Command::Infuse | Command::Peer | Command::Fray => return Ok(2),
Command::Genesis => return Ok(choose_mm(1, 0))
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod nomen;
fn main() {
let merlin_args = App::new("merlin:")
.about("An esoteric, programmable text editor")
.version("1.0.3")
.version("1.0.4")
.arg(Arg::with_name("no-errors")
.short("n")
.long("no-errors")
Expand Down
1 change: 1 addition & 0 deletions src/plane/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ impl Plane {
let n = data.pop().unwrap();
self.nomen(data, n);
}
Command::Merlin => self.parse_line_atom(&data[0]),
Command::Summon => self.summon(data.remove(0))?,
Command::Spellbook => self.spellbook(&data[0])?,
Command::Volume => return oksome(self.volume().to_string()),
Expand Down

0 comments on commit cc89c3b

Please sign in to comment.