Skip to content

Commit 8057ec5

Browse files
committed
Fix indentation in code examples for consistency
1 parent 64d9577 commit 8057ec5

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

docs/control-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ condition is true. The `else` statement is optional.
1010

1111
```rn linenums="1" title="conditional-statements.rn"
1212
if true {
13-
print("true")
13+
print("true")
1414
1515
} else {
16-
print("false")
16+
print("false")
1717
}
1818
```
1919

docs/language-reference.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Multi-line block comments are wrapped in `#!` … `!#`:
1919

2020
```rn
2121
#!
22-
This is a
23-
multi-line comment.
22+
This is a
23+
multi-line comment.
2424
!#
2525
var y = 2
2626
```
@@ -109,9 +109,9 @@ without creating an instance. Instance access also works.
109109

110110
```rn
111111
class MathHelper {
112-
static fun square(n) {
113-
return n ^ 2
114-
}
112+
static fun square(n) {
113+
return n ^ 2
114+
}
115115
}
116116
117117
print(MathHelper.square(5)) # 25
@@ -136,9 +136,9 @@ an array:
136136

137137
```rn
138138
fun sum(...nums) {
139-
var total = 0
140-
for n in nums { total += n }
141-
return total
139+
var total = 0
140+
for n in nums { total += n }
141+
return total
142142
}
143143
144144
print(sum(1, 2, 3, 4)) # 10
@@ -162,9 +162,9 @@ hashmap:
162162

163163
```rn
164164
fun show(***kwargs) {
165-
for key in kwargs {
166-
print(key + " = " + str(kwargs[key]))
167-
}
165+
for key in kwargs {
166+
print(key + " = " + str(kwargs[key]))
167+
}
168168
}
169169
170170
show(name="Alice", age=30)
@@ -179,11 +179,11 @@ variable is shared — mutations are visible:
179179

180180
```rn
181181
fun make_counter() {
182-
var count = 0
183-
return fun() {
184-
count += 1
185-
return count
186-
}
182+
var count = 0
183+
return fun() {
184+
count += 1
185+
return count
186+
}
187187
}
188188
189189
const counter = make_counter()
@@ -297,8 +297,8 @@ signature.
297297

298298
```rn
299299
fun add(a, b) {
300-
"Returns the sum of a and b."
301-
return a + b
300+
"Returns the sum of a and b."
301+
return a + b
302302
}
303303
304304
help(add)

0 commit comments

Comments
 (0)