Skip to content

Commit 8470f59

Browse files
committed
Added a new example showcasing doc comments
1 parent 3f292b9 commit 8470f59

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

examples/docs.pics

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
import std.io
3+
import std.fs
4+
5+
// Module: Foo
6+
// Contains functions for testing
7+
Foo :: module {
8+
// Function: getFoo
9+
// gets the value "Foo"
10+
//
11+
// Returns:
12+
// The string value "Foo"
13+
getFoo :: () = "Foo"
14+
15+
// Function: getBar
16+
// gets the value "Bar"
17+
//
18+
// Returns:
19+
// The string value "Bar"
20+
getBar :: () = "Bar"
21+
}
22+
23+
combine :: (foo, bar) = foo + " " + bar
24+
25+
foo := Foo::getFoo()
26+
bar := Foo::getBar()
27+
foobar := combine(foo, bar)
28+
IO::println(foobar)
29+

0 commit comments

Comments
 (0)