diff --git a/src/ast/typed.rs b/src/ast/typed.rs index fac8eec..9bce7f0 100644 --- a/src/ast/typed.rs +++ b/src/ast/typed.rs @@ -17,9 +17,9 @@ impl FromStr for Type { type Err = SemanticErrorKind; fn from_str(s: &str) -> Result { - match s { - "I" => Ok(Type::Int), - "F" => Ok(Type::Float), + match s.to_lowercase().as_str() { + "i" => Ok(Type::Int), + "f" => Ok(Type::Float), _ => Err(SemanticErrorKind::UnknownType(s.to_string())), } }