zkas: formatting, typos, clippy

This commit is contained in:
y
2023-09-17 11:45:57 -04:00
committed by parazyd
parent 8a333100ef
commit 3b52ed4e27
2 changed files with 12 additions and 14 deletions

View File

@@ -270,18 +270,16 @@ impl Analyzer {
v.column,
))
}
} else if arg_types[0] == VarType::ScalarArray {
if var_type != VarType::Scalar {
return Err(self.error.abort(
&format!(
"Incorrect argument type. Expected `{:?}`, got `{:?}`.",
VarType::Scalar,
var_type
),
v.line,
v.column,
))
}
} else if arg_types[0] == VarType::ScalarArray && var_type != VarType::Scalar {
return Err(self.error.abort(
&format!(
"Incorrect argument type. Expected `{:?}`, got `{:?}`.",
VarType::Scalar,
var_type
),
v.line,
v.column,
))
}
// Validation for non-Array types
if var_type != arg_types[idx] {

View File

@@ -124,7 +124,7 @@ impl Parser {
let mut ast_inner = IndexMap::new();
let mut ast = IndexMap::new();
if self.tokens.len() == 0 {
if self.tokens.is_empty() {
return Err(self.error.abort("Source file does not contain any valid tokens.", 0, 0))
}
@@ -1056,7 +1056,7 @@ impl Parser {
// x => unimplemented!("{:#?}", x),
_ => {
return Err(self.error.abort(
&format!("Characer is illegal/unimplemented in this context",),
"Character is illegal/unimplemented in this context",
arg.line,
arg.column,
))