Hello Scite-interest,
I bring to your attention the script.
I'm waiting for your offers and remarks.

> ===================================================
-- List of functions / procedures available in a code
-- mozers
-----------------------------------------------------

-- Patterns for different programming languages (correct and add)
-- Send your variants to <[EMAIL PROTECTED]>
local findRegExp = {
    ['cxx']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",
      ['h']="([^.,<>=\n]-[ :][^.,<>=\n%s]+[(][^.<>=)]-[)])[%s\/}]-%b{}",
    ['pas']="\nprocedure ([^(;]-)[;(].-\n%bb;"
}
local findPattern = findRegExp [props["FileExt"]]
if findPattern == nil then
-- Universal pattern for all other programming languages (tested on LUA, VB, 
VBS, JS)
    findPattern = "\n[SsFf][Uu][BbNn][^ ]* ([^(]*%b())"
end

-- Search pattern in the all text
output:ClearAll()
editor:MarkerDeleteAll(1)
local textAll = editor:GetText()
local startPos, endPos, findString
local count = 0
startPos = 1
print("> List of functions / procedures:")
while true do
    startPos, endPos, findString = string.find(textAll, findPattern, startPos)
    if startPos == nil then break end
    findString = string.gsub (findString, "\r\n", "")
    findString = string.gsub (findString, "%s+", " ")
    local style = editor.StyleAt[startPos]
    -- Add in list only uncommenting functions
    if not (style == 1 or style == 2) then
        local line = editor:LineFromPosition(startPos)
        editor:MarkerAdd(line,1)
        print(props['FileNameExt']..':'..(line+1)..':\t'..findString) 
    end
    count = count + 1
    startPos = endPos + 1
end
if count > 0 then
    trace("> Find: "..count.." functions / procedures\nDoubleClick at line with 
result will establish the cursor for an original line")
else
    trace("> Functions / procedures not found!")
end

-- 
mozers
<http://scite.ruteam.ru>

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to