From 606c358cc9f919f53b3c09e9cdb233ab1361f414 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 28 Mar 2019 15:01:20 +0100 Subject: [PATCH] Make operator table one-columned --- README.md | 30 +++++++++++++++++++----------- src/lib.rs | 30 +++++++++++++++++++----------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 69cbe19..523084d 100644 --- a/README.md +++ b/README.md @@ -127,17 +127,25 @@ The precedence of variables and values is 200, and the precedence of function li Supported binary operators: -| Operator | Precedence | Description | | Operator | Precedence | Description | -|----------|------------|-------------|---|----------|------------|-------------| -| + | 95 | Sum | | < | 80 | Lower than | -| - | 95 | Difference | | \> | 80 | Greater than | -| * | 100 | Product | | <= | 80 | Lower than or equal | -| / | 100 | Division | | \>= | 80 | Greater than or equal | -| % | 100 | Modulo | | == | 80 | Equal | -| ^ | 120 | Exponentiation | | != | 80 | Not equal | -| && | 75 | Logical and | | , | 40 | Aggregation | -| || | 70 | Logical or | | = | 50 | Assignment | -| | | | | ; | 0 | Expression Chaining | +| Operator | Precedence | Description | +|----------|------------|-------------| +| ^ | 120 | Exponentiation | +| * | 100 | Product | +| / | 100 | Division | +| % | 100 | Modulo | +| + | 95 | Sum | +| - | 95 | Difference | +| < | 80 | Lower than | +| \> | 80 | Greater than | +| <= | 80 | Lower than or equal | +| \>= | 80 | Greater than or equal | +| == | 80 | Equal | +| != | 80 | Not equal | +| && | 75 | Logical and | +| || | 70 | Logical or | +| = | 50 | Assignment | +| , | 40 | Aggregation | +| ; | 0 | Expression Chaining | Supported unary operators: diff --git a/src/lib.rs b/src/lib.rs index 8b7567f..60d0a17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,17 +114,25 @@ //! //! Supported binary operators: //! -//! | Operator | Precedence | Description | | Operator | Precedence | Description | -//! |----------|------------|-------------|---|----------|------------|-------------| -//! | + | 95 | Sum | | < | 80 | Lower than | -//! | - | 95 | Difference | | \> | 80 | Greater than | -//! | * | 100 | Product | | <= | 80 | Lower than or equal | -//! | / | 100 | Division | | \>= | 80 | Greater than or equal | -//! | % | 100 | Modulo | | == | 80 | Equal | -//! | ^ | 120 | Exponentiation | | != | 80 | Not equal | -//! | && | 75 | Logical and | | , | 40 | Aggregation | -//! | || | 70 | Logical or | | = | 50 | Assignment | -//! | | | | | ; | 0 | Expression Chaining | +//! | Operator | Precedence | Description | +//! |----------|------------|-------------| +//! | ^ | 120 | Exponentiation | +//! | * | 100 | Product | +//! | / | 100 | Division | +//! | % | 100 | Modulo | +//! | + | 95 | Sum | +//! | - | 95 | Difference | +//! | < | 80 | Lower than | +//! | \> | 80 | Greater than | +//! | <= | 80 | Lower than or equal | +//! | \>= | 80 | Greater than or equal | +//! | == | 80 | Equal | +//! | != | 80 | Not equal | +//! | && | 75 | Logical and | +//! | || | 70 | Logical or | +//! | = | 50 | Assignment | +//! | , | 40 | Aggregation | +//! | ; | 0 | Expression Chaining | //! //! Supported unary operators: //!