On Sunday, December 4, 2016 at 5:45:37 AM UTC-6, Edward K. Ream wrote:
>
> I have declared #334 <https://github.com/leo-editor/leo-editor/issues/334>: 
> to be complete. In fact, Leo's importers are clearly as simple as possible.
>

i.gen_lines now supports skip counts, and in a more flexible manner than 
used in several x.gen_lines overrides.  Rather than returning a skip count, 
helpers can set the self.skip ivar. This is a nice simplification and 
generalization.

- Fix #342 <https://github.com/leo-editor/leo-editor/issues/342>: @auto and 
> @auto-md not equivalent for .Rmd file.
>

Still open.  I have found an odious "if" statement in the atFile write 
logic:

   elif root.isAtAutoRstNode():

I trust that future maintainers will despise this kinds of hack as much as 
I do ;-)

Having said that, @auto-rst and @auto-md are supposed to force the correct 
importer to be used, when the file's extension is ambiguous.  So this item 
is a nit.
 

> - C and Java importers: Backtrack to the start of signature lines, to 
> eliminate empty headlines.
>

I am working extremely hard to complete the importers before Rebecca and I 
leave for Florida the Friday, December 9. 

After a long day of work, the C importer is almost complete.  I expect to 
complete it this morning.  There were several false starts.  Instead of 
backtracking, the new code actually does parse C extern, class and function 
definitions using various regex's.

It's complex, but the complexity is inherent in the problem, not in the 
Importer infrastructure.  Furthermore, the complexity is limited to 
communication between two overrides of base class methods: c_i.starts_block 
and c_i.start_new_block. So while the complexity is unavoidable, it's all 
in one place where future maintainer can understand them fairly easily.

It's possible to imagine situations where the regex's will fail to parse 
properly.  For instance, if there were multi-line block comments in the 
middle of int foo (whatever) {.  I'm prepared to wait for the unlikely bug 
reports to fix this nit. A fix is surely possibly, but it would involve a 
secondary full C scanner, something like BaseScanner.startsHelper. It's not 
worth doing now.

The java importer will use a similar scheme.

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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to