support lowercase type
This commit is contained in:
@@ -17,9 +17,9 @@ impl FromStr for Type {
|
||||
type Err = SemanticErrorKind;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
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())),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user