From 20c74953b54d8368ef8c4a7bb2305e4e00f5c46b Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 16 Sep 2017 17:44:06 -0700 Subject: [PATCH] Get rid of unimplemented! and panic! --- src/schala_lang/parsing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schala_lang/parsing.rs b/src/schala_lang/parsing.rs index 6b1f5eb..803886f 100644 --- a/src/schala_lang/parsing.rs +++ b/src/schala_lang/parsing.rs @@ -649,7 +649,7 @@ impl Parser { Ok(IntLiteral(n)) }, HexNumberSigil => { - unimplemented!() + ParseError::new("Not implemented") }, _ => return ParseError::new("Expected '0x' or '0b'"), } @@ -664,13 +664,13 @@ impl Parser { digits.push_str(&self.digits()?); match digits.parse::() { Ok(f) => Ok(FloatLiteral(f)), - Err(e) => unimplemented!("Float didn't parse with error: {}", e), + Err(e) => ParseError::new(&format!("Float failed to parse with error: {}", e)), } } else { match digits.parse::() { Ok(d) => Ok(IntLiteral(d)), - Err(e) => unimplemented!("Need to handle numbers that don't parse to a Rust u64 {}", e), + Err(e) => ParseError::new(&format!("Integer failed to parse with error: {}", e)), } } });