Skip to content

Commit c7b2b09

Browse files
committed
Update The-Expression-Syntax.md
1 parent 90b81f2 commit c7b2b09

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

docs/The-Expression-Syntax.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,26 @@ The package supports:
99

1010
* **strings** - single and double quotes (e.g. `"hello"`, `'hello'`)
1111
* **numbers** - e.g. `103`, `2.5`
12-
* **arrays** - e.g. `[1, 2]`
12+
* **arrays** - e.g. `[1, 2, 3]`
1313
* **maps** - e.g. `{foo: "bar"}`
1414
* **booleans** - `true` and `false`
1515
* **nil** - `nil`
1616

17-
## Working with Structs
17+
## Accessing Public Properties
1818

19-
When passing structs or maps into an expression, you can use different syntaxes to
20-
access properties.
21-
22-
Public properties on structs can be accessed by using the `.` syntax:
23-
24-
```coffeescript
25-
Foo.Bar.Baz
26-
```
27-
28-
## Working with Functions
29-
30-
You can also use functions by calling them using C syntax.
19+
Public properties on structs can be accessed by using the `.` syntax.
20+
If you pass an array into an expression, use the `[]` syntax to access array keys.
3121

3222
```coffeescript
33-
Upper("text")
23+
foo.Array[0].Value
3424
```
3525

36-
Result will be set to `HELLO`.
37-
38-
> Note: `Upper` function doesn't present in package by default.
39-
40-
## Working with Arrays
26+
## Calling Methods
4127

42-
Use the `[]` syntax to access values:
28+
The `.` syntax can also be used to call methods on an struct.
4329

4430
```coffeescript
45-
array[2]
31+
price.String()
4632
```
4733

4834
## Supported Operators
@@ -92,7 +78,7 @@ Example:
9278
Example:
9379

9480
```
95-
life < universe or life < everything
81+
life < universe || life < everything
9682
```
9783

9884
### String Operators
@@ -125,7 +111,7 @@ Result will be set to `Arthur Dent`.
125111
Example:
126112

127113
```coffeescript
128-
User.Group in ["human_resources", "marketing"]
114+
user.Group in ["human_resources", "marketing"]
129115
```
130116

131117
```coffeescript
@@ -139,7 +125,7 @@ User.Group in ["human_resources", "marketing"]
139125
Example:
140126

141127
```coffeescript
142-
User.Age in 18..45
128+
user.Age in 18..45
143129
```
144130

145131
The range is inclusive:

0 commit comments

Comments
 (0)