make from an operator (#14241)

This commit is contained in:
hlaaftana 2020-05-08 08:54:46 +03:00 • committed by GitHub
commit de27910ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 22 deletions

View file

@ -6,7 +6,7 @@ colon = ':' COMMENT?
colcom = ':' COMMENT?
operator = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9
| 'or' | 'xor' | 'and'
| 'is' | 'isnot' | 'in' | 'notin' | 'of' | 'as'
| 'is' | 'isnot' | 'in' | 'notin' | 'of' | 'as' | 'from' |
| 'div' | 'mod' | 'shl' | 'shr' | 'not' | 'static' | '..'
prefixOperator = operator
optInd = COMMENT? IND?

View file

@ -565,7 +565,7 @@ following characters::
defined here.)
These keywords are also operators:
``and or not xor shl shr div mod in notin is isnot of as``.
``and or not xor shl shr div mod in notin is isnot of as from``.
`.`:tok: `=`:tok:, `:`:tok:, `::`:tok: are not available as general operators; they
are used for other notational purposes.
@ -638,21 +638,21 @@ has the second lowest precedence.
Otherwise precedence is determined by the first character.
================ ================================================== ================== ===============
Precedence level Operators First character Terminal symbol
================ ================================================== ================== ===============
10 (highest) ``$ ^`` OP10
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
8 ``+ -`` ``+ - ~ |`` OP8
7 ``&`` ``&`` OP7
6 ``..`` ``.`` OP6
5 ``== <= < >= > != in notin is isnot not of as`` ``= < > !`` OP5
4 ``and`` OP4
3 ``or xor`` OP3
2 ``@ : ?`` OP2
1 *assignment operator* (like ``+=``, ``*=``) OP1
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
================ ================================================== ================== ===============
================ ======================================================= ================== ===============
Precedence level Operators First character Terminal symbol
================ ======================================================= ================== ===============
10 (highest) ``$ ^`` OP10
9 ``* / div mod shl shr %`` ``* % \ /`` OP9
8 ``+ -`` ``+ - ~ |`` OP8
7 ``&`` ``&`` OP7
6 ``..`` ``.`` OP6
5 ``== <= < >= > != in notin is isnot not of as from`` ``= < > !`` OP5
4 ``and`` OP4
3 ``or xor`` OP3
2 ``@ : ?`` OP2
1 *assignment operator* (like ``+=``, ``*=``) OP1
0 (lowest) *arrow like operator* (like ``->``, ``=>``) OP0
================ ======================================================= ================== ===============
Whether an operator is used a prefix operator is also affected by preceding