Skip to content

Commit

Permalink
Add doc-comment example script.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Dec 31, 2021
1 parent e3aa2c1 commit 05baee0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/doc-comments.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// The function `foo`, which prints `hello, world!` and a magic number,
/// accepts three parameters.
///
/// # Parameters
///
/// `x` - `i64`
/// `y` - `string`
/// `z` - `bool`
///
/// # Notes
///
/// This is a doc-comment. It can be obtained with the `metadata` feature.
///
/// An example is the `rhai-doc` app.
///
fn foo(x, y, z) {
print(`hello, world! ${if z { x + y.len() } else { x } }`);
}

foo(39, "bar", true);

0 comments on commit 05baee0

Please sign in to comment.