summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/ast/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-parse/src/ast/expr.rs')
-rw-r--r--crates/rebel-parse/src/ast/expr.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/crates/rebel-parse/src/ast/expr.rs b/crates/rebel-parse/src/ast/expr.rs
index 69c4407..4e386e7 100644
--- a/crates/rebel-parse/src/ast/expr.rs
+++ b/crates/rebel-parse/src/ast/expr.rs
@@ -157,21 +157,6 @@ pub enum Literal<'a> {
}
impl<'a> Literal<'a> {
- pub(crate) fn number(s: &'a str) -> Result<Self, &'static str> {
- let (radix, rest) = if let Some(rest) = s.strip_prefix("0x") {
- (16, rest)
- } else if let Some(rest) = s.strip_prefix("0o") {
- (8, rest)
- } else if let Some(rest) = s.strip_prefix("0b") {
- (2, rest)
- } else {
- (10, s)
- };
- let digits = rest.replace('_', "");
- let value = u64::from_str_radix(&digits, radix).or(Err("number"))?;
- Ok(Literal::Int(value))
- }
-
fn validate(&self) -> Result<(), ValidationError> {
match self {
Literal::Unit => Ok(()),