add semantics of overloaded + operator

This commit is contained in:
Valentin Gagarin 2022-12-22 22:11:17 +01:00
parent 63b640e0c2
commit 969e5ad5bf

View file

@ -70,16 +70,6 @@ Associativity: left
Precedence: 6
## Addition
> *e1* `+` *e2*
Add numbers *e1* and *e2*.
Associativity: left
Precedence: 7
## Subtraction
> *e1* `-` *e2*
@ -90,6 +80,16 @@ Associativity: left
Precedence: 7
## Addition
> *e1* `+` *e2*
Add numbers *e1* and *e2*.
Associativity: left
Precedence: 7
## String concatenation
> *string1* `+` *string2*
@ -100,6 +100,44 @@ Associativity: left
Precedence: 7
## Path concatenation
> *path1* `+` *path2*
Concatenate two paths.
The result is a path.
## Path and string concatenation
> *path* `+` *string*
Concatenate *path* with *string*.
The result is a path.
> **Note**
>
> The string must not have a string context that refers to a store path.
Associativity: left
Precedence: 7
## String and path concatenation
> *string* `+` *path*
Concatenate *string* with *path*.
The result is a string.
> **Important**
>
> The file or directory at *path* must exist and is copied to the store
> The path appears in the result as the corresponding store path.
Associativity: left
Precedence: 7
## Logical negation (`NOT`)
> `!` *e*