Repository navigation
v0.8.0
Immutable
release. Only release title and notes can be modified.
Changed
LimitExceededis no longer aParseError. It derives fromDemanglingError
directly, soexcept ParseErrorstops taking "too large to read under these limits"
for "malformed". Code that caughtParseErrorto cover both should catch
DemanglingError. It has nopositionany more; it never had one to give.demangle_all()refuses a single name. Astris an iterable ofstr, so
demangle_all("_Z1fv")came back as['_', 'Z', '1', 'f', 'v']. Onestror bytes
object is aTypeErrornow.demangle_text()andfind_symbols()say what was wrong with atextthat is not
astr. It was aTypeErrorout ofre, andfind_symbols()raised it at the
firstnext()rather than at the call.
Added
Node.find()takes a node class as well as akindstring:tree.find(Name)
yieldsNamenodes, subclasses included, and a type checker then knows their fields.CacheStats, theTypedDictthatcache_stats()returns, in place of
dict[str, Any].- Annotations on the rest of the core: the node constructors,
Reader, the registry
and the fields ofLanguagePluginandStyle, so a scheme written against them is
type-checked.DemanglingErrordeclares themangledevery subclass sets.
Performance
- MSVC names read about 1.4x faster cold over a symbol table (msvc-boost.txt: 64 to
46 us a name). The template instantiations a name spells out are remembered across
names now, not just within one, so a table that writes out the same
std::basic_string<...>thousands of times reads it once. The memo is bounded at
about 8M characters andcache_clear()empties it. Output is unchanged. - Swift names read about 8% faster cold (swift-real-world.txt: 53 to 49 us a name, 17%
fewer instructions). Identifiers are split into words by a regular expression rather
than a loop over characters, and the commonest productions, nominal types, tuples and
function types, pop the stack directly instead of through helpers. Output is
unchanged.
Install with python -m pip install --upgrade demangle.
See the changelog for details.