New importers for c++, python, cython and coffeescript now in devel

15 views
Skip to first unread message

Edward K. Ream

unread,
May 15, 2023, 6:00:08 PM5/15/23
to leo-editor
PR #3330 created new methods in the base Importer class and rewrote the c++ importer.

PR #3345 (just merged) fixed various bugs in PR #3330 and converted the c++, python, cython, and coffeescript importers to the new importer framework.

More brags

The importers for cython and coffeescript are almost nothing but top-level regex patterns for python_i.find_blocks.

The importers for c++ and python only override i.find_blocks, and these overrides are straightforward.

The highlight of the new code is python_i.find_end_of_block. A simple hack appends all comments and empty lines to the end of the block. This kind of hack was impossible in all previous iterations of Leo's importers.

Summary

Work is going faster than expected. Much of the work involved adjusting the unit tests to reflect the improved code!

I continue rewriting importers until none of the old importer code remains.

Edward
Reply all
Reply to author
Forward
0 new messages