Ну..
Если совсем будет плохо - наваяю чудовище на JS
PS: Из секретных источников стало известно, что DihlofozzZ & Destruction планируют открыть более масштабный проект по MMORPG.. Пока только планируют.
Добавлено:
NMY прикопался..
Code:
<html>
<head>
<title>Yoko Injection - CodeSweeper (c) Destruction</title>
<script type="text/javascript">
<!-- //
var space_count = 1;
var space_symbl = 0;
function CodeSweeper(){
var sc = document.getElementById( 'code' ).value.split( /[\r\n]+/ );
var i, j, offset = 0;
space_count = parseInt( document.getElementById( 'count' ).value, 10 );
space_symbl = document.getElementById( "is_tab" ).checked ? "\t" : " ";
var a1 = [ 'sub', 'if', 'repeat', 'else', 'for', 'while'/*, etc..*/ ];
var a2 = [ 'endsub', 'endif', 'end sub', 'end if', 'until', 'else', 'next', 'wend'/*, etc..*/ ];
for( i = 0; i < sc.length; i ++ ){
sc[ i ] = sc[ i ].replace( /^\s+/, '' );
for( j = 0; j < a2.length; j ++ ){
if( sc[ i ].toLowerCase().substr( 0, a2[ j ].length ) == a2[ j ] ){
--offset;
}
}
sc[ i ] = WriteSpace( offset ) + sc[ i ];
for( j = 0; j < a1.length; j ++ ){
if( sc[ i ].toLowerCase().substr( offset * space_count, a1[ j ].length ) == a1[ j ] ){
++offset;
}
}
}
document.getElementById( 'code' ).value = sc.join( '\r\n' );
return false;
}
function WriteSpace( num ){
var i, result = '';
for( i = 0; i < num * space_count; i ++ ){
result += space_symbl;
}
return result;
}
// -->
</script>
</head>
<body>
<textarea id="code" style="width: 100%; height: 90%;"></textarea>
<br />Кол-во: <input type="text" id="count" value="1" size="1" />, Тип: Пробел<input type="radio" name="type" value="0" /><input type="radio" name="type" value="1" checked id="is_tab" />Табуляция
<br /><input type="button" onclick="return CodeSweeper( )" value="Sweep my code please.." />
</body>
</html>
PS: Сохранить как .html и радоваться всегда доступному CodeSweeper
PPS:
http://nmy.id.lv/codesweeper.htm