Skip to content

Commit

Permalink
ESQL: Generate railroad diagrams for operators (elastic#103143)
Browse files Browse the repository at this point in the history
This enables the generation of railroad diagrams for unary minus and a
bunch of binary operators like `+`, `-`, `%`, and `>=`.

Relates to elastic#100558
  • Loading branch information
nik9000 authored Dec 8, 2023
1 parent 2e592a3 commit 6e0c031
Show file tree
Hide file tree
Showing 15 changed files with 186 additions and 58 deletions.
10 changes: 9 additions & 1 deletion docs/reference/esql/functions/binary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ These binary comparison operators are supported:
* less than: `<`
* less than or equal: `<=`
* larger than: `>`
* larger than or equal: `>=`
* larger than or equal: `>=`

And these mathematical operators are supported:

[.text-center]
image::esql/functions/signature/add.svg[Embedded,opts=inline]

[.text-center]
image::esql/functions/signature/sub.svg[Embedded,opts=inline]
2 changes: 2 additions & 0 deletions docs/reference/esql/functions/operators.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Boolean operators for comparing against one or multiple expressions.

// tag::op_list[]
* <<esql-binary-operators>>
* <<esql-unary-operators>>
* <<esql-logical-operators>>
* <<esql-predicates>>
* <<esql-cidr_match>>
Expand All @@ -23,6 +24,7 @@ Boolean operators for comparing against one or multiple expressions.
// end::op_list[]

include::binary.asciidoc[]
include::unary.asciidoc[]
include::logical.asciidoc[]
include::predicates.asciidoc[]
include::cidr_match.asciidoc[]
Expand Down
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/div.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/equals.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/greater_than.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/less_than.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/mod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/mul.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/neg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/not_equals.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/sub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/reference/esql/functions/unary.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[discrete]
[[esql-unary-operators]]
=== Unary operators

These unary mathematical operators are supported:

[.text-center]
image::esql/functions/signature/neg.svg[Embedded,opts=inline]
Loading

0 comments on commit 6e0c031

Please sign in to comment.