Skip to content

Commit 41d3e40

Browse files
authored
Update Language-Definition.md
1 parent 212ed0f commit 41d3e40

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/Language-Definition.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ d>
116116

117117
Examples:
118118

119-
```python
119+
```c++
120120
user.Age in 18..45 and user.Name not in ["admin", "root"]
121121
```
122122

123-
```python
123+
```c++
124124
foo matches "^[A-Z].*"
125125
```
126126

@@ -143,7 +143,7 @@ The `?.` operator can be used to access a field of a struct or an item of a map
143143
without checking if the struct or the map is `nil`. If the struct or the map is
144144
`nil`, the result of the expression is `nil`.
145145

146-
```python
146+
```c++
147147
author?.User?.Name
148148
```
149149

@@ -153,7 +153,7 @@ The slice operator `[:]` can be used to access a slice of an array.
153153

154154
For example, variable `array` is `[1, 2, 3, 4, 5]`:
155155

156-
```python
156+
```c++
157157
array[1:4] == [2, 3, 4]
158158
array[1:-1] == [2, 3, 4]
159159
array[:3] == [1, 2, 3]
@@ -191,7 +191,7 @@ array[:] == array
191191
Returns **true** if all elements satisfies the [predicate](#predicate).
192192
If the array is empty, returns **true**.
193193

194-
```python
194+
```c++
195195
all(Tweets, {.Size < 280})
196196
```
197197
@@ -205,7 +205,7 @@ If the array is empty, returns **false**.
205205
Returns **true** if _exactly one_ element satisfies the [predicate](#predicate).
206206
If the array is empty, returns **false**.
207207
208-
```python
208+
```c++
209209
one(Participants, {.Winner})
210210
```
211211

@@ -228,7 +228,7 @@ Returns new array by filtering elements of the array by [predicate](#predicate).
228228
Returns the number of elements what satisfies the [predicate](#predicate).
229229
Equivalent to:
230230

231-
```python
231+
```c++
232232
len(filter(array, predicate))
233233
```
234234
@@ -244,7 +244,7 @@ Returns the absolute value of a number.
244244
245245
Returns the integer value of a number or a string.
246246
247-
```python
247+
```c++
248248
int("123") == 123
249249
```
250250

@@ -264,12 +264,12 @@ map(0..9, {# / 2})
264264
If items of the array is a struct or a map, it is possible to access fields with
265265
omitted `#` symbol (`#.Value` becomes `.Value`).
266266
267-
```python
267+
```c++
268268
filter(Tweets, {len(.Value) > 280})
269269
```
270270

271271
Braces `{` `}` can be omitted:
272272

273-
```python
273+
```c++
274274
filter(Tweets, len(.Value) > 280)
275275
```

0 commit comments

Comments
 (0)