commit
60256576f6
|
@ -169,7 +169,8 @@ Operators with a lower number have higher precedence.
|
|||
| | `>` `>=` | |
|
||||
| |`=~` `!~` | |
|
||||
| 5 | `not` | Unary logical expression |
|
||||
| 6 |`and` `or`| Logical AND and OR |
|
||||
| 6 | `and` | Logical AND |
|
||||
| 7 | `or` | Logical OR |
|
||||
|
||||
The operator precedence is encoded directly into the grammar as the following.
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ Flux includes the following types of operators:
|
|||
- [Literal constructors](#literal-constructors)
|
||||
- [Miscellaneous operators](#miscellaneous-operators)
|
||||
|
||||
_Also see:_
|
||||
|
||||
- [Operator precedence](#operator-precedence)
|
||||
|
||||
## Arithmetic operators
|
||||
Arithmetic operators take two numerical values (either literals or variables) and
|
||||
perform a calculation that returns a single numerical value.
|
||||
|
@ -114,9 +118,28 @@ Literal constructors define fixed values.
|
|||
| `""` | String |
|
||||
|
||||
## Miscellaneous operators
|
||||
| Operator | Description | Example |
|
||||
|:--------:|:----------- | ------- |
|
||||
| `( )` | Logical grouping | `r._value / (r._value * 2)` |
|
||||
| `,` | Sequence delimiter | `item1, item2, item3` |
|
||||
| `:` | Key-value separator | `{name: "Bob"}` |
|
||||
| `.` | Dot reference | `r._measurement` |
|
||||
| Operator | Description | Example |
|
||||
|:--------:|:----------- | ------- |
|
||||
| `( )` | Logical grouping | `r._value / (r._value * 2)` |
|
||||
| `,` | Sequence delimiter | `item1, item2, item3` |
|
||||
| `:` | Key-value separator | `{name: "Bob"}` |
|
||||
| `.` | Member access / dot reference | `r._measurement` |
|
||||
|
||||
## Operator precedence
|
||||
The table below outlines operator precedence.
|
||||
Operators with a lower number have higher precedence.
|
||||
|
||||
|Precedence | Operator | Description |
|
||||
|:--------- |:--------: |:----------- |
|
||||
| 1 | `a()` | Function call |
|
||||
| | `a[]` | Member or index access |
|
||||
| | `.` | Member access |
|
||||
| 2 | `*` `/` | Multiplication and division|
|
||||
| 3 | `+` `-` | Addition and subtraction |
|
||||
| 4 | `==` `!=` | Comparison operators |
|
||||
| | `<` `<=` | |
|
||||
| | `>` `>=` | |
|
||||
| | `=~` `!~` | |
|
||||
| 5 | `not` | Unary logical expression |
|
||||
| 6 | `and` | Logical AND |
|
||||
| 7 | `or` | Logical OR |
|
||||
|
|
|
@ -9,10 +9,22 @@ menu:
|
|||
---
|
||||
|
||||
{{% note %}}
|
||||
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.24.0**.
|
||||
Any newer versions of Flux will not be available until the next InfluxDB release._
|
||||
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.25.0**.
|
||||
Though newer versions of Flux may be available, they will not be included with
|
||||
InfluxDB until the next InfluxDB v2.0 release._
|
||||
{{% /note %}}
|
||||
|
||||
## v0.25.0 [2019-04-08]
|
||||
|
||||
## Breaking changes
|
||||
- Fix logical operators (`and`, `or`) precedence.
|
||||
|
||||
## Bug fixes
|
||||
- Omit space between unary operator and operand.
|
||||
- Format AST preserving operator precedence.
|
||||
|
||||
---
|
||||
|
||||
## v0.24.0 [2019-04-01]
|
||||
|
||||
### Breaking changes
|
||||
|
@ -22,6 +34,8 @@ Any newer versions of Flux will not be available until the next InfluxDB release
|
|||
- Handle when a non-call expression is parsed as the pipe destination.
|
||||
- Add error message to Compile methods for empty Spec.
|
||||
|
||||
---
|
||||
|
||||
## v0.23.0 [2019-03-26]
|
||||
|
||||
### Breaking changes
|
||||
|
|
Loading…
Reference in New Issue