Revise docs.

This commit is contained in:
Stephen Chung
2020-07-28 10:25:57 +08:00
parent f05cd1fdf3
commit b70fd35f4a
9 changed files with 91 additions and 51 deletions

View File

@@ -63,7 +63,9 @@ cause a stack overflow in the [`Engine`], unless stopped by setting a limit for
For instance, importing itself always causes an infinite recursion:
```rust
// This file is 'hello.rhai'
--------------
| hello.rhai |
--------------
import "hello" as foo; // import itself - infinite recursion!
@@ -73,11 +75,18 @@ foo::do_something();
Modules cross-referencing also cause infinite recursion:
```rust
// This file is 'hello.rhai' - references 'world.rhai'
--------------
| hello.rhai |
--------------
import "world" as foo;
foo::do_something();
// This file is 'world.rhai' - references 'hello.rhai'
--------------
| world.rhai |
--------------
import "hello" as bar;
bar::do_something_else();
```