|
parsing binary unary
precedence binding binding operators
strength strength
2 2 -*end of file*-
4 4 -*end of cell*-
6 ) ] |> }
8 7 ;
10 10 10 ,
12 12 do else list then
14 13 %= &= **= *= ++= += -= -> ..<= ..= //= /= := <- <<= <==>= = ===>= ==>= => >> >>= ??= @= @@= @@?= \= \\= ^**= ^= ^^= _= |-= |= |_= ||= ·= ⊠= ⧢=
16 16 from in of to when
18 18 18 <<
20 19 20 |-
22 21 ===>
22 21 22 <===
24 23 <==>
26 25 ==>
26 25 26 <==
28 27 or
28 27 28 ??
30 29 xor
32 31 and
34 34 not
36 35 != =!= == ===
36 35 36 < <= > >= ?
38 38 ||
40 39 :
42 42 |
44 44 ^^
46 46 &
48 48 .. ..<
50 50 ++
50 50 50 + -
52 52 ·
54 54 ** ⊠ ⧢
56 6 <| [
58 57 \ \\
58 58 % / //
58 58 58 *
60 59 @
62 -*...symbols...*-
62 6 ( {
62 12 break breakpoint catch continue elapsedTime elapsedTiming if profile return shield step TEST throw time timing try while
62 16 for new
62 74 global local symbol threadLocal
62 61 SPACE
64 (*)
66 66 @@ @@?
68 ^* ^~ _* _~ ~
70 70 #? . .? ^ ^** ^< ^<= ^> ^>= _ _< _<= _> _>= |_
70 70 61 #
72 ! ^! _!
|
One of the most unusual aspects of the parsing precedence table above is that [ is assigned a precedence several steps lower than the precedence of symbols and adjacency, and also lower than the precedence of /. This was done so expressions like R/I[x] would be parsed according to mathematical custom, but it implies that expressions like f g [x] will be parsed in a surprising way, with f g being evaluated first, even if f and g are both functions. Suitably placed parentheses can help, as illustrated in the next example.
|
|
|
|
The source of this document is in Macaulay2Doc/ov_language.m2:1225:0.