Laufzeit-Eingabe und Zonenzustand korrigieren und Change archivieren

This commit is contained in:
2026-09-06 08:04:22 +02:00
parent 815825dde7
commit c8b92f0619
36 changed files with 1104 additions and 91 deletions

View File

@@ -243,6 +243,7 @@ fn builtin_fn(name: &str) -> Option<(u8, u8, &'static [ArgK], RetK)> {
"DATE$" | "TIME$" => (0, 0, &[], St),
"TIMER" => (0, 0, &[], Sg),
"NOW" => (0, 0, &[], Db),
"TIMEZONEKNOWN" => (0, 0, &[], I),
"DATESERIAL" | "TIMESERIAL" => (3, 3, &[N, N, N], Db),
"DATEVALUE" | "TIMEVALUE" => (1, 1, &[S], Db),
"DAY" | "MONTH" | "YEAR" | "WEEKDAY" | "HOUR" | "MINUTE" | "SECOND" => (1, 1, &[N], I),
@@ -5374,6 +5375,7 @@ impl Sema {
b(bt, a, Ty::Dbl, self)
}
"NOW" => b(Builtin::Now, vec![], Ty::Dbl, self),
"TIMEZONEKNOWN" => b(Builtin::TimezoneKnown, vec![], Ty::Int, self),
"DATESERIAL" | "TIMESERIAL" => {
let x = conv_arg!(0, NumTy::Lng);
let y = conv_arg!(1, NumTy::Lng);
@@ -5663,6 +5665,19 @@ mod tests {
assert!(diags("PRINT CHR$(\"x\")").contains(&"Type mismatch".to_string()));
assert!(diags("x$ = INKEY$").is_empty());
assert!(diags("t! = TIMER").is_empty());
assert!(matches!(
super::builtin_fn("TIMEZONEKNOWN"),
Some((0, 0, [], super::RetK::I))
));
assert!(diags("PRINT TIMEZONEKNOWN").is_empty());
for name in ["TIMEZONEKNOWN(1)", "MKL$()"] {
let d = diags(&format!("PRINT {name}"));
assert!(
d.iter().any(|m| m.contains("Argument-count mismatch")
&& m.contains(name.split('(').next().unwrap())),
"{d:?}"
);
}
}
#[test]