On Thursday, January 21, 2016 at 8:12:45 AM UTC-6, Edward K. Ream wrote:

match-brackets fails when matching '}' snippet from the jQuery sources:
>
> {
>     a + "//" + b
> }
>
> This one case is going to require a rewrite of all the code!
>

I rewrote the code.  It worked, but was way too slow.  The new code has 
been relegated to the attic.

I am going to fall back on the following plan:

1. Leo will assume that the user isn't going to run the match-bracket 
command on a bracket that is inside a string, comment or regex.  If that 
assumption is false *both* the forward and backward scanning code will fail.

2. With the above assumption, it *is* possible (but not easy!) to scan 
backwards reliably.  The hard case is mb.ends_comment.  I'll be working on 
this asap.

3. If the g.MatchBrackets class is ever used for importing the import code 
will scan only in the forward direction, starting at a bracket that is 
known not to be inside a string, comment or regex.  Details can be omitted 
because the importer isn't likely to match brackets.

*Summary*

The match-brackets command now works better than ever before.  It handles 
javascript regexs and perl regexs and substitutions of the form /a/b/.  A 
localized change to mb.ends_comment should make the code reliable *assuming* 
that match-brackets is invoked outside strings, comments or regexs.

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