Rework LR helper crate #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Currently the LR helper crate is quite wastefull:
Strings, allocated & owned by an rule, which wastes memory for alternations due to many allocated strings.Strings which wastes more memory.While one could argue that this dosn't matter that much rn, since the tool currently is used at compiletime to generate rust code, it does so by using an proc-macro which will potentially get re-run every time a compile task is started. Also it hurts any tool trying to use it at runtime (i.e. I want to build an playground some day).
Solutions:
Either wrap rules inside
Rcto have multiple references or use rule indezies / IDs to refer to them internally. Same for terminals: we dont actually need an string representation to build the tables, since they only store IDs anyway.