changed markdown tags from slang to rust

This commit is contained in:
2025-12-26 21:57:11 -07:00
parent 85f8b136e1
commit 0fdceac22c

View File

@@ -17,7 +17,7 @@ This guide covers the basics of writing your first Slang program.
A Slang program consists of top-level declarations and a main loop: A Slang program consists of top-level declarations and a main loop:
```slang ```rust
// Device declarations // Device declarations
device self = "db"; device self = "db";
device sensor = "d0"; device sensor = "d0";
@@ -43,7 +43,7 @@ game tick, preventing the script from consuming excessive resources.
**Important:** You should always include `yield()` in your main loop unless you **Important:** You should always include `yield()` in your main loop unless you
know what you're doing. know what you're doing.
```slang ```rust
loop { loop {
yield(); // Recommended! yield(); // Recommended!
// ... // ...
@@ -55,7 +55,7 @@ loop {
Here's a simple program that turns on a light when a gas sensor detects low Here's a simple program that turns on a light when a gas sensor detects low
pressure: pressure:
```slang ```rust
device gasSensor = "d0"; device gasSensor = "d0";
device light = "d1"; device light = "d1";
@@ -82,7 +82,7 @@ loop {
Slang supports single-line comments and documentation comments: Slang supports single-line comments and documentation comments:
```slang ```rust
// This is a regular comment // This is a regular comment
/// This is a documentation comment /// This is a documentation comment