Table of precedence
This table describes the precedence of CQL filters.Filters in the same cell of the table have the same precedence.
The table's cells are arranged in order of increasing precedence (as you go down the table, the precedence increases). Thus, and has high precedence than or because it is further down the table.
Precedence is explained more fully here.
operation |
---|
-->, in line <--, in line |
+ wildcard * wildcard |
ancestor descendant distance find if/then/else lca loop transforms, e.g. flipcolor, shift arguments to user-defined functions body of echo body of piece body of sort body of square constituents of a compound filter |
or |
and |
not |
in filter |
< <= == >= > != |
makesquare abs unary - right side of += right side of -= right side of *= right side of /= right side of %= right side of persistent sqrt position |
+(addition), -(subtraction) |
-(unary minus) |
*, /, % |
rank file # in parameter to piecein parameter to squarebetween power type colortype right hand side of piece assignment pieceid |
| |
& |
~ |
attacks, attackedby |
from parameter to pin, moveto parameter to pin, movecapture parameter to moveenpassantsquare parameter to movethrough parameter to pin |
any direction filter: up, down, etc. light dark |
: |
In the above table, all the operators are left associative where applicable, except for : and the relational operators, which are right associative.