On Mon, Nov 15, 2021 at 8:17 AM jkn <[email protected]> wrote:

> I'll watch this with interest, if only because one project for my 'copious
> free time' is adding an importer for a QnD note-taking format I use myself.
>
> I started on this a while ago but got a bit bogged down in the details of
> the current mechanism, and have never got back to it (typical!)
>

Thanks for this note. There was a serious bug in the base Importer class,
in the undent method.  Other than that, all changes should be to the
Py_Importer subclass.

All importers use the same basic strategy. Each importer handles the input
line-by-line. The tokenizer subclasses know all about tokens such as
strings and multi-line comments. Tokenizing each line is essential to avoid
mistaking strings for syntactic entities.

The main line of each importer is the gen_lines method. Many importers use
the base Importer.gen_lines method. The python importer does not, because
indentation matters so much.

I am starting to get an inkling that the python version of gen_lines method
might be simplified. I am also wondering how much processing to do in
gen_lines and how much in the post pass.  We shall see.

Feel free to ask questions about your importer. Leo's importers are part of
its crown jewels.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2NApJkVEx-uSQRyLMOHBaNsKrAtQh09DFjikfFAENYFQ%40mail.gmail.com.

Reply via email to