Okay, so I got alternative regular expressions to work in the CLM for strings and comments. I still have a problem with functions.

-- Functions look like
function sqroot(x, guess)
        guess = guess or 2
        local dividend = x/guess
        if math.abs(guess - dividend)/guess < 1.0e-8
                return guess
        else
                return sqroot(x, (guess+dividend)/2)
        end
end

-- Or a function could be a member of a structure (in this case a table referenced by 'a':
function a.myFunction()
        -- ...
end

-- Or an object method:
function MyStruct:do_good_things(for_the_children)
        -- ...
end

The regular expression that works for me in Find is:
        (?s)^([ \t]*)function\s+(?P<function_name>[A-Za-z_:.]+).+?\r\1end\b

The intention is to match an end statement with the same leading whitespace as the function line.

But putting it into lua.plist (substituting &lt; and &gt; for < and >) does not populate the function popup.

If I remove the attempt to match indentation ( ([ \t]*) ... \1 ), the function popup will match all functions aligned at the left margin (and code folding works), but I regard this as an incomplete solution. The back-matching should work, it seems to me.

Again: what's up?

        — F


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to