Leo's new importers handle leading whitespace (lws) much more carefully 
than previously.  Leo runs these better checks for *all* languages. All 
unit tests pass. Please report any problems immediately.

*Summary*

Leo now *always* checks lws for consistency, including consistency with 
@tabwidth directives. When problems are found, the importers regularize the 
lws as best they can, disabling perfect import tests related to lws.  All 
other perfect import tests remain in effect.

These consistency checks revealed intermixed blanks and tabs in several 
unit tests.  I've chosen to leave these tests just as they are.  At 
present, tracing produces warnings for these unit tests.  That's to be 
expected for now.  Later, I'll disable the additional tracing.

*Check-in Log*

The following is the checking log for rev 483ea4b. It shows the 
complications involved. Comments and questions are encouraged.

QQQ
Another happy milestone: all unit tests pass with much better checking of 
leading whitespace. In particular, all tests pass with no_clean = True in 
BLS.check.

- BLS.run calls BLS.check_blanks_and_tabs for *all* languages. This should 
always have been done. It revealed intermixed blanks and tabs in several 
unit tests. It's good to leave them just as they are.
  
- BLS.check_blanks_and_tabs now does a more thorough and informative job of 
reporting problems with leading whitespace. In particular, it warns if 
whitespace does not match the @tabwidth value. Such mismatches would cause 
failures later on, were it not for BLS.regularize_whitespace.

- BLS.regularize_whitespace now gives much more informative warnings. It 
tells what was changed, and why. When tracing is on, as at present, the 
warnings are given even during unit tests. So the additional output during 
unit tests is expected, and a good thing.
  
- BLS.regularize_whitespace sets a flag for BLS.check if it changes any 
whitespace.
      
- BLS.clean ignores lws problems if regularize_whitespace has changed 
anything. This is the only reasonable way to handle things, imo.

- BLS.clean produces better messages.
      
- Added BLS.get_lws. It simplifies the code and clarifies what is going on.

- BLS.gen_ref now uses the line's leading whitespace to indent refs 
properly. This always works because unindenting happens only in the 
post-pass. As a result, the hack in BLS.common_ws is not needed.

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