Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilturek committed Jun 15, 2024
1 parent c6c9ab9 commit 3f7fd29
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,24 @@ let y = 5 < 5;
let z = 5 == 5;
let v = 5 != 5;
```

### Operator Precedence

The following table shows the operator precedence in Monkey, from lowest to highest:

| Precedence Level | Operators | Description |
|------------------|-----------------|----------------------------|
| 6 (Highest) | Function calls | Function calls |
| 5 | Prefix `-`, `!` | Unary operations |
| 4 | `*`, `/` | Multiplication and Division|
| 3 | `+`, `-` | Addition and Subtraction |
| 2 | `<`, `>` | Comparison |
| 1 (Lowest) | `==`, `!=` | Equality |

### Grouped Expressions

You can use parentheses to influence the order of executing arithmetic operations.

```
let x = (2 / (5 + 5));
```

0 comments on commit 3f7fd29

Please sign in to comment.