first documentation run
This commit is contained in:
parent
e065108f58
commit
f59e6a5fd5
21 changed files with 64 additions and 23 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue