f5devcentral / f5-corkscrew

TMOS parser and application extractor
Apache License 2.0
14 stars 3 forks source link

[RFE] refactor initial parent object extraction #6

Closed DumpySquare closed 1 year ago

DumpySquare commented 3 years ago

When parsing the config files, the regex, for extracting the parent objects has some corner cases where it may miss some information, like closing brackets. It might not be that efficient with the use of lookbacks.

Furthermore, making this operation more efficient and streaming in file contents, could be the next big step in accuracy and performance improvements.

So, look at moving file input (after extracting from archive and saving locally), to stream in data as it's read, then test using the "balanced-matched" package to identify and extract each parent item object with all the necessary matched brackets and push them to the config array (or convert/merge into the final json tree

This would tie into #4

DumpySquare commented 1 year ago

This work has pretty much been done with the latest async unpack and parse functions and balanced-matched has been in use for some time (almost two years now). The pending release of v1.0.0 removes most of this legacy code.