The code at rev 4776 imports the infamous data.html file correctly.
All unit tests pass, but there is the potential for unintended
consequences.  As always, please report any problems immediately.

I have been using a private unit test as the test harness:  It is in
leoPy.leo::

    leoPy.leo#Unit tests-->@test import dataN.html

However, data.html is not part of the repository, and won't be, so I
have some work to do converting the test above to self-contained unit
tests that don't use external files.

The fixes are simple and straightforward (as such things go ;-)  Here
is the checkin log:

QQQQQ
Fixed all known html-import problems in a clean way. Unit tests
exists, but they use external files. They will be converted soon.

Important changes:

1. Added hasNestedClasses ivar in the baseScannerClass, True only for
xml/html scanners.

When True, scanHelper and skipDecls allocate a substring to be used
for all further scanning. This is the *only* way to limit Leo's
scanners properly.

This was, in essence, the fix for duplicate code generation arising
from unbalanced tags:
skipToEndOfTag and skipToMatchingTag can't match outside the present
tag because
the 's' argument passed to those methods has already been truncated.

This is a simple, elegant solution, and in essence the *only* proper
solution. For example, it would not work to pass an 'end' argument to
skipToEndOfTag and skipToMatchingTag because the scanners inside those
methods do not understand 'end' arguments.

Thus, the simplest, most efficient solution is for scanHelper and
skipDecls to truncate the
string to be scanned. That way, the truncation happens at most once
per "class".

2. Added hasDecls in the baseScannerClass, False only for xml/html
scanners.

Various methods call skipDecls only if this ivar is True.  Suppressing
this call is essential for proper generation of xml/html code.
QQQQQ

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to