On Monday, October 10, 2016 at 7:32:58 AM UTC-5, Edward K. Ream wrote:

Rev 182398c regularizes all leading whitespace automatically.  Imo, this is 
> a reasonable thing to do in all situations.
>

Rev fbc8d58 contains several improvements, as discussed below.  The code is 
essentially complete, but generating section references instead of @others 
can't be completed until #321 
<https://github.com/leo-editor/leo-editor/issues/321> is completed.

Please report any problems, no matter how big or small, immediately.

*@bool js_importer_clean_lws* 

This is a new setting. The default (and recommended) value is True.

When the switch is True, the importer will "regularize" leading whitespace, 
which may cause the outline to write differently than the original outline.

When this switch is False:

- @others is never indented,
- All nodes contain the *original* leading whitespace,
- The outline should write *exactly* as the original.
- You are not allowed to complain about the looks of the resulting outline 
;-)

You are not allowed to complain because there is no other *safe *way to 
ensure that the outline writes exactly as the original.

*Regular expressions*

The code now handles regex expressions reasonably in all known situations.  
A unit test ensures that this is true.  The code can be changed relatively 
easily if new weird cases are discovered.

*Other settings*

@int importer_min_scan_size = 0
@int importer_min_rescan_size = 0

I don't recommend changing these settings, but they might be useful in some 
situations.  See leoSettings.leo for details.

*A new testing pattern*

The following appears just before the JavaScriptScanner class in 
leo.plugins.importers.javascript:

gen_clean = None
    # None: use @bool js_importer_clean_lws setting
    # True: clean blank lines and regularize indentation.

gen_refs = False
    # None: use @bool js_importer_gen_refs setting
    # True: generate section references.
    # False generate @others

The *static* gen_clean switch is now None, which enables @bool 
js_importer_clean_lws.  But during development, it was much more convenient 
for me to change gen_clean than the corresponding user setting.

The *static* gen_refs switch is still False, which means that @bool 
js_importer_gen_refs is disabled.  It will remain that way until #321 
<https://github.com/leo-editor/leo-editor/issues/321> is completed.  This 
is the only remaining unfinished part of this project.

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