You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment indicates that limiting forward references is important for
performance, but many more were used than needed.
This is a 75% reduction in forward reference instances.
Many of these are included in the definition of remaining forward
references but do not themselves need to be a forward reference (indeed
only 1 thing in a given cycle actually needs to be such that it can be
referred to prior to its definition)
`auto_delim` is recursively self-referential, and thus _must_ be all on
its own
`placeable` and `accent` form a tight loop, so one of those two needed
to be a forward reference, and placeable was the easiest to keep (and
most likely to be used in another definition that may introduce similar
constraints)
`token` is one of the more generic definitions, that is used in multiple
other definitions.
`required_group` and `optional_group` both caused failed tests when I
tried to make them no longer forward references, has something to do
with how `__call__` works for `Forward` vs `And` objects in pyparsing
(though did not dig too much deeper into it, beyond noticing that the
names in future `required_group("name")` calls still had error messages
that say `"group"`, not their newer names, and that reverting to
`Forward` instances fixed it).
`operatorname` needed to move to avoid using forward references for
`simple`, but does not actually have a cycle.
Otherwise rewrapped some of the definitions to be one line and fixed a
typing error that I noticed when looking into the parsing things.
0 commit comments