Skip to content

Commit 5c72db1

Browse files
Update concatenation rule docs
1 parent 2f4464e commit 5c72db1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

goml-script.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,16 @@ store-value: (effect, ":hover")
6666
set-text: ("element" + |variable|, "something " + 2 + " something else")
6767
```
6868

69-
Rules of concatenation are simple: if any of the element is a string, then it'll concatenate as a string. Examples:
69+
Operations are handled from the left to the right. Operations between parens are performed first:
7070

7171
```ignore
72-
1 + 2 + "a" // gives string "12a"
73-
1 + 2 // gives number 3
72+
1 + 2 + "a" + (4 * 3)
73+
// first the parens
74+
1 + 2 + "a" + 12
75+
// then from left to right
76+
3 + "a" + 12
77+
"3a" + 12
78+
"3a12"
7479
```
7580

7681
This is just a sub-part of expressions which allow more things.

0 commit comments

Comments
 (0)