Remu-Operator
This is framework to separate the resolution of operator precedence and associativity from parsing time, by using a concise algorithm instead of Shunting Yard algorithm.
Taine Zhao is the author of this algorithm, and has named it "Operator Bubbling".
from remu_operator import Operator, binop_reduce
precedences = {
'+': 1,
'*': 2,
"^": 3,
}
left = False
right = True
associativities = {'+': left, '*': left, '^': right}
def cons(v):
return lambda l, r: '({} {} {})'.format(l, v, r)
x = binop_reduce(
cons,
[1, Operator("+"), 2,
Operator("*"), 3, Operator("^"), 4,
Operator("^"), 5, Operator("+"), 6,
Operator("*"), 7], precedences, associativities)
assert x == '((1 + (2 * (3 ^ (4 ^ 5)))) + (6 * 7))'
Metadata
Release files for remu-operator 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| remu_operator-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for remu_operator-1.0.1-py3-none-any.whl |
Release files / remu_operator-1.0.1-py3-none-any.whl
| Download URL | remu_operator-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d72cde42d6c585d27f91ffe7adf1faa6106cbfdc2b5c99584916b71d8163b3c
|
|
BLAKE2b-256 checksum How to use checksums |
0fb22873bc0915e0c33089f33c2da9e6e6cfdc4f84c878548e6df451241b8fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.4
|
Security for remu-operator 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.