You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/writing-reactors/preambles.mdx
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,7 +442,7 @@ The important takeaway here is with the package.json file and the compiled JavaS
442
442
443
443
For example, you can use the `preamble` to define macros and functions that are shared within the given reactor:
444
444
445
-
```lf-c
445
+
```lf-rs
446
446
target Rust;
447
447
448
448
main reactor {
@@ -476,7 +476,7 @@ This also can allow us to change the scope of items using the `use` statement.
476
476
477
477
For example, the follow reactor brings the constant `PI` into scope and print out the first 15 digits of pi:
478
478
479
-
```lf-c
479
+
```lf-rs
480
480
target Rust;
481
481
482
482
main reactor {
@@ -502,7 +502,7 @@ This would be an example of accessing a user created module named `foo` that is
502
502
503
503
File: example.lf
504
504
505
-
```lf-c
505
+
```lf-rs
506
506
target Rust {
507
507
rust-include: ["foo.rs"]
508
508
}
@@ -530,12 +530,8 @@ This will print:
530
530
Hello, world!
531
531
```
532
532
533
-
It is important to note that besides Crates specified in the rust target declaration's _cargo-dependencies_ and user modules in _rust-include_, all user code is added to a module called `reactors` during compilation time.
533
+
It is important to note that besides [crates](https://doc.rust-lang.org/book/ch07-01-packages-and-crates.html) specified in the rust target declaration's _cargo-dependencies_ and user modules in _rust-include_, all user code is added to a module called `reactors` during compilation time.
534
534
This means that crate level attributes like `#![no_std]` will not work if added to the preamble.
0 commit comments