first documentation run

This commit is contained in:
Sebastian Hugentobler 2025-05-26 12:24:35 +02:00
parent e065108f58
commit f59e6a5fd5
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
21 changed files with 64 additions and 23 deletions

View file

@ -11,6 +11,7 @@ use crate::{
value::{CallableType, Value},
};
/// Native clock function that returns the current time in seconds since the Unix epoch
struct Clock;
impl Callable for Clock {
@ -22,6 +23,7 @@ impl Callable for Clock {
0
}
/// Return the current system time in seconds since the Unix epoch
fn call(
&self,
_interpreter: &mut Interpreter,
@ -36,6 +38,7 @@ impl Callable for Clock {
}
}
/// Return all native functions available to the Lox interpreter
pub fn all() -> Vec<(String, Value)> {
vec![(
"clock".into(),