summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 346ecb2..a1d9a32 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -116,9 +116,11 @@ fn parse_place(player: Player, pl: &str) -> Result<Action, String> {
}
if (x < 'a') || (x > 'h') {
- return Err(String::from(
- "Placements must specify a valid position on the game board.",
- ));
+ return Err(if (x >= 'A') && (x <= 'Z') {
+ format!("Unrecognised stone type '{}' in placement.", x)
+ } else {
+ String::from("Placements must specify a valid position on the game board.")
+ });
}
let x: u8 = x as u8 - 'a' as u8;