Home Download Buy Blog Forum Support


Re: BracketHighlighter

Postby facelessuser on Sat Feb 08, 2014 10:29 pm

adamal wrote:Am I correct in assuming that this will not work with nested constructs? E.g.:

Probably will need to right a bh_plugin.

We have a proprietary language I have to use at work that is similar in this way:

for illustration
Code: Select all
def somefunction var1 var2
        if (somecondition)
            some more code;

So, I define my opening and closing brackets, and then sort out which opening matches to which closing by using a bh_plugin (do until is an exception):
def compare(name, first, second, bfr):
opening = bfr[first.begin:first.end].lower()
closing = bfr[second.begin:second.end].lower()
match = False
if opening == "do":
if closing == "until":
match = True
match = "e" + opening == closing
return match

Another example for handling case differences in PHP keywords:
https://github.com/facelessuser/Bracket ... eywords.py
Posts: 1446
Joined: Tue Apr 05, 2011 7:38 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 9 guests