Repository: incubator-groovy Updated Branches: refs/heads/master 59ab3236a -> cdcac9830
operator precedence doco didn't match grammar in a few spots plus some missing operators Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/cdcac983 Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/cdcac983 Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/cdcac983 Branch: refs/heads/master Commit: cdcac9830b0ddf20712904fefcb1e13f90b0087c Parents: 59ab323 Author: Paul King <pa...@asert.com.au> Authored: Mon May 18 10:52:12 2015 +1000 Committer: Paul King <pa...@asert.com.au> Committed: Mon May 18 10:52:42 2015 +1000 ---------------------------------------------------------------------- src/spec/doc/core-operators.adoc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/cdcac983/src/spec/doc/core-operators.adoc ---------------------------------------------------------------------- diff --git a/src/spec/doc/core-operators.adoc b/src/spec/doc/core-operators.adoc index 30d26b4..2492aaa 100644 --- a/src/spec/doc/core-operators.adoc +++ b/src/spec/doc/core-operators.adoc @@ -648,24 +648,27 @@ The table below lists all groovy operators in order of precedence. [options="header"] |====================== |Level | Operator(s) | Name(s) -| 1 | `$x` | scope escape -| | `new` `()` | new, explicit parentheses -| | `()` `{}` `[]` | method call, closure, list/map -| | `.` `?.` `*.` | dot, safe dereferencing, spread-dot -| | `~` `!$` `(type)` | bitwise negate, not, typecast +| 1 | `new` `()` | object creation, explicit parentheses +| | `()` `{}` `[]` | method call, closure, literal list/map +| | `.` `.&` `.@` | member access, method closure, field/attribute access +| | `?.` `*` `*.` `*:` | safe dereferencing, spread, spread-dot, spread-map +| | `~` `!` `(type)` | bitwise negate/pattern, not, typecast +| | [] ++ -- | list/map/array index, post inc/decrement | 2 | `**` | power -| 3 | `++` `--` `+` `-` | pre/post increment/decrement, unary plus, unary minus +| 3 | `++` `--` `+` `-` | pre inc/decrement, unary plus, unary minus | 4 | `*` `/` `%` | multiply, div, modulo -| 5 | `+` `-` | binary plus, binary minus +| 5 | `+` `-` | addition, subtraction | 6 | `<<` `>>` `>>>` `..` `..<` | left/right (unsigned) shift, inclusive/exclusive range -| 7 | `<` `\<=` `>` `>=` `instanceof` `as` | less/greater than/or equal, instanceof, type coercion -| 8 | `==` `!=` `pass:[<=>]` | equal, not equal, compare to -| 9 | `&` | binary and -| 10 | `^` | binary xor -| 11 | `\|` | binary or +| 7 | `<` `\<=` `>` `>=` `in` `instanceof` `as` | less/greater than/or equal, in, instanceof, type coercion +| 8 | `==` `!=` `pass:[<=>]` | equals, not equals, compare to +| | `=~` `==~` | regex find, regex match +| 9 | `&` | binary/bitwise and +| 10 | `^` | binary/bitwise xor +| 11 | `\|` | binary/bitwise or | 12 | `&&` | logical and | 13 | `\|\|` | logical or -| 14 | `?:` | ternary conditional +| 14 | `? :` | ternary conditional +| | `?:` | elvis operator | 15 | `=` `\**=` `*=` `/=` `%=` `+=` `-=` `pass:[<<=]` `>>=` `>>>=` `&=` `^=` `\|=` | various assignments |======================