diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-16 16:07:21 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-16 18:10:54 +0200 |
commit | 4dc2cafb17c2dbdb58ada3a200e843a894bfc113 (patch) | |
tree | 88b45f8caaf22b3ed0bec8727b7f7b164b2dc24a /doc/concepts | |
parent | 2c362dc379217da3c213b4698543ddfe4b7bd9cf (diff) | |
download | justbuild-4dc2cafb17c2dbdb58ada3a200e843a894bfc113.tar.gz |
expression language: add array access by index
Diffstat (limited to 'doc/concepts')
-rw-r--r-- | doc/concepts/expressions.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/concepts/expressions.md b/doc/concepts/expressions.md index 192952f4..25da0fc8 100644 --- a/doc/concepts/expressions.md +++ b/doc/concepts/expressions.md @@ -354,6 +354,16 @@ those) argument(s) to obtain the final result. `"default"` argument (with default `null`) is evaluated and returned. + - `"[]"` This function takes two keyword arguments, `"index"` and + `"list"`. The `"list"` argument has to evaluate to a list. The + `"index"` argument has to evaluate to either a number (which + is then rounded to the nearest integer) or a string (which + is interpreted as an integer). If the index obtained in this + way is valid for the obtained list, the entry at that index + is returned; negative indices count from the end of the list. + Otherwise the `"default"` argument (with default `null`) is + evaluated and returned. + #### Constructs related to reporting of user errors Normally, if an error occurs during the evaluation the error is |