diff --git a/sample-code/module_hell.cl b/sample-code/module_hell.cl new file mode 100644 index 0000000..130a2f6 --- /dev/null +++ b/sample-code/module_hell.cl @@ -0,0 +1,17 @@ +//! Demonstrates modules + +fn main() { + use foo::bar::baz; // -> use super::baz::qux as baz: 10 -> fn baz::qux: 12 + baz() +} + +mod foo { + mod bar { + use super::baz::qux as baz; // -> fn qux: 14 + } + mod baz { + fn qux() { + print("foo, bar, baz, qux") + } + } +}