[OT] Rev + BBEdit
Mark Wieder
mwieder at ahsoftware.net
Mon Feb 16 12:53:22 EST 2009
Richard-
Monday, February 16, 2009, 9:21:26 AM, you wrote:
> I've broken the list into two parts; the ones here at the top could use
> more explanation to describe exactly what you're after - are they
> documented in BBEDit? If so I'll just look 'em up there:
Since I put these in, I'd probably better explain them...
> - folding conditionals
control- or right-click or something on an "if" statement
the visible code condenses the whole conditional to one line
click again to expand it
> - refactoring support
probably a plugin, but support for various refactoring methods:
creating a function from repeated code
eliminating dead code
converting script locals to handler locals
etc
> - conditional balancing
same idea as paren balancing:
for each "if", find the matching "end if"
for each "repeat" find the matching "end repeat"
etc
--------------------
As a bonus, here's how to implement macros:
-- just before setting the script to compile it...
put Preprocess(tScript) into tScript
set the script of object xyz to tScript
function Preprocess pScript
local tScript
local _tMacros
local _tCode
put pScript into tScript
set the custompropertyset of this stack to "uMacros"
put the customproperties["uMacros"] of this stack into _tMacros
put the keys of _tMacros into _tMacros
repeat for each line _tMacro in _tMacros
do "put the" && _tMacro && "of this stack into _tCode"
do _tCode
end repeat
set the custompropertyset of this stack to empty
return tScript
end Preprocess
the macros are then stored as custom properties of the stack.
--
-Mark Wieder
mwieder at ahsoftware.net
More information about the use-livecode
mailing list