diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-07-16 15:18:45 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-07-16 15:18:45 +0900 |
commit | d017bd37253ae35b29d82e3277b9adcbb4517dd0 (patch) | |
tree | d884d5cf71c4dd350d1abcf752c438e117a872d5 /indenters | |
parent | a0148cf62fc298126980a7dc27603b123e1d764c (diff) | |
download | universal-indent-gui-tqt-d017bd37253ae35b29d82e3277b9adcbb4517dd0.tar.gz universal-indent-gui-tqt-d017bd37253ae35b29d82e3277b9adcbb4517dd0.zip |
Convert files to unix format. Convert C++ header names to C header names.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'indenters')
-rwxr-xr-x | indenters/example.cbl | 116 | ||||
-rwxr-xr-x | indenters/example.cpp | 698 | ||||
-rwxr-xr-x | indenters/example.css | 544 | ||||
-rwxr-xr-x | indenters/example.f90 | 64 | ||||
-rwxr-xr-x | indenters/example.php | 6 | ||||
-rwxr-xr-x | indenters/example.pl | 108 | ||||
-rwxr-xr-x | indenters/example.py | 46 | ||||
-rwxr-xr-x | indenters/example.sql | 74 | ||||
-rwxr-xr-x | indenters/example.vb | 98 | ||||
-rwxr-xr-x | indenters/phpStylist.php | 2802 | ||||
-rwxr-xr-x | indenters/phpStylist.txt | 322 | ||||
-rwxr-xr-x | indenters/pindent.txt | 150 | ||||
-rwxr-xr-x | indenters/uigui_CblBeau.ini | 1086 | ||||
-rwxr-xr-x | indenters/uigui_jsppp.ini | 162 | ||||
-rwxr-xr-x | indenters/uigui_phpStylist.ini | 516 | ||||
-rwxr-xr-x | indenters/uigui_php_Beautifier.ini | 216 | ||||
-rwxr-xr-x | indenters/uigui_pindent.ini | 108 | ||||
-rwxr-xr-x | indenters/uigui_psti.ini | 392 | ||||
-rwxr-xr-x | indenters/uigui_rubyformatter.ini | 52 | ||||
-rwxr-xr-x | indenters/uigui_shellindent.ini | 34 | ||||
-rwxr-xr-x | indenters/uigui_tidy.ini | 1224 | ||||
-rwxr-xr-x | indenters/uigui_vbsbeaut.ini | 90 | ||||
-rwxr-xr-x | indenters/uigui_xmlindent.ini | 122 |
23 files changed, 4515 insertions, 4515 deletions
diff --git a/indenters/example.cbl b/indenters/example.cbl index eb5b1aa..8b12b04 100755 --- a/indenters/example.cbl +++ b/indenters/example.cbl @@ -1,59 +1,59 @@ -000000* An example illustrating the use of a programmer defined paragraphs
- * and perform-thru
- identification division.
- program-id. level88.
- author. kik.
- environment division.
- configuration section.
- special-names.
- console is crt
- decimal-point is comma.
- data division.
- working-storage section.
- 77 transaction-kode pic 99.
- 88 valid-kode value 4, 8 thru 15.
- 88 create value 10.
- 88 destroy value 15.
-
- procedure division.
- main section.
- *
- * Some code leading to "transacion-kode" getting a value
- *
-
- move 10 to transaction-kode.
-
-
- *
- * Testing the conditions
- *
-
- if valid-kode then
- if create then
- perform p-create thru p-create-end
- else
- if destroy then
- perform p-destroy thru p-destroy-end
- else
- perform ordinary-transaction
- thru ordinary-transaction-end.
-
- *
- p-create.
- * some creation code
- p-create-end.
- exit.
-
- p-destroy.
- * some destruction code
- p-destroy-end.
- exit.
-
- ordinary-transaction.
- * some ordinary data processing code
- ord-trns-1.
-
- ord-trns-2.
-
- ordinary-transaction-end.
+000000* An example illustrating the use of a programmer defined paragraphs
+ * and perform-thru
+ identification division.
+ program-id. level88.
+ author. kik.
+ environment division.
+ configuration section.
+ special-names.
+ console is crt
+ decimal-point is comma.
+ data division.
+ working-storage section.
+ 77 transaction-kode pic 99.
+ 88 valid-kode value 4, 8 thru 15.
+ 88 create value 10.
+ 88 destroy value 15.
+
+ procedure division.
+ main section.
+ *
+ * Some code leading to "transacion-kode" getting a value
+ *
+
+ move 10 to transaction-kode.
+
+
+ *
+ * Testing the conditions
+ *
+
+ if valid-kode then
+ if create then
+ perform p-create thru p-create-end
+ else
+ if destroy then
+ perform p-destroy thru p-destroy-end
+ else
+ perform ordinary-transaction
+ thru ordinary-transaction-end.
+
+ *
+ p-create.
+ * some creation code
+ p-create-end.
+ exit.
+
+ p-destroy.
+ * some destruction code
+ p-destroy-end.
+ exit.
+
+ ordinary-transaction.
+ * some ordinary data processing code
+ ord-trns-1.
+
+ ord-trns-2.
+
+ ordinary-transaction-end.
exit.
\ No newline at end of file diff --git a/indenters/example.cpp b/indenters/example.cpp index f9b099c..44e6a80 100755 --- a/indenters/example.cpp +++ b/indenters/example.cpp @@ -1,349 +1,349 @@ -#include <a.h>
-#include <a.h>
-#include <a.h>
-
-using namespace a.b.c a;
-
-PREPROCESSOR()
-
-BEGIN_MESSAGE_MAP()
- ON_COMMAND()
-END_MESSAGE_MAP()
-
-extern struct x y;
-
-static const class Example :
- Int1, Int2, Int3
-{
-public:
- Example::~Example() :
- S1(),
- S2(),
- S3() {
- // if statements with empty braces
- if( x ) { }
- else if( x ) { }
- else { }
-
- // if statements with exactly one braced statement
- if( x ) {
- statement;
- }
- else if( x ) {
- statement;
- }
- else {
- statement;
- }
-
- // special 'if' cases
- if( x ) {
- statement;
- }
- else {
- statement;
- }
-
- if( x ) {
- statement;
-
- statement;
- }
- else {
- statement;
-
- statement;
- }
-
- // if statements with a single implicit substatement
- if( x )
- statement;
-
- else if( x )
- statement;
-
- else
- statement;
-
- // if statements with multiple statements
- if( x ) {
- statement;
-
- statement;
- }
- else if( x ) {
- statement;
-
- statement;
- }
- else {
- statement;
-
- statement;
- }
-
- // while statements with a single implicit substatement
- while( x )
- statement;
-
- // while statements with a single implicit 'if' substatement
- while( x )
- if( x )
- statement;
-
- // while with multiple statements
- while( x ) {
- statement;
-
- statement;
- }
-
- // labeled statement
- label:
- statement;
-
- // for statements with a single braced statement
- for ( x; x; x ) {
- statement;
- }
-
- // do statements with a single braced substatement
- do {
- statement;
- } while ( false );
-
- // do statement with an empty block
- do { } while ( x );
-
- // local blocks
- {
- statement;
- }
-
- /* Switch blocks:
- *
- * You can have case substatements be aligned by giving an example like:
- *
- * case 1: statement;
- *
- * statement;
- *
- * statement;
- *
- * etc...
- */
- switch( c ) {
- case 1:
- case 2:
- case 3:
- statement;
-
- statement;
-
- statement;
-
- case 4:
- break; // case with exactly one substatement
-
- default:
- break;
- }
- }
-
- void method( const myClass<item> &x, int [][][] c, ... ) {
- // try-catch-finally with empty bodies
- try { }
- catch(Throwable e) { }
- finally { }
-
- // try-catch-finally with exactly one statement
- try {
- statement;
- }
- catch( Throwable t ) {
- statement;
- }
- finally {
- statement;
- }
-
- // try-catch-finally with multiple statements
- try {
- statement;
-
- statement;
- }
- catch( Throwable e ) {
- statement;
-
- statement;
- }
- finally {
- statement;
-
- statement;
-
- statement;
- }
- }
-};
-
-// enum statement
-static typedef enum x
-{
-x,
-y,
-z,
-};
-
-// simple typedef
-typedef interface static short int x;
-
-namespace x
-{
-// template header
-template <class T>
-x y z v() const;
-
-// pure virtual function, using c-style formal parameters with double parens
-void v(()) = 0;
-
-// function with one single line statement and c-style formal parameters
-void v(( int i )) {
- statement;
-};
-
-// function with no statements
-myClass<myType>::method() { }
-};
-
-template <T> class x
-{
-public:
-
- // operator declarations
- int operator +();
-
- int operator []();
-
- // template method
- static void A<x>::method() [][][] {
- asm
- {
- - Assembler statements -
-
- The outside braces are formatted but the asm code is passed through
- unchanged.
- }
-
- asm Single line assembler statements are also just passed through
- }
-
- extern void oldStyleFunction()
- int a;
- int b;
- int c; {
- // various simple statements
- long int a, b, c;
-
- long double [] i;
-
- goto x;
-
- delete [] x;
-
- delete [][][] x;
-
- return x;
-
- continue label;
-
- throw e;
-
- // c-style function calls with double parens
- b((a, b, c));
-
- a(());
-
- // expressions
- new Object()->field.method();
-
- s = "string"
- "split across lines";
-
- method(a, B::C, 'd');
-
- z = j[0][0][0] || k * 3 >> ++i + "0" > i++ & (i) == !j;
-
- int *v;
-
- int &v;
-
- x = x * *x;
-
- (int *)x;
-
- int (*functionPointer)( x, y, z );
-
- h[0] += a ? b : ((int)c).d;
-
- new Handler();
- }
-} a, b, c; // struct instances
-
-class Class2
-{
-/* Array creation with multiple non-array elements.
- *
- * If you give this example with the elements on the same line, then
- * Polystyle will automatically vertically align them into a grid when it
- * fits your code to the page. An alternate style is to have each
- * element on its own line, like this:
- * {
- * x,
- * y
- * z
- * }
- */
-boolean *bools1 =
- {
- x, y, z
- };
-
-// array creation with a single element
-boolean bools2 = { x };
-
-// array creation with no elements
-boolean bools3 = { };
-
-// multidimensional array creation
-const int *** array =
- {
- { 1, 2, 3 },
- { 1, 2, 3 },
- { 1, 2, 3 },
- };
-};
-
-#if x
-
-#define x
-
-#elif a
-
-#define x
-
-#else
-
-#define x
-
-#define x
-
-#define x
-
-#endif
-
-// see if multi line macros are safely handled:
-#define multilinemacro do { x= x+5; } while (0); \
-printf("a multilinemacro"); \
-printf("a multilinemacro2");
+#include <a.h> +#include <a.h> +#include <a.h> + +using namespace a.b.c a; + +PREPROCESSOR() + +BEGIN_MESSAGE_MAP() + ON_COMMAND() +END_MESSAGE_MAP() + +extern struct x y; + +static const class Example : + Int1, Int2, Int3 +{ +public: + Example::~Example() : + S1(), + S2(), + S3() { + // if statements with empty braces + if( x ) { } + else if( x ) { } + else { } + + // if statements with exactly one braced statement + if( x ) { + statement; + } + else if( x ) { + statement; + } + else { + statement; + } + + // special 'if' cases + if( x ) { + statement; + } + else { + statement; + } + + if( x ) { + statement; + + statement; + } + else { + statement; + + statement; + } + + // if statements with a single implicit substatement + if( x ) + statement; + + else if( x ) + statement; + + else + statement; + + // if statements with multiple statements + if( x ) { + statement; + + statement; + } + else if( x ) { + statement; + + statement; + } + else { + statement; + + statement; + } + + // while statements with a single implicit substatement + while( x ) + statement; + + // while statements with a single implicit 'if' substatement + while( x ) + if( x ) + statement; + + // while with multiple statements + while( x ) { + statement; + + statement; + } + + // labeled statement + label: + statement; + + // for statements with a single braced statement + for ( x; x; x ) { + statement; + } + + // do statements with a single braced substatement + do { + statement; + } while ( false ); + + // do statement with an empty block + do { } while ( x ); + + // local blocks + { + statement; + } + + /* Switch blocks: + * + * You can have case substatements be aligned by giving an example like: + * + * case 1: statement; + * + * statement; + * + * statement; + * + * etc... + */ + switch( c ) { + case 1: + case 2: + case 3: + statement; + + statement; + + statement; + + case 4: + break; // case with exactly one substatement + + default: + break; + } + } + + void method( const myClass<item> &x, int [][][] c, ... ) { + // try-catch-finally with empty bodies + try { } + catch(Throwable e) { } + finally { } + + // try-catch-finally with exactly one statement + try { + statement; + } + catch( Throwable t ) { + statement; + } + finally { + statement; + } + + // try-catch-finally with multiple statements + try { + statement; + + statement; + } + catch( Throwable e ) { + statement; + + statement; + } + finally { + statement; + + statement; + + statement; + } + } +}; + +// enum statement +static typedef enum x +{ +x, +y, +z, +}; + +// simple typedef +typedef interface static short int x; + +namespace x +{ +// template header +template <class T> +x y z v() const; + +// pure virtual function, using c-style formal parameters with double parens +void v(()) = 0; + +// function with one single line statement and c-style formal parameters +void v(( int i )) { + statement; +}; + +// function with no statements +myClass<myType>::method() { } +}; + +template <T> class x +{ +public: + + // operator declarations + int operator +(); + + int operator [](); + + // template method + static void A<x>::method() [][][] { + asm + { + - Assembler statements - + + The outside braces are formatted but the asm code is passed through + unchanged. + } + + asm Single line assembler statements are also just passed through + } + + extern void oldStyleFunction() + int a; + int b; + int c; { + // various simple statements + long int a, b, c; + + long double [] i; + + goto x; + + delete [] x; + + delete [][][] x; + + return x; + + continue label; + + throw e; + + // c-style function calls with double parens + b((a, b, c)); + + a(()); + + // expressions + new Object()->field.method(); + + s = "string" + "split across lines"; + + method(a, B::C, 'd'); + + z = j[0][0][0] || k * 3 >> ++i + "0" > i++ & (i) == !j; + + int *v; + + int &v; + + x = x * *x; + + (int *)x; + + int (*functionPointer)( x, y, z ); + + h[0] += a ? b : ((int)c).d; + + new Handler(); + } +} a, b, c; // struct instances + +class Class2 +{ +/* Array creation with multiple non-array elements. + * + * If you give this example with the elements on the same line, then + * Polystyle will automatically vertically align them into a grid when it + * fits your code to the page. An alternate style is to have each + * element on its own line, like this: + * { + * x, + * y + * z + * } + */ +boolean *bools1 = + { + x, y, z + }; + +// array creation with a single element +boolean bools2 = { x }; + +// array creation with no elements +boolean bools3 = { }; + +// multidimensional array creation +const int *** array = + { + { 1, 2, 3 }, + { 1, 2, 3 }, + { 1, 2, 3 }, + }; +}; + +#if x + +#define x + +#elif a + +#define x + +#else + +#define x + +#define x + +#define x + +#endif + +// see if multi line macros are safely handled: +#define multilinemacro do { x= x+5; } while (0); \ +printf("a multilinemacro"); \ +printf("a multilinemacro2"); diff --git a/indenters/example.css b/indenters/example.css index 09b5ecf..438f8ab 100755 --- a/indenters/example.css +++ b/indenters/example.css @@ -1,272 +1,272 @@ -/* General
-/*******************************/
-body
-{
- font-size: Small;
- margin: 30px 0 20px 0;
- background: url(images/background.jpg);
-}
-
-span
-{
- font-family: Tahoma,serif;
-}
-
-/* Page
-/*******************************/
-#page
-{
- width: 808px;
- margin: 0 auto;
- position: relative;
-
-}
-
-/* Links general
-/*******************************/
-a
-{
- color: #36b;
-}
-
-a:link { text-decoration:none; }
-a:visited { text-decoration:none; }
-a:active { text-decoration:none; }
-a:focus { text-decoration:none; }
-a:hover { text-decoration:underline; }
-
-/* Links external
-/*******************************/
-a.external
-{
- background: url("images/externallinks.png") center right no-repeat;
- padding-right: 13px;
-}
-
-/* Header
-/*******************************/
-#header
-{
- float: left;
- width: 800px;
- height: 171px;
- background-image: url(images/banner.jpg);
- background-repeat: no-repeat;
- background-position: left bottom;
- padding-left: 20px;
-}
-
-/* Tabs
-/*******************************/
-#tabs
-{
-}
-
-#tabs ul
-{
- list-style: none;
- display: inline;
-}
-
-#tabs li
-{
- width: 125px;
- float: left;
- background-image: url(images/tab3.jpg);
- background-repeat: no-repeat;
- background-position: center top;
- text-align: center;
-}
-
-#tabs li a
-{
- font-family: sans-serif;
- font-size: 100%;
- font-weight: normal;
- color: black;
- height: 28px;
- padding: 21px 0 0 0;
- display: block;
-}
-
-#tabs li a:link { text-decoration:none; }
-#tabs li a:visited { text-decoration:none; }
-#tabs li a:active { text-decoration:none; }
-#tabs li a:focus { text-decoration:none; }
-#tabs li a:hover
-{
- width: 125px;
- float: left;
- background-image: url(images/tab3hover.jpg);
- background-repeat: no-repeat;
- background-position: center top;
- text-align: center;
-}
-
-#tabs #current
-{
- background-image: url(images/tab3_selected.jpg);
- background-repeat: no-repeat;
- background-position: center top;
- margin-top: -5px;
-}
-
-#tabs #current a
-{
- background-image: url(images/tab3_selected.jpg);
- background-repeat: no-repeat;
- background-position: center top;
- padding: 27px 0;
- height: 17px;
- font-weight: bold;
-}
-
-/* Main
-*******************************/
-#main
-{
- background-image: url(images/page_middle.png);
- background-repeat: repeat-y;
- float: left;
-}
-
-/* Content
-/*******************************/
-#content
-{
- padding: 22px;
- margin: 0;
- width: 541px;
- float: left;
-}
-
-#content h1, h2, h3, h4, h5, h6, h7, #content h2 a
-{
- font-family: Tahoma,serif;
- margin-bottom: 10px;
- margin-top: 10px;
-}
-
-#content h1
-{
- font-size: x-large;
-}
-
-#content h2
-{
- font-size: large;
-}
-
-#content p, #content ul, #content a, #content ol
-{
- margin-top: 10px;
- font-family: verdana, sans-serif;
-}
-
-/* Progress
-/*******************************/
-.progressframe
-{
- border: 1px black solid;
- width: 100%;
-}
-
-.progress
-{
- font-family: Tahoma,serif;
- font-weight: bold;
- /*padding-left: 10px;*/
- background-color: red;
- color: white;
-}
-
-.p0 { width: 0%; color: black; background-color: white; }
-.p5 { width: 5%; background-color: rgb(240,16,0); }
-.p10 { width: 10%; background-color: rgb(240,32,0); }
-.p15 { width: 15%; background-color: rgb(240,48,0); }
-.p20 { width: 20%; background-color: rgb(240,64,0); }
-.p25 { width: 25%; background-color: rgb(240,80,0); }
-.p30 { width: 30%; background-color: rgb(240,80,0); }
-.p35 { width: 35%; background-color: rgb(240,96,0); }
-.p40 { width: 40%; background-color: rgb(240,96,0); }
-.p45 { width: 45%; background-color: rgb(240,112,0); }
-.p50 { width: 50%; background-color: rgb(240,112,0); }
-.p55 { width: 55%; background-color: rgb(224,128,0); }
-.p60 { width: 60%; background-color: rgb(208,144,0); }
-.p65 { width: 65%; background-color: rgb(192,160,0); }
-.p70 { width: 70%; background-color: rgb(176,176,0); }
-.p75 { width: 75%; background-color: rgb(176,176,0); }
-.p80 { width: 80%; background-color: rgb(160,192,0); }
-.p85 { width: 85%; background-color: rgb(160,192,0); }
-.p90 { width: 90%; background-color: rgb(144,208,0); }
-.p95 { width: 95%; background-color: rgb(144,208,0); }
-.p100 { width: 100%; background-color: green; }
-
-/* Sidebar
-/*******************************/
-#sidebar
-{
- margin: 0;
- padding: 10px;
- width: 195px;
- font-family: verdana, sans-serif;
- float: right;
-}
-
-#sidebar a
-{
- border : none;
-}
-
-#sidebar a:link { text-decoration:none; }
-#sidebar a:visited { text-decoration:none; }
-#sidebar a:active { text-decoration:none; }
-#sidebar a:focus { text-decoration:none; }
-#sidebar a:hover { text-decoration:underline; }
-
-#sidebar a img
-{
- border : none;
-}
-
-#sidebar h1
-{
- font-size: 10pt;
- font-weight: bold;
- margin-bottom: 0;
-}
-
-#sidebar ul
-{
- vertical-align: middle;
-}
-
-#sidebar li
-{
- list-style-image: url(images/icon_page.gif);
-}
-
-
-/* Footer
-/*******************************/
-#footer
-{
- font-family: verdana, sans-serif;
- background: url(images/page_bottom.png);
- font-size: x-small;
- font-weight: bold;
- color: #CCCCCC;
- height: 44px;
- width: 800px;
- clear: both;
-}
-
-#footer p
-{
- padding: 0px 0 0 20px;
-}
-
-#footer a
-{
- color: #CCE0F5;
-}
+/* General +/*******************************/ +body +{ + font-size: Small; + margin: 30px 0 20px 0; + background: url(images/background.jpg); +} + +span +{ + font-family: Tahoma,serif; +} + +/* Page +/*******************************/ +#page +{ + width: 808px; + margin: 0 auto; + position: relative; + +} + +/* Links general +/*******************************/ +a +{ + color: #36b; +} + +a:link { text-decoration:none; } +a:visited { text-decoration:none; } +a:active { text-decoration:none; } +a:focus { text-decoration:none; } +a:hover { text-decoration:underline; } + +/* Links external +/*******************************/ +a.external +{ + background: url("images/externallinks.png") center right no-repeat; + padding-right: 13px; +} + +/* Header +/*******************************/ +#header +{ + float: left; + width: 800px; + height: 171px; + background-image: url(images/banner.jpg); + background-repeat: no-repeat; + background-position: left bottom; + padding-left: 20px; +} + +/* Tabs +/*******************************/ +#tabs +{ +} + +#tabs ul +{ + list-style: none; + display: inline; +} + +#tabs li +{ + width: 125px; + float: left; + background-image: url(images/tab3.jpg); + background-repeat: no-repeat; + background-position: center top; + text-align: center; +} + +#tabs li a +{ + font-family: sans-serif; + font-size: 100%; + font-weight: normal; + color: black; + height: 28px; + padding: 21px 0 0 0; + display: block; +} + +#tabs li a:link { text-decoration:none; } +#tabs li a:visited { text-decoration:none; } +#tabs li a:active { text-decoration:none; } +#tabs li a:focus { text-decoration:none; } +#tabs li a:hover +{ + width: 125px; + float: left; + background-image: url(images/tab3hover.jpg); + background-repeat: no-repeat; + background-position: center top; + text-align: center; +} + +#tabs #current +{ + background-image: url(images/tab3_selected.jpg); + background-repeat: no-repeat; + background-position: center top; + margin-top: -5px; +} + +#tabs #current a +{ + background-image: url(images/tab3_selected.jpg); + background-repeat: no-repeat; + background-position: center top; + padding: 27px 0; + height: 17px; + font-weight: bold; +} + +/* Main +*******************************/ +#main +{ + background-image: url(images/page_middle.png); + background-repeat: repeat-y; + float: left; +} + +/* Content +/*******************************/ +#content +{ + padding: 22px; + margin: 0; + width: 541px; + float: left; +} + +#content h1, h2, h3, h4, h5, h6, h7, #content h2 a +{ + font-family: Tahoma,serif; + margin-bottom: 10px; + margin-top: 10px; +} + +#content h1 +{ + font-size: x-large; +} + +#content h2 +{ + font-size: large; +} + +#content p, #content ul, #content a, #content ol +{ + margin-top: 10px; + font-family: verdana, sans-serif; +} + +/* Progress +/*******************************/ +.progressframe +{ + border: 1px black solid; + width: 100%; +} + +.progress +{ + font-family: Tahoma,serif; + font-weight: bold; + /*padding-left: 10px;*/ + background-color: red; + color: white; +} + +.p0 { width: 0%; color: black; background-color: white; } +.p5 { width: 5%; background-color: rgb(240,16,0); } +.p10 { width: 10%; background-color: rgb(240,32,0); } +.p15 { width: 15%; background-color: rgb(240,48,0); } +.p20 { width: 20%; background-color: rgb(240,64,0); } +.p25 { width: 25%; background-color: rgb(240,80,0); } +.p30 { width: 30%; background-color: rgb(240,80,0); } +.p35 { width: 35%; background-color: rgb(240,96,0); } +.p40 { width: 40%; background-color: rgb(240,96,0); } +.p45 { width: 45%; background-color: rgb(240,112,0); } +.p50 { width: 50%; background-color: rgb(240,112,0); } +.p55 { width: 55%; background-color: rgb(224,128,0); } +.p60 { width: 60%; background-color: rgb(208,144,0); } +.p65 { width: 65%; background-color: rgb(192,160,0); } +.p70 { width: 70%; background-color: rgb(176,176,0); } +.p75 { width: 75%; background-color: rgb(176,176,0); } +.p80 { width: 80%; background-color: rgb(160,192,0); } +.p85 { width: 85%; background-color: rgb(160,192,0); } +.p90 { width: 90%; background-color: rgb(144,208,0); } +.p95 { width: 95%; background-color: rgb(144,208,0); } +.p100 { width: 100%; background-color: green; } + +/* Sidebar +/*******************************/ +#sidebar +{ + margin: 0; + padding: 10px; + width: 195px; + font-family: verdana, sans-serif; + float: right; +} + +#sidebar a +{ + border : none; +} + +#sidebar a:link { text-decoration:none; } +#sidebar a:visited { text-decoration:none; } +#sidebar a:active { text-decoration:none; } +#sidebar a:focus { text-decoration:none; } +#sidebar a:hover { text-decoration:underline; } + +#sidebar a img +{ + border : none; +} + +#sidebar h1 +{ + font-size: 10pt; + font-weight: bold; + margin-bottom: 0; +} + +#sidebar ul +{ + vertical-align: middle; +} + +#sidebar li +{ + list-style-image: url(images/icon_page.gif); +} + + +/* Footer +/*******************************/ +#footer +{ + font-family: verdana, sans-serif; + background: url(images/page_bottom.png); + font-size: x-small; + font-weight: bold; + color: #CCCCCC; + height: 44px; + width: 800px; + clear: both; +} + +#footer p +{ + padding: 0px 0 0 20px; +} + +#footer a +{ + color: #CCE0F5; +} diff --git a/indenters/example.f90 b/indenters/example.f90 index f2aae7d..8131b8b 100755 --- a/indenters/example.f90 +++ b/indenters/example.f90 @@ -1,33 +1,33 @@ -module module1
-! Identity of a utility
-! ____________________________________________________________________
- character (len=*), parameter :: xyz = &
-"I am just a more or less long string."
- character (len=*), parameter :: zhlp = '( &
-&"This program is free software; you can redistribute it and/or modify"/&
-&"____________________________________________________________________")'
-integer:: n
-contains
-
-recursive subroutine sub1(x)
-integer,intent(inout):: x
-integer:: y
-y=0
-if (x<n) then
- x= x + 1
- y =x**2
- print *, 'x = ', x,', y = ', y
- call sub1(x)
- print *, 'x = ', x,', y = ', y
-end if
-end subroutine sub1
-
-end module module1
-
-program main
-use module1
-integer:: x = 0
-print *, 'Enter number of repeats'
-read (*,*) n
-call sub1(x)
+module module1
+! Identity of a utility +! ____________________________________________________________________
+ character (len=*), parameter :: xyz = & +"I am just a more or less long string."
+ character (len=*), parameter :: zhlp = '( &
+&"This program is free software; you can redistribute it and/or modify"/&
+&"____________________________________________________________________")'
+integer:: n +contains + +recursive subroutine sub1(x) +integer,intent(inout):: x +integer:: y +y=0 +if (x<n) then + x= x + 1 + y =x**2 + print *, 'x = ', x,', y = ', y + call sub1(x) + print *, 'x = ', x,', y = ', y +end if +end subroutine sub1 + +end module module1 + +program main +use module1 +integer:: x = 0 +print *, 'Enter number of repeats' +read (*,*) n +call sub1(x) end program main
\ No newline at end of file diff --git a/indenters/example.php b/indenters/example.php index 0aa1676..5817e49 100755 --- a/indenters/example.php +++ b/indenters/example.php @@ -1,4 +1,4 @@ -<?php
-if($code == BAD){$action = REWRITE;}else{$action = KEEP;}
-for($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10;}}}
+<?php +if($code == BAD){$action = REWRITE;}else{$action = KEEP;} +for($i=0; $i<10;$i++){while($j>0){$j++;doCall($i+$j);if($k){$k/=10;}}} ?>
\ No newline at end of file diff --git a/indenters/example.pl b/indenters/example.pl index 5266ab3..1323bfc 100755 --- a/indenters/example.pl +++ b/indenters/example.pl @@ -1,55 +1,55 @@ -print "Help Desk -- What Editor do you use?";
-chomp($editor = <STDIN>);
-if ($editor =~ /emacs/i) {
- print "Why aren't you using vi?\n";
-} elsif ($editor =~ /vi/i) {
- print "Why aren't you using emacs?\n";
-} else {
- print "I think that's the problem\n";
-}
-
-{
- L9140:
- if ($msccom::obj==$msccom::food) {
- goto L8142;
- }
- if ($msccom::obj==$msccom::bird||$msccom::obj==$msccom::snake||$msccom::obj==$msccom::clam||$msccom::obj==$msccom::oyster||$msccom::obj==$msccom::dwarf||$msccom::obj==$msccom::dragon||$msccom::obj==$msccom::troll||$msccom::obj==$msccom::bear) {
- $msccom::spk=71;
- }
- goto L2011;
- #
- # DRINK. IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE. IF WATER IS
- # THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM.
- #
- L9150:
- if ($msccom::obj==0&&$liqloc->($placom::loc)!=$msccom::water&&($liq->(0)!=$msccom::water||!$here->($msccom::bottle))) {
- goto L8000;
- }
- if ($msccom::obj!=0&&$msccom::obj!=$msccom::water) {
- $msccom::spk=110;
- }
- if ($msccom::spk==110||$liq->(0)!=$msccom::water||!$here->($msccom::bottle)) {
- goto L2011;
- }
- $placom::prop->($msccom::bottle)=1;
- $placom::place->($msccom::water)=0;
- $msccom::spk=74;
- goto L2011;
- #
- # RUB. YIELDS VARIOUS SNIDE REMARKS.
- #
- L9160:
- if ($msccom::obj!=$placom::lamp) {
- $msccom::spk=76;
- }
- goto L2011;
- #
- # THROW. SAME AS DISCARD UNLESS AXE. THEN SAME AS ATTACK EXCEPT IGNOR
- # AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED. (ONLY WAY TO DO SO
- # AXE ALSO SPECIAL FOR DRAGON, BEAR, AND TROLL. TREASURES SPECIAL FOR
- #
- L9170:
- if ($toting->($msccom::rod2)&&$msccom::obj==$msccom::rod&&!$toting->($msccom::rod)) {
- $msccom::obj=$msccom::rod2;
- }
+print "Help Desk -- What Editor do you use?";
+chomp($editor = <STDIN>);
+if ($editor =~ /emacs/i) {
+ print "Why aren't you using vi?\n";
+} elsif ($editor =~ /vi/i) {
+ print "Why aren't you using emacs?\n";
+} else {
+ print "I think that's the problem\n";
+}
+
+{ + L9140: + if ($msccom::obj==$msccom::food) { + goto L8142; + } + if ($msccom::obj==$msccom::bird||$msccom::obj==$msccom::snake||$msccom::obj==$msccom::clam||$msccom::obj==$msccom::oyster||$msccom::obj==$msccom::dwarf||$msccom::obj==$msccom::dragon||$msccom::obj==$msccom::troll||$msccom::obj==$msccom::bear) { + $msccom::spk=71; + } + goto L2011; + # + # DRINK. IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE. IF WATER IS + # THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM. + # + L9150: + if ($msccom::obj==0&&$liqloc->($placom::loc)!=$msccom::water&&($liq->(0)!=$msccom::water||!$here->($msccom::bottle))) { + goto L8000; + } + if ($msccom::obj!=0&&$msccom::obj!=$msccom::water) { + $msccom::spk=110; + } + if ($msccom::spk==110||$liq->(0)!=$msccom::water||!$here->($msccom::bottle)) { + goto L2011; + } + $placom::prop->($msccom::bottle)=1; + $placom::place->($msccom::water)=0; + $msccom::spk=74; + goto L2011; + # + # RUB. YIELDS VARIOUS SNIDE REMARKS. + # + L9160: + if ($msccom::obj!=$placom::lamp) { + $msccom::spk=76; + } + goto L2011; + # + # THROW. SAME AS DISCARD UNLESS AXE. THEN SAME AS ATTACK EXCEPT IGNOR + # AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED. (ONLY WAY TO DO SO + # AXE ALSO SPECIAL FOR DRAGON, BEAR, AND TROLL. TREASURES SPECIAL FOR + # + L9170: + if ($toting->($msccom::rod2)&&$msccom::obj==$msccom::rod&&!$toting->($msccom::rod)) { + $msccom::obj=$msccom::rod2; + } }
\ No newline at end of file diff --git a/indenters/example.py b/indenters/example.py index d6525aa..a975cb2 100755 --- a/indenters/example.py +++ b/indenters/example.py @@ -1,23 +1,23 @@ -#! /usr/bin/env python
-"Replace CRLF with LF in argument files. Print names of changed files."
-
-import sys, os
-
-def main():
- for filename in sys.argv[1:]:
- if os.path.isdir(filename):
- print filename, "Directory!"
- continue
- data = open(filename, "rb").read()
- if '\0' in data:
- print filename, "Binary!"
- continue
- newdata = data.replace("\r\n", "\n")
- if newdata != data:
- print filename
- f = open(filename, "wb")
- f.write(newdata)
- f.close()
-
-if __name__ == '__main__':
- main()
+#! /usr/bin/env python +"Replace CRLF with LF in argument files. Print names of changed files." + +import sys, os + +def main(): + for filename in sys.argv[1:]: + if os.path.isdir(filename): + print filename, "Directory!" + continue + data = open(filename, "rb").read() + if '\0' in data: + print filename, "Binary!" + continue + newdata = data.replace("\r\n", "\n") + if newdata != data: + print filename + f = open(filename, "wb") + f.write(newdata) + f.close() + +if __name__ == '__main__': + main() diff --git a/indenters/example.sql b/indenters/example.sql index b7736b5..077eeb8 100755 --- a/indenters/example.sql +++ b/indenters/example.sql @@ -1,37 +1,37 @@ -CREATE PACKAGE BODY b IS
-
-PROCEDURE proc1 IS
-BEGIN
-IF 7 <> 5 THEN
-FOR rec IN (SELECT * FROM dual
- WHERE g = 5) LOOP
-NULL;
-END LOOP;
- END IF;
-END;
-
-PROCEDURE recurse IS
- b number:=5;
- d456 number:=456;
-BEGIN
- recurse;
- proc1;
- a := (a + 1
- +4
- + 5
- + 8);
- c := f + 4 + 34;
- total := earth +sky;
-
- --this is comment
-
- uk:=h;
- g:=l;
- exception
- when no_data then
- hello;
- END;
-
- BEGIN
- NULL;
-END;
+CREATE PACKAGE BODY b IS + +PROCEDURE proc1 IS +BEGIN +IF 7 <> 5 THEN +FOR rec IN (SELECT * FROM dual + WHERE g = 5) LOOP +NULL; +END LOOP; + END IF; +END; + +PROCEDURE recurse IS + b number:=5; + d456 number:=456; +BEGIN + recurse; + proc1; + a := (a + 1 + +4 + + 5 + + 8); + c := f + 4 + 34; + total := earth +sky; + + --this is comment + + uk:=h; + g:=l; + exception + when no_data then + hello; + END; + + BEGIN + NULL; +END; diff --git a/indenters/example.vb b/indenters/example.vb index 2ecbdc0..94adf39 100755 --- a/indenters/example.vb +++ b/indenters/example.vb @@ -1,50 +1,50 @@ -Dim docRoot As New ChilkatXml
-
-Dim success As Long
-
-docRoot.Tag = "myDoc"
-
-' To zip compress the content, set this flag to 1
-Dim zipContent As Long
-zipContent = 0
-' To 128-bit AES encrypt the content, set this flag to 1
-Dim encryptContent As Long
-encryptContent = 0
-Dim encryptPassword As String
-encryptPassword = ""
-
-Dim pdfNode As ChilkatXml
-
-Set pdfNode = docRoot.NewChild("pdf","")
-
-' Embed a PDF into XML
-success = pdfNode.SetBinaryContentFromFile("sample.pdf",zipContent,encryptContent,encryptPassword)
-If (success <> 1) Then
- MsgBox pdfNode.LastErrorText
-
- Exit Sub
-End If
-
-MsgBox pdfNode.LastErrorText
-
-' Display the entire XML document:
-Text1.Text = Text1.Text & docRoot.GetXml() & vbCrLf
-
-' Get the Base64-encoded content and display it:
-Text1.Text = Text1.Text & pdfNode.Content & vbCrLf
-
-' Extract the binary content from XML:
-Dim unzipContent As Long
-unzipContent = 0
-Dim decryptContent As Long
-decryptContent = 0
-Dim decryptPassword As String
-decryptPassword = ""
-success = pdfNode.SaveBinaryContent("out.pdf",unzipContent,decryptContent,decryptPassword)
-If (success <> 1) Then
- MsgBox pdfNode.LastErrorText
-
- Exit Sub
-End If
-
+Dim docRoot As New ChilkatXml + +Dim success As Long + +docRoot.Tag = "myDoc" + +' To zip compress the content, set this flag to 1 +Dim zipContent As Long +zipContent = 0 +' To 128-bit AES encrypt the content, set this flag to 1 +Dim encryptContent As Long +encryptContent = 0 +Dim encryptPassword As String +encryptPassword = "" + +Dim pdfNode As ChilkatXml + +Set pdfNode = docRoot.NewChild("pdf","") + +' Embed a PDF into XML +success = pdfNode.SetBinaryContentFromFile("sample.pdf",zipContent,encryptContent,encryptPassword) +If (success <> 1) Then + MsgBox pdfNode.LastErrorText + + Exit Sub +End If + +MsgBox pdfNode.LastErrorText + +' Display the entire XML document: +Text1.Text = Text1.Text & docRoot.GetXml() & vbCrLf + +' Get the Base64-encoded content and display it: +Text1.Text = Text1.Text & pdfNode.Content & vbCrLf + +' Extract the binary content from XML: +Dim unzipContent As Long +unzipContent = 0 +Dim decryptContent As Long +decryptContent = 0 +Dim decryptPassword As String +decryptPassword = "" +success = pdfNode.SaveBinaryContent("out.pdf",unzipContent,decryptContent,decryptPassword) +If (success <> 1) Then + MsgBox pdfNode.LastErrorText + + Exit Sub +End If + MsgBox "Success!"
\ No newline at end of file diff --git a/indenters/phpStylist.php b/indenters/phpStylist.php index 59099cd..4c8cbaf 100755 --- a/indenters/phpStylist.php +++ b/indenters/phpStylist.php @@ -1,1401 +1,1401 @@ -<?php
-/*****************************************************************************
- * The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
- * Version 1.1 ("License"); You may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * http://opensource.org/licenses/rpl.php. Software distributed under the
- * License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
- * either express or implied.
- *
- * @author: Mr. Milk (aka Marcelo Leite)
- * @email: mrmilk@anysoft.com.br
- * @version: 0.9 beta
- * @date: 2007-07-07
- *
- *****************************************************************************/
-if (isDownload()) {
- downloadFile();
-} elseif(isCommandLine()) {
- processBatch();
-}?>
-<html>
- <head>
- <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
- <script>
- var menus = [
- [ "Indentation and General Formatting", "", [
- [ "indent_size", " characters per indentation level" ],
- [ "indent_with_tabs", "Indent with tabs instead of spaces" ],
- [ "keep_redundant_lines", "Keep redundant lines" ],
- [ "space_inside_parentheses", "Space inside parentheses" ],
- [ "space_outside_parentheses", "Space outside parentheses" ],
- [ "space_after_comma", "Space after comma" ]
- ]],
- [ "Operators", "(=, .=, +=, -=, *=, /=, &=, |=, <<<, ==, ===, !=, !==, >, >=, <, <=, -, +, *, /, %, &&, ||, AND, OR, XOR, ?, :)", [
- [ "space_around_assignment", "Space around assignment (= .= += -= *= /= <<<)" ],
- [ "align_var_assignment", "Align block +3 assigned variables" ],
- [ "space_around_comparison", "Space around comparison (== === != !== > >= < <=)" ],
- [ "space_around_arithmetic", "Space around arithmetic (- + * / %)" ],
- [ "space_around_logical", "Space around logical (&& || AND OR XOR << >>)" ],
- [ "space_around_colon_question", "Space around question/colon (? :)" ]
- ]],
- [ "Functions, Classes and Objects", "(keywords: function, class, interface, abstract, public, protected, private, final, ->, ::)", [
- [ "line_before_function", "Blank line before keyword" ],
- [ "line_before_curly_function", "Opening bracket on next line" ],
- [ "line_after_curly_function", "Blank line below opening bracket" ],
- [ "space_around_obj_operator", "Space around object operator (->)" ],
- [ "space_around_double_colon", "Space around double colon (::)" ]
- ]],
- [ "Control Structures", "(if, elseif, else, for, foreach, while, do, switch, break)", [
- [ "space_after_if", "Space between keyword and opening parentheses" ],
- [ "else_along_curly", "Keep else/elseif along with bracket" ],
- [ "line_before_curly", "Opening bracket on next line" ],
- [ "add_missing_braces", "Add missing brackets to single line structs" ],
- [ "line_after_break", "Blank line after case \"break\"" ],
- [ "space_inside_for", "Space between \"for\" elements" ],
- [ "indent_case", "Extra indent for \"Case\" and \"Default\"" ]
- ]],
- [ "Arrays and Concatenation", "(array, dot, double arrow =>)", [
- [ "line_before_array", "Opening array parentheses on next line" ],
- [ "vertical_array", "Non-empty arrays as vertical block" ],
- [ "align_array_assignment", "Align block +3 assigned array elements" ],
- [ "space_around_double_arrow", "Space around double arrow" ],
- [ "vertical_concat", "Concatenation as vertical block" ],
- [ "space_around_concat", "Space around concat elements" ]
- ]],
- [ "Comments", "(//, #, /* */, /** */)", [
- [ "line_before_comment_multi", "Blank line before multi-line comment (/*)" ],
- [ "line_after_comment_multi", "Blank line after multi-line comment (/*)" ],
- [ "line_before_comment", "Blank line before single line comments (//)" ],
- [ "line_after_comment", "Blank line after single line comments (//)" ]
- ]]
- ];
-
- window.onload = function() {
-
- t = gEBI("g").cloneNode(true);
- r = gEBI("e").cloneNode(true);
- i = gEBI("i").cloneNode(true);
- loadFileMenu();
- for(y=0; y<(menus.length); y++) {
- h = menus[y][0];
- k = menus[y][1];
- addGroup(h, k, y+1);
- for(z=0; z<(menus[y][2].length); z++) {
- n = menus[y][2][z][0];
- d = menus[y][2][z][1];
- addItem(n, d, z, y+1);
- }
- if(getCookie("menu"+(y+1))=="on") {
- collapse(gEBN("a")[y+1]);
- }
- }
- gEBI("nowrap").checked = getCookie("nowrap")=="on" ? true : false;
- gEBI("iso8859").checked = getCookie("iso8859")=="on" ? true : false;
- gEBN("textarea")[1].checked = getCookie("textarea")!="on" ? true : false;
- gEBN("textarea")[0].checked = !gEBN("textarea")[1].checked;
- if(gEBN("textarea")[1].checked) {
- switchPanels(gEBN("textarea")[1]);
- }
-
- }
-
- function addGroup(h, k, y) {
- gEBI("m").parentNode.insertBefore(t.cloneNode(true), gEBI("m"));
- gEBN("h")[y].innerHTML = h;
- gEBN("k")[y].innerHTML = k;
- }
-
- function addItem(n, d, z, y) {
- c = n=="indent_size" ? i.cloneNode(true) : r.cloneNode(true);
- gEBTN('tbody',gEBN("g")[y])[0].appendChild(c);
- tr = gEBTN("tr",gEBN("g")[y])[z+2];
- td = gEBTN("td",tr)[0];
- gEBTN("input",td)[0].name = n;
- gEBTN("input",td)[0].id = n;
- gEBTN("span",td)[0].innerHTML = d;
- ck = getCookie(n);
- if(ck && ck=="on") {
- gEBTN("input",td)[0].checked = true;
- gEBTN("input",td)[0].value = "on";
- }
- else if(ck!=null) {
- gEBTN("input",td)[0].value = ck;
- }
- }
-
- function switchPanels(el) {
- if(el.name=="textarea") {
- if(gEBN("textarea")[0].checked) {
- sDIS(gEBI("tx"));
- sDIS(gEBI("hl"),"none");
- }
- else {
- sDIS(gEBI("tx"),"none");
- sDIS(gEBI("hl"));
- }
- }
- }
-
- function setCookie() {
-
- var cooky = "";
- var ta_index = 0;
- var elems = gEBTN("input");
- for(i=0; i<elems.length; i++) {
- switch(elems[i].type) {
- case "text":
- if(elems[i].value!="" && elems[i].name!="") {
- cooky += elems[i].name+":"+elems[i].value+"#";
- }
- break;
- case "checkbox":
- if(elems[i].checked) {
- cooky += elems[i].name+":on#";
- }
- break;
- case "radio":
- ta_index++;
- if(elems[i].checked && ta_index==1) {
- cooky += elems[i].name+":on#";
- }
- }
- }
- elems = gEBN("a");
- for(i=0; i<elems.length; i++) {
- tb = elems[i].parentNode.parentNode.parentNode;
- if(gEBTN("tr",tb)[1].style.display=="") {
- cooky += "menu"+i+":on#";
- }
- }
- document.cookie = "options="+cooky+"; expires="+(new Date(2020, 01, 01)).toGMTString();
- }
-
- function getCookie(ckn) {
- var res = document.cookie.match(ckn+':(.*?)(#|$)');
- return res ? res[1] : null;
- }
-
- function loadFileMenu() {
- gEBN("h")[0].innerHTML = "Choose Source Code";
- gEBN("k")[0].innerHTML = "(select file, paste code into text box or use sample)";
- sDIS(gEBN("k")[0].parentNode);
- gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("f"));
- gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("x"));
- gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("s"));
- gEBN("a")[0].style.color = "red";
- if(getCookie("menu0")=="off") {
- collapse(gEBN("a")[0]);
- }
- }
-
- function collapse(el) {
- var ai = 0;
- while(ai<gEBN("a").length && gEBN("a")[ai++]!=el);
- tb = el.parentNode.parentNode.parentNode;
- el.style.color = el.style.color=="" ? "red" : "";
- for(i=1; i<gEBTN("tr",tb).length; i++) {
- tr = gEBTN("tr",tb)[i];
- if(i==1) {
- st = tr.style.display=="none" ? "" : "none";
- }
- sDIS(tr,st);
- }
- window.focus();
- }
-
- function hideLeft(el) {
- if(el.innerHTML=="hide left panel") {
- el.innerHTML = "show left panel";
- gEBI("hide_top").appendChild(el);
- sDIS(gEBI("left"),"none");
- sDIS(gEBI("hide_top"));
- }
- else {
- el.innerHTML = "hide left panel";
- gEBI("hide_left").appendChild(el);
- sDIS(gEBI("left"));
- sDIS(gEBI("hide_top"),"none");
- }
- }
-
- function submitCode(el) {
- if(gEBI('file').value!='') {
- gEBI('ta').value = '';
- }
- if(el.name=="sc") {
- gEBI("download").value = 2;
- }
- else if(el.name=="dl") {
- gEBI("download").value = 1;
- }
- else {
- gEBI("download").value = 0;
- }
- var elems = gEBTN("input");
- for(i=0; i<elems.length; i++) {
- if(elems[i].type=="checkbox" && elems[i].checked) {
- elems[i].value = "on";
- }
- }
- document.stylist.submit();
- }
-
- var t = null;
- var r = null;
- var i = null;
- var h = null;
- var k = null;
- var n = null;
- var d = null;
-
- function gEBI(id) {
- return document.getElementById(id);
- }
- function gEBN(nm, el) {
- return el==undefined ? document.getElementsByName(nm) : el.getElementsByName(nm);
- }
- function gEBTN(tn, el) {
- return el==undefined ? document.getElementsByTagName(tn) : el.getElementsByTagName(tn);
- }
- function sDIS(el,st) {
- el.style.display = st==undefined ? "" : st;
- }
-
- </script>
-
- <style>
- body, table {
- font-family: "Lucida Grande", "trebuchet ms", verdana, Tahoma, Arial, Verdana, Helvetica, sans-serif;
- color: #444444;
- font-size: 11px;
- background-color: #ffffff;
- margin-top: 0px;
- }
- input {
- font-family: "Lucida Grande", "trebuchet ms", verdana, Tahoma, Arial, Verdana, Helvetica, sans-serif;
- border: 1px solid #888888;
- font-size: 10px;
- background-color: #ffffff;
- }
- textarea {
- font-family: Courier New, Bitstream Vera Sans Mono, Courier, sans-serif;
- border: 0px;
- font-size: 12px;
- background-color: #ffffff;
- }
- a {
- text-decoration: none;
- color: black;
- font-weight: normal;
- }
- a:hover {
- color: #0094F2;
- }
- table {
- border: 1px solid #e7e7e7;
- }
- td {
- padding: 2px 5px 2px 5px;
- }
- h1 {
- font-variant: small-caps;
- font-size: 20px;
- margin: 0px;
- }
- hr {
- height: 1px;
- margin-bottom: 5px;
- }
- .button {
- font-size: 10px;
- color: #666666;
- margin: 0px;
- }
- .check {
- border: 0px;
- vertical-align: middle;
- }
- .h {
- font-size: 11px;
- color: #666666;
- font-weight: bold;
- text-align: left;
- margin: 0px;
- border-bottom: 1px solid #e7e7e7;
- padding-bottom: 3px;
- padding-right: 0px;
- }
- .k {
- font-style: italic;
- }
- .l {
- border-bottom: 1px solid #e7e7e7;
- }
- </style>
-
- </head>
- <body>
- <table width="100%" height="98%" cellpadding=0 cellspacing=0 border=0 style="margin-top: 10px; border: 0px;">
- <form action="phpStylist.php" method="POST" name="stylist" enctype="multipart/form-data">
- <tr height=1>
- <td valign=top style="padding: 0px;">
- <table cellpadding=0 cellspacing=0 border=0 style="border: 0px;">
- <tr>
- <td style="padding: 0px;"><h1>phpStylist by Mr. Milk</h1></td>
- <td style="padding-left: 20px;"valign=bottom><i>“because your code may not work, but it must look professional!!!”</i></td>
- </tr>
- </table>
- <hr>
- </td>
- </tr>
- <tr>
- <td valign=top style="padding: 0px;">
- <table width="100%" height="100%" cellpadding=0 cellspacing=0 border=0 style="border: 0px">
- <tr>
- <td width="290" valign=top id="left">
- <table id="g" name="g" width="290" style="margin-bottom: 10px;" cellpadding=0 cellspacing=0 border=0>
- <tr>
- <td id="h" name="h" class="h" nowrap></td>
- <td align=right class="l" nowrap><a href="#" name="a" title="expand/collapse" onclick="collapse(this); setCookie(); return false;">•••</a></td>
- </tr>
- <tr style="display: none;">
- <td id="k" name="k" class="k" colspan=2></td>
- </tr>
- </table>
- <table id="m" style="display: none; margin-bottom: 10px;">
- <tr id="e" name="e" style="display: none;">
- <td colspan=2 nowrap>
- <input type="checkbox" class="check" onclick="setCookie();" value="off"><span></span>
- </td>
- </tr>
- <tr id="i" name="i" style="display: none;">
- <td colspan=2>
- <input type="text" size=2 value="2" onchange="setCookie();"><span></span>
- </td>
- </tr>
- <tr id="f" name="f">
- <td colspan=2 style="padding-top: 10px;">
- <input type="file" name="file" id="file" size=39>
- </td>
- </tr>
- <tr id="x" name="x">
- <td colspan=2 style="padding-top: 0px;">
- <input type="radio" class="check" id="textarea" name="textarea" onclick="switchPanels(this); setCookie();" value="on" checked>show editable text box<br>
- <input type="radio" class="check" id="textarea" name="textarea" onclick="switchPanels(this); setCookie();" value="off">show syntax highlighted code<br>
- <input type="checkbox" class="check" id="iso8859" name="iso8859" onclick="setCookie();" value="off">use ISO-8859-1 charset (default UTF-8)<br>
- <input type="checkbox" class="check" id="nowrap" name="nowrap" onclick="setCookie();" value="off">do not wrap lines in right panel
- </td>
- </tr>
- <tr id="s" name="s">
- <td colspan=2 style="padding-bottom: 10px;">
- <input type="button" name="pv" onclick="submitCode(this);" value=" Preview " class="button">
- <input type="button" name="dl" onclick="submitCode(this);" value=" Download " class="button">
- <input type="button" name="sc" onclick="submitCode(this);" value="Use Sample" class="button">
- <input type="hidden" name="download" id="download">
- </td>
- </tr>
- </table>
- <div id="hide_left"><a href="#" id="hide" onclick="hideLeft(this);" style="color: #0094F2" class="k">hide left panel</a></div>
- </td>
- <td valign=top style="padding-bottom: 10px;">
- <table width="100%" height="100%" cellpadding=0 cellspacing=0 border=0>
- <tr height=1>
- <td style="border-bottom: 1px solid #f5f5f5; padding: 0px; margin: 0px;">
- <div id="hide_top" style="display: none; margin-left: 5px;"></div>
- </td>
- </tr>
- <?echo parseFile();?>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- </body>
-</html>
-
-<?php
-function parseFile($download = false)
-{
- global $HTTP_POST_FILES;
- $code = "";
- $stylist = new phpStylist();
- if ((isset($_REQUEST['file']) && $_REQUEST['file']!="") || (isset($HTTP_POST_FILES['file']['tmp_name']) && $HTTP_POST_FILES['file']['tmp_name'] != "none" && $HTTP_POST_FILES['file']['tmp_name'] != "")) {
- $file = isset($_REQUEST['file']) ? $_REQUEST['file'] : $HTTP_POST_FILES['file']['tmp_name'];
- $code = loadFile($file);
- if (isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" && !isDownload()) {
- $code = utf8_encode($code);
- }
- }
- elseif (isset($_REQUEST["download"]) && $_REQUEST["download"] == '2') {
- $code = getSampleCode();
- }
- elseif (isset($_REQUEST["ta"]) && $_REQUEST["ta"] != '') {
- $code = stripslashes($_REQUEST["ta"]);
- if (isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" && isDownload()) {
- $code = utf8_decode($code);
- }
- }
- if (!empty($code)) {
- foreach ($_REQUEST as $k => $v) {
- if (isset($stylist->options[strtoupper($k)])) {
- $stylist->options[strtoupper($k)] = $v != "off";
- }
- }
- if (isset($_REQUEST["indent_with_tabs"]) && $_REQUEST["indent_with_tabs"] != "off") {
- $stylist->indent_char = "\t";
- }
- if (isset($_REQUEST["indent_size"]) && $_REQUEST["indent_size"] != "" && $_REQUEST["indent_size"] != "null") {
- $stylist->indent_size = $_REQUEST["indent_size"];
- }
- if (strpos($code, '<?') === false) {
- $code = '<?php ' . $code . ' ?' . '>';
- }
- $formatted = $stylist->formatCode($code);
- $highlight = highlight_string($formatted, true);
- if (isset($HTTP_POST_FILES['file']['tmp_name']) && file_exists($HTTP_POST_FILES['file']['tmp_name'])) {
- unlink($HTTP_POST_FILES['file']['tmp_name']);
- }
- $nowrap = isset($_REQUEST["nowrap"]) && $_REQUEST["nowrap"] == 'on' ? "nowrap" : "";
- $tawrap = $nowrap == "" ? "" : "wrap='off' ";
- $display = isset($_REQUEST["textarea"]) && $_REQUEST["textarea"] == 'on' ? "" : "style='display: none;'";
- $textarea = "<tr id='tx' $display><td valign=top><textarea $tawrap style='width: 100%; height: 100%;' id='ta' name='ta'>" . htmlspecialchars($formatted) . "</textarea></td></tr>";
- $display = isset($_REQUEST["textarea"]) && $_REQUEST["textarea"] == 'on' ? "style='display: none;'" : "";
- $frame = "<tr id='hl' $display><td valign=top $nowrap>$highlight</td></tr>";
- }
- else {
- $nowrap = isset($_REQUEST["nowrap"]) && $_REQUEST["nowrap"] == 'on' ? "nowrap" : "";
- $tawrap = $nowrap == "" ? "" : "wrap='off' ";
- $textarea = "<tr id='tx'><td valign=top><textarea $tawrap style='width: 100%; height=100%;' id='ta' name='ta'></textarea></td></tr>";
- $frame = "<tr id='hl' style='display: none;'><td valign=top $nowrap></td></tr>";
- }
- if ($download) {
- return isset($formatted) ? $formatted : "";
- }
- else {
- return $textarea . $frame;
- }
-}
-
-function isCommandLine() {
- global $argv;
- return ((is_array($argv) && count($argv)>0) || (is_array($_SERVER['argv']) && count($_SERVER['argv'])>0) || (is_array($GLOBALS['HTTP_SERVER_VARS']['argv']) && count($GLOBALS['HTTP_SERVER_VARS']['argv'])>0));
-}
-
-function processBatch() {
-
- global $argv;
- if (is_array($argv)) {
- $options = $argv;
- }
- elseif (is_array($_SERVER['argv'])) {
- $options = $_SERVER['argv'];
- }
- elseif (is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
- $options = $GLOBALS['HTTP_SERVER_VARS']['argv'];
- }
- foreach($options as $index=>$option) {
- if($option=="--help") {
- echo "phpStylist v0.8 by Mr. Milk\n";
- echo "usage: phpStylist source_file options\n\n";
- echo "Indentation and General Formatting:\n";
- echo "--indent_size n\n";
- echo "--indent_with_tabs\n";
- echo "--keep_redundant_lines\n";
- echo "--space_inside_parentheses\n";
- echo "--space_outside_parentheses\n";
- echo "--space_after_comma\n\n";
- echo "Operators:\n";
- echo "--space_around_assignment\n";
- echo "--align_var_assignment\n";
- echo "--space_around_comparison\n";
- echo "--space_around_arithmetic\n";
- echo "--space_around_logical\n";
- echo "--space_around_colon_question\n\n";
- echo "Functions, Classes and Objects:\n";
- echo "--line_before_function\n";
- echo "--line_before_curly_function\n";
- echo "--line_after_curly_function\n";
- echo "--space_around_obj_operator\n";
- echo "--space_around_double_colon\n\n";
- echo "Control Structures:\n";
- echo "--space_after_if\n";
- echo "--else_along_curly\n";
- echo "--line_before_curly\n";
- echo "--add_missing_braces\n";
- echo "--line_after_break\n";
- echo "--space_inside_for\n";
- echo "--indent_case\n\n";
- echo "Arrays and Concatenation:\n";
- echo "--line_before_array\n";
- echo "--vertical_array\n";
- echo "--align_array_assignment\n";
- echo "--space_around_double_arrow\n";
- echo "--vertical_concat\n";
- echo "--space_around_concat\n\n";
- echo "Comments:\n";
- echo "--line_before_comment_multi\n";
- echo "--line_after_comment_multi\n";
- echo "--line_before_comment\n";
- echo "--line_after_comment\n";
- exit;
- }
- if($index==1) {
- $_REQUEST["file"] = $option;
- }
- elseif($option=="--indent_size") {
- $_REQUEST["indent_size"] = $options[$index+1];
- }
- elseif($index>0 && $options[$index-1]!="indent_size") {
- $_REQUEST[substr($option, 2)] = "on";
- }
- }
- $_REQUEST["download"] = 2;
- $str = parseFile(true);
- echo $str;
- exit;
-
-}
-
-function isDownload()
-{
- return isset($_REQUEST["download"]) && $_REQUEST["download"] == '1';
-}
-
-function downloadFile()
-{
- global $HTTP_POST_FILES;
- $charset = isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" ? "ISO-8859-1" : "UTF-8";
- $str = parseFile(true);
- if ($str != "") {
- $fn = isset($HTTP_POST_FILES['file']) && $HTTP_POST_FILES['file']['name'] != '' ? $HTTP_POST_FILES['file']['name'] : "phpStylist.php";
- header("Expires: Wed, 20 Jun 2007 00:00:00 GMT");
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
- header("Cache-Control: no-store, no-cache, must-revalidate");
- header("Cache-Control: post-check=0, pre-check=0", false);
- header("Pragma: no-cache");
- header("Content-Type: text/plain; charset=".$charset);
- header('Content-Disposition: attachment; filename="' . $fn . '";');
- header("Pragma: public");
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
- header("Content-Transfer-Encoding: binary");
- }
- echo $str;
- exit;
-}
-
-function loadFile($filename)
-{
- $code = "";
- if(filesize($filename)>0) {
- $f = fopen("$filename", "rb");
- $code = fread($f, filesize($filename));
- fclose($f);
- }
- return $code;
-}
-
-function getSampleCode()
-{
- $sample = 'PD9waHANCi8qKioNCiAqIHBocFN0eWxpc3QgZGVtb25zdHJhdGlvbiBjb2RlDQogKiBieSBNci4gTWlsayAoYWthIE1hcmNlbG8gTGVpdGUpDQogKiBtcm1pbGtAYW55c29mdC5jb20uYnINCiAqLw0KDQokd29ya19ob3VycyA9IDEyOw0KJHRpbWUgPSAkd29ya19ob3VycyoyOw0KJGRldmVsb3BlciA9ICRwb29yZ3V5Ow0KJGdvZCA9ICQkbXJnYXRlczsNCiR3YWdlID0gJHdvcmtfaG91cnMvMjsNCiRib251cyA9ICR3YWdlICogMC4wMDAwMTsNCiR3YXJuZWQgPSBmYWxzZTsNCiRwcm9wZXJ0aWVzID0gYXJyYXkoImdhdGVzIj0+YXJyYXkoImV2ZXJ5dGhpbmciPT4ieWVzIiwgImFueXRoaW5nIj0+InllcyIsICJhbnl0aGluZyBlbHNlIj0+InllcyIsICJ5b3UiPT4iY29tcGxldGVseSIpLCAiZGV2ZWxvcGVyIj0+YXJyYXkoImFuIG9sZCBjYXIiPT4iMiBpbnN0YWxsbWVudHMiLCAibW9kZGVkIGNvbXB1dGVyIj0+ImFsbW9zdCIsICJiZWVyIG11ZyI9PiJzdXJlISIpKTsNCiR3YXJuaW5nID0gIk1yLiAiLiRkZXZlbG9wZXIuIiwgeW91IG1hZGUgIi4gJGdvZC4gIiB1bmhhcHB5IHRvZGF5LiI7DQovLyBkZXZlbG9wZXIncyBtaXNlcmFibGUgbGlmZQ0KZm9yKCR5b3U9JGRldmVsb3BlcjskeW91PCRnb2Q7JHlvdSsrKSB7DQogIC8vIGxldCdzIHVzZSBoaXMgcG90ZW50aWFsDQogIGlmKCR3b3JrPD0kdGltZSo0KSB7DQogICAgJHdvcmsrKzsNCiAgICAkc2xlZXAtLTsNCiAgICAkZW5yaWNoR2F0ZXMoKTsNCiAgfQ0KICAvLyBjaGlja2VuaW5nIG91dCBodWg/DQogIGVsc2UgaWYoJHRpcmVkKSB7DQogICAgaWYoISR3YXJuZWQpIHsNCiAgICAgICRzY2FyZVRvRGVhdGgoJGRldmVsb3Blciwkd2FybmluZyk7DQogICAgICAkYm9udXMvPTI7DQogICAgfQ0KICAgIGVsc2UgaWYoJGJvbnVzID4gMCkNCiAgICAgICRib251cz0wOw0KICAgIGVsc2Ugew0KICAgICAgZmlyZSgkZGV2ZWxvcGVyKTsNCiAgICAgICRyZXBsYWNlbWVudCA9IGZpbmRJZGlvdCgpOw0KICAgICAgaGlyZSgkcmVwbGFjZW1lbnQsICR3YWdlLzIpOw0KICAgIH0NCiAgfQ0KICAvLyB0aGlzIGd1eSBjYW4gdGFrZSBpdA0KICBlbHNlaWYoJHdhZ2U+MCkNCiAgICAkd2FnZS0tOw0KICAvLyBoYXZlIHdlIHJlYWxseSBmb3VuZCB3aG8gd2UndmUgYmVlbiBsb29raW5nIGZvcj8NCiAgZWxzZSB7DQogICAgJGVucmljaEdhdGVzKCk7DQogICAgJGhlYWx0aF9sZXZlbCA9IGVtZXJnZW5jeVJvb20oJGRldmVsb3Blcik7DQogICAgLyogc2FuaXR5IGNoZWNrISAqLw0KICAgIHN3aXRjaCgkaGVhbHRoX2xldmVsKSB7DQogICAgICBjYXNlICJncmVhdCI6DQogICAgICAgIGZpcmUoJGRvY3Rvcik7DQogICAgICAgIHVuc2V0KCRwcm9wZXJ0aWVzWyJkZXZlbG9wZXIiXSk7DQogICAgICAgIHVuc2V0KCRwcm9wZXJ0aWVzWyJnYXRlcyJdWyJ5b3UiXSk7DQogICAgICAgIGN1Y2tvb3NOZXN0KCRkZXZlbG9wZXIpOw0KICAgICAgICAkcmVwbGFjZW1lbnQgPSBmaW5kSWRpb3QoKTsNCiAgICAgICAgaGlyZSgkcmVwbGFjZW1lbnQsICRtaW5fd2FnZSk7DQogICAgICAgIGJyZWFrOw0KICAgICAgY2FzZSAiZ29vZCI6DQogICAgICBjYXNlICJiYWQiOg0KICAgICAgICBiYWNrVG9Xb3JrKCk7DQogICAgICBicmVhazsNCiAgICAgIGNhc2UgInRlcm1pbmFsIjoNCiAgICAgICAgZmlyZSgkZGV2ZWxvcGVyKTsNCiAgICAgICAgJHJlcGxhY2VtZW50ID0gJGhhc19icm90aGVyID8gImJyb3RoZXIiIDogImZyaWVuZCI7DQogICAgICAgIGhpcmUoJHJlcGxhY2VtZW50LCAkbWluX3dhZ2UvMik7DQogICAgICBicmVhazsNCiAgICAgIGRlZmF1bHQ6DQogICAgfQ0KICB9DQp9DQovKioqDQogKiBGdW5jdGlvbnMNCiAqLw0KDQpmdW5jdGlvbiBlbWVyZ2VuY3lSb29tKCR3aG8pIHsNCiAgJGhlYWx0aHkgPWZhbHNlOw0KICAkaW50ZXJuID0gMDsNCiAgd2hpbGUoISRoZWFsdGh5ICYmICRoZWFsdGh5IT0iZW5kIikNCiAgICAkaGVhbHRoeSA9IHNjcnVic0ludGVybk9waW5pb25zKCR3aG8sICsrJGludGVybik7DQogICRpbnRlcm4gPSAwOw0KICB3aGlsZSghJGhlYWx0aHkgJiYgJGhlYWx0aHkhPSJlbmQiKQ0KICAgICRoZWFsdGh5ID0gZXJJbnRlcm5PcGluaW9ucygkd2hvLCAkaW50ZXJuKyspOw0KICByZXR1cm4gJGhlYWx0aHk7DQp9DQoNCmZ1bmN0aW9uIGhpcmUoJHdobywgJHdhZ2UpIHsNCiAgJGRldmVsb3BlciA9IG5ldyBTbGF2ZSgpOw0KICAkZGV2ZWxvcGVyLT5wZXJzb24gPSAkd2hvOw0KICAkZGV2ZWxvcGVyLT5zZXRTYWxhcnkoJHdhZ2UpOw0KICAkY29zdCA9IGhyUm91dGluZXM6OmdldEhpcmluZ0Nvc3QoKTsNCiAgJGRldmVsb3Blci0+c2V0RGVidCgkY29zdCk7DQp9DQoNCmZ1bmN0aW9uIGZpcmUoJHdobykgew0KICBjYWxsU2VjdXJpdHkoKTsNCiAgZ2V0SGltT3V0KCR3aG8pOw0KfQ0KDQo/Pg0K';
- return base64_decode($sample);
-}
-
-class phpStylist
-{
- var $indent_size = 2;
- var $indent_char = " ";
- var $block_size = 3;
- var $options = array(
- "SPACE_INSIDE_PARENTHESES" => false,
- "SPACE_OUTSIDE_PARENTHESES" => false,
- "SPACE_INSIDE_FOR" => false,
- "SPACE_AFTER_IF" => false,
- "SPACE_AFTER_COMMA" => false,
- "SPACE_AROUND_OBJ_OPERATOR" => false,
- "SPACE_AROUND_DOUBLE_COLON" => false,
- "SPACE_AROUND_DOUBLE_ARROW" => false,
- "SPACE_AROUND_ASSIGNMENT" => false,
- "SPACE_AROUND_COMPARISON" => false,
- "SPACE_AROUND_COLON_QUESTION" => false,
- "SPACE_AROUND_LOGICAL" => false,
- "SPACE_AROUND_ARITHMETIC" => false,
- "SPACE_AROUND_CONCAT" => false,
- "LINE_BEFORE_FUNCTION" => false,
- "LINE_BEFORE_CURLY" => false,
- "LINE_BEFORE_CURLY_FUNCTION" => false,
- "LINE_AFTER_CURLY_FUNCTION" => false,
- "LINE_BEFORE_ARRAY" => false,
- "LINE_BEFORE_COMMENT" => false,
- "LINE_AFTER_COMMENT" => false,
- "LINE_BEFORE_COMMENT_MULTI" => false,
- "LINE_AFTER_COMMENT_MULTI" => false,
- "LINE_AFTER_BREAK" => false,
- "VERTICAL_CONCAT" => false,
- "VERTICAL_ARRAY" => false,
- "INDENT_CASE" => false,
- "KEEP_REDUNDANT_LINES" => false,
- "ADD_MISSING_BRACES" => false,
- "ALIGN_ARRAY_ASSIGNMENT" => false,
- "ALIGN_VAR_ASSIGNMENT" => false,
- "ELSE_ALONG_CURLY" => false,
- );
- var $_new_line = "\n";
- var $_indent = 0;
- var $_for_idx = 0;
- var $_code = "";
- var $_log = false;
- var $_pointer = 0;
- var $_tokens = 0;
-
- function phpStylist()
- {
- define("S_OPEN_CURLY", "{");
- define("S_CLOSE_CURLY", "}");
- define("S_OPEN_BRACKET", "[");
- define("S_CLOSE_BRACKET", "]");
- define("S_OPEN_PARENTH", "(");
- define("S_CLOSE_PARENTH", ")");
- define("S_SEMI_COLON", ";");
- define("S_COMMA", ",");
- define("S_CONCAT", ".");
- define("S_COLON", ":");
- define("S_QUESTION", "?");
- define("S_EQUAL", "=");
- define("S_EXCLAMATION", "!");
- define("S_IS_GREATER", ">");
- define("S_IS_SMALLER", "<");
- define("S_MINUS", "-");
- define("S_PLUS", "+");
- define("S_TIMES", "*");
- define("S_DIVIDE", "/");
- define("S_MODULUS", "%");
- define("S_REFERENCE", "&");
- define("S_QUOTE", '"');
- define("S_AT", "@");
- define("S_DOLLAR", "$");
- define("S_ABSTRACT", "abstract");
- define("S_INTERFACE", "interface");
- define("S_FINAL", "final");
- define("S_PUBLIC", "public");
- define("S_PRIVATE", "private");
- define("S_PROTECTED", "protected");
- if (defined("T_ML_COMMENT")) {
- define("T_DOC_COMMENT", T_ML_COMMENT);
- }
- elseif (defined("T_DOC_COMMENT")) {
- define("T_ML_COMMENT", T_DOC_COMMENT);
- }
- }
-
- function formatCode($source = '')
- {
- $in_for = false;
- $in_break = false;
- $in_function = false;
- $in_concat = false;
- $space_after = false;
- $curly_open = false;
- $array_level = 0;
- $arr_parenth = array();
- $switch_level = 0;
- $if_level = 0;
- $if_pending = 0;
- $else_pending = false;
- $if_parenth = array();
- $switch_arr = array();
- $halt_parser = false;
- $after = false;
- $this->_tokens = token_get_all($source);
- foreach ($this->_tokens as $index => $token) {
- list($id, $text) = $this->_get_token($token);
- $this->_pointer = $index;
- if ($halt_parser && $id != S_QUOTE) {
- $this->_append_code($text, false);
- continue;
- }
- if (substr(phpversion(), 0, 1) == "4" && $id == T_STRING) {
- switch (strtolower(trim($text))) {
- case S_ABSTRACT:
- case S_INTERFACE:
- case S_FINAL:
- case S_PUBLIC:
- case S_PRIVATE:
- case S_PROTECTED:
- $id = T_PUBLIC;
- default:
- }
- }
- switch ($id) {
- case S_OPEN_CURLY:
- $condition = $in_function ? $this->options["LINE_BEFORE_CURLY_FUNCTION"] : $this->options["LINE_BEFORE_CURLY"];
- $this->_set_indent( + 1);
- $this->_append_code((!$condition ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf($this->options["LINE_AFTER_CURLY_FUNCTION"] && $in_function && !$this->_is_token_lf()) . $this->_get_crlf_indent());
- $in_function = false;
- break;
-
- case S_CLOSE_CURLY:
- if ($curly_open) {
- $curly_open = false;
- $this->_append_code(trim($text));
- }
- else {
- if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["s" . $switch_level] == $this->_indent - 2) {
- if ($this->options["INDENT_CASE"]) {
- $this->_set_indent( - 1);
- }
- $switch_arr["l" . $switch_level]--;
- $switch_arr["c" . $switch_level]--;
- }
- while ($switch_level > 0 && $switch_arr["l" . $switch_level] == 0 && $this->options["INDENT_CASE"]) {
- unset($switch_arr["s" . $switch_level]);
- unset($switch_arr["c" . $switch_level]);
- unset($switch_arr["l" . $switch_level]);
- $switch_level--;
- if ($switch_level > 0) {
- $switch_arr["l" . $switch_level]--;
- }
- $this->_set_indent( - 1);
- $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent());
- $text = '';
- }
- if ($text != '') {
- $this->_set_indent( - 1);
- $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent());
- }
- }
- break;
-
- case S_SEMI_COLON:
- if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["s" . $switch_level] == $this->_indent - 2) {
- if ($this->options["INDENT_CASE"]) {
- $this->_set_indent( - 1);
- }
- $switch_arr["l" . $switch_level]--;
- $switch_arr["c" . $switch_level]--;
- }
- if ($in_concat) {
- $this->_set_indent( - 1);
- $in_concat = false;
- }
- $this->_append_code($text . $this->_get_crlf($this->options["LINE_AFTER_BREAK"] && $in_break) . $this->_get_crlf_indent($in_for));
- while ($if_pending > 0) {
- $text = $this->options["ADD_MISSING_BRACES"] ? "}" : "";
- $this->_set_indent( - 1);
- if ($text != "") {
- $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent());
- }
- else {
- $this->_append_code($this->_get_crlf_indent());
- }
- $if_pending--;
- if ($this->_is_token(array(T_ELSE, T_ELSEIF))) {
- break;
- }
- }
- if ($this->_for_idx == 0) {
- $in_for = false;
- }
- $in_break = false;
- $in_function = false;
- break;
-
- case S_OPEN_BRACKET:
- case S_CLOSE_BRACKET:
- $this->_append_code($text);
- break;
-
- case S_OPEN_PARENTH:
- if ($if_level > 0) {
- $if_parenth["i" . $if_level]++;
- }
- if ($array_level > 0) {
- $arr_parenth["i" . $array_level]++;
- if ($this->_is_token(array(T_ARRAY), true) && !$this->_is_token(S_CLOSE_PARENTH)) {
- $this->_set_indent( + 1);
- $this->_append_code((!$this->options["LINE_BEFORE_ARRAY"] ? '' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent());
- break;
- }
- }
- $this->_append_code($this->_get_space($this->options["SPACE_OUTSIDE_PARENTHESES"] || $space_after) . $text . $this->_get_space($this->options["SPACE_INSIDE_PARENTHESES"]));
- $space_after = false;
- break;
-
- case S_CLOSE_PARENTH:
- if ($array_level > 0) {
- $arr_parenth["i" . $array_level]--;
- if ($arr_parenth["i" . $array_level] == 0) {
- $comma = substr(trim($this->_code), - 1) != "," && $this->options['VERTICAL_ARRAY'] ? "," : "";
- $this->_set_indent( - 1);
- $this->_append_code($comma . $this->_get_crlf_indent() . $text . $this->_get_crlf_indent());
- unset($arr_parenth["i" . $array_level]);
- $array_level--;
- break;
- }
- }
- $this->_append_code($this->_get_space($this->options["SPACE_INSIDE_PARENTHESES"]) . $text . $this->_get_space($this->options["SPACE_OUTSIDE_PARENTHESES"]));
- if ($if_level > 0) {
- $if_parenth["i" . $if_level]--;
- if ($if_parenth["i" . $if_level] == 0) {
- if (!$this->_is_token(S_OPEN_CURLY) && !$this->_is_token(S_SEMI_COLON)) {
- $text = $this->options["ADD_MISSING_BRACES"] ? "{" : "";
- $this->_set_indent( + 1);
- $this->_append_code((!$this->options["LINE_BEFORE_CURLY"] || $text == "" ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent());
- $if_pending++;
- }
- unset($if_parenth["i" . $if_level]);
- $if_level--;
- }
- }
- break;
-
- case S_COMMA:
- if ($array_level > 0) {
- $this->_append_code($text . $this->_get_crlf_indent($in_for));
- }
- else {
- $this->_append_code($text . $this->_get_space($this->options["SPACE_AFTER_COMMA"]));
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $this->options["SPACE_AFTER_COMMA"];
- }
- }
- break;
-
- case S_CONCAT:
- $condition = $this->options["SPACE_AROUND_CONCAT"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- if ($this->options["VERTICAL_CONCAT"]) {
- if (!$in_concat) {
- $in_concat = true;
- $this->_set_indent( + 1);
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_crlf_indent());
- }
- else {
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- }
- break;
-
- case T_CONCAT_EQUAL:
- case T_DIV_EQUAL:
- case T_MINUS_EQUAL:
- case T_PLUS_EQUAL:
- case T_MOD_EQUAL:
- case T_MUL_EQUAL:
- case T_AND_EQUAL:
- case T_OR_EQUAL:
- case T_XOR_EQUAL:
- case T_SL_EQUAL:
- case T_SR_EQUAL:
- case S_EQUAL:
- $condition = $this->options["SPACE_AROUND_ASSIGNMENT"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_IS_EQUAL:
- case S_IS_GREATER:
- case T_IS_GREATER_OR_EQUAL:
- case T_IS_SMALLER_OR_EQUAL:
- case S_IS_SMALLER:
- case T_IS_IDENTICAL:
- case T_IS_NOT_EQUAL:
- case T_IS_NOT_IDENTICAL:
- $condition = $this->options["SPACE_AROUND_COMPARISON"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_BOOLEAN_AND:
- case T_BOOLEAN_OR:
- case T_LOGICAL_AND:
- case T_LOGICAL_OR:
- case T_LOGICAL_XOR:
- case T_SL:
- case T_SR:
- $condition = $this->options["SPACE_AROUND_LOGICAL"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_DOUBLE_COLON:
- $condition = $this->options["SPACE_AROUND_DOUBLE_COLON"];
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case S_COLON:
- if ($switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["c" . $switch_level] < $switch_arr["l" . $switch_level]) {
- $switch_arr["c" . $switch_level]++;
- if ($this->options["INDENT_CASE"]) {
- $this->_set_indent( + 1);
- }
- $this->_append_code($text . $this->_get_crlf_indent());
- }
- else {
- $condition = $this->options["SPACE_AROUND_COLON_QUESTION"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- }
- if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0) {
- if ($this->options["INDENT_CASE"]) {
- $this->_set_indent( - 1);
- }
- $switch_arr["l" . $switch_level]--;
- $switch_arr["c" . $switch_level]--;
- }
- break;
-
- case S_QUESTION:
- $condition = $this->options["SPACE_AROUND_COLON_QUESTION"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_DOUBLE_ARROW:
- $condition = $this->options["SPACE_AROUND_DOUBLE_ARROW"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case S_MINUS:
- case S_PLUS:
- case S_TIMES:
- case S_DIVIDE:
- case S_MODULUS:
- $condition = $this->options["SPACE_AROUND_ARITHMETIC"];
- if ($this->_is_token(S_OPEN_PARENTH)) {
- $space_after = $condition;
- }
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_OBJECT_OPERATOR:
- $condition = $this->options["SPACE_AROUND_OBJ_OPERATOR"];
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition));
- break;
-
- case T_FOR:
- $in_for = true;
- case T_FOREACH:
- case T_WHILE:
- case T_DO:
- case T_IF:
- case T_SWITCH:
- $space_after = $this->options["SPACE_AFTER_IF"];
- $this->_append_code($text . $this->_get_space($space_after), false);
- if ($id == T_SWITCH) {
- $switch_level++;
- $switch_arr["s" . $switch_level] = $this->_indent;
- $switch_arr["l" . $switch_level] = 0;
- $switch_arr["c" . $switch_level] = 0;
- }
- $if_level++;
- $if_parenth["i" . $if_level] = 0;
- break;
-
- case T_FUNCTION:
- case T_CLASS:
- case T_INTERFACE:
- case T_FINAL:
- case T_ABSTRACT:
- case T_PUBLIC:
- case T_PROTECTED:
- case T_PRIVATE:
- if (!$in_function) {
- if ($this->options["LINE_BEFORE_FUNCTION"]) {
- $this->_append_code($this->_get_crlf($after || !$this->_is_token(array(T_COMMENT, T_ML_COMMENT, T_DOC_COMMENT), true)) . $this->_get_crlf_indent() . $text . $this->_get_space());
- $after = false;
- }
- else {
- $this->_append_code($text . $this->_get_space(), false);
- }
- $in_function = true;
- }
- else {
- $this->_append_code($this->_get_space() . $text . $this->_get_space());
- }
- break;
-
- case T_START_HEREDOC:
- $this->_append_code($this->_get_space($this->options["SPACE_AROUND_ASSIGNMENT"]) . $text);
- break;
-
- case T_END_HEREDOC:
- $this->_append_code($this->_get_crlf() . $text . $this->_get_crlf_indent());
- break;
-
- case T_COMMENT:
- case T_ML_COMMENT:
- case T_DOC_COMMENT:
- if (is_array($this->_tokens[$index - 1])) {
- $pad = $this->_tokens[$index - 1][1];
- $i = strlen($pad) - 1;
- $k = "";
- while (substr($pad, $i, 1) != "\n" && substr($pad, $i, 1) != "\r" && $i >= 0) {
- $k .= substr($pad, $i--, 1);
- }
- $text = preg_replace("/\r?\n$k/", $this->_get_crlf_indent(), $text);
- }
- $after = $id == (T_COMMENT && preg_match("/^\/\//", $text)) ? $this->options["LINE_AFTER_COMMENT"] : $this->options["LINE_AFTER_COMMENT_MULTI"];
- $before = $id == (T_COMMENT && preg_match("/^\/\//", $text)) ? $this->options["LINE_BEFORE_COMMENT"] : $this->options["LINE_BEFORE_COMMENT_MULTI"];
- if ($prev = $this->_is_token(S_OPEN_CURLY, true, $index, true)) {
- $before = $before && !$this->_is_token_lf(true, $prev);
- }
- $after = $after && (!$this->_is_token_lf() || !$this->options["KEEP_REDUNDANT_LINES"]);
- if ($before) {
- $this->_append_code($this->_get_crlf(!$this->_is_token(array(T_COMMENT), true)) . $this->_get_crlf_indent() . trim($text) . $this->_get_crlf($after) . $this->_get_crlf_indent());
- }
- else {
- $this->_append_code(trim($text) . $this->_get_crlf($after) . $this->_get_crlf_indent(), false);
- }
- break;
-
- case T_DOLLAR_OPEN_CURLY_BRACES:
- case T_CURLY_OPEN:
- $curly_open = true;
- case T_NUM_STRING:
- case T_BAD_CHARACTER:
- $this->_append_code(trim($text));
- break;
-
- case T_EXTENDS:
- case T_IMPLEMENTS:
- case T_INSTANCEOF:
- case T_AS:
- $this->_append_code($this->_get_space() . $text . $this->_get_space());
- break;
-
- case S_DOLLAR:
- case S_REFERENCE:
- case T_INC:
- case T_DEC:
- $this->_append_code(trim($text), false);
- break;
-
- case T_WHITESPACE:
- $redundant = "";
- if ($this->options["KEEP_REDUNDANT_LINES"]) {
- $lines = preg_match_all("/\r?\n/", $text, $matches);
- $lines = $lines > 0 ? $lines - 1 : 0;
- $redundant = $lines > 0 ? str_repeat($this->_new_line, $lines) : "";
- $current_indent = $this->_get_indent();
- if (substr($this->_code, strlen($current_indent) * - 1) == $current_indent && $lines > 0) {
- $redundant .= $current_indent;
- }
- }
- if($this->_is_token(array(T_OPEN_TAG), true)) {
- $this->_append_code($text, false);
- }
- else {
- $this->_append_code($redundant . trim($text), false);
- }
- break;
-
- case S_QUOTE:
- $this->_append_code($text, false);
- $halt_parser = !$halt_parser;
- break;
-
- case T_ARRAY:
- if ($this->options["VERTICAL_ARRAY"]) {
- $next = $this->_is_token(array(T_DOUBLE_ARROW), true);
- $next |= $this->_is_token(S_EQUAL, true);
- $next |= $array_level>0;
- if ($next) {
- $next = $this->_is_token(S_OPEN_PARENTH, false, $index, true);
- if ($next) {
- $next = !$this->_is_token(S_CLOSE_PARENTH, false, $next);
- }
- }
- if ($next) {
- $array_level++;
- $arr_parenth["i" . $array_level] = 0;
- }
- }
- case T_STRING:
- case T_CONSTANT_ENCAPSED_STRING:
- case T_ENCAPSED_AND_WHITESPACE:
- case T_VARIABLE:
- case T_CHARACTER:
- case T_STRING_VARNAME:
- case S_AT:
- case S_EXCLAMATION:
- case T_OPEN_TAG:
- case T_OPEN_TAG_WITH_ECHO:
- $this->_append_code($text, false);
- break;
-
- case T_CLOSE_TAG:
- $this->_append_code($text, !$this->_is_token_lf(true));
- break;
-
- case T_CASE:
- case T_DEFAULT:
- if ($switch_arr["l" . $switch_level] > 0 && $this->options["INDENT_CASE"]) {
- $switch_arr["c" . $switch_level]--;
- $this->_set_indent( - 1);
- $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_space());
- }
- else {
- $switch_arr["l" . $switch_level]++;
- $this->_append_code($text . $this->_get_space(), false);
- }
- break;
-
- case T_INLINE_HTML:
- $this->_append_code($text, false);
- break;
-
- case T_BREAK:
- case T_CONTINUE:
- $in_break = true;
- case T_VAR:
- case T_GLOBAL:
- case T_STATIC:
- case T_CONST:
- case T_ECHO:
- case T_PRINT:
- case T_INCLUDE:
- case T_INCLUDE_ONCE:
- case T_REQUIRE:
- case T_REQUIRE_ONCE:
- case T_DECLARE:
- case T_EMPTY:
- case T_ISSET:
- case T_UNSET:
- case T_DNUMBER:
- case T_LNUMBER:
- case T_RETURN:
- case T_EVAL:
- case T_EXIT:
- case T_LIST:
- case T_CLONE:
- case T_NEW:
- case T_FUNC_C:
- case T_CLASS_C:
- case T_FILE:
- case T_LINE:
- $this->_append_code($text . $this->_get_space(), false);
- break;
-
- case T_ELSEIF:
- $space_after = $this->options["SPACE_AFTER_IF"];
- $added_braces = $this->_is_token(S_SEMI_COLON, true) && $this->options["ADD_MISSING_BRACES"];
- $condition = $this->options['ELSE_ALONG_CURLY'] && ($this->_is_token(S_CLOSE_CURLY, true) || $added_braces);
- $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($space_after), $condition);
- $if_level++;
- $if_parenth["i" . $if_level] = 0;
- break;
-
- case T_ELSE:
- $added_braces = $this->_is_token(S_SEMI_COLON, true) && $this->options["ADD_MISSING_BRACES"];
- $condition = $this->options['ELSE_ALONG_CURLY'] && ($this->_is_token(S_CLOSE_CURLY, true) || $added_braces);
- $this->_append_code($this->_get_space($condition) . $text, $condition);
- if (!$this->_is_token(S_OPEN_CURLY) && !$this->_is_token(array(T_IF))) {
- $text = $this->options["ADD_MISSING_BRACES"] ? "{" : "";
- $this->_set_indent( + 1);
- $this->_append_code((!$this->options["LINE_BEFORE_CURLY"] || $text == "" ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent());
- $if_pending++;
- }
- break;
-
- default:
- $this->_append_code($text . ' ', false);
- break;
- }
- }
- return $this->_align_operators();
- }
-
- function _get_token($token)
- {
- if (is_string($token)) {
- return array($token, $token);
- }
- else {
- return $token;
- }
- }
-
- function _append_code($code = "", $trim = true)
- {
- if ($trim) {
- $this->_code = rtrim($this->_code) . $code;
- }
- else {
- $this->_code .= $code;
- }
- }
-
- function _get_crlf_indent($in_for = false, $increment = 0)
- {
- if ($in_for) {
- $this->_for_idx++;
- if ($this->_for_idx > 2) {
- $this->_for_idx = 0;
- }
- }
- if ($this->_for_idx == 0 || !$in_for) {
- return $this->_get_crlf() . $this->_get_indent($increment);
- }
- else {
- return $this->_get_space($this->options["SPACE_INSIDE_FOR"]);
- }
- }
-
- function _get_crlf($true = true)
- {
- return $true ? $this->_new_line : "";
- }
-
- function _get_space($true = true)
- {
- return $true ? " " : "";
- }
-
- function _get_indent($increment = 0)
- {
- return str_repeat($this->indent_char, ($this->_indent + $increment) * $this->indent_size);
- }
-
- function _set_indent($increment)
- {
- $this->_indent += $increment;
- if ($this->_indent < 0) {
- $this->_indent = 0;
- }
- }
-
- function _is_token($token, $prev = false, $i = 99999, $idx = false)
- {
- if ($i == 99999) {
- $i = $this->_pointer;
- }
- if ($prev) {
- while (--$i >= 0 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE);
- }
- else {
- while (++$i < count($this->_tokens)-1 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE);
- }
- if (is_string($this->_tokens[$i]) && $this->_tokens[$i] == $token) {
- return $idx ? $i : true;
- }
- elseif (is_array($token) && is_array($this->_tokens[$i])) {
- if (in_array($this->_tokens[$i][0], $token)) {
- return $idx ? $i : true;
- }
- elseif ($prev && $this->_tokens[$i][0] == T_OPEN_TAG) {
- return $idx ? $i : true;
- }
- }
- return false;
- }
-
- function _is_token_lf($prev = false, $i = 99999)
- {
- if ($i == 99999) {
- $i = $this->_pointer;
- }
- if ($prev) {
- $count = 0;
- while (--$i >= 0 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE && strpos($this->_tokens[$i][1], "\n") === false);
- }
- else {
- $count = 1;
- while (++$i < count($this->_tokens) && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE && strpos($this->_tokens[$i][1], "\n") === false);
- }
- if (is_array($this->_tokens[$i]) && preg_match_all("/\r?\n/", $this->_tokens[$i][1], $matches) > $count) {
- return true;
- }
- return false;
- }
-
- function _pad_operators($found)
- {
- global $quotes;
- $pad_size = 0;
- $result = "";
- $source = explode($this->_new_line, $found[0]);
- $position = array();
- array_pop($source);
- foreach ($source as $k => $line) {
- if (preg_match("/'quote[0-9]+'/", $line)) {
- preg_match_all("/'quote([0-9]+)'/", $line, $holders);
- for ($i = 0; $i < count($holders[1]); $i++) {
- $line = preg_replace("/" . $holders[0][$i] . "/", str_repeat(" ", strlen($quotes[0][$holders[1][$i]])), $line);
- }
- }
- if (strpos($line, "=") > $pad_size) {
- $pad_size = strpos($line, "=");
- }
- $position[$k] = strpos($line, "=");
- }
- foreach ($source as $k => $line) {
- $padding = str_repeat(" ", $pad_size - $position[$k]);
- $padded = preg_replace("/^([^=]+?)([\.\+\*\/\-\%]?=)(.*)$/", "\\1{$padding}\\2\\3" . $this->_new_line, $line);
- $result .= $padded;
- }
- return $result;
- }
-
- function _parse_block($blocks)
- {
- global $quotes;
- $pad_chars = "";
- $holders = array();
- if ($this->options['ALIGN_ARRAY_ASSIGNMENT']) {
- $pad_chars .= ",";
- }
- if ($this->options['ALIGN_VAR_ASSIGNMENT']) {
- $pad_chars .= ";";
- }
- $php_code = $blocks[0];
- preg_match_all("/\/\*.*?\*\/|\/\/[^\n]*|#[^\n]|([\"'])[^\\\\]*?(?:\\\\.[^\\\\]*?)*?\\1/s", $php_code, $quotes);
- $quotes[0] = array_values(array_unique($quotes[0]));
- for ($i = 0; $i < count($quotes[0]); $i++) {
- $patterns[] = "/" . preg_quote($quotes[0][$i], '/') . "/";
- $holders[] = "'quote$i'";
- $quotes[0][$i] = str_replace('\\\\', '\\\\\\\\', $quotes[0][$i]);
- }
- if (count($holders) > 0) {
- $php_code = preg_replace($patterns, $holders, $php_code);
- }
- $php_code = preg_replace_callback("/(?:.+=.+[" . $pad_chars . "]\r?\n){" . $this->block_size . ",}/", array($this, "_pad_operators"), $php_code);
- for ($i = count($holders) - 1; $i >= 0; $i--) {
- $holders[$i] = "/" . $holders[$i] . "/";
- }
- if (count($holders) > 0) {
- $php_code = preg_replace($holders, $quotes[0], $php_code);
- }
- return $php_code;
- }
-
- function _align_operators()
- {
- if ($this->options['ALIGN_ARRAY_ASSIGNMENT'] || $this->options['ALIGN_VAR_ASSIGNMENT']) {
- return preg_replace_callback("/<\?.*?\?" . ">/s", array($this, "_parse_block"), $this->_code);
- }
- else {
- return $this->_code;
- }
- }
-}
-?>
+<?php +/***************************************************************************** + * The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE + * Version 1.1 ("License"); You may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * http://opensource.org/licenses/rpl.php. Software distributed under the + * License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, + * either express or implied. + * + * @author: Mr. Milk (aka Marcelo Leite) + * @email: mrmilk@anysoft.com.br + * @version: 0.9 beta + * @date: 2007-07-07 + * + *****************************************************************************/ +if (isDownload()) { + downloadFile(); +} elseif(isCommandLine()) { + processBatch(); +}?> +<html> + <head> + <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> + <script> + var menus = [ + [ "Indentation and General Formatting", "", [ + [ "indent_size", " characters per indentation level" ], + [ "indent_with_tabs", "Indent with tabs instead of spaces" ], + [ "keep_redundant_lines", "Keep redundant lines" ], + [ "space_inside_parentheses", "Space inside parentheses" ], + [ "space_outside_parentheses", "Space outside parentheses" ], + [ "space_after_comma", "Space after comma" ] + ]], + [ "Operators", "(=, .=, +=, -=, *=, /=, &=, |=, <<<, ==, ===, !=, !==, >, >=, <, <=, -, +, *, /, %, &&, ||, AND, OR, XOR, ?, :)", [ + [ "space_around_assignment", "Space around assignment (= .= += -= *= /= <<<)" ], + [ "align_var_assignment", "Align block +3 assigned variables" ], + [ "space_around_comparison", "Space around comparison (== === != !== > >= < <=)" ], + [ "space_around_arithmetic", "Space around arithmetic (- + * / %)" ], + [ "space_around_logical", "Space around logical (&& || AND OR XOR << >>)" ], + [ "space_around_colon_question", "Space around question/colon (? :)" ] + ]], + [ "Functions, Classes and Objects", "(keywords: function, class, interface, abstract, public, protected, private, final, ->, ::)", [ + [ "line_before_function", "Blank line before keyword" ], + [ "line_before_curly_function", "Opening bracket on next line" ], + [ "line_after_curly_function", "Blank line below opening bracket" ], + [ "space_around_obj_operator", "Space around object operator (->)" ], + [ "space_around_double_colon", "Space around double colon (::)" ] + ]], + [ "Control Structures", "(if, elseif, else, for, foreach, while, do, switch, break)", [ + [ "space_after_if", "Space between keyword and opening parentheses" ], + [ "else_along_curly", "Keep else/elseif along with bracket" ], + [ "line_before_curly", "Opening bracket on next line" ], + [ "add_missing_braces", "Add missing brackets to single line structs" ], + [ "line_after_break", "Blank line after case \"break\"" ], + [ "space_inside_for", "Space between \"for\" elements" ], + [ "indent_case", "Extra indent for \"Case\" and \"Default\"" ] + ]], + [ "Arrays and Concatenation", "(array, dot, double arrow =>)", [ + [ "line_before_array", "Opening array parentheses on next line" ], + [ "vertical_array", "Non-empty arrays as vertical block" ], + [ "align_array_assignment", "Align block +3 assigned array elements" ], + [ "space_around_double_arrow", "Space around double arrow" ], + [ "vertical_concat", "Concatenation as vertical block" ], + [ "space_around_concat", "Space around concat elements" ] + ]], + [ "Comments", "(//, #, /* */, /** */)", [ + [ "line_before_comment_multi", "Blank line before multi-line comment (/*)" ], + [ "line_after_comment_multi", "Blank line after multi-line comment (/*)" ], + [ "line_before_comment", "Blank line before single line comments (//)" ], + [ "line_after_comment", "Blank line after single line comments (//)" ] + ]] + ]; + + window.onload = function() { + + t = gEBI("g").cloneNode(true); + r = gEBI("e").cloneNode(true); + i = gEBI("i").cloneNode(true); + loadFileMenu(); + for(y=0; y<(menus.length); y++) { + h = menus[y][0]; + k = menus[y][1]; + addGroup(h, k, y+1); + for(z=0; z<(menus[y][2].length); z++) { + n = menus[y][2][z][0]; + d = menus[y][2][z][1]; + addItem(n, d, z, y+1); + } + if(getCookie("menu"+(y+1))=="on") { + collapse(gEBN("a")[y+1]); + } + } + gEBI("nowrap").checked = getCookie("nowrap")=="on" ? true : false; + gEBI("iso8859").checked = getCookie("iso8859")=="on" ? true : false; + gEBN("textarea")[1].checked = getCookie("textarea")!="on" ? true : false; + gEBN("textarea")[0].checked = !gEBN("textarea")[1].checked; + if(gEBN("textarea")[1].checked) { + switchPanels(gEBN("textarea")[1]); + } + + } + + function addGroup(h, k, y) { + gEBI("m").parentNode.insertBefore(t.cloneNode(true), gEBI("m")); + gEBN("h")[y].innerHTML = h; + gEBN("k")[y].innerHTML = k; + } + + function addItem(n, d, z, y) { + c = n=="indent_size" ? i.cloneNode(true) : r.cloneNode(true); + gEBTN('tbody',gEBN("g")[y])[0].appendChild(c); + tr = gEBTN("tr",gEBN("g")[y])[z+2]; + td = gEBTN("td",tr)[0]; + gEBTN("input",td)[0].name = n; + gEBTN("input",td)[0].id = n; + gEBTN("span",td)[0].innerHTML = d; + ck = getCookie(n); + if(ck && ck=="on") { + gEBTN("input",td)[0].checked = true; + gEBTN("input",td)[0].value = "on"; + } + else if(ck!=null) { + gEBTN("input",td)[0].value = ck; + } + } + + function switchPanels(el) { + if(el.name=="textarea") { + if(gEBN("textarea")[0].checked) { + sDIS(gEBI("tx")); + sDIS(gEBI("hl"),"none"); + } + else { + sDIS(gEBI("tx"),"none"); + sDIS(gEBI("hl")); + } + } + } + + function setCookie() { + + var cooky = ""; + var ta_index = 0; + var elems = gEBTN("input"); + for(i=0; i<elems.length; i++) { + switch(elems[i].type) { + case "text": + if(elems[i].value!="" && elems[i].name!="") { + cooky += elems[i].name+":"+elems[i].value+"#"; + } + break; + case "checkbox": + if(elems[i].checked) { + cooky += elems[i].name+":on#"; + } + break; + case "radio": + ta_index++; + if(elems[i].checked && ta_index==1) { + cooky += elems[i].name+":on#"; + } + } + } + elems = gEBN("a"); + for(i=0; i<elems.length; i++) { + tb = elems[i].parentNode.parentNode.parentNode; + if(gEBTN("tr",tb)[1].style.display=="") { + cooky += "menu"+i+":on#"; + } + } + document.cookie = "options="+cooky+"; expires="+(new Date(2020, 01, 01)).toGMTString(); + } + + function getCookie(ckn) { + var res = document.cookie.match(ckn+':(.*?)(#|$)'); + return res ? res[1] : null; + } + + function loadFileMenu() { + gEBN("h")[0].innerHTML = "Choose Source Code"; + gEBN("k")[0].innerHTML = "(select file, paste code into text box or use sample)"; + sDIS(gEBN("k")[0].parentNode); + gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("f")); + gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("x")); + gEBTN("tbody",gEBN("g")[0])[0].appendChild(gEBI("s")); + gEBN("a")[0].style.color = "red"; + if(getCookie("menu0")=="off") { + collapse(gEBN("a")[0]); + } + } + + function collapse(el) { + var ai = 0; + while(ai<gEBN("a").length && gEBN("a")[ai++]!=el); + tb = el.parentNode.parentNode.parentNode; + el.style.color = el.style.color=="" ? "red" : ""; + for(i=1; i<gEBTN("tr",tb).length; i++) { + tr = gEBTN("tr",tb)[i]; + if(i==1) { + st = tr.style.display=="none" ? "" : "none"; + } + sDIS(tr,st); + } + window.focus(); + } + + function hideLeft(el) { + if(el.innerHTML=="hide left panel") { + el.innerHTML = "show left panel"; + gEBI("hide_top").appendChild(el); + sDIS(gEBI("left"),"none"); + sDIS(gEBI("hide_top")); + } + else { + el.innerHTML = "hide left panel"; + gEBI("hide_left").appendChild(el); + sDIS(gEBI("left")); + sDIS(gEBI("hide_top"),"none"); + } + } + + function submitCode(el) { + if(gEBI('file').value!='') { + gEBI('ta').value = ''; + } + if(el.name=="sc") { + gEBI("download").value = 2; + } + else if(el.name=="dl") { + gEBI("download").value = 1; + } + else { + gEBI("download").value = 0; + } + var elems = gEBTN("input"); + for(i=0; i<elems.length; i++) { + if(elems[i].type=="checkbox" && elems[i].checked) { + elems[i].value = "on"; + } + } + document.stylist.submit(); + } + + var t = null; + var r = null; + var i = null; + var h = null; + var k = null; + var n = null; + var d = null; + + function gEBI(id) { + return document.getElementById(id); + } + function gEBN(nm, el) { + return el==undefined ? document.getElementsByName(nm) : el.getElementsByName(nm); + } + function gEBTN(tn, el) { + return el==undefined ? document.getElementsByTagName(tn) : el.getElementsByTagName(tn); + } + function sDIS(el,st) { + el.style.display = st==undefined ? "" : st; + } + + </script> + + <style> + body, table { + font-family: "Lucida Grande", "trebuchet ms", verdana, Tahoma, Arial, Verdana, Helvetica, sans-serif; + color: #444444; + font-size: 11px; + background-color: #ffffff; + margin-top: 0px; + } + input { + font-family: "Lucida Grande", "trebuchet ms", verdana, Tahoma, Arial, Verdana, Helvetica, sans-serif; + border: 1px solid #888888; + font-size: 10px; + background-color: #ffffff; + } + textarea { + font-family: Courier New, Bitstream Vera Sans Mono, Courier, sans-serif; + border: 0px; + font-size: 12px; + background-color: #ffffff; + } + a { + text-decoration: none; + color: black; + font-weight: normal; + } + a:hover { + color: #0094F2; + } + table { + border: 1px solid #e7e7e7; + } + td { + padding: 2px 5px 2px 5px; + } + h1 { + font-variant: small-caps; + font-size: 20px; + margin: 0px; + } + hr { + height: 1px; + margin-bottom: 5px; + } + .button { + font-size: 10px; + color: #666666; + margin: 0px; + } + .check { + border: 0px; + vertical-align: middle; + } + .h { + font-size: 11px; + color: #666666; + font-weight: bold; + text-align: left; + margin: 0px; + border-bottom: 1px solid #e7e7e7; + padding-bottom: 3px; + padding-right: 0px; + } + .k { + font-style: italic; + } + .l { + border-bottom: 1px solid #e7e7e7; + } + </style> + + </head> + <body> + <table width="100%" height="98%" cellpadding=0 cellspacing=0 border=0 style="margin-top: 10px; border: 0px;"> + <form action="phpStylist.php" method="POST" name="stylist" enctype="multipart/form-data"> + <tr height=1> + <td valign=top style="padding: 0px;"> + <table cellpadding=0 cellspacing=0 border=0 style="border: 0px;"> + <tr> + <td style="padding: 0px;"><h1>phpStylist by Mr. Milk</h1></td> + <td style="padding-left: 20px;"valign=bottom><i>“because your code may not work, but it must look professional!!!”</i></td> + </tr> + </table> + <hr> + </td> + </tr> + <tr> + <td valign=top style="padding: 0px;"> + <table width="100%" height="100%" cellpadding=0 cellspacing=0 border=0 style="border: 0px"> + <tr> + <td width="290" valign=top id="left"> + <table id="g" name="g" width="290" style="margin-bottom: 10px;" cellpadding=0 cellspacing=0 border=0> + <tr> + <td id="h" name="h" class="h" nowrap></td> + <td align=right class="l" nowrap><a href="#" name="a" title="expand/collapse" onclick="collapse(this); setCookie(); return false;">•••</a></td> + </tr> + <tr style="display: none;"> + <td id="k" name="k" class="k" colspan=2></td> + </tr> + </table> + <table id="m" style="display: none; margin-bottom: 10px;"> + <tr id="e" name="e" style="display: none;"> + <td colspan=2 nowrap> + <input type="checkbox" class="check" onclick="setCookie();" value="off"><span></span> + </td> + </tr> + <tr id="i" name="i" style="display: none;"> + <td colspan=2> + <input type="text" size=2 value="2" onchange="setCookie();"><span></span> + </td> + </tr> + <tr id="f" name="f"> + <td colspan=2 style="padding-top: 10px;"> + <input type="file" name="file" id="file" size=39> + </td> + </tr> + <tr id="x" name="x"> + <td colspan=2 style="padding-top: 0px;"> + <input type="radio" class="check" id="textarea" name="textarea" onclick="switchPanels(this); setCookie();" value="on" checked>show editable text box<br> + <input type="radio" class="check" id="textarea" name="textarea" onclick="switchPanels(this); setCookie();" value="off">show syntax highlighted code<br> + <input type="checkbox" class="check" id="iso8859" name="iso8859" onclick="setCookie();" value="off">use ISO-8859-1 charset (default UTF-8)<br> + <input type="checkbox" class="check" id="nowrap" name="nowrap" onclick="setCookie();" value="off">do not wrap lines in right panel + </td> + </tr> + <tr id="s" name="s"> + <td colspan=2 style="padding-bottom: 10px;"> + <input type="button" name="pv" onclick="submitCode(this);" value=" Preview " class="button"> + <input type="button" name="dl" onclick="submitCode(this);" value=" Download " class="button"> + <input type="button" name="sc" onclick="submitCode(this);" value="Use Sample" class="button"> + <input type="hidden" name="download" id="download"> + </td> + </tr> + </table> + <div id="hide_left"><a href="#" id="hide" onclick="hideLeft(this);" style="color: #0094F2" class="k">hide left panel</a></div> + </td> + <td valign=top style="padding-bottom: 10px;"> + <table width="100%" height="100%" cellpadding=0 cellspacing=0 border=0> + <tr height=1> + <td style="border-bottom: 1px solid #f5f5f5; padding: 0px; margin: 0px;"> + <div id="hide_top" style="display: none; margin-left: 5px;"></div> + </td> + </tr> + <?echo parseFile();?> + </table> + </td> + </tr> + </table> + </td> + </tr> + </table> + </form> + </body> +</html> + +<?php +function parseFile($download = false) +{ + global $HTTP_POST_FILES; + $code = ""; + $stylist = new phpStylist(); + if ((isset($_REQUEST['file']) && $_REQUEST['file']!="") || (isset($HTTP_POST_FILES['file']['tmp_name']) && $HTTP_POST_FILES['file']['tmp_name'] != "none" && $HTTP_POST_FILES['file']['tmp_name'] != "")) { + $file = isset($_REQUEST['file']) ? $_REQUEST['file'] : $HTTP_POST_FILES['file']['tmp_name']; + $code = loadFile($file); + if (isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" && !isDownload()) { + $code = utf8_encode($code); + } + } + elseif (isset($_REQUEST["download"]) && $_REQUEST["download"] == '2') { + $code = getSampleCode(); + } + elseif (isset($_REQUEST["ta"]) && $_REQUEST["ta"] != '') { + $code = stripslashes($_REQUEST["ta"]); + if (isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" && isDownload()) { + $code = utf8_decode($code); + } + } + if (!empty($code)) { + foreach ($_REQUEST as $k => $v) { + if (isset($stylist->options[strtoupper($k)])) { + $stylist->options[strtoupper($k)] = $v != "off"; + } + } + if (isset($_REQUEST["indent_with_tabs"]) && $_REQUEST["indent_with_tabs"] != "off") { + $stylist->indent_char = "\t"; + } + if (isset($_REQUEST["indent_size"]) && $_REQUEST["indent_size"] != "" && $_REQUEST["indent_size"] != "null") { + $stylist->indent_size = $_REQUEST["indent_size"]; + } + if (strpos($code, '<?') === false) { + $code = '<?php ' . $code . ' ?' . '>'; + } + $formatted = $stylist->formatCode($code); + $highlight = highlight_string($formatted, true); + if (isset($HTTP_POST_FILES['file']['tmp_name']) && file_exists($HTTP_POST_FILES['file']['tmp_name'])) { + unlink($HTTP_POST_FILES['file']['tmp_name']); + } + $nowrap = isset($_REQUEST["nowrap"]) && $_REQUEST["nowrap"] == 'on' ? "nowrap" : ""; + $tawrap = $nowrap == "" ? "" : "wrap='off' "; + $display = isset($_REQUEST["textarea"]) && $_REQUEST["textarea"] == 'on' ? "" : "style='display: none;'"; + $textarea = "<tr id='tx' $display><td valign=top><textarea $tawrap style='width: 100%; height: 100%;' id='ta' name='ta'>" . htmlspecialchars($formatted) . "</textarea></td></tr>"; + $display = isset($_REQUEST["textarea"]) && $_REQUEST["textarea"] == 'on' ? "style='display: none;'" : ""; + $frame = "<tr id='hl' $display><td valign=top $nowrap>$highlight</td></tr>"; + } + else { + $nowrap = isset($_REQUEST["nowrap"]) && $_REQUEST["nowrap"] == 'on' ? "nowrap" : ""; + $tawrap = $nowrap == "" ? "" : "wrap='off' "; + $textarea = "<tr id='tx'><td valign=top><textarea $tawrap style='width: 100%; height=100%;' id='ta' name='ta'></textarea></td></tr>"; + $frame = "<tr id='hl' style='display: none;'><td valign=top $nowrap></td></tr>"; + } + if ($download) { + return isset($formatted) ? $formatted : ""; + } + else { + return $textarea . $frame; + } +} + +function isCommandLine() { + global $argv; + return ((is_array($argv) && count($argv)>0) || (is_array($_SERVER['argv']) && count($_SERVER['argv'])>0) || (is_array($GLOBALS['HTTP_SERVER_VARS']['argv']) && count($GLOBALS['HTTP_SERVER_VARS']['argv'])>0)); +} + +function processBatch() { + + global $argv; + if (is_array($argv)) { + $options = $argv; + } + elseif (is_array($_SERVER['argv'])) { + $options = $_SERVER['argv']; + } + elseif (is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) { + $options = $GLOBALS['HTTP_SERVER_VARS']['argv']; + } + foreach($options as $index=>$option) { + if($option=="--help") { + echo "phpStylist v0.8 by Mr. Milk\n"; + echo "usage: phpStylist source_file options\n\n"; + echo "Indentation and General Formatting:\n"; + echo "--indent_size n\n"; + echo "--indent_with_tabs\n"; + echo "--keep_redundant_lines\n"; + echo "--space_inside_parentheses\n"; + echo "--space_outside_parentheses\n"; + echo "--space_after_comma\n\n"; + echo "Operators:\n"; + echo "--space_around_assignment\n"; + echo "--align_var_assignment\n"; + echo "--space_around_comparison\n"; + echo "--space_around_arithmetic\n"; + echo "--space_around_logical\n"; + echo "--space_around_colon_question\n\n"; + echo "Functions, Classes and Objects:\n"; + echo "--line_before_function\n"; + echo "--line_before_curly_function\n"; + echo "--line_after_curly_function\n"; + echo "--space_around_obj_operator\n"; + echo "--space_around_double_colon\n\n"; + echo "Control Structures:\n"; + echo "--space_after_if\n"; + echo "--else_along_curly\n"; + echo "--line_before_curly\n"; + echo "--add_missing_braces\n"; + echo "--line_after_break\n"; + echo "--space_inside_for\n"; + echo "--indent_case\n\n"; + echo "Arrays and Concatenation:\n"; + echo "--line_before_array\n"; + echo "--vertical_array\n"; + echo "--align_array_assignment\n"; + echo "--space_around_double_arrow\n"; + echo "--vertical_concat\n"; + echo "--space_around_concat\n\n"; + echo "Comments:\n"; + echo "--line_before_comment_multi\n"; + echo "--line_after_comment_multi\n"; + echo "--line_before_comment\n"; + echo "--line_after_comment\n"; + exit; + } + if($index==1) { + $_REQUEST["file"] = $option; + } + elseif($option=="--indent_size") { + $_REQUEST["indent_size"] = $options[$index+1]; + } + elseif($index>0 && $options[$index-1]!="indent_size") { + $_REQUEST[substr($option, 2)] = "on"; + } + } + $_REQUEST["download"] = 2; + $str = parseFile(true); + echo $str; + exit; + +} + +function isDownload() +{ + return isset($_REQUEST["download"]) && $_REQUEST["download"] == '1'; +} + +function downloadFile() +{ + global $HTTP_POST_FILES; + $charset = isset($_REQUEST["iso8859"]) && $_REQUEST["iso8859"]!="off" ? "ISO-8859-1" : "UTF-8"; + $str = parseFile(true); + if ($str != "") { + $fn = isset($HTTP_POST_FILES['file']) && $HTTP_POST_FILES['file']['name'] != '' ? $HTTP_POST_FILES['file']['name'] : "phpStylist.php"; + header("Expires: Wed, 20 Jun 2007 00:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + header("Content-Type: text/plain; charset=".$charset); + header('Content-Disposition: attachment; filename="' . $fn . '";'); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Content-Transfer-Encoding: binary"); + } + echo $str; + exit; +} + +function loadFile($filename) +{ + $code = ""; + if(filesize($filename)>0) { + $f = fopen("$filename", "rb"); + $code = fread($f, filesize($filename)); + fclose($f); + } + return $code; +} + +function getSampleCode() +{ + $sample = 'PD9waHANCi8qKioNCiAqIHBocFN0eWxpc3QgZGVtb25zdHJhdGlvbiBjb2RlDQogKiBieSBNci4gTWlsayAoYWthIE1hcmNlbG8gTGVpdGUpDQogKiBtcm1pbGtAYW55c29mdC5jb20uYnINCiAqLw0KDQokd29ya19ob3VycyA9IDEyOw0KJHRpbWUgPSAkd29ya19ob3VycyoyOw0KJGRldmVsb3BlciA9ICRwb29yZ3V5Ow0KJGdvZCA9ICQkbXJnYXRlczsNCiR3YWdlID0gJHdvcmtfaG91cnMvMjsNCiRib251cyA9ICR3YWdlICogMC4wMDAwMTsNCiR3YXJuZWQgPSBmYWxzZTsNCiRwcm9wZXJ0aWVzID0gYXJyYXkoImdhdGVzIj0+YXJyYXkoImV2ZXJ5dGhpbmciPT4ieWVzIiwgImFueXRoaW5nIj0+InllcyIsICJhbnl0aGluZyBlbHNlIj0+InllcyIsICJ5b3UiPT4iY29tcGxldGVseSIpLCAiZGV2ZWxvcGVyIj0+YXJyYXkoImFuIG9sZCBjYXIiPT4iMiBpbnN0YWxsbWVudHMiLCAibW9kZGVkIGNvbXB1dGVyIj0+ImFsbW9zdCIsICJiZWVyIG11ZyI9PiJzdXJlISIpKTsNCiR3YXJuaW5nID0gIk1yLiAiLiRkZXZlbG9wZXIuIiwgeW91IG1hZGUgIi4gJGdvZC4gIiB1bmhhcHB5IHRvZGF5LiI7DQovLyBkZXZlbG9wZXIncyBtaXNlcmFibGUgbGlmZQ0KZm9yKCR5b3U9JGRldmVsb3BlcjskeW91PCRnb2Q7JHlvdSsrKSB7DQogIC8vIGxldCdzIHVzZSBoaXMgcG90ZW50aWFsDQogIGlmKCR3b3JrPD0kdGltZSo0KSB7DQogICAgJHdvcmsrKzsNCiAgICAkc2xlZXAtLTsNCiAgICAkZW5yaWNoR2F0ZXMoKTsNCiAgfQ0KICAvLyBjaGlja2VuaW5nIG91dCBodWg/DQogIGVsc2UgaWYoJHRpcmVkKSB7DQogICAgaWYoISR3YXJuZWQpIHsNCiAgICAgICRzY2FyZVRvRGVhdGgoJGRldmVsb3Blciwkd2FybmluZyk7DQogICAgICAkYm9udXMvPTI7DQogICAgfQ0KICAgIGVsc2UgaWYoJGJvbnVzID4gMCkNCiAgICAgICRib251cz0wOw0KICAgIGVsc2Ugew0KICAgICAgZmlyZSgkZGV2ZWxvcGVyKTsNCiAgICAgICRyZXBsYWNlbWVudCA9IGZpbmRJZGlvdCgpOw0KICAgICAgaGlyZSgkcmVwbGFjZW1lbnQsICR3YWdlLzIpOw0KICAgIH0NCiAgfQ0KICAvLyB0aGlzIGd1eSBjYW4gdGFrZSBpdA0KICBlbHNlaWYoJHdhZ2U+MCkNCiAgICAkd2FnZS0tOw0KICAvLyBoYXZlIHdlIHJlYWxseSBmb3VuZCB3aG8gd2UndmUgYmVlbiBsb29raW5nIGZvcj8NCiAgZWxzZSB7DQogICAgJGVucmljaEdhdGVzKCk7DQogICAgJGhlYWx0aF9sZXZlbCA9IGVtZXJnZW5jeVJvb20oJGRldmVsb3Blcik7DQogICAgLyogc2FuaXR5IGNoZWNrISAqLw0KICAgIHN3aXRjaCgkaGVhbHRoX2xldmVsKSB7DQogICAgICBjYXNlICJncmVhdCI6DQogICAgICAgIGZpcmUoJGRvY3Rvcik7DQogICAgICAgIHVuc2V0KCRwcm9wZXJ0aWVzWyJkZXZlbG9wZXIiXSk7DQogICAgICAgIHVuc2V0KCRwcm9wZXJ0aWVzWyJnYXRlcyJdWyJ5b3UiXSk7DQogICAgICAgIGN1Y2tvb3NOZXN0KCRkZXZlbG9wZXIpOw0KICAgICAgICAkcmVwbGFjZW1lbnQgPSBmaW5kSWRpb3QoKTsNCiAgICAgICAgaGlyZSgkcmVwbGFjZW1lbnQsICRtaW5fd2FnZSk7DQogICAgICAgIGJyZWFrOw0KICAgICAgY2FzZSAiZ29vZCI6DQogICAgICBjYXNlICJiYWQiOg0KICAgICAgICBiYWNrVG9Xb3JrKCk7DQogICAgICBicmVhazsNCiAgICAgIGNhc2UgInRlcm1pbmFsIjoNCiAgICAgICAgZmlyZSgkZGV2ZWxvcGVyKTsNCiAgICAgICAgJHJlcGxhY2VtZW50ID0gJGhhc19icm90aGVyID8gImJyb3RoZXIiIDogImZyaWVuZCI7DQogICAgICAgIGhpcmUoJHJlcGxhY2VtZW50LCAkbWluX3dhZ2UvMik7DQogICAgICBicmVhazsNCiAgICAgIGRlZmF1bHQ6DQogICAgfQ0KICB9DQp9DQovKioqDQogKiBGdW5jdGlvbnMNCiAqLw0KDQpmdW5jdGlvbiBlbWVyZ2VuY3lSb29tKCR3aG8pIHsNCiAgJGhlYWx0aHkgPWZhbHNlOw0KICAkaW50ZXJuID0gMDsNCiAgd2hpbGUoISRoZWFsdGh5ICYmICRoZWFsdGh5IT0iZW5kIikNCiAgICAkaGVhbHRoeSA9IHNjcnVic0ludGVybk9waW5pb25zKCR3aG8sICsrJGludGVybik7DQogICRpbnRlcm4gPSAwOw0KICB3aGlsZSghJGhlYWx0aHkgJiYgJGhlYWx0aHkhPSJlbmQiKQ0KICAgICRoZWFsdGh5ID0gZXJJbnRlcm5PcGluaW9ucygkd2hvLCAkaW50ZXJuKyspOw0KICByZXR1cm4gJGhlYWx0aHk7DQp9DQoNCmZ1bmN0aW9uIGhpcmUoJHdobywgJHdhZ2UpIHsNCiAgJGRldmVsb3BlciA9IG5ldyBTbGF2ZSgpOw0KICAkZGV2ZWxvcGVyLT5wZXJzb24gPSAkd2hvOw0KICAkZGV2ZWxvcGVyLT5zZXRTYWxhcnkoJHdhZ2UpOw0KICAkY29zdCA9IGhyUm91dGluZXM6OmdldEhpcmluZ0Nvc3QoKTsNCiAgJGRldmVsb3Blci0+c2V0RGVidCgkY29zdCk7DQp9DQoNCmZ1bmN0aW9uIGZpcmUoJHdobykgew0KICBjYWxsU2VjdXJpdHkoKTsNCiAgZ2V0SGltT3V0KCR3aG8pOw0KfQ0KDQo/Pg0K'; + return base64_decode($sample); +} + +class phpStylist +{ + var $indent_size = 2; + var $indent_char = " "; + var $block_size = 3; + var $options = array( + "SPACE_INSIDE_PARENTHESES" => false, + "SPACE_OUTSIDE_PARENTHESES" => false, + "SPACE_INSIDE_FOR" => false, + "SPACE_AFTER_IF" => false, + "SPACE_AFTER_COMMA" => false, + "SPACE_AROUND_OBJ_OPERATOR" => false, + "SPACE_AROUND_DOUBLE_COLON" => false, + "SPACE_AROUND_DOUBLE_ARROW" => false, + "SPACE_AROUND_ASSIGNMENT" => false, + "SPACE_AROUND_COMPARISON" => false, + "SPACE_AROUND_COLON_QUESTION" => false, + "SPACE_AROUND_LOGICAL" => false, + "SPACE_AROUND_ARITHMETIC" => false, + "SPACE_AROUND_CONCAT" => false, + "LINE_BEFORE_FUNCTION" => false, + "LINE_BEFORE_CURLY" => false, + "LINE_BEFORE_CURLY_FUNCTION" => false, + "LINE_AFTER_CURLY_FUNCTION" => false, + "LINE_BEFORE_ARRAY" => false, + "LINE_BEFORE_COMMENT" => false, + "LINE_AFTER_COMMENT" => false, + "LINE_BEFORE_COMMENT_MULTI" => false, + "LINE_AFTER_COMMENT_MULTI" => false, + "LINE_AFTER_BREAK" => false, + "VERTICAL_CONCAT" => false, + "VERTICAL_ARRAY" => false, + "INDENT_CASE" => false, + "KEEP_REDUNDANT_LINES" => false, + "ADD_MISSING_BRACES" => false, + "ALIGN_ARRAY_ASSIGNMENT" => false, + "ALIGN_VAR_ASSIGNMENT" => false, + "ELSE_ALONG_CURLY" => false, + ); + var $_new_line = "\n"; + var $_indent = 0; + var $_for_idx = 0; + var $_code = ""; + var $_log = false; + var $_pointer = 0; + var $_tokens = 0; + + function phpStylist() + { + define("S_OPEN_CURLY", "{"); + define("S_CLOSE_CURLY", "}"); + define("S_OPEN_BRACKET", "["); + define("S_CLOSE_BRACKET", "]"); + define("S_OPEN_PARENTH", "("); + define("S_CLOSE_PARENTH", ")"); + define("S_SEMI_COLON", ";"); + define("S_COMMA", ","); + define("S_CONCAT", "."); + define("S_COLON", ":"); + define("S_QUESTION", "?"); + define("S_EQUAL", "="); + define("S_EXCLAMATION", "!"); + define("S_IS_GREATER", ">"); + define("S_IS_SMALLER", "<"); + define("S_MINUS", "-"); + define("S_PLUS", "+"); + define("S_TIMES", "*"); + define("S_DIVIDE", "/"); + define("S_MODULUS", "%"); + define("S_REFERENCE", "&"); + define("S_QUOTE", '"'); + define("S_AT", "@"); + define("S_DOLLAR", "$"); + define("S_ABSTRACT", "abstract"); + define("S_INTERFACE", "interface"); + define("S_FINAL", "final"); + define("S_PUBLIC", "public"); + define("S_PRIVATE", "private"); + define("S_PROTECTED", "protected"); + if (defined("T_ML_COMMENT")) { + define("T_DOC_COMMENT", T_ML_COMMENT); + } + elseif (defined("T_DOC_COMMENT")) { + define("T_ML_COMMENT", T_DOC_COMMENT); + } + } + + function formatCode($source = '') + { + $in_for = false; + $in_break = false; + $in_function = false; + $in_concat = false; + $space_after = false; + $curly_open = false; + $array_level = 0; + $arr_parenth = array(); + $switch_level = 0; + $if_level = 0; + $if_pending = 0; + $else_pending = false; + $if_parenth = array(); + $switch_arr = array(); + $halt_parser = false; + $after = false; + $this->_tokens = token_get_all($source); + foreach ($this->_tokens as $index => $token) { + list($id, $text) = $this->_get_token($token); + $this->_pointer = $index; + if ($halt_parser && $id != S_QUOTE) { + $this->_append_code($text, false); + continue; + } + if (substr(phpversion(), 0, 1) == "4" && $id == T_STRING) { + switch (strtolower(trim($text))) { + case S_ABSTRACT: + case S_INTERFACE: + case S_FINAL: + case S_PUBLIC: + case S_PRIVATE: + case S_PROTECTED: + $id = T_PUBLIC; + default: + } + } + switch ($id) { + case S_OPEN_CURLY: + $condition = $in_function ? $this->options["LINE_BEFORE_CURLY_FUNCTION"] : $this->options["LINE_BEFORE_CURLY"]; + $this->_set_indent( + 1); + $this->_append_code((!$condition ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf($this->options["LINE_AFTER_CURLY_FUNCTION"] && $in_function && !$this->_is_token_lf()) . $this->_get_crlf_indent()); + $in_function = false; + break; + + case S_CLOSE_CURLY: + if ($curly_open) { + $curly_open = false; + $this->_append_code(trim($text)); + } + else { + if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["s" . $switch_level] == $this->_indent - 2) { + if ($this->options["INDENT_CASE"]) { + $this->_set_indent( - 1); + } + $switch_arr["l" . $switch_level]--; + $switch_arr["c" . $switch_level]--; + } + while ($switch_level > 0 && $switch_arr["l" . $switch_level] == 0 && $this->options["INDENT_CASE"]) { + unset($switch_arr["s" . $switch_level]); + unset($switch_arr["c" . $switch_level]); + unset($switch_arr["l" . $switch_level]); + $switch_level--; + if ($switch_level > 0) { + $switch_arr["l" . $switch_level]--; + } + $this->_set_indent( - 1); + $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent()); + $text = ''; + } + if ($text != '') { + $this->_set_indent( - 1); + $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent()); + } + } + break; + + case S_SEMI_COLON: + if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["s" . $switch_level] == $this->_indent - 2) { + if ($this->options["INDENT_CASE"]) { + $this->_set_indent( - 1); + } + $switch_arr["l" . $switch_level]--; + $switch_arr["c" . $switch_level]--; + } + if ($in_concat) { + $this->_set_indent( - 1); + $in_concat = false; + } + $this->_append_code($text . $this->_get_crlf($this->options["LINE_AFTER_BREAK"] && $in_break) . $this->_get_crlf_indent($in_for)); + while ($if_pending > 0) { + $text = $this->options["ADD_MISSING_BRACES"] ? "}" : ""; + $this->_set_indent( - 1); + if ($text != "") { + $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_crlf_indent()); + } + else { + $this->_append_code($this->_get_crlf_indent()); + } + $if_pending--; + if ($this->_is_token(array(T_ELSE, T_ELSEIF))) { + break; + } + } + if ($this->_for_idx == 0) { + $in_for = false; + } + $in_break = false; + $in_function = false; + break; + + case S_OPEN_BRACKET: + case S_CLOSE_BRACKET: + $this->_append_code($text); + break; + + case S_OPEN_PARENTH: + if ($if_level > 0) { + $if_parenth["i" . $if_level]++; + } + if ($array_level > 0) { + $arr_parenth["i" . $array_level]++; + if ($this->_is_token(array(T_ARRAY), true) && !$this->_is_token(S_CLOSE_PARENTH)) { + $this->_set_indent( + 1); + $this->_append_code((!$this->options["LINE_BEFORE_ARRAY"] ? '' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent()); + break; + } + } + $this->_append_code($this->_get_space($this->options["SPACE_OUTSIDE_PARENTHESES"] || $space_after) . $text . $this->_get_space($this->options["SPACE_INSIDE_PARENTHESES"])); + $space_after = false; + break; + + case S_CLOSE_PARENTH: + if ($array_level > 0) { + $arr_parenth["i" . $array_level]--; + if ($arr_parenth["i" . $array_level] == 0) { + $comma = substr(trim($this->_code), - 1) != "," && $this->options['VERTICAL_ARRAY'] ? "," : ""; + $this->_set_indent( - 1); + $this->_append_code($comma . $this->_get_crlf_indent() . $text . $this->_get_crlf_indent()); + unset($arr_parenth["i" . $array_level]); + $array_level--; + break; + } + } + $this->_append_code($this->_get_space($this->options["SPACE_INSIDE_PARENTHESES"]) . $text . $this->_get_space($this->options["SPACE_OUTSIDE_PARENTHESES"])); + if ($if_level > 0) { + $if_parenth["i" . $if_level]--; + if ($if_parenth["i" . $if_level] == 0) { + if (!$this->_is_token(S_OPEN_CURLY) && !$this->_is_token(S_SEMI_COLON)) { + $text = $this->options["ADD_MISSING_BRACES"] ? "{" : ""; + $this->_set_indent( + 1); + $this->_append_code((!$this->options["LINE_BEFORE_CURLY"] || $text == "" ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent()); + $if_pending++; + } + unset($if_parenth["i" . $if_level]); + $if_level--; + } + } + break; + + case S_COMMA: + if ($array_level > 0) { + $this->_append_code($text . $this->_get_crlf_indent($in_for)); + } + else { + $this->_append_code($text . $this->_get_space($this->options["SPACE_AFTER_COMMA"])); + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $this->options["SPACE_AFTER_COMMA"]; + } + } + break; + + case S_CONCAT: + $condition = $this->options["SPACE_AROUND_CONCAT"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + if ($this->options["VERTICAL_CONCAT"]) { + if (!$in_concat) { + $in_concat = true; + $this->_set_indent( + 1); + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_crlf_indent()); + } + else { + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + } + break; + + case T_CONCAT_EQUAL: + case T_DIV_EQUAL: + case T_MINUS_EQUAL: + case T_PLUS_EQUAL: + case T_MOD_EQUAL: + case T_MUL_EQUAL: + case T_AND_EQUAL: + case T_OR_EQUAL: + case T_XOR_EQUAL: + case T_SL_EQUAL: + case T_SR_EQUAL: + case S_EQUAL: + $condition = $this->options["SPACE_AROUND_ASSIGNMENT"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_IS_EQUAL: + case S_IS_GREATER: + case T_IS_GREATER_OR_EQUAL: + case T_IS_SMALLER_OR_EQUAL: + case S_IS_SMALLER: + case T_IS_IDENTICAL: + case T_IS_NOT_EQUAL: + case T_IS_NOT_IDENTICAL: + $condition = $this->options["SPACE_AROUND_COMPARISON"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_BOOLEAN_AND: + case T_BOOLEAN_OR: + case T_LOGICAL_AND: + case T_LOGICAL_OR: + case T_LOGICAL_XOR: + case T_SL: + case T_SR: + $condition = $this->options["SPACE_AROUND_LOGICAL"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_DOUBLE_COLON: + $condition = $this->options["SPACE_AROUND_DOUBLE_COLON"]; + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case S_COLON: + if ($switch_level > 0 && $switch_arr["l" . $switch_level] > 0 && $switch_arr["c" . $switch_level] < $switch_arr["l" . $switch_level]) { + $switch_arr["c" . $switch_level]++; + if ($this->options["INDENT_CASE"]) { + $this->_set_indent( + 1); + } + $this->_append_code($text . $this->_get_crlf_indent()); + } + else { + $condition = $this->options["SPACE_AROUND_COLON_QUESTION"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + } + if (($in_break || $this->_is_token(S_CLOSE_CURLY)) && $switch_level > 0 && $switch_arr["l" . $switch_level] > 0) { + if ($this->options["INDENT_CASE"]) { + $this->_set_indent( - 1); + } + $switch_arr["l" . $switch_level]--; + $switch_arr["c" . $switch_level]--; + } + break; + + case S_QUESTION: + $condition = $this->options["SPACE_AROUND_COLON_QUESTION"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_DOUBLE_ARROW: + $condition = $this->options["SPACE_AROUND_DOUBLE_ARROW"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case S_MINUS: + case S_PLUS: + case S_TIMES: + case S_DIVIDE: + case S_MODULUS: + $condition = $this->options["SPACE_AROUND_ARITHMETIC"]; + if ($this->_is_token(S_OPEN_PARENTH)) { + $space_after = $condition; + } + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_OBJECT_OPERATOR: + $condition = $this->options["SPACE_AROUND_OBJ_OPERATOR"]; + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($condition)); + break; + + case T_FOR: + $in_for = true; + case T_FOREACH: + case T_WHILE: + case T_DO: + case T_IF: + case T_SWITCH: + $space_after = $this->options["SPACE_AFTER_IF"]; + $this->_append_code($text . $this->_get_space($space_after), false); + if ($id == T_SWITCH) { + $switch_level++; + $switch_arr["s" . $switch_level] = $this->_indent; + $switch_arr["l" . $switch_level] = 0; + $switch_arr["c" . $switch_level] = 0; + } + $if_level++; + $if_parenth["i" . $if_level] = 0; + break; + + case T_FUNCTION: + case T_CLASS: + case T_INTERFACE: + case T_FINAL: + case T_ABSTRACT: + case T_PUBLIC: + case T_PROTECTED: + case T_PRIVATE: + if (!$in_function) { + if ($this->options["LINE_BEFORE_FUNCTION"]) { + $this->_append_code($this->_get_crlf($after || !$this->_is_token(array(T_COMMENT, T_ML_COMMENT, T_DOC_COMMENT), true)) . $this->_get_crlf_indent() . $text . $this->_get_space()); + $after = false; + } + else { + $this->_append_code($text . $this->_get_space(), false); + } + $in_function = true; + } + else { + $this->_append_code($this->_get_space() . $text . $this->_get_space()); + } + break; + + case T_START_HEREDOC: + $this->_append_code($this->_get_space($this->options["SPACE_AROUND_ASSIGNMENT"]) . $text); + break; + + case T_END_HEREDOC: + $this->_append_code($this->_get_crlf() . $text . $this->_get_crlf_indent()); + break; + + case T_COMMENT: + case T_ML_COMMENT: + case T_DOC_COMMENT: + if (is_array($this->_tokens[$index - 1])) { + $pad = $this->_tokens[$index - 1][1]; + $i = strlen($pad) - 1; + $k = ""; + while (substr($pad, $i, 1) != "\n" && substr($pad, $i, 1) != "\r" && $i >= 0) { + $k .= substr($pad, $i--, 1); + } + $text = preg_replace("/\r?\n$k/", $this->_get_crlf_indent(), $text); + } + $after = $id == (T_COMMENT && preg_match("/^\/\//", $text)) ? $this->options["LINE_AFTER_COMMENT"] : $this->options["LINE_AFTER_COMMENT_MULTI"]; + $before = $id == (T_COMMENT && preg_match("/^\/\//", $text)) ? $this->options["LINE_BEFORE_COMMENT"] : $this->options["LINE_BEFORE_COMMENT_MULTI"]; + if ($prev = $this->_is_token(S_OPEN_CURLY, true, $index, true)) { + $before = $before && !$this->_is_token_lf(true, $prev); + } + $after = $after && (!$this->_is_token_lf() || !$this->options["KEEP_REDUNDANT_LINES"]); + if ($before) { + $this->_append_code($this->_get_crlf(!$this->_is_token(array(T_COMMENT), true)) . $this->_get_crlf_indent() . trim($text) . $this->_get_crlf($after) . $this->_get_crlf_indent()); + } + else { + $this->_append_code(trim($text) . $this->_get_crlf($after) . $this->_get_crlf_indent(), false); + } + break; + + case T_DOLLAR_OPEN_CURLY_BRACES: + case T_CURLY_OPEN: + $curly_open = true; + case T_NUM_STRING: + case T_BAD_CHARACTER: + $this->_append_code(trim($text)); + break; + + case T_EXTENDS: + case T_IMPLEMENTS: + case T_INSTANCEOF: + case T_AS: + $this->_append_code($this->_get_space() . $text . $this->_get_space()); + break; + + case S_DOLLAR: + case S_REFERENCE: + case T_INC: + case T_DEC: + $this->_append_code(trim($text), false); + break; + + case T_WHITESPACE: + $redundant = ""; + if ($this->options["KEEP_REDUNDANT_LINES"]) { + $lines = preg_match_all("/\r?\n/", $text, $matches); + $lines = $lines > 0 ? $lines - 1 : 0; + $redundant = $lines > 0 ? str_repeat($this->_new_line, $lines) : ""; + $current_indent = $this->_get_indent(); + if (substr($this->_code, strlen($current_indent) * - 1) == $current_indent && $lines > 0) { + $redundant .= $current_indent; + } + } + if($this->_is_token(array(T_OPEN_TAG), true)) { + $this->_append_code($text, false); + } + else { + $this->_append_code($redundant . trim($text), false); + } + break; + + case S_QUOTE: + $this->_append_code($text, false); + $halt_parser = !$halt_parser; + break; + + case T_ARRAY: + if ($this->options["VERTICAL_ARRAY"]) { + $next = $this->_is_token(array(T_DOUBLE_ARROW), true); + $next |= $this->_is_token(S_EQUAL, true); + $next |= $array_level>0; + if ($next) { + $next = $this->_is_token(S_OPEN_PARENTH, false, $index, true); + if ($next) { + $next = !$this->_is_token(S_CLOSE_PARENTH, false, $next); + } + } + if ($next) { + $array_level++; + $arr_parenth["i" . $array_level] = 0; + } + } + case T_STRING: + case T_CONSTANT_ENCAPSED_STRING: + case T_ENCAPSED_AND_WHITESPACE: + case T_VARIABLE: + case T_CHARACTER: + case T_STRING_VARNAME: + case S_AT: + case S_EXCLAMATION: + case T_OPEN_TAG: + case T_OPEN_TAG_WITH_ECHO: + $this->_append_code($text, false); + break; + + case T_CLOSE_TAG: + $this->_append_code($text, !$this->_is_token_lf(true)); + break; + + case T_CASE: + case T_DEFAULT: + if ($switch_arr["l" . $switch_level] > 0 && $this->options["INDENT_CASE"]) { + $switch_arr["c" . $switch_level]--; + $this->_set_indent( - 1); + $this->_append_code($this->_get_crlf_indent() . $text . $this->_get_space()); + } + else { + $switch_arr["l" . $switch_level]++; + $this->_append_code($text . $this->_get_space(), false); + } + break; + + case T_INLINE_HTML: + $this->_append_code($text, false); + break; + + case T_BREAK: + case T_CONTINUE: + $in_break = true; + case T_VAR: + case T_GLOBAL: + case T_STATIC: + case T_CONST: + case T_ECHO: + case T_PRINT: + case T_INCLUDE: + case T_INCLUDE_ONCE: + case T_REQUIRE: + case T_REQUIRE_ONCE: + case T_DECLARE: + case T_EMPTY: + case T_ISSET: + case T_UNSET: + case T_DNUMBER: + case T_LNUMBER: + case T_RETURN: + case T_EVAL: + case T_EXIT: + case T_LIST: + case T_CLONE: + case T_NEW: + case T_FUNC_C: + case T_CLASS_C: + case T_FILE: + case T_LINE: + $this->_append_code($text . $this->_get_space(), false); + break; + + case T_ELSEIF: + $space_after = $this->options["SPACE_AFTER_IF"]; + $added_braces = $this->_is_token(S_SEMI_COLON, true) && $this->options["ADD_MISSING_BRACES"]; + $condition = $this->options['ELSE_ALONG_CURLY'] && ($this->_is_token(S_CLOSE_CURLY, true) || $added_braces); + $this->_append_code($this->_get_space($condition) . $text . $this->_get_space($space_after), $condition); + $if_level++; + $if_parenth["i" . $if_level] = 0; + break; + + case T_ELSE: + $added_braces = $this->_is_token(S_SEMI_COLON, true) && $this->options["ADD_MISSING_BRACES"]; + $condition = $this->options['ELSE_ALONG_CURLY'] && ($this->_is_token(S_CLOSE_CURLY, true) || $added_braces); + $this->_append_code($this->_get_space($condition) . $text, $condition); + if (!$this->_is_token(S_OPEN_CURLY) && !$this->_is_token(array(T_IF))) { + $text = $this->options["ADD_MISSING_BRACES"] ? "{" : ""; + $this->_set_indent( + 1); + $this->_append_code((!$this->options["LINE_BEFORE_CURLY"] || $text == "" ? ' ' : $this->_get_crlf_indent(false, - 1)) . $text . $this->_get_crlf_indent()); + $if_pending++; + } + break; + + default: + $this->_append_code($text . ' ', false); + break; + } + } + return $this->_align_operators(); + } + + function _get_token($token) + { + if (is_string($token)) { + return array($token, $token); + } + else { + return $token; + } + } + + function _append_code($code = "", $trim = true) + { + if ($trim) { + $this->_code = rtrim($this->_code) . $code; + } + else { + $this->_code .= $code; + } + } + + function _get_crlf_indent($in_for = false, $increment = 0) + { + if ($in_for) { + $this->_for_idx++; + if ($this->_for_idx > 2) { + $this->_for_idx = 0; + } + } + if ($this->_for_idx == 0 || !$in_for) { + return $this->_get_crlf() . $this->_get_indent($increment); + } + else { + return $this->_get_space($this->options["SPACE_INSIDE_FOR"]); + } + } + + function _get_crlf($true = true) + { + return $true ? $this->_new_line : ""; + } + + function _get_space($true = true) + { + return $true ? " " : ""; + } + + function _get_indent($increment = 0) + { + return str_repeat($this->indent_char, ($this->_indent + $increment) * $this->indent_size); + } + + function _set_indent($increment) + { + $this->_indent += $increment; + if ($this->_indent < 0) { + $this->_indent = 0; + } + } + + function _is_token($token, $prev = false, $i = 99999, $idx = false) + { + if ($i == 99999) { + $i = $this->_pointer; + } + if ($prev) { + while (--$i >= 0 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE); + } + else { + while (++$i < count($this->_tokens)-1 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE); + } + if (is_string($this->_tokens[$i]) && $this->_tokens[$i] == $token) { + return $idx ? $i : true; + } + elseif (is_array($token) && is_array($this->_tokens[$i])) { + if (in_array($this->_tokens[$i][0], $token)) { + return $idx ? $i : true; + } + elseif ($prev && $this->_tokens[$i][0] == T_OPEN_TAG) { + return $idx ? $i : true; + } + } + return false; + } + + function _is_token_lf($prev = false, $i = 99999) + { + if ($i == 99999) { + $i = $this->_pointer; + } + if ($prev) { + $count = 0; + while (--$i >= 0 && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE && strpos($this->_tokens[$i][1], "\n") === false); + } + else { + $count = 1; + while (++$i < count($this->_tokens) && is_array($this->_tokens[$i]) && $this->_tokens[$i][0] == T_WHITESPACE && strpos($this->_tokens[$i][1], "\n") === false); + } + if (is_array($this->_tokens[$i]) && preg_match_all("/\r?\n/", $this->_tokens[$i][1], $matches) > $count) { + return true; + } + return false; + } + + function _pad_operators($found) + { + global $quotes; + $pad_size = 0; + $result = ""; + $source = explode($this->_new_line, $found[0]); + $position = array(); + array_pop($source); + foreach ($source as $k => $line) { + if (preg_match("/'quote[0-9]+'/", $line)) { + preg_match_all("/'quote([0-9]+)'/", $line, $holders); + for ($i = 0; $i < count($holders[1]); $i++) { + $line = preg_replace("/" . $holders[0][$i] . "/", str_repeat(" ", strlen($quotes[0][$holders[1][$i]])), $line); + } + } + if (strpos($line, "=") > $pad_size) { + $pad_size = strpos($line, "="); + } + $position[$k] = strpos($line, "="); + } + foreach ($source as $k => $line) { + $padding = str_repeat(" ", $pad_size - $position[$k]); + $padded = preg_replace("/^([^=]+?)([\.\+\*\/\-\%]?=)(.*)$/", "\\1{$padding}\\2\\3" . $this->_new_line, $line); + $result .= $padded; + } + return $result; + } + + function _parse_block($blocks) + { + global $quotes; + $pad_chars = ""; + $holders = array(); + if ($this->options['ALIGN_ARRAY_ASSIGNMENT']) { + $pad_chars .= ","; + } + if ($this->options['ALIGN_VAR_ASSIGNMENT']) { + $pad_chars .= ";"; + } + $php_code = $blocks[0]; + preg_match_all("/\/\*.*?\*\/|\/\/[^\n]*|#[^\n]|([\"'])[^\\\\]*?(?:\\\\.[^\\\\]*?)*?\\1/s", $php_code, $quotes); + $quotes[0] = array_values(array_unique($quotes[0])); + for ($i = 0; $i < count($quotes[0]); $i++) { + $patterns[] = "/" . preg_quote($quotes[0][$i], '/') . "/"; + $holders[] = "'quote$i'"; + $quotes[0][$i] = str_replace('\\\\', '\\\\\\\\', $quotes[0][$i]); + } + if (count($holders) > 0) { + $php_code = preg_replace($patterns, $holders, $php_code); + } + $php_code = preg_replace_callback("/(?:.+=.+[" . $pad_chars . "]\r?\n){" . $this->block_size . ",}/", array($this, "_pad_operators"), $php_code); + for ($i = count($holders) - 1; $i >= 0; $i--) { + $holders[$i] = "/" . $holders[$i] . "/"; + } + if (count($holders) > 0) { + $php_code = preg_replace($holders, $quotes[0], $php_code); + } + return $php_code; + } + + function _align_operators() + { + if ($this->options['ALIGN_ARRAY_ASSIGNMENT'] || $this->options['ALIGN_VAR_ASSIGNMENT']) { + return preg_replace_callback("/<\?.*?\?" . ">/s", array($this, "_parse_block"), $this->_code); + } + else { + return $this->_code; + } + } +} +?> diff --git a/indenters/phpStylist.txt b/indenters/phpStylist.txt index ee3f7a2..55b3cc5 100755 --- a/indenters/phpStylist.txt +++ b/indenters/phpStylist.txt @@ -1,161 +1,161 @@ -/*****************************************************************************
- * The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
- * Version 1.1 ("License"); You may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * http://opensource.org/licenses/rpl.php. Software distributed under the
- * License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
- * either express or implied.
- *
- * @product: phpStylist
- * @author: Mr. Milk (aka Marcelo Leite)
- * @email: mrmilk@anysoft.com.br
- * @version: 1.0
- * @date: 2007-11-22
- *
- *****************************************************************************/
-
-CONTENTS
---------
-Below you will find instructions on how to use phpStylist:
-
-- Web Server Usage
-- Command Line Mode
-- PSPad Integration
-- Command Line Options
-
-==============================================================================
-
-WEB SERVER USAGE
-----------------
-
-phpStylist runs as a single file on you web server. You don't need any special
-module or library. It has been tested with php from 4.4.2 to 5.2.2.
-
-Save phpStylist.php to your web server folder and start it from the browser.
-For example, http://localhost/phpStylist.php.
-
-On the left menu, you will see more than 30 options that you can use to adjust
-the application to your coding style. All options are sticky based on cookies.
-Select one of your files or click on the button "Use Sample" and try each
-option to see what it is all about.
-
-If you want to type in or paste code directly into the app, first click on the
-option "SHOW EDITABLE TEXT BOX". The right panel will then become editable.
-
-COMMAND LINE MODE
------------------
-
-You can also use phpStylist through the command line to automatically format
-local files. You will still need php installed.
-
-First, find the exact location of you php.exe and the exact location where you
-placed phpStylist. Let's say they are in
-"C:\Program Files\PHP\php.exe" and "C:\Program Files\Apache\htdocs\phpStylist.php"
-
-You then must run php passing phpStylist.php along with the -f argument. At
-this point the command line would be like this:
-"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
-
-But that's not all. You also need to add the full path of the source file you
-want to format and the options you want to be used. For each of those 34 options
-you see on the web server usage, there will be an option on the command line.
-You can use the "--help" option to see a list of options.
-
-Use the --help switch to see all options (full list at the end of this file):
-"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" --help
-
-The first phpStylist paramenter MUST be the source file name you want to
-format. After the file name, you can add as many options as you want, in any
-order. It can get pretty big, but it works. Another example:
-"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
-"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
---indent_case --indent_size 4 --space_after_comma --line_before_function
-
-Output will be to STDOUT, so if you want to send it to a file, append "> filename"
-at the end of the command line. In our above example:
-"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php"
-"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if
---indent_case --indent_size 4 --line_before_comment_multi --vertical_array
---line_before_function > "C:\Code Library\Formatted Code\destination_file.php"
-
-Don't forget the quotes around long file names.
-
-PSPAD INTEGRATION
------------------
-PSPad is a popular, powerful and free code editor. It can be extended through
-scripting. I have also created a script that will automatically format php code
-from inside the editor. In fact, the script runs phpStylist in command line
-mode, sending the current editor file name. It then get the results and replace
-the code in the editor.
-
-Save the file phpStylist.js to your PSPad javascript folder, usually
-C:\Program Files\PSPad\Script\JScript.
-
-Open the phpStylist.js file and edit the first two variables:
- php_path = "C:\\Program Files\\xampp\\php\\php.exe";
- stylist_path = "C:\\Program Files\\xampp\\htdocs\\phpStylist.php";
-
-Replace the paths with the appropriate for your system. Don't forget to double
-backslashes.
-
-You will also see all the options, some are commented out, some are active (the
-current setup is the one I use). Simply comment out or uncomment the options
-you want to use and save the file. Restart PSPad or use the the option Scripts,
-Recompile Scripts.
-
-Now, just open a php file on the editor and select phpStylist from the menu.
-That's all. You can also select some block of code before using the option so
-you can reformat only that portion. Of course, try to select a full block such
-as a function.
-
-If you don't use PSPad or don't want the integration you don't need the file
-phpStylist.js.
-
-FULL LIST OF OPTIONS
---------------------
-
-Indentation and General Formatting:
---indent_size n n characters per indentation level
---indent_with_tabs Indent with tabs instead of spaces
---keep_redundant_lines Keep redundant lines
---space_inside_parentheses Space inside parentheses
---space_outside_parentheses Space outside parentheses
---space_after_comma Space after comma
-
-Operators:
---space_around_assignment Space around = .= += -= *= /= <<<
---align_var_assignment Align block +3 assigned variables
---space_around_comparison Space around == === != !== > >= < <=
---space_around_arithmetic Space around - + * / %
---space_around_logical Space around && || AND OR XOR << >>
---space_around_colon_question Space around ? :
-
-Functions, Classes and Objects:
---line_before_function Blank line before keyword
---line_before_curly_function Opening bracket on next line
---line_after_curly_function Blank line below opening bracket
---space_around_obj_operator Space around ->
---space_around_double_colon Space around ::
-
-Control Structures:
---space_after_if Space between keyword and opening parentheses
---else_along_curly Keep else/elseif along with bracket
---line_before_curly Opening bracket on next line
---add_missing_braces Add missing brackets to single line structs
---line_after_break Blank line after case "break"
---space_inside_for Space between "for" elements
---indent_case Extra indent for "Case" and "Default"
-
-Arrays and Concatenation:
---line_before_array Opening array parentheses on next line
---vertical_array Non-empty arrays as vertical block
---align_array_assignment Align block +3 assigned array elements
---space_around_double_arrow Space around double arrow
---vertical_concat Concatenation as vertical block
---space_around_concat Space around concat elements
-
-Comments:
---line_before_comment_multi Blank line before multi-line comment (/*)
---line_after_comment_multi Blank line after multi-line comment (/*)
---line_before_comment Blank line before single line comments (//)
---line_after_comment Blank line after single line comments (//)
+/***************************************************************************** + * The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE + * Version 1.1 ("License"); You may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * http://opensource.org/licenses/rpl.php. Software distributed under the + * License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, + * either express or implied. + * + * @product: phpStylist + * @author: Mr. Milk (aka Marcelo Leite) + * @email: mrmilk@anysoft.com.br + * @version: 1.0 + * @date: 2007-11-22 + * + *****************************************************************************/ + +CONTENTS +-------- +Below you will find instructions on how to use phpStylist: + +- Web Server Usage +- Command Line Mode +- PSPad Integration +- Command Line Options + +============================================================================== + +WEB SERVER USAGE +---------------- + +phpStylist runs as a single file on you web server. You don't need any special +module or library. It has been tested with php from 4.4.2 to 5.2.2. + +Save phpStylist.php to your web server folder and start it from the browser. +For example, http://localhost/phpStylist.php. + +On the left menu, you will see more than 30 options that you can use to adjust +the application to your coding style. All options are sticky based on cookies. +Select one of your files or click on the button "Use Sample" and try each +option to see what it is all about. + +If you want to type in or paste code directly into the app, first click on the +option "SHOW EDITABLE TEXT BOX". The right panel will then become editable. + +COMMAND LINE MODE +----------------- + +You can also use phpStylist through the command line to automatically format +local files. You will still need php installed. + +First, find the exact location of you php.exe and the exact location where you +placed phpStylist. Let's say they are in +"C:\Program Files\PHP\php.exe" and "C:\Program Files\Apache\htdocs\phpStylist.php" + +You then must run php passing phpStylist.php along with the -f argument. At +this point the command line would be like this: +"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" + +But that's not all. You also need to add the full path of the source file you +want to format and the options you want to be used. For each of those 34 options +you see on the web server usage, there will be an option on the command line. +You can use the "--help" option to see a list of options. + +Use the --help switch to see all options (full list at the end of this file): +"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" --help + +The first phpStylist paramenter MUST be the source file name you want to +format. After the file name, you can add as many options as you want, in any +order. It can get pretty big, but it works. Another example: +"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" +"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if +--indent_case --indent_size 4 --space_after_comma --line_before_function + +Output will be to STDOUT, so if you want to send it to a file, append "> filename" +at the end of the command line. In our above example: +"C:\Program Files\PHP\php.exe" -f "C:\Program Files\Apache\htdocs\phpStylist.php" +"C:\Program Files\Apache\htdocs\source_file_to_format.php" --space_after_if +--indent_case --indent_size 4 --line_before_comment_multi --vertical_array +--line_before_function > "C:\Code Library\Formatted Code\destination_file.php" + +Don't forget the quotes around long file names. + +PSPAD INTEGRATION +----------------- +PSPad is a popular, powerful and free code editor. It can be extended through +scripting. I have also created a script that will automatically format php code +from inside the editor. In fact, the script runs phpStylist in command line +mode, sending the current editor file name. It then get the results and replace +the code in the editor. + +Save the file phpStylist.js to your PSPad javascript folder, usually +C:\Program Files\PSPad\Script\JScript. + +Open the phpStylist.js file and edit the first two variables: + php_path = "C:\\Program Files\\xampp\\php\\php.exe"; + stylist_path = "C:\\Program Files\\xampp\\htdocs\\phpStylist.php"; + +Replace the paths with the appropriate for your system. Don't forget to double +backslashes. + +You will also see all the options, some are commented out, some are active (the +current setup is the one I use). Simply comment out or uncomment the options +you want to use and save the file. Restart PSPad or use the the option Scripts, +Recompile Scripts. + +Now, just open a php file on the editor and select phpStylist from the menu. +That's all. You can also select some block of code before using the option so +you can reformat only that portion. Of course, try to select a full block such +as a function. + +If you don't use PSPad or don't want the integration you don't need the file +phpStylist.js. + +FULL LIST OF OPTIONS +-------------------- + +Indentation and General Formatting: +--indent_size n n characters per indentation level +--indent_with_tabs Indent with tabs instead of spaces +--keep_redundant_lines Keep redundant lines +--space_inside_parentheses Space inside parentheses +--space_outside_parentheses Space outside parentheses +--space_after_comma Space after comma + +Operators: +--space_around_assignment Space around = .= += -= *= /= <<< +--align_var_assignment Align block +3 assigned variables +--space_around_comparison Space around == === != !== > >= < <= +--space_around_arithmetic Space around - + * / % +--space_around_logical Space around && || AND OR XOR << >> +--space_around_colon_question Space around ? : + +Functions, Classes and Objects: +--line_before_function Blank line before keyword +--line_before_curly_function Opening bracket on next line +--line_after_curly_function Blank line below opening bracket +--space_around_obj_operator Space around -> +--space_around_double_colon Space around :: + +Control Structures: +--space_after_if Space between keyword and opening parentheses +--else_along_curly Keep else/elseif along with bracket +--line_before_curly Opening bracket on next line +--add_missing_braces Add missing brackets to single line structs +--line_after_break Blank line after case "break" +--space_inside_for Space between "for" elements +--indent_case Extra indent for "Case" and "Default" + +Arrays and Concatenation: +--line_before_array Opening array parentheses on next line +--vertical_array Non-empty arrays as vertical block +--align_array_assignment Align block +3 assigned array elements +--space_around_double_arrow Space around double arrow +--vertical_concat Concatenation as vertical block +--space_around_concat Space around concat elements + +Comments: +--line_before_comment_multi Blank line before multi-line comment (/*) +--line_after_comment_multi Blank line after multi-line comment (/*) +--line_before_comment Blank line before single line comments (//) +--line_after_comment Blank line after single line comments (//) diff --git a/indenters/pindent.txt b/indenters/pindent.txt index 1a04ba6..55ddefb 100755 --- a/indenters/pindent.txt +++ b/indenters/pindent.txt @@ -1,75 +1,75 @@ -# This file contains a class and a main program that perform three
-# related (though complimentary) formatting operations on Python
-# programs. When called as "pindent -c", it takes a valid Python
-# program as input and outputs a version augmented with block-closing
-# comments. When called as "pindent -d", it assumes its input is a
-# Python program with block-closing comments and outputs a commentless
-# version. When called as "pindent -r" it assumes its input is a
-# Python program with block-closing comments but with its indentation
-# messed up, and outputs a properly indented version.
-
-# A "block-closing comment" is a comment of the form '# end <keyword>'
-# where <keyword> is the keyword that opened the block. If the
-# opening keyword is 'def' or 'class', the function or class name may
-# be repeated in the block-closing comment as well. Here is an
-# example of a program fully augmented with block-closing comments:
-
-# def foobar(a, b):
-# if a == b:
-# a = a+1
-# elif a < b:
-# b = b-1
-# if b > a: a = a-1
-# # end if
-# else:
-# print 'oops!'
-# # end if
-# # end def foobar
-
-# Note that only the last part of an if...elif...else... block needs a
-# block-closing comment; the same is true for other compound
-# statements (e.g. try...except). Also note that "short-form" blocks
-# like the second 'if' in the example must be closed as well;
-# otherwise the 'else' in the example would be ambiguous (remember
-# that indentation is not significant when interpreting block-closing
-# comments).
-
-# The operations are idempotent (i.e. applied to their own output
-# they yield an identical result). Running first "pindent -c" and
-# then "pindent -r" on a valid Python program produces a program that
-# is semantically identical to the input (though its indentation may
-# be different). Running "pindent -e" on that output produces a
-# program that only differs from the original in indentation.
-
-# Other options:
-# -s stepsize: set the indentation step size (default 8)
-# -t tabsize : set the number of spaces a tab character is worth (default 8)
-# -e : expand TABs into spaces
-# file ... : input file(s) (default standard input)
-# The results always go to standard output
-
-# Caveats:
-# - comments ending in a backslash will be mistaken for continued lines
-# - continuations using backslash are always left unchanged
-# - continuations inside parentheses are not extra indented by -r
-# but must be indented for -c to work correctly (this breaks
-# idempotency!)
-# - continued lines inside triple-quoted strings are totally garbled
-
-# Secret feature:
-# - On input, a block may also be closed with an "end statement" --
-# this is a block-closing comment without the '#' sign.
-
-# Possible improvements:
-# - check syntax based on transitions in 'next' table
-# - better error reporting
-# - better error recovery
-# - check identifier after class/def
-
-# The following wishes need a more complete tokenization of the source:
-# - Don't get fooled by comments ending in backslash
-# - reindent continuation lines indicated by backslash
-# - handle continuation lines inside parentheses/braces/brackets
-# - handle triple quoted strings spanning lines
-# - realign comments
-# - optionally do much more thorough reformatting, a la C indent
+# This file contains a class and a main program that perform three +# related (though complimentary) formatting operations on Python +# programs. When called as "pindent -c", it takes a valid Python +# program as input and outputs a version augmented with block-closing +# comments. When called as "pindent -d", it assumes its input is a +# Python program with block-closing comments and outputs a commentless +# version. When called as "pindent -r" it assumes its input is a +# Python program with block-closing comments but with its indentation +# messed up, and outputs a properly indented version. + +# A "block-closing comment" is a comment of the form '# end <keyword>' +# where <keyword> is the keyword that opened the block. If the +# opening keyword is 'def' or 'class', the function or class name may +# be repeated in the block-closing comment as well. Here is an +# example of a program fully augmented with block-closing comments: + +# def foobar(a, b): +# if a == b: +# a = a+1 +# elif a < b: +# b = b-1 +# if b > a: a = a-1 +# # end if +# else: +# print 'oops!' +# # end if +# # end def foobar + +# Note that only the last part of an if...elif...else... block needs a +# block-closing comment; the same is true for other compound +# statements (e.g. try...except). Also note that "short-form" blocks +# like the second 'if' in the example must be closed as well; +# otherwise the 'else' in the example would be ambiguous (remember +# that indentation is not significant when interpreting block-closing +# comments). + +# The operations are idempotent (i.e. applied to their own output +# they yield an identical result). Running first "pindent -c" and +# then "pindent -r" on a valid Python program produces a program that +# is semantically identical to the input (though its indentation may +# be different). Running "pindent -e" on that output produces a +# program that only differs from the original in indentation. + +# Other options: +# -s stepsize: set the indentation step size (default 8) +# -t tabsize : set the number of spaces a tab character is worth (default 8) +# -e : expand TABs into spaces +# file ... : input file(s) (default standard input) +# The results always go to standard output + +# Caveats: +# - comments ending in a backslash will be mistaken for continued lines +# - continuations using backslash are always left unchanged +# - continuations inside parentheses are not extra indented by -r +# but must be indented for -c to work correctly (this breaks +# idempotency!) +# - continued lines inside triple-quoted strings are totally garbled + +# Secret feature: +# - On input, a block may also be closed with an "end statement" -- +# this is a block-closing comment without the '#' sign. + +# Possible improvements: +# - check syntax based on transitions in 'next' table +# - better error reporting +# - better error recovery +# - check identifier after class/def + +# The following wishes need a more complete tokenization of the source: +# - Don't get fooled by comments ending in backslash +# - reindent continuation lines indicated by backslash +# - handle continuation lines inside parentheses/braces/brackets +# - handle triple quoted strings spanning lines +# - realign comments +# - optionally do much more thorough reformatting, a la C indent diff --git a/indenters/uigui_CblBeau.ini b/indenters/uigui_CblBeau.ini index 03b82f1..069f429 100755 --- a/indenters/uigui_CblBeau.ini +++ b/indenters/uigui_CblBeau.ini @@ -1,543 +1,543 @@ -[header]
-categories="Cobol Beautifier|Renumbering|Generic Reporting|Cobol Dialects|Extra Features|Copy Libraries|Parser Messages|Length and Offset|PrettyPrint Basics|PrettyPrint Indentation|Output Comments|Line Identification"
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.cbl|*.cob
-indenterFileName=cbl-beau.exe
-indenterName=Cobol Beautifier (Cobol)
-inputFileName=indentinput
-inputFileParameter=" "
-manual=http://www.siber.com/sct/tools/cbl-beau.html
-outputFileName=indentoutput
-outputFileParameter="-gen-file="
-parameterOrder=ipo
-showHelpParameter="-help"
-stringparaminquotes=false
-useCfgFileParameter=
-version=1.0
-
-
-[Add value clause]
-Category=0
-Description="<html>Add VALUE clauses to WS data items that have no VALUE clause</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-add-value-clause|"
-
-[Norm dd levels]
-Category=0
-Description="<html>Normalize data item level numbers</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-norm-dd-levels|"
-
-[Add end stmts]
-Category=0
-Description="<html>Add END-IF, END-SEARCH, END-EVALUATE, END-PERFORM closing statements</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-add-end-stmts|"
-
-[Section name fmt]
-CallName="-section-name-fmt="
-Category=1
-Description="<html>Section name format, smth like T1%dT2%sT3</html>"
-EditorType=string
-Enabled=false
-ValueDefault="T1%dT2%sT3"
-
-[Section name start]
-CallName="-section-name-start="
-Category=1
-Description="<html>Start value for number in section name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Section name step]
-CallName="-section-name-step="
-Category=1
-Description="<html>Step for number in section name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Para name fmt]
-CallName="-para-name-fmt="
-Category=1
-Description="<html>Paragraph name format, smth like T1%dT2%sT3</html>"
-EditorType=string
-Enabled=false
-ValueDefault="T1%dT2%sT3"
-
-[Para name start]
-CallName="-para-name-start="
-Category=1
-Description="<html>Start value for counter in paragraph name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Para name step]
-CallName="-para-name-step="
-Category=1
-Description="<html>Step for counter in paragraph name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Data name fmt]
-CallName="-data-name-fmt="
-Category=1
-Description="<html>Data name format, smth like T1%dT2%sT3</html>"
-EditorType=string
-Enabled=false
-ValueDefault="T1%dT2%sT3"
-
-[Data name start]
-CallName="-data-name-start="
-Category=1
-Description="<html>Start value for number in data name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Data name step]
-CallName="-data-name-step="
-Category=1
-Description="<html>Step for number in data name</html>"
-EditorType=numeric
-Enabled=false
-MaxVal=9999
-MinVal=0
-ValueDefault=1
-
-[Conv warn]
-Category=2
-Description="<html>Warn about transformation problems</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-conv-warn|-no-conv-warn"
-
-[Conv info]
-Category=2
-Description="<html>Inform about every transformation performed</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-conv-info|-no-conv-info"
-
-[Conv list]
-Category=2
-Description="<html>List all transformations applied</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-conv-list|-no-conv-list"
-
-[Find only]
-Category=2
-Description="<html>Only list potential transformations, do not execute them</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-find-only|-no-find-only"
-
-[Silent]
-Category=2
-Description="<html>Do not print short summary of the conversion</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-silent|-no-silent"
-
-[Primary Cobol dialect]
-Category=3
-Description="<html>Set the primary Cobol dialect</html>"
-ValueDefault=1
-Enabled=false
-EditorType=multiple
-Choices="-lang=ansi74|-lang=ansi85|-lang=osvs|-lang=vsii|-lang=saa|-lang=xopen|-lang=mf|-lang=ms|-lang=rm|-lang=rm85|-lang=dosvs|-lang=univac|-lang=wang|-lang=fsc|-lang=net|-lang=fscnet|-lang=icobol|-lang=acu|-lang=dml|-lang=idms"
-ChoicesReadable="Ansi 74|Ansi 85|OSVS|VSII|SAA|XOpen|MF|MS|RM|RM 85|DOSVS|UniVAC|Wang|FSC|Net|FSCnet|iCobol|ACU|DML|IDMS"
-
-[Secondary Cobol dialect]
-Category=3
-Description="<html>Set the secondary Cobol dialect</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-lang2=ansi74|-lang2=ansi85|-lang2=osvs|-lang2=vsii|-lang2=saa|-lang2=xopen|-lang2=mf|-lang2=ms|-lang2=rm|-lang2=rm85|-lang2=dosvs|-lang2=univac|-lang2=wang|-lang2=fsc|-lang2=net|-lang2=fscnet|-lang2=icobol|-lang2=acu|-lang2=dml|-lang2=idms"
-ChoicesReadable="Ansi 74|Ansi 85|OSVS|VSII|SAA|XOpen|MF|MS|RM|RM 85|DOSVS|UniVAC|Wang|FSC|Net|FSCnet|iCobol|ACU|DML|IDMS"
-
-[Line format]
-Category=3
-Description="<html>Set the secondary Cobol dialect</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-line-format=dial|-line-format=fixed|-line-format=free|-line-format=fsc-free|-line-format=var"
-ChoicesReadable="Dial|fixed|free|FSC free|var"
-
-[Progid comments]
-Category=3
-Description="<html>Allow Program-Id line comments</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-progid-comments|-no-progid-comments"
-
-[Separators follow spaces]
-Category=3
-Description="<html>Separators must be followed by spaces</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-sep-space-reqd=dial|-sep-space-reqd=no|-sep-space-reqd=yes"
-ChoicesReadable="Dial|No|Yes"
-
-[Exclude keywords]
-CallName="-exclude-keywords="
-Category=3
-Description="<html>Excluded keywords (separated by spaces?)</html>"
-EditorType=string
-Enabled=false
-ValueDefault=""
-
-[Set constants]
-CallName="-set-constants="
-Category=4
-Description="<html>78 constant settings, strings: name'value', numbers: name(value)</html>"
-EditorType=string
-Enabled=false
-ValueDefault=""
-
-[Assign external]
-Category=4
-Description="<html>Assume that undefined data items in ASSIGN TO are external</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-assign-external|-no-assign-external"
-
-[SQL]
-Category=4
-Description="<html>Parse SQL in EXEC SQL</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-sql|-no-sql"
-
-[CICS]
-Category=4
-Description="<html>Parse CICS statements embedded in EXEC CICS ... END-EXEC</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-cics|-no-cics"
-
-[CICS EIB]
-Category=4
-Description="<html>Add CICS EIB data block to LINKAGE SECTION</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-cics-eib=auto|-cics-eib=no|-cics-eib=yes"
-ChoicesReadable="Auto|No|Yes"
-
-[Copylib dir]
-CallName="-copylib-dir="
-Category=5
-Description="<html>Copylib directories path</html>"
-EditorType=string
-Enabled=false
-ValueDefault="."
-
-[Copylib suffix]
-CallName="-copylib-sfx="
-Category=5
-Description="<html>Copylib files default suffix(es)</html>"
-EditorType=string
-Enabled=false
-ValueDefault=".cpy"
-
-[Copylib names]
-Category=5
-Description="<html>Add CICS EIB data block to LINKAGE SECTION</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-copynames-case=exact|-copynames-case=lower|-copynames-case=upper"
-ChoicesReadable="Exact|Lower|Upper"
-
-[Copylib old]
-Category=5
-Description="<html>Allow old 1968 Copy statements</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-old-copy|-no-old-copy"
-
-[Copylib irreversibly]
-Category=5
-Description="<html>Inline copybooks irreversibly</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-irrev-inline|-no-irrev-inline"
-
-[Warnings]
-Category=6
-Description="<html>Display Warnings</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-warnings|-no-warnings"
-
-[Muli undef errors]
-Category=6
-Description="<html>Error message for every (OFF: only first) use of undefined name</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-multi-undefd-errs|-no-multi-undefd-errs"
-
-[Same para data name]
-Category=6
-Description="<html>One name can be used both as paragraph-name and data-name</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-same-para-data-name=dial|-same-para-data-name=no|-same-para-data-name=yes"
-ChoicesReadable="Dial|No|Yes"
-
-[Lengths and offsets]
-Category=7
-Description="<html>Compute data item lengths and offsets</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-leng-offs|-no-leng-offs"
-
-[Storage mode]
-Category=7
-Description="<html>Is Numeric Sign a Trailing Separate Character</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-lo-stor-mode=dial|-lo-stor-mode=no|-lo-stor-mode=yes"
-ChoicesReadable="Dial|No|Yes"
-
-[Numeric sign trailing separate]
-Category=7
-Description="<html>Is Numeric Sign a Trailing Separate Character</html>"
-ValueDefault=0
-Enabled=false
-EditorType=multiple
-Choices="-num-sign-trail-sep=dial|-num-sign-trail-sep=no|-num-sign-trail-sep=yes"
-ChoicesReadable="Dial|No|Yes"
-
-[Num sign EBCDIC]
-Category=7
-Description="<html>Is Numeric Sign an EBCDIC character</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-num-sign-ebcdic|-no-num-sign-ebcdic"
-
-[Lo pointer size]
-CallName="-lo-pointer-size="
-Category=7
-Description="<html>Memory model: Pointer size</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=4
-
-[Lo proc pointer size]
-CallName="-lo-proc-pointer-size="
-Category=7
-Description="<html>Memory model: Procedure-Pointer size</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=4
-
-[Lo index size]
-CallName="-lo-index-size="
-Category=7
-Description="<html>Memory model: Index size</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=4
-
-[Lo unfold flex arrays]
-Category=7
-Description="<html>Compute length of table with OCCURS DEPENDING ON based on upper bounds</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-lo-unfold-flex-arrays|-no-lo-unfold-flex-arrays"
-
-[Progress]
-Category=7
-Description="<html>Display Parsing Progress Indicator</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-progress|-no-progress"
-
-[Bailout level]
-Category=7
-Description="<html>Level of parser messages that cause bailout</html>"
-ValueDefault=2
-Enabled=false
-EditorType=multiple
-Choices="-bailout-level=warnings|-bailout-level=errors|-bailout-level=severe"
-ChoicesReadable="Warnings|Errors|Severe"
-
-[Stats]
-Category=7
-Description="<html>Print short source program statistics</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-stat|-no-stat"
-
-[Genereate SourcePrint]
-Category=8
-Description="<html>Generate Cobol in SourcePrint (ON) / PrettyPrint(OFF) mode</html>"
-ValueDefault=0
-Enabled=false
-EditorType=boolean
-TrueFalse="-gen-src|-no-gen-src"
-
-[Copybook dir]
-CallName="-gen-copy-dir="
-Category=8
-Description="<html>Write copybooks to this directory</html>"
-EditorType=string
-Enabled=false
-ValueDefault=""
-
-[Indent size]
-CallName="-gen-indent-step="
-Category=9
-Description="<html>Indentation step</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=2
-
-[Indent max]
-CallName="-gen-max-indent="
-Category=9
-Description="<html>Maximum starting position for indented text</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=40
-
-[Tabs]
-CallName="-gen-tabs="
-Category=9
-Description="<html>Tabulation Positions</html>"
-EditorType=string
-Enabled=false
-ValueDefault="12,24,32,42,44,54"
-
-[Line format]
-Category=9
-Description="<html>Generated line format</html>"
-ValueDefault=1
-Enabled=false
-EditorType=multiple
-Choices="-gen-line-format=na|-gen-line-format=fixed|-gen-line-format=free|-gen-line-format=fsc-free|-gen-line-format=var"
-ChoicesReadable="Na|Fixed|Free|FSC-free|Var"
-
-[Observe rules]
-Category=9
-Description="<html>Observe Area A/B rules in generated code</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-gen-observe-ab-rules |-no-gen-observe-ab-rules "
-
-[Preserve comments]
-Category=10
-Description="<html>Preserve comments</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-gen-print-comments |-no-gen-print-comments "
-
-[Enter Exit comments]
-Category=10
-Description="<html>Generate Enter/Exit comments around inlined copybooks</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-gen-enter-exit-copy-comments|-no-gen-enter-exit-copy-comments"
-
-[Preserve line IDs]
-Category=11
-Description="<html>Preserve original Line IDs (cols 1-6, 73-80)</html>"
-ValueDefault=1
-Enabled=true
-EditorType=boolean
-TrueFalse="-gen-line-id-comments|-no-gen-line-id-comments"
-
-[Put text 73-80]
-CallName="-gen-73to80-fmt="
-Category=11
-Description="<html>Put text of this format into columns 73 to 80</html>"
-EditorType=string
-Enabled=false
-ValueDefault=""
-
-[Start number 73-80]
-CallName="-gen-73to80-start="
-Category=11
-Description="<html>Start value for number put into columns 73 to 80</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=1
-
-[Step number 73-80]
-CallName="-gen-73to80-step="
-Category=11
-Description="<html>Step for number put into columns 73 to 80</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=1
-ValueDefault=1
-
-[Convert comments]
-CallName="-gen-mark-conv="
-Category=11
-Description="<html>Add comment in columns 73 and up that show that line was changed or generated</html>"
-EditorType=string
-Enabled=false
-ValueDefault=""
+[header] +categories="Cobol Beautifier|Renumbering|Generic Reporting|Cobol Dialects|Extra Features|Copy Libraries|Parser Messages|Length and Offset|PrettyPrint Basics|PrettyPrint Indentation|Output Comments|Line Identification" +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.cbl|*.cob +indenterFileName=cbl-beau.exe +indenterName=Cobol Beautifier (Cobol) +inputFileName=indentinput +inputFileParameter=" " +manual=http://www.siber.com/sct/tools/cbl-beau.html +outputFileName=indentoutput +outputFileParameter="-gen-file=" +parameterOrder=ipo +showHelpParameter="-help" +stringparaminquotes=false +useCfgFileParameter= +version=1.0 + + +[Add value clause] +Category=0 +Description="<html>Add VALUE clauses to WS data items that have no VALUE clause</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-add-value-clause|" + +[Norm dd levels] +Category=0 +Description="<html>Normalize data item level numbers</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-norm-dd-levels|" + +[Add end stmts] +Category=0 +Description="<html>Add END-IF, END-SEARCH, END-EVALUATE, END-PERFORM closing statements</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-add-end-stmts|" + +[Section name fmt] +CallName="-section-name-fmt=" +Category=1 +Description="<html>Section name format, smth like T1%dT2%sT3</html>" +EditorType=string +Enabled=false +ValueDefault="T1%dT2%sT3" + +[Section name start] +CallName="-section-name-start=" +Category=1 +Description="<html>Start value for number in section name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Section name step] +CallName="-section-name-step=" +Category=1 +Description="<html>Step for number in section name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Para name fmt] +CallName="-para-name-fmt=" +Category=1 +Description="<html>Paragraph name format, smth like T1%dT2%sT3</html>" +EditorType=string +Enabled=false +ValueDefault="T1%dT2%sT3" + +[Para name start] +CallName="-para-name-start=" +Category=1 +Description="<html>Start value for counter in paragraph name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Para name step] +CallName="-para-name-step=" +Category=1 +Description="<html>Step for counter in paragraph name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Data name fmt] +CallName="-data-name-fmt=" +Category=1 +Description="<html>Data name format, smth like T1%dT2%sT3</html>" +EditorType=string +Enabled=false +ValueDefault="T1%dT2%sT3" + +[Data name start] +CallName="-data-name-start=" +Category=1 +Description="<html>Start value for number in data name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Data name step] +CallName="-data-name-step=" +Category=1 +Description="<html>Step for number in data name</html>" +EditorType=numeric +Enabled=false +MaxVal=9999 +MinVal=0 +ValueDefault=1 + +[Conv warn] +Category=2 +Description="<html>Warn about transformation problems</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-conv-warn|-no-conv-warn" + +[Conv info] +Category=2 +Description="<html>Inform about every transformation performed</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-conv-info|-no-conv-info" + +[Conv list] +Category=2 +Description="<html>List all transformations applied</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-conv-list|-no-conv-list" + +[Find only] +Category=2 +Description="<html>Only list potential transformations, do not execute them</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-find-only|-no-find-only" + +[Silent] +Category=2 +Description="<html>Do not print short summary of the conversion</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-silent|-no-silent" + +[Primary Cobol dialect] +Category=3 +Description="<html>Set the primary Cobol dialect</html>" +ValueDefault=1 +Enabled=false +EditorType=multiple +Choices="-lang=ansi74|-lang=ansi85|-lang=osvs|-lang=vsii|-lang=saa|-lang=xopen|-lang=mf|-lang=ms|-lang=rm|-lang=rm85|-lang=dosvs|-lang=univac|-lang=wang|-lang=fsc|-lang=net|-lang=fscnet|-lang=icobol|-lang=acu|-lang=dml|-lang=idms" +ChoicesReadable="Ansi 74|Ansi 85|OSVS|VSII|SAA|XOpen|MF|MS|RM|RM 85|DOSVS|UniVAC|Wang|FSC|Net|FSCnet|iCobol|ACU|DML|IDMS" + +[Secondary Cobol dialect] +Category=3 +Description="<html>Set the secondary Cobol dialect</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-lang2=ansi74|-lang2=ansi85|-lang2=osvs|-lang2=vsii|-lang2=saa|-lang2=xopen|-lang2=mf|-lang2=ms|-lang2=rm|-lang2=rm85|-lang2=dosvs|-lang2=univac|-lang2=wang|-lang2=fsc|-lang2=net|-lang2=fscnet|-lang2=icobol|-lang2=acu|-lang2=dml|-lang2=idms" +ChoicesReadable="Ansi 74|Ansi 85|OSVS|VSII|SAA|XOpen|MF|MS|RM|RM 85|DOSVS|UniVAC|Wang|FSC|Net|FSCnet|iCobol|ACU|DML|IDMS" + +[Line format] +Category=3 +Description="<html>Set the secondary Cobol dialect</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-line-format=dial|-line-format=fixed|-line-format=free|-line-format=fsc-free|-line-format=var" +ChoicesReadable="Dial|fixed|free|FSC free|var" + +[Progid comments] +Category=3 +Description="<html>Allow Program-Id line comments</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-progid-comments|-no-progid-comments" + +[Separators follow spaces] +Category=3 +Description="<html>Separators must be followed by spaces</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-sep-space-reqd=dial|-sep-space-reqd=no|-sep-space-reqd=yes" +ChoicesReadable="Dial|No|Yes" + +[Exclude keywords] +CallName="-exclude-keywords=" +Category=3 +Description="<html>Excluded keywords (separated by spaces?)</html>" +EditorType=string +Enabled=false +ValueDefault="" + +[Set constants] +CallName="-set-constants=" +Category=4 +Description="<html>78 constant settings, strings: name'value', numbers: name(value)</html>" +EditorType=string +Enabled=false +ValueDefault="" + +[Assign external] +Category=4 +Description="<html>Assume that undefined data items in ASSIGN TO are external</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-assign-external|-no-assign-external" + +[SQL] +Category=4 +Description="<html>Parse SQL in EXEC SQL</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-sql|-no-sql" + +[CICS] +Category=4 +Description="<html>Parse CICS statements embedded in EXEC CICS ... END-EXEC</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-cics|-no-cics" + +[CICS EIB] +Category=4 +Description="<html>Add CICS EIB data block to LINKAGE SECTION</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-cics-eib=auto|-cics-eib=no|-cics-eib=yes" +ChoicesReadable="Auto|No|Yes" + +[Copylib dir] +CallName="-copylib-dir=" +Category=5 +Description="<html>Copylib directories path</html>" +EditorType=string +Enabled=false +ValueDefault="." + +[Copylib suffix] +CallName="-copylib-sfx=" +Category=5 +Description="<html>Copylib files default suffix(es)</html>" +EditorType=string +Enabled=false +ValueDefault=".cpy" + +[Copylib names] +Category=5 +Description="<html>Add CICS EIB data block to LINKAGE SECTION</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-copynames-case=exact|-copynames-case=lower|-copynames-case=upper" +ChoicesReadable="Exact|Lower|Upper" + +[Copylib old] +Category=5 +Description="<html>Allow old 1968 Copy statements</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-old-copy|-no-old-copy" + +[Copylib irreversibly] +Category=5 +Description="<html>Inline copybooks irreversibly</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-irrev-inline|-no-irrev-inline" + +[Warnings] +Category=6 +Description="<html>Display Warnings</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-warnings|-no-warnings" + +[Muli undef errors] +Category=6 +Description="<html>Error message for every (OFF: only first) use of undefined name</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-multi-undefd-errs|-no-multi-undefd-errs" + +[Same para data name] +Category=6 +Description="<html>One name can be used both as paragraph-name and data-name</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-same-para-data-name=dial|-same-para-data-name=no|-same-para-data-name=yes" +ChoicesReadable="Dial|No|Yes" + +[Lengths and offsets] +Category=7 +Description="<html>Compute data item lengths and offsets</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-leng-offs|-no-leng-offs" + +[Storage mode] +Category=7 +Description="<html>Is Numeric Sign a Trailing Separate Character</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-lo-stor-mode=dial|-lo-stor-mode=no|-lo-stor-mode=yes" +ChoicesReadable="Dial|No|Yes" + +[Numeric sign trailing separate] +Category=7 +Description="<html>Is Numeric Sign a Trailing Separate Character</html>" +ValueDefault=0 +Enabled=false +EditorType=multiple +Choices="-num-sign-trail-sep=dial|-num-sign-trail-sep=no|-num-sign-trail-sep=yes" +ChoicesReadable="Dial|No|Yes" + +[Num sign EBCDIC] +Category=7 +Description="<html>Is Numeric Sign an EBCDIC character</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-num-sign-ebcdic|-no-num-sign-ebcdic" + +[Lo pointer size] +CallName="-lo-pointer-size=" +Category=7 +Description="<html>Memory model: Pointer size</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=4 + +[Lo proc pointer size] +CallName="-lo-proc-pointer-size=" +Category=7 +Description="<html>Memory model: Procedure-Pointer size</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=4 + +[Lo index size] +CallName="-lo-index-size=" +Category=7 +Description="<html>Memory model: Index size</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=4 + +[Lo unfold flex arrays] +Category=7 +Description="<html>Compute length of table with OCCURS DEPENDING ON based on upper bounds</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-lo-unfold-flex-arrays|-no-lo-unfold-flex-arrays" + +[Progress] +Category=7 +Description="<html>Display Parsing Progress Indicator</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-progress|-no-progress" + +[Bailout level] +Category=7 +Description="<html>Level of parser messages that cause bailout</html>" +ValueDefault=2 +Enabled=false +EditorType=multiple +Choices="-bailout-level=warnings|-bailout-level=errors|-bailout-level=severe" +ChoicesReadable="Warnings|Errors|Severe" + +[Stats] +Category=7 +Description="<html>Print short source program statistics</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-stat|-no-stat" + +[Genereate SourcePrint] +Category=8 +Description="<html>Generate Cobol in SourcePrint (ON) / PrettyPrint(OFF) mode</html>" +ValueDefault=0 +Enabled=false +EditorType=boolean +TrueFalse="-gen-src|-no-gen-src" + +[Copybook dir] +CallName="-gen-copy-dir=" +Category=8 +Description="<html>Write copybooks to this directory</html>" +EditorType=string +Enabled=false +ValueDefault="" + +[Indent size] +CallName="-gen-indent-step=" +Category=9 +Description="<html>Indentation step</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=2 + +[Indent max] +CallName="-gen-max-indent=" +Category=9 +Description="<html>Maximum starting position for indented text</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=40 + +[Tabs] +CallName="-gen-tabs=" +Category=9 +Description="<html>Tabulation Positions</html>" +EditorType=string +Enabled=false +ValueDefault="12,24,32,42,44,54" + +[Line format] +Category=9 +Description="<html>Generated line format</html>" +ValueDefault=1 +Enabled=false +EditorType=multiple +Choices="-gen-line-format=na|-gen-line-format=fixed|-gen-line-format=free|-gen-line-format=fsc-free|-gen-line-format=var" +ChoicesReadable="Na|Fixed|Free|FSC-free|Var" + +[Observe rules] +Category=9 +Description="<html>Observe Area A/B rules in generated code</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-gen-observe-ab-rules |-no-gen-observe-ab-rules " + +[Preserve comments] +Category=10 +Description="<html>Preserve comments</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-gen-print-comments |-no-gen-print-comments " + +[Enter Exit comments] +Category=10 +Description="<html>Generate Enter/Exit comments around inlined copybooks</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-gen-enter-exit-copy-comments|-no-gen-enter-exit-copy-comments" + +[Preserve line IDs] +Category=11 +Description="<html>Preserve original Line IDs (cols 1-6, 73-80)</html>" +ValueDefault=1 +Enabled=true +EditorType=boolean +TrueFalse="-gen-line-id-comments|-no-gen-line-id-comments" + +[Put text 73-80] +CallName="-gen-73to80-fmt=" +Category=11 +Description="<html>Put text of this format into columns 73 to 80</html>" +EditorType=string +Enabled=false +ValueDefault="" + +[Start number 73-80] +CallName="-gen-73to80-start=" +Category=11 +Description="<html>Start value for number put into columns 73 to 80</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=1 + +[Step number 73-80] +CallName="-gen-73to80-step=" +Category=11 +Description="<html>Step for number put into columns 73 to 80</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=1 +ValueDefault=1 + +[Convert comments] +CallName="-gen-mark-conv=" +Category=11 +Description="<html>Add comment in columns 73 and up that show that line was changed or generated</html>" +EditorType=string +Enabled=false +ValueDefault="" diff --git a/indenters/uigui_jsppp.ini b/indenters/uigui_jsppp.ini index 0af1f6b..53c886c 100755 --- a/indenters/uigui_jsppp.ini +++ b/indenters/uigui_jsppp.ini @@ -1,81 +1,81 @@ -[header]
-categories=General options
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.jsp|*.html|*.xml
-indenterFileName=jsppp
-indenterName=JSPPP (JSP)
-inputFileName=indentinput
-inputFileParameter=
-manual=http://jsppp.sourceforge.net/
-outputFileName=indentinput
-outputFileParameter=none
-stringparaminquotes=false
-parameterOrder=pio
-showHelpParameter=-h
-stringparaminquotes=false
-useCfgFileParameter=
-version=0.5.2a
-
-[Spaces]
-Category=0
-Description="<html>If spaces is true, spaces, not tabs, will be used to indent the lines.</html>"
-EditorType=boolean
-TrueFalse=|--tabs
-ValueDefault=1
-
-[Number of spaces]
-Category=0
-Description="<html>If spaces are used for indenting, NUMSPACES is the number of spaces to use per indent level.</html>"
-Enabled=true
-EditorType=numeric
-CallName="--spaces="
-MinVal=0
-MaxVal=999
-ValueDefault=2
-
-[Line length]
-Category=0
-Description="<html>The length, in bytes (JSPPP does not yet support Unicode input, no one has asked for it yet) of the soft line length limit. JavaScript, long element names, attributes, etc., that cannot be broken up will end up over the limit if they have already been indented too far.</html>"
-Enabled=false
-EditorType=numeric
-CallName="--length="
-MinVal=1
-MaxVal=9999
-ValueDefault=120
-
-[Tabsize]
-Category=0
-Description="<html>The default number of spaces per tab is 8. This number is used to determine how much of the line has been used by a tab.</html>"
-Enabled=false
-EditorType=numeric
-CallName="--tab-size="
-MinVal=0
-MaxVal=999
-ValueDefault=8
-
-[Punctuation]
-Category=0
-Description="<html>PUNCTUATION is a list of characters which should be handled specially after an anchor tag. If there is whitespace after a link tag but before one of these characters then the whitespace is removed. To have no special characters, use the line "PUNCTUATION=".</html>"
-Enabled=false
-CallName=PUNCTUATION=
-EditorType=string
-ValueDefault=",.!?"
-
-[Loose or tight spacing]
-Category=0
-Description="<html>Use loose or tight spacing.</html>"
-Enabled=true
-EditorType=multiple
-Choices="--loose-spacing|--tight-spacing"
-ChoicesReadable="Loose spacing|Tight spacing"
-ValueDefault=0
-
-[Backup file]
-Category=0
-Description="<html>Leave a backup file, which will be overwritten on a second run, or leave no backup file at all.</html>"
-Enabled=true
-EditorType=multiple
-Choices="--engage-safety|--disengage-safety"
-ChoicesReadable="Leave backup file|Leave NO backup file"
-ValueDefault=1
+[header] +categories=General options +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.jsp|*.html|*.xml +indenterFileName=jsppp +indenterName=JSPPP (JSP) +inputFileName=indentinput +inputFileParameter= +manual=http://jsppp.sourceforge.net/ +outputFileName=indentinput +outputFileParameter=none +stringparaminquotes=false +parameterOrder=pio +showHelpParameter=-h +stringparaminquotes=false +useCfgFileParameter= +version=0.5.2a + +[Spaces] +Category=0 +Description="<html>If spaces is true, spaces, not tabs, will be used to indent the lines.</html>" +EditorType=boolean +TrueFalse=|--tabs +ValueDefault=1 + +[Number of spaces] +Category=0 +Description="<html>If spaces are used for indenting, NUMSPACES is the number of spaces to use per indent level.</html>" +Enabled=true +EditorType=numeric +CallName="--spaces=" +MinVal=0 +MaxVal=999 +ValueDefault=2 + +[Line length] +Category=0 +Description="<html>The length, in bytes (JSPPP does not yet support Unicode input, no one has asked for it yet) of the soft line length limit. JavaScript, long element names, attributes, etc., that cannot be broken up will end up over the limit if they have already been indented too far.</html>" +Enabled=false +EditorType=numeric +CallName="--length=" +MinVal=1 +MaxVal=9999 +ValueDefault=120 + +[Tabsize] +Category=0 +Description="<html>The default number of spaces per tab is 8. This number is used to determine how much of the line has been used by a tab.</html>" +Enabled=false +EditorType=numeric +CallName="--tab-size=" +MinVal=0 +MaxVal=999 +ValueDefault=8 + +[Punctuation] +Category=0 +Description="<html>PUNCTUATION is a list of characters which should be handled specially after an anchor tag. If there is whitespace after a link tag but before one of these characters then the whitespace is removed. To have no special characters, use the line "PUNCTUATION=".</html>" +Enabled=false +CallName=PUNCTUATION= +EditorType=string +ValueDefault=",.!?" + +[Loose or tight spacing] +Category=0 +Description="<html>Use loose or tight spacing.</html>" +Enabled=true +EditorType=multiple +Choices="--loose-spacing|--tight-spacing" +ChoicesReadable="Loose spacing|Tight spacing" +ValueDefault=0 + +[Backup file] +Category=0 +Description="<html>Leave a backup file, which will be overwritten on a second run, or leave no backup file at all.</html>" +Enabled=true +EditorType=multiple +Choices="--engage-safety|--disengage-safety" +ChoicesReadable="Leave backup file|Leave NO backup file" +ValueDefault=1 diff --git a/indenters/uigui_phpStylist.ini b/indenters/uigui_phpStylist.ini index e5f5b54..6374906 100755 --- a/indenters/uigui_phpStylist.ini +++ b/indenters/uigui_phpStylist.ini @@ -1,258 +1,258 @@ -[header]
-categories="General|Operators|Functions, Classes and Objects|Control Structures|Arrays and Concatenation|Comments"
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.php|*.phpt|*.phps
-indenterFileName=phpStylist.php
-indenterName=phpStylist (PHP)
-inputFileName=indentinput
-inputFileParameter=" "
-manual=http://sourceforge.net/projects/phpstylist/
-outputFileName=
-outputFileParameter=stdout
-parameterOrder=ipo
-showHelpParameter="-- --help"
-stringparaminquotes=false
-useCfgFileParameter=
-version=1.0
-
-[Indent size]
-CallName="--indent_size "
-Category=0
-Description="<html>Indent the code with the set number of spaces.</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=0
-ValueDefault=4
-
-[Indent with tabs]
-Category=0
-Description="<html>Indent with tabs instead of spaces</html>"
-EditorType=boolean
-TrueFalse="--indent_with_tabs|"
-ValueDefault=0
-
-[Keep redundant lines]
-Category=0
-Description="<html>Keep redundant lines</html>"
-EditorType=boolean
-TrueFalse="--keep_redundant_lines|"
-ValueDefault=0
-
-[Space inside parentheses]
-Category=0
-Description="<html>Space inside parentheses</html>"
-EditorType=boolean
-TrueFalse="--space_inside_parentheses|"
-ValueDefault=0
-
-[Space outside parentheses]
-Category=0
-Description="<html>Space outside parentheses</html>"
-EditorType=boolean
-TrueFalse="--space_outside_parentheses|"
-ValueDefault=0
-
-[Space after comma]
-Category=0
-Description="<html>Space after comma</html>"
-EditorType=boolean
-TrueFalse="--space_after_comma|"
-ValueDefault=0
-
-[Space around assignment]
-Category=1
-Description="<html>Space around = .= += -= *= /= <<<</html>"
-EditorType=boolean
-TrueFalse="--space_around_assignment|"
-ValueDefault=0
-
-[Align block +3 assigned variables]
-Category=1
-Description="<html>Align block +3 assigned variables</html>"
-EditorType=boolean
-TrueFalse="--align_var_assignment|"
-ValueDefault=0
-
-[Space around comparison]
-Category=1
-Description="<html>Space around == === != !== > >= < <=</html>"
-EditorType=boolean
-TrueFalse="--space_around_comparison|"
-ValueDefault=0
-
-[Space around arithmetic]
-Category=1
-Description="<html>Space around - + * / %</html>"
-EditorType=boolean
-TrueFalse="--space_around_arithmetic|"
-ValueDefault=0
-
-[Space around logical]
-Category=1
-Description="<html>Space around && || AND OR XOR << >></html>"
-EditorType=boolean
-TrueFalse="--space_around_logical|"
-ValueDefault=0
-
-[Space around colon and question]
-Category=1
-Description="<html>Space around ? :</html>"
-EditorType=boolean
-TrueFalse="--space_around_colon_question|"
-ValueDefault=0
-
-[Blank line before keyword]
-Category=2
-Description="<html>Blank line before keyword</html>"
-EditorType=boolean
-TrueFalse="--line_before_function|"
-ValueDefault=0
-
-[Opening bracket on next line]
-Category=2
-Description="<html>Opening bracket on next line</html>"
-EditorType=boolean
-TrueFalse="--line_before_curly_function|"
-ValueDefault=0
-
-[Blank line below opening bracket]
-Category=2
-Description="<html>Blank line below opening bracket</html>"
-EditorType=boolean
-TrueFalse="--line_after_curly_function|"
-ValueDefault=0
-
-[Space around ->]
-Category=2
-Description="<html>Space around -></html>"
-EditorType=boolean
-TrueFalse="--space_around_obj_operator|"
-ValueDefault=0
-
-[Space around ::]
-Category=2
-Description="<html>Space around ::</html>"
-EditorType=boolean
-TrueFalse="--space_around_double_colon|"
-ValueDefault=0
-
-[Space before parentheses]
-Category=3
-Description="<html>Space between keyword and opening parentheses</html>"
-EditorType=boolean
-TrueFalse="--space_after_if|"
-ValueDefault=0
-
-[Keep else/elseif along with bracket]
-Category=3
-Description="<html>Keep else/elseif along with bracket</html>"
-EditorType=boolean
-TrueFalse="--else_along_curly|"
-ValueDefault=0
-
-[Opening bracket on next line]
-Category=3
-Description="<html>Opening bracket on next line</html>"
-EditorType=boolean
-TrueFalse="--line_before_curly|"
-ValueDefault=0
-
-[Add missing brackets]
-Category=3
-Description="<html>Add missing brackets to single line structs</html>"
-EditorType=boolean
-TrueFalse="--add_missing_braces|"
-ValueDefault=0
-
-[Blank line after case "break"]
-Category=3
-Description="<html>Blank line after case 'break'</html>"
-EditorType=boolean
-TrueFalse="--line_after_break|"
-ValueDefault=0
-
-[Space between "for" elements]
-Category=3
-Description="<html>Space between 'for' elements</html>"
-EditorType=boolean
-TrueFalse="--space_inside_for|"
-ValueDefault=0
-
-[Extra indent for "Case" and "Default"]
-Category=3
-Description="<html>Extra indent for 'Case' and 'Default'</html>"
-EditorType=boolean
-TrueFalse="--indent_case|"
-ValueDefault=0
-
-[Opening array parentheses on next line]
-Category=4
-Description="<html>Opening array parentheses on next line</html>"
-EditorType=boolean
-TrueFalse="--line_before_array|"
-ValueDefault=0
-
-[Non-empty arrays as vertical block]
-Category=4
-Description="<html>Non-empty arrays as vertical block</html>"
-EditorType=boolean
-TrueFalse="--vertical_array|"
-ValueDefault=0
-
-[Align block +3 assigned array elements]
-Category=4
-Description="<html>Align block +3 assigned array elements</html>"
-EditorType=boolean
-TrueFalse="--align_array_assignment|"
-ValueDefault=0
-
-[Space around double arrow]
-Category=4
-Description="<html>Space around double arrow</html>"
-EditorType=boolean
-TrueFalse="--space_around_double_arrow|"
-ValueDefault=0
-
-[Concatenation as vertical block]
-Category=4
-Description="<html>Concatenation as vertical block</html>"
-EditorType=boolean
-TrueFalse="--vertical_concat|"
-ValueDefault=0
-
-[Space around concat elements]
-Category=4
-Description="<html>Space around concat elements</html>"
-EditorType=boolean
-TrueFalse="--space_around_concat|"
-ValueDefault=0
-
-[Blank line before multi-line comment]
-Category=5
-Description="<html>Blank line before multi-line comment (/*)</html>"
-EditorType=boolean
-TrueFalse="--line_before_comment_multi|"
-ValueDefault=0
-
-[Blank line after multi-line comment]
-Category=5
-Description="<html>Blank line after multi-line comment (/*)</html>"
-EditorType=boolean
-TrueFalse="--line_after_comment_multi|"
-ValueDefault=0
-
-[Blank line before single line comments]
-Category=5
-Description="<html>Blank line before single line comments (//)</html>"
-EditorType=boolean
-TrueFalse="--line_before_comment|"
-ValueDefault=0
-
-[Blank line after single line comments]
-Category=5
-Description="<html>Blank line after single line comments (//)</html>"
-EditorType=boolean
-TrueFalse="--line_after_comment|"
-ValueDefault=0
+[header] +categories="General|Operators|Functions, Classes and Objects|Control Structures|Arrays and Concatenation|Comments" +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.php|*.phpt|*.phps +indenterFileName=phpStylist.php +indenterName=phpStylist (PHP) +inputFileName=indentinput +inputFileParameter=" " +manual=http://sourceforge.net/projects/phpstylist/ +outputFileName= +outputFileParameter=stdout +parameterOrder=ipo +showHelpParameter="-- --help" +stringparaminquotes=false +useCfgFileParameter= +version=1.0 + +[Indent size] +CallName="--indent_size " +Category=0 +Description="<html>Indent the code with the set number of spaces.</html>" +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=0 +ValueDefault=4 + +[Indent with tabs] +Category=0 +Description="<html>Indent with tabs instead of spaces</html>" +EditorType=boolean +TrueFalse="--indent_with_tabs|" +ValueDefault=0 + +[Keep redundant lines] +Category=0 +Description="<html>Keep redundant lines</html>" +EditorType=boolean +TrueFalse="--keep_redundant_lines|" +ValueDefault=0 + +[Space inside parentheses] +Category=0 +Description="<html>Space inside parentheses</html>" +EditorType=boolean +TrueFalse="--space_inside_parentheses|" +ValueDefault=0 + +[Space outside parentheses] +Category=0 +Description="<html>Space outside parentheses</html>" +EditorType=boolean +TrueFalse="--space_outside_parentheses|" +ValueDefault=0 + +[Space after comma] +Category=0 +Description="<html>Space after comma</html>" +EditorType=boolean +TrueFalse="--space_after_comma|" +ValueDefault=0 + +[Space around assignment] +Category=1 +Description="<html>Space around = .= += -= *= /= <<<</html>" +EditorType=boolean +TrueFalse="--space_around_assignment|" +ValueDefault=0 + +[Align block +3 assigned variables] +Category=1 +Description="<html>Align block +3 assigned variables</html>" +EditorType=boolean +TrueFalse="--align_var_assignment|" +ValueDefault=0 + +[Space around comparison] +Category=1 +Description="<html>Space around == === != !== > >= < <=</html>" +EditorType=boolean +TrueFalse="--space_around_comparison|" +ValueDefault=0 + +[Space around arithmetic] +Category=1 +Description="<html>Space around - + * / %</html>" +EditorType=boolean +TrueFalse="--space_around_arithmetic|" +ValueDefault=0 + +[Space around logical] +Category=1 +Description="<html>Space around && || AND OR XOR << >></html>" +EditorType=boolean +TrueFalse="--space_around_logical|" +ValueDefault=0 + +[Space around colon and question] +Category=1 +Description="<html>Space around ? :</html>" +EditorType=boolean +TrueFalse="--space_around_colon_question|" +ValueDefault=0 + +[Blank line before keyword] +Category=2 +Description="<html>Blank line before keyword</html>" +EditorType=boolean +TrueFalse="--line_before_function|" +ValueDefault=0 + +[Opening bracket on next line] +Category=2 +Description="<html>Opening bracket on next line</html>" +EditorType=boolean +TrueFalse="--line_before_curly_function|" +ValueDefault=0 + +[Blank line below opening bracket] +Category=2 +Description="<html>Blank line below opening bracket</html>" +EditorType=boolean +TrueFalse="--line_after_curly_function|" +ValueDefault=0 + +[Space around ->] +Category=2 +Description="<html>Space around -></html>" +EditorType=boolean +TrueFalse="--space_around_obj_operator|" +ValueDefault=0 + +[Space around ::] +Category=2 +Description="<html>Space around ::</html>" +EditorType=boolean +TrueFalse="--space_around_double_colon|" +ValueDefault=0 + +[Space before parentheses] +Category=3 +Description="<html>Space between keyword and opening parentheses</html>" +EditorType=boolean +TrueFalse="--space_after_if|" +ValueDefault=0 + +[Keep else/elseif along with bracket] +Category=3 +Description="<html>Keep else/elseif along with bracket</html>" +EditorType=boolean +TrueFalse="--else_along_curly|" +ValueDefault=0 + +[Opening bracket on next line] +Category=3 +Description="<html>Opening bracket on next line</html>" +EditorType=boolean +TrueFalse="--line_before_curly|" +ValueDefault=0 + +[Add missing brackets] +Category=3 +Description="<html>Add missing brackets to single line structs</html>" +EditorType=boolean +TrueFalse="--add_missing_braces|" +ValueDefault=0 + +[Blank line after case "break"] +Category=3 +Description="<html>Blank line after case 'break'</html>" +EditorType=boolean +TrueFalse="--line_after_break|" +ValueDefault=0 + +[Space between "for" elements] +Category=3 +Description="<html>Space between 'for' elements</html>" +EditorType=boolean +TrueFalse="--space_inside_for|" +ValueDefault=0 + +[Extra indent for "Case" and "Default"] +Category=3 +Description="<html>Extra indent for 'Case' and 'Default'</html>" +EditorType=boolean +TrueFalse="--indent_case|" +ValueDefault=0 + +[Opening array parentheses on next line] +Category=4 +Description="<html>Opening array parentheses on next line</html>" +EditorType=boolean +TrueFalse="--line_before_array|" +ValueDefault=0 + +[Non-empty arrays as vertical block] +Category=4 +Description="<html>Non-empty arrays as vertical block</html>" +EditorType=boolean +TrueFalse="--vertical_array|" +ValueDefault=0 + +[Align block +3 assigned array elements] +Category=4 +Description="<html>Align block +3 assigned array elements</html>" +EditorType=boolean +TrueFalse="--align_array_assignment|" +ValueDefault=0 + +[Space around double arrow] +Category=4 +Description="<html>Space around double arrow</html>" +EditorType=boolean +TrueFalse="--space_around_double_arrow|" +ValueDefault=0 + +[Concatenation as vertical block] +Category=4 +Description="<html>Concatenation as vertical block</html>" +EditorType=boolean +TrueFalse="--vertical_concat|" +ValueDefault=0 + +[Space around concat elements] +Category=4 +Description="<html>Space around concat elements</html>" +EditorType=boolean +TrueFalse="--space_around_concat|" +ValueDefault=0 + +[Blank line before multi-line comment] +Category=5 +Description="<html>Blank line before multi-line comment (/*)</html>" +EditorType=boolean +TrueFalse="--line_before_comment_multi|" +ValueDefault=0 + +[Blank line after multi-line comment] +Category=5 +Description="<html>Blank line after multi-line comment (/*)</html>" +EditorType=boolean +TrueFalse="--line_after_comment_multi|" +ValueDefault=0 + +[Blank line before single line comments] +Category=5 +Description="<html>Blank line before single line comments (//)</html>" +EditorType=boolean +TrueFalse="--line_before_comment|" +ValueDefault=0 + +[Blank line after single line comments] +Category=5 +Description="<html>Blank line after single line comments (//)</html>" +EditorType=boolean +TrueFalse="--line_after_comment|" +ValueDefault=0 diff --git a/indenters/uigui_php_Beautifier.ini b/indenters/uigui_php_Beautifier.ini index fc03fc6..ab5364d 100755 --- a/indenters/uigui_php_Beautifier.ini +++ b/indenters/uigui_php_Beautifier.ini @@ -1,108 +1,108 @@ -[header]
-categories=General
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.php|*.phpt|*.phps
-indenterFileName=php_beautifier
-indenterName=PHP_Beautifier (PHP)
-inputFileName=indentinput
-inputFileParameter="-f "
-manual=http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/tutorial_PHP_Beautifier.howtouse.commandline.pkg.html
-outputFileName=indentoutput
-outputFileParameter="-o "
-parameterOrder=iop
-showHelpParameter=--help
-stringparaminquotes=false
-useCfgFileParameter=
-version=0.1.13
-
-[Indent With Spaces]
-CallName="-s"
-Category=1
-Description=<html>Indent the code with the set number of spaces.</html>
-EditorType=numeric
-Enabled=true
-MaxVal=99
-MinVal=0
-ValueDefault=4
-
-[Indent With Tabs]
-CallName="-t"
-Category=1
-Description=<html>Indent the code with the set number of tabs.</html>
-EditorType=numeric
-Enabled=false
-MaxVal=99
-MinVal=0
-ValueDefault=1
-
-[Add Header]
-Category=0
-Choices="-l \"Pear(add_header=php)\"|-l \"Pear(add_header=bsd)\"|-l \"Pear(add_header=apache)\"|-l \"Pear(add_header=lgpl)\"|-l \"Pear(add_header=pear)\""
-ChoicesReadable="PHP|BSD|Apache|LGPL|PEAR"
-Description="<html>Adds header information to a file. These can be Php, BSD, Apache, LGPL or Pear license info.</html>"
-EditorType=multiple
-Enabled=true
-ValueDefault=0
-
-[Newline Class]
-Category=0
-Description=<html>Add a new line after class before opening brace.</html>
-EditorType=boolean
-TrueFalse="-l \"Pear(newline_class=true)\"|-l \"Pear(newline_class=false)\""
-ValueDefault=1
-
-[Newline Function]
-Category=0
-Description=<html>Add a new line after function before opening brace.</html>
-EditorType=boolean
-TrueFalse="-l \"Pear(newline_function=true)\"|-l \"Pear(newline_function=false)\""
-ValueDefault=1
-
-[New Lines Before]
-CallName="-l \"NewLines(before="
-Category=0
-Description="<html>Add new lines before specific keywords. Keywords are separated by a single colon. Example: if:switch:T_CLASS<br />The string MUST end with a closing brace and an escaped double quote.</html>"
-EditorType=string
-Enabled=false
-ValueDefault="if:switch:T_CLASS)\""
-
-[New Lines After]
-CallName="-l \"NewLines(after="
-Category=0
-Description="<html>Add new lines after specific keywords. Keywords are separated by a single colon. Example: T_COMMENT:function<br />The string MUST end with a closing brace and an escaped double quote.</html>"
-EditorType=string
-Enabled=false
-ValueDefault="T_COMMENT:function)\""
-
-[Arrays Nested]
-Category=0
-Description=<html></html>
-EditorType=boolean
-TrueFalse="-l \"ArrayNested()\"|"
-ValueDefault=0
-
-[Lowercase]
-Category=0
-Description=<html>Lowercases all control structures.</html>
-EditorType=boolean
-TrueFalse="-l \"Lowercase()\"|"
-ValueDefault=0
-
-[List Class And Functions]
-Category=0
-Choices="-l \"ListClassFunction(list_classes=true)\"|-l \"ListClassFunction(list_functions=true)\"|-l \"ListClassFunction()\""
-ChoicesReadable="List Classes|List Functions|List Classes And Functions"
-Description=<html>Create a list of functions and classes in the script By default, this Filter puts the list at the beggining of the script. If you want it in another position, put a comment like that <pre> // Class and Function List </pre> The script lookup for the string 'Class and Function List' in a comment and replace the entire comment with the list.</html>
-EditorType=multiple
-Enabled=false
-ValueDefault=0
-
-[Indent Styles]
-Category=0
-Choices="-l \"IndentStyles(style=k&r)\"|-l \"IndentStyles(style=allman)\"|-l \"IndentStyles(style=whitesmiths)\"|-l \"IndentStyles(style=gnu)\""
-ChoicesReadable="K&R|Allman|Whitesmiths|GNU"
-Description=<html></html>
-EditorType=multiple
-Enabled=false
-ValueDefault=0
+[header] +categories=General +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.php|*.phpt|*.phps +indenterFileName=php_beautifier +indenterName=PHP_Beautifier (PHP) +inputFileName=indentinput +inputFileParameter="-f " +manual=http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/tutorial_PHP_Beautifier.howtouse.commandline.pkg.html +outputFileName=indentoutput +outputFileParameter="-o " +parameterOrder=iop +showHelpParameter=--help +stringparaminquotes=false +useCfgFileParameter= +version=0.1.13 + +[Indent With Spaces] +CallName="-s" +Category=1 +Description=<html>Indent the code with the set number of spaces.</html> +EditorType=numeric +Enabled=true +MaxVal=99 +MinVal=0 +ValueDefault=4 + +[Indent With Tabs] +CallName="-t" +Category=1 +Description=<html>Indent the code with the set number of tabs.</html> +EditorType=numeric +Enabled=false +MaxVal=99 +MinVal=0 +ValueDefault=1 + +[Add Header] +Category=0 +Choices="-l \"Pear(add_header=php)\"|-l \"Pear(add_header=bsd)\"|-l \"Pear(add_header=apache)\"|-l \"Pear(add_header=lgpl)\"|-l \"Pear(add_header=pear)\"" +ChoicesReadable="PHP|BSD|Apache|LGPL|PEAR" +Description="<html>Adds header information to a file. These can be Php, BSD, Apache, LGPL or Pear license info.</html>" +EditorType=multiple +Enabled=true +ValueDefault=0 + +[Newline Class] +Category=0 +Description=<html>Add a new line after class before opening brace.</html> +EditorType=boolean +TrueFalse="-l \"Pear(newline_class=true)\"|-l \"Pear(newline_class=false)\"" +ValueDefault=1 + +[Newline Function] +Category=0 +Description=<html>Add a new line after function before opening brace.</html> +EditorType=boolean +TrueFalse="-l \"Pear(newline_function=true)\"|-l \"Pear(newline_function=false)\"" +ValueDefault=1 + +[New Lines Before] +CallName="-l \"NewLines(before=" +Category=0 +Description="<html>Add new lines before specific keywords. Keywords are separated by a single colon. Example: if:switch:T_CLASS<br />The string MUST end with a closing brace and an escaped double quote.</html>" +EditorType=string +Enabled=false +ValueDefault="if:switch:T_CLASS)\"" + +[New Lines After] +CallName="-l \"NewLines(after=" +Category=0 +Description="<html>Add new lines after specific keywords. Keywords are separated by a single colon. Example: T_COMMENT:function<br />The string MUST end with a closing brace and an escaped double quote.</html>" +EditorType=string +Enabled=false +ValueDefault="T_COMMENT:function)\"" + +[Arrays Nested] +Category=0 +Description=<html></html> +EditorType=boolean +TrueFalse="-l \"ArrayNested()\"|" +ValueDefault=0 + +[Lowercase] +Category=0 +Description=<html>Lowercases all control structures.</html> +EditorType=boolean +TrueFalse="-l \"Lowercase()\"|" +ValueDefault=0 + +[List Class And Functions] +Category=0 +Choices="-l \"ListClassFunction(list_classes=true)\"|-l \"ListClassFunction(list_functions=true)\"|-l \"ListClassFunction()\"" +ChoicesReadable="List Classes|List Functions|List Classes And Functions" +Description=<html>Create a list of functions and classes in the script By default, this Filter puts the list at the beggining of the script. If you want it in another position, put a comment like that <pre> // Class and Function List </pre> The script lookup for the string 'Class and Function List' in a comment and replace the entire comment with the list.</html> +EditorType=multiple +Enabled=false +ValueDefault=0 + +[Indent Styles] +Category=0 +Choices="-l \"IndentStyles(style=k&r)\"|-l \"IndentStyles(style=allman)\"|-l \"IndentStyles(style=whitesmiths)\"|-l \"IndentStyles(style=gnu)\"" +ChoicesReadable="K&R|Allman|Whitesmiths|GNU" +Description=<html></html> +EditorType=multiple +Enabled=false +ValueDefault=0 diff --git a/indenters/uigui_pindent.ini b/indenters/uigui_pindent.ini index ee41fb3..ae17620 100755 --- a/indenters/uigui_pindent.ini +++ b/indenters/uigui_pindent.ini @@ -1,54 +1,54 @@ -[header]
-categories=General options
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.py
-indenterFileName=pindent.py
-indenterName=PIndent (Python)
-inputFileName=indentinput
-inputFileParameter=
-manual=http://coverage.livinglogic.de/Tools/scripts/pindent.py.html
-outputFileName=indentinput
-outputFileParameter=none
-stringparaminquotes=false
-parameterOrder=pio
-showHelpParameter=
-stringparaminquotes=false
-useCfgFileParameter=
-version="from Python 2.5.1 package"
-
-[End directives]
-Category=0
-Description="<html>Complete takes a valid Python program as input and outputs a version augmented with block-closing comments (add #end directives).<br />Or Delete assumes its input is a Python program with block-closing comments and outputs a commentless version(delete #end directives).<br />Or Reformat assumes its input is a Python program with block-closing comments but with its indentation messed up, and outputs a properly indented version (use #end directives).</html>"
-Enabled=true
-EditorType=multiple
-Choices="-c|-d|-r"
-ChoicesReadable="Complete|Delete|Reformat"
-ValueDefault=0
-
-[Step size]
-Category=0
-Description="<html>Sets the indentation step size.</html>"
-Enabled=true
-EditorType=numeric
-CallName="-s "
-MinVal=0
-MaxVal=999
-ValueDefault=8
-
-[Tab size]
-Category=0
-Description="<html>Sets the number of spaces a tab character is worth.</html>"
-Enabled=true
-EditorType=numeric
-CallName="-t "
-MinVal=0
-MaxVal=999
-ValueDefault=8
-
-[Convert Tabs]
-Category=0
-Description="<html>Expand TABs into spaces.</html>"
-EditorType=boolean
-TrueFalse=-e|
-ValueDefault=0
+[header] +categories=General options +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.py +indenterFileName=pindent.py +indenterName=PIndent (Python) +inputFileName=indentinput +inputFileParameter= +manual=http://coverage.livinglogic.de/Tools/scripts/pindent.py.html +outputFileName=indentinput +outputFileParameter=none +stringparaminquotes=false +parameterOrder=pio +showHelpParameter= +stringparaminquotes=false +useCfgFileParameter= +version="from Python 2.5.1 package" + +[End directives] +Category=0 +Description="<html>Complete takes a valid Python program as input and outputs a version augmented with block-closing comments (add #end directives).<br />Or Delete assumes its input is a Python program with block-closing comments and outputs a commentless version(delete #end directives).<br />Or Reformat assumes its input is a Python program with block-closing comments but with its indentation messed up, and outputs a properly indented version (use #end directives).</html>" +Enabled=true +EditorType=multiple +Choices="-c|-d|-r" +ChoicesReadable="Complete|Delete|Reformat" +ValueDefault=0 + +[Step size] +Category=0 +Description="<html>Sets the indentation step size.</html>" +Enabled=true +EditorType=numeric +CallName="-s " +MinVal=0 +MaxVal=999 +ValueDefault=8 + +[Tab size] +Category=0 +Description="<html>Sets the number of spaces a tab character is worth.</html>" +Enabled=true +EditorType=numeric +CallName="-t " +MinVal=0 +MaxVal=999 +ValueDefault=8 + +[Convert Tabs] +Category=0 +Description="<html>Expand TABs into spaces.</html>" +EditorType=boolean +TrueFalse=-e| +ValueDefault=0 diff --git a/indenters/uigui_psti.ini b/indenters/uigui_psti.ini index a1a82b0..9a1acb7 100755 --- a/indenters/uigui_psti.ini +++ b/indenters/uigui_psti.ini @@ -1,196 +1,196 @@ -[header]
-categories=General options|Spaces|Indentation|Alignments
-cfgFileParameterEnding=cr
-configFilename=psti.cfg
-fileTypes=*.sql
-indenterFileName=psti.exe
-indenterName=Pl/Sql tidy (Pl/Sql)
-inputFileName=indentinput
-inputFileParameter="-i "
-manual=http://psti.equinoxbase.com/manual.html
-outputFileName=indentoutput
-outputFileParameter="-o "
-stringparaminquotes=false
-parameterOrder=iop
-showHelpParameter=-h
-stringparaminquotes=false
-useCfgFileParameter="-ls "
-version=1.2
-
-[Disable all switches]
-Category=0
-Description="<html>Sets all switches to off.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-0|
-ValueDefault=0
-
-[Uppercase Keywords]
-Category=0
-Description="<html>Uppercase Keywords.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-uk+|-uk-
-ValueDefault=0
-
-[Capitalized Keywords]
-Category=0
-Description="<html>Capitalized Keywords.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-ck+|-ck-
-ValueDefault=0
-
-[Lowercase Keywords]
-Category=0
-Description="<html>Lowercase Keywords.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-lk+|-lk-
-ValueDefault=0
-
-[Uppercase Identifiers]
-Category=0
-Description="<html>Uppercase Identifiers.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-ui+|-ui-
-ValueDefault=0
-
-[Lowercase Identifiers]
-Category=0
-Description="<html>Lowercase Identifiers.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-li+|-li-
-ValueDefault=0
-
-[Capitalized Identifiers]
-Category=0
-Description="<html>Capitalized Identifiers.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-ci+|-ci-
-ValueDefault=0
-
-[Compactify]
-Category=1
-Description="<html>Compactify, remove redundant spaces/keep.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-c+|-c-
-ValueDefault=0
-
-[Remove Operation Spaces]
-Category=1
-Description="<html>Remove spaces around operations (+,- etcdo nothing/).</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-co+|-co-
-ValueDefault=0
-
-[Add Operation Spaces]
-Category=1
-Description="<html>Add space around operations/do nothing.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-sao+|-sao-
-ValueDefault=0
-
-[Remove Space Open Bracket]
-Category=1
-Description="<html>Remove spaces after opening brackets/keep.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-rsaob+|-rsaob-
-ValueDefault=0
-
-[Don't Remove Bracket Space]
-Category=1
-Description="<html>Don't remove spaces around brackets/do nothing.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-ncb+|-ncb-
-ValueDefault=0
-
-[Indent Size]
-Category=2
-Description="<html>Indent size in spaces or in tabs (generally).</html>"
-Enabled=true
-EditorType=numeric
-CallName="-is "
-MinVal=0
-MaxVal=1024
-ValueDefault=4
-
-[Indent Lines]
-Category=2
-Description="<html>Whether to indent strings lines.</html>"
-Enabled=true
-EditorType=boolean
-TrueFalse=-in+|-in-
-ValueDefault=1
-
-[Keep relative indentation]
-Category=2
-Description="<html>Keep the relative identation of an allowed sql/do nothing.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-rs+|-rs-
-ValueDefault=0
-
-[Indent after exception]
-Category=2
-Description="<html>Extra indentation after exception when yes/no.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-iaew+|-iaew-
-ValueDefault=0
-
-[Indent after case]
-Category=2
-Description="<html>Extra indentation after case when yes/no.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-iacw+|-iacw-
-ValueDefault=0
-
-[Indent after cursor]
-Category=2
-Description="<html>Extra indentation after cursor yes/no.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-iac+|-iac-
-ValueDefault=0
-
-[Indent comments]
-Category=2
-Description="<html>Indent standalone comments.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-isc+|-isc-
-ValueDefault=0
-
-[Indent comments special]
-Category=2
-Description="<html>Indent standalone comments in some special cases too.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-isc2+|-isc2-
-ValueDefault=0
-
-[Indent inside comments]
-Category=2
-Description="<html>Indent inside comments/do nothing.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-iic+|-iic-
-ValueDefault=0
-
-[Column alignment]
-Category=3
-Description="<html>Column like lists inside brackets.</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=-clb+|-clb-
-ValueDefault=0
+[header] +categories=General options|Spaces|Indentation|Alignments +cfgFileParameterEnding=cr +configFilename=psti.cfg +fileTypes=*.sql +indenterFileName=psti.exe +indenterName=Pl/Sql tidy (Pl/Sql) +inputFileName=indentinput +inputFileParameter="-i " +manual=http://psti.equinoxbase.com/manual.html +outputFileName=indentoutput +outputFileParameter="-o " +stringparaminquotes=false +parameterOrder=iop +showHelpParameter=-h +stringparaminquotes=false +useCfgFileParameter="-ls " +version=1.2 + +[Disable all switches] +Category=0 +Description="<html>Sets all switches to off.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-0| +ValueDefault=0 + +[Uppercase Keywords] +Category=0 +Description="<html>Uppercase Keywords.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-uk+|-uk- +ValueDefault=0 + +[Capitalized Keywords] +Category=0 +Description="<html>Capitalized Keywords.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-ck+|-ck- +ValueDefault=0 + +[Lowercase Keywords] +Category=0 +Description="<html>Lowercase Keywords.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-lk+|-lk- +ValueDefault=0 + +[Uppercase Identifiers] +Category=0 +Description="<html>Uppercase Identifiers.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-ui+|-ui- +ValueDefault=0 + +[Lowercase Identifiers] +Category=0 +Description="<html>Lowercase Identifiers.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-li+|-li- +ValueDefault=0 + +[Capitalized Identifiers] +Category=0 +Description="<html>Capitalized Identifiers.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-ci+|-ci- +ValueDefault=0 + +[Compactify] +Category=1 +Description="<html>Compactify, remove redundant spaces/keep.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-c+|-c- +ValueDefault=0 + +[Remove Operation Spaces] +Category=1 +Description="<html>Remove spaces around operations (+,- etcdo nothing/).</html>" +Enabled=false +EditorType=boolean +TrueFalse=-co+|-co- +ValueDefault=0 + +[Add Operation Spaces] +Category=1 +Description="<html>Add space around operations/do nothing.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-sao+|-sao- +ValueDefault=0 + +[Remove Space Open Bracket] +Category=1 +Description="<html>Remove spaces after opening brackets/keep.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-rsaob+|-rsaob- +ValueDefault=0 + +[Don't Remove Bracket Space] +Category=1 +Description="<html>Don't remove spaces around brackets/do nothing.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-ncb+|-ncb- +ValueDefault=0 + +[Indent Size] +Category=2 +Description="<html>Indent size in spaces or in tabs (generally).</html>" +Enabled=true +EditorType=numeric +CallName="-is " +MinVal=0 +MaxVal=1024 +ValueDefault=4 + +[Indent Lines] +Category=2 +Description="<html>Whether to indent strings lines.</html>" +Enabled=true +EditorType=boolean +TrueFalse=-in+|-in- +ValueDefault=1 + +[Keep relative indentation] +Category=2 +Description="<html>Keep the relative identation of an allowed sql/do nothing.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-rs+|-rs- +ValueDefault=0 + +[Indent after exception] +Category=2 +Description="<html>Extra indentation after exception when yes/no.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-iaew+|-iaew- +ValueDefault=0 + +[Indent after case] +Category=2 +Description="<html>Extra indentation after case when yes/no.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-iacw+|-iacw- +ValueDefault=0 + +[Indent after cursor] +Category=2 +Description="<html>Extra indentation after cursor yes/no.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-iac+|-iac- +ValueDefault=0 + +[Indent comments] +Category=2 +Description="<html>Indent standalone comments.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-isc+|-isc- +ValueDefault=0 + +[Indent comments special] +Category=2 +Description="<html>Indent standalone comments in some special cases too.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-isc2+|-isc2- +ValueDefault=0 + +[Indent inside comments] +Category=2 +Description="<html>Indent inside comments/do nothing.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-iic+|-iic- +ValueDefault=0 + +[Column alignment] +Category=3 +Description="<html>Column like lists inside brackets.</html>" +Enabled=false +EditorType=boolean +TrueFalse=-clb+|-clb- +ValueDefault=0 diff --git a/indenters/uigui_rubyformatter.ini b/indenters/uigui_rubyformatter.ini index 58ff452..1afba10 100755 --- a/indenters/uigui_rubyformatter.ini +++ b/indenters/uigui_rubyformatter.ini @@ -1,27 +1,27 @@ -[header]
-categories=General
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.rb
-indenterFileName=ruby_formatter.rb
-indenterName=Simple Ruby Formatter (Ruby)
-inputFileName=indentinput
-inputFileParameter=
-manual=http://raa.ruby-lang.org/project/ruby_formatter/
-outputFileName=indentinput
-outputFileParameter=none
-parameterOrder=pio
-showHelpParameter=
-stringparaminquotes=false
-useCfgFileParameter=
-version=Rev 0.6.1
-
-[indent spaces]
-CallName="-s "
-Category=0
-Description=<html>Indent using # spaces per indent</html>
-EditorType=numeric
-Enabled=false
-MaxVal=20
-MinVal=2
+[header] +categories=General +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.rb +indenterFileName=ruby_formatter.rb +indenterName=Simple Ruby Formatter (Ruby) +inputFileName=indentinput +inputFileParameter= +manual=http://raa.ruby-lang.org/project/ruby_formatter/ +outputFileName=indentinput +outputFileParameter=none +parameterOrder=pio +showHelpParameter= +stringparaminquotes=false +useCfgFileParameter= +version=Rev 0.6.1 + +[indent spaces] +CallName="-s " +Category=0 +Description=<html>Indent using # spaces per indent</html> +EditorType=numeric +Enabled=false +MaxVal=20 +MinVal=2 ValueDefault=4
\ No newline at end of file diff --git a/indenters/uigui_shellindent.ini b/indenters/uigui_shellindent.ini index 283f90b..2c36958 100755 --- a/indenters/uigui_shellindent.ini +++ b/indenters/uigui_shellindent.ini @@ -1,17 +1,17 @@ -[header]
-categories=
-cfgFileParameterEnding=" "
-configFilename=
-fileTypes=*.sh
-indenterFileName=shellindent.awk
-indenterName=Shell Code Indent (sh)
-inputFileName=indentinput
-inputFileParameter=
-manual=http://www.bolthole.com/AWK.html
-outputFileName=
-outputFileParameter=stdout
-parameterOrder=pio
-showHelpParameter=
-stringparaminquotes=false
-useCfgFileParameter=
-version=2008-01-10
+[header] +categories= +cfgFileParameterEnding=" " +configFilename= +fileTypes=*.sh +indenterFileName=shellindent.awk +indenterName=Shell Code Indent (sh) +inputFileName=indentinput +inputFileParameter= +manual=http://www.bolthole.com/AWK.html +outputFileName= +outputFileParameter=stdout +parameterOrder=pio +showHelpParameter= +stringparaminquotes=false +useCfgFileParameter= +version=2008-01-10 diff --git a/indenters/uigui_tidy.ini b/indenters/uigui_tidy.ini index 61b9b0a..1341d45 100755 --- a/indenters/uigui_tidy.ini +++ b/indenters/uigui_tidy.ini @@ -1,612 +1,612 @@ -[header]
-categories="HTML, XHTML, XML|Diagnostics|Pretty Print|Character Encoding|Miscellaneous"
-cfgFileParameterEnding=cr
-configFilename=htmltidy.cfg
-fileTypes=*.html|*.htm
-indenterFileName=tidy
-indenterName=(HTML) Tidy
-inputFileName=indentinput
-inputFileParameter=
-manual=http://tidy.sourceforge.net/docs/tidy_man.html
-outputFileName=indentoutput
-outputFileParameter="-o "
-parameterOrder=poi
-showHelpParameter=-h
-stringparaminquotes=false
-useCfgFileParameter="-q -config "
-version=2007-05-24
-
-[Quiet]
-Category=4
-Description="<html>This option specifies if Tidy should output the summary of the numbers of errors and warnings, or the welcome or informational messages.</html>"
-EditorType=boolean
-Enabled=true
-TrueFalse=quiet:yes|quiet:no
-ValueDefault=1
-
-[Uppercase tags]
-Category=0
-Description=<html>This option specifies if Tidy should output tag names in upper case. The default is no, which results in lower case tag names, except for XML input, where the original case is preserved.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=uppercase-tags:yes|uppercase-tags:no
-ValueDefault=0
-
-[accessibility-check]
-CallName=accessibility-check:
-Category=1
-Description="<html>This option specifies what level of accessibility checking, if any, that Tidy should do. Level 0 is equivalent to Tidy Classic's accessibility checking. For more information on Tidy's accessibility checking, visit the Adaptive Technology Resource Centre at the University of Toronto.</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=3
-MinVal=0
-ValueDefault=0
-
-[add-xml-decl]
-Category=0
-Description="<html>This option specifies if Tidy should add the XML declaration when outputting XML or XHTML. Note that if the input already includes an <?xml ... ?> declaration then this option will be ignored. If the encoding for the output is different from 'ascii', one of the utf encodings or 'raw', the declaration is always added as required by the XML standard.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=add-xml-decl:yes|add-xml-decl:no
-ValueDefault=0
-
-[add-xml-space]
-Category=0
-Description="<html>This option specifies if Tidy should add xml:space='preserve' to elements such as <PRE>, <STYLE> and <SCRIPT> when generating XML. This is needed if the whitespace in such elements is to be parsed appropriately without having access to the DTD.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=add-xml-space:yes|add-xml-space:no
-ValueDefault=0
-
-[alt-text]
-CallName=alt-text:
-Category=0
-Description="<html>-This option specifies the default 'alt=' text Tidy uses for <IMG> attributes. This feature is dangerous as it suppresses further accessibility warnings. You are responsible for making your documents accessible to people who can not see the images!</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[ascii-chars]
-Category=3
-Description="<html>Can be used to modify behavior of -c (--clean yes) option. If set to 'yes' when using -c, &emdash;, ”, and other named character entities are downgraded to their closest ascii equivalents.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=ascii-chars:yes|ascii-chars:no
-ValueDefault=0
-
-[assume-xml-procins]
-Category=0
-Description=<html>This option specifies if Tidy should change the parsing of processing instructions to require ?> as the terminator rather than >. This option is automatically set if the input is in XML.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=assume-xml-procins:yes|assume-xml-procins:no
-ValueDefault=0
-
-[bare]
-Category=0
-Description="<html>This option specifies if Tidy should strip Microsoft specific HTML from Word 2000 documents, and output spaces rather than non-breaking spaces where they exist in the input.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=bare:yes|bare:no
-ValueDefault=0
-
-[break-before-br]
-Category=2
-Description=<html>This option specifies if Tidy should output a line break before each <BR> element.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=break-before-br:yes|break-before-br:no
-ValueDefault=0
-
-[char-encoding]
-Category=3
-Choices=char-encoding:raw|char-encoding:ascii|char-encoding:latin0|char-encoding:latin1|char-encoding:utf8|char-encoding:iso2022|char-encoding:mac|char-encoding:win1252|char-encoding:ibm858|char-encoding:utf16le|char-encoding:utf16be|char-encoding:utf16|char-encoding:big5|char-encoding:shiftjis
-Description="<html>This option specifies the character encoding Tidy uses for both the input and output. For ascii, Tidy will accept Latin-1 (ISO-8859-1) character values, but will use entities for all characters whose value > 127. For raw, Tidy will output values above 127 without translating them into entities. For latin1, characters above 255 will be written as entities. For utf8, Tidy assumes that both input and output is encoded as UTF-8. You can use iso2022 for files encoded using the ISO-2022 family of encodings e.g. ISO-2022-JP. For mac and win1252, Tidy will accept vendor specific character values, but will use entities for all characters whose value > 127.</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=1
-
-[clean]
-Category=0
-Description=<html>This option specifies if Tidy should strip out surplus presentational tags and attributes replacing them by style rules and structural markup as appropriate. It works well on the HTML saved by Microsoft Office products.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=clean:yes|clean:no
-ValueDefault=0
-
-[css-prefix]
-CallName=css-prefix
-Category=0
-Description="<html>-This option specifies the prefix that Tidy uses for styles rules. By default, 'c' will be used.</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[decorate-inferred-ul]
-Category=0
-Description=<html>This option specifies if Tidy should decorate inferred UL elements with some CSS markup to avoid indentation to the right.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=decorate-inferred-ul:yes|decorate-inferred-ul:no
-ValueDefault=0
-
-[doctype]
-Category=0
-Choices=doctype:omit|doctype:auto|doctype:strict|doctype:transitional|doctype:user
-Description=<html>This option specifies the DOCTYPE declaration generated by Tidy. If set to 'omit' the output won't contain a DOCTYPE declaration. If set to 'auto' (the default) Tidy will use an educated guess based upon the contents of the document. If set to 'strict', Tidy will set the DOCTYPE to the strict DTD. If set to 'loose', the DOCTYPE is set to the loose (transitional) DTD. Alternatively, you can supply a string for the formal public identifier (FPI). For example: doctype: '-//ACME//DTD HTML 3.14159//EN' If you specify the FPI for an XHTML document, Tidy will set the system identifier to an empty string. For an HTML document, Tidy adds a system identifier only if one was already present in order to preserve the processing mode of some browsers. Tidy leaves the DOCTYPE for generic XML documents unchanged. --doctype omit implies --numeric-entities yes. This option does not offer a validation of the document conformance.</html>
-EditorType=multiple
-Enabled=false
-ValueDefault=1
-
-[drop-empty-paras]
-Category=0
-Description=<html>This option specifies if Tidy should discard empty paragraphs.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=drop-empty-paras:yes|drop-empty-paras:no
-ValueDefault=1
-
-[drop-font-tags]
-Category=0
-Description=<html>This option specifies if Tidy should discard <FONT> and <CENTER> tags without creating the corresponding style rules. This option can be set independently of the clean option.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=drop-font-tags:yes|drop-font-tags:no
-ValueDefault=0
-
-[drop-proprietary-attributes]
-Category=0
-Description="<html>This option specifies if Tidy should strip out proprietary attributes, such as MS data binding attributes. </html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=drop-proprietary-attributes:yes|drop-proprietary-attributes:no
-ValueDefault=0
-
-[enclose-block-text]
-Category=0
-Description=<html>This option specifies if Tidy should insert a <P> element to enclose any text it finds in any element that allows mixed content for HTML transitional but not HTML strict.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=enclose-block-text:yes|enclose-block-text:no
-ValueDefault=0
-
-[enclose-text]
-Category=0
-Description=<html>This option specifies if Tidy should enclose any text it finds in the body element within a <P> element. This is useful when you want to take existing HTML and use it with a style sheet.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=enclose-text:yes|enclose-text:no
-ValueDefault=0
-
-[escape-cdata]
-Category=0
-Description=<html>This option specifies if Tidy should convert <![CDATA[]]> sections to normal text.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=escape-cdata:yes|escape-cdata:no
-ValueDefault=0
-
-[fix-backslash]
-Category=0
-Description=<html>This option specifies if Tidy should replace backslash characters '' in URLs by forward slashes '/'.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=fix-backslash:yes|fix-backslash:no
-ValueDefault=1
-
-[fix-bad-comments]
-Category=0
-Description="<html>This option specifies if Tidy should replace unexpected hyphens with '=' characters when it comes across adjacent hyphens. The default is yes. This option is provided for users of Cold Fusion which uses the comment syntax: <!--- ---></html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=fix-bad-comments:yes|fix-bad-comments:no
-ValueDefault=1
-
-[fix-uri]
-Category=0
-Description="<html>This option specifies if Tidy should check attribute values that carry URIs for illegal characters and if such are found, escape them as HTML 4 recommends.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=fix-uri:yes|fix-uri:no
-ValueDefault=1
-
-[hide-comments]
-Category=0
-Description=<html>This option specifies if Tidy should print out comments.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=hide-comments:yes|hide-comments:no
-ValueDefault=0
-
-[hide-endtags]
-Category=0
-Description=<html>This option specifies if Tidy should omit optional end-tags when generating the pretty printed markup. This option is ignored if you are outputting to XML.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=hide-endtags:yes|hide-endtags:no
-ValueDefault=0
-
-[indent]
-Category=2
-Description="<html>This option specifies if Tidy should indent block-level tags. If set to 'auto', this option causes Tidy to decide whether or not to indent the content of tags such as TITLE, H1-H6, LI, TD, TD, or P depending on whether or not the content includes a block-level element. You are advised to avoid setting indent to yes as this can expose layout bugs in some browsers.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=indent:yes|indent:no
-ValueDefault=0
-
-[indent-attributes]
-Category=2
-Description=<html>This option specifies if Tidy should begin each attribute on a new line.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=indent-attributes:yes|indent-attributes:no
-ValueDefault=0
-
-[indent-cdata]
-Category=0
-Description=<html>This option specifies if Tidy should indent <![CDATA[]]> sections.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=indent-cdata:yes|indent-cdata:no
-ValueDefault=0
-
-[indent-spaces]
-CallName=indent-spaces:
-Category=2
-Description="<html>This option specifies the number of spaces Tidy uses to indent content, when indentation is enabled.</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=5000
-MinVal=0
-ValueDefault=2
-
-[input-encoding]
-Category=3
-Choices=input-encoding:raw|input-encoding:ascii|input-encoding:latin0|input-encoding:latin1|input-encoding:utf8|input-encoding:iso2022|input-encoding:mac|input-encoding:win1252|input-encoding:ibm858|input-encoding:utf16le|input-encoding:utf16be|input-encoding:utf16|input-encoding:big5|input-encoding:shiftjis
-Description=<html>This option specifies the character encoding Tidy uses for the input. See char-encoding for more info.</html>
-EditorType=multiple
-Enabled=false
-ValueDefault=4
-
-[input-xml]
-Category=0
-Description=<html>This option specifies if Tidy should use the XML parser rather than the error correcting HTML parser.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=input-xml:yes|input-xml:no
-ValueDefault=0
-
-[join-classes]
-Category=0
-Description="<html>This option specifies if Tidy should combine class names to generate a single new class name, if multiple class assignments are detected on an element.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=join-classes:yes|join-classes:no
-ValueDefault=0
-
-[join-styles]
-Category=0
-Description="<html>This option specifies if Tidy should combine styles to generate a single new style, if multiple style values are detected on an element.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=join-styles:yes|join-styles:no
-ValueDefault=1
-
-[literal-attributes]
-Category=0
-Description=<html>This option specifies if Tidy should ensure that whitespace characters within attribute values are passed through unchanged.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=literal-attributes:yes|literal-attributes:no
-ValueDefault=0
-
-[logical-emphasis]
-Category=0
-Description="<html>This option specifies if Tidy should replace any occurrence of <I> by <EM> and any occurrence of <B> by <STRONG>. In both cases, the attributes are preserved unchanged. This option can be set independently of the clean and drop-font-tags options.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=logical-emphasis:yes|logical-emphasis:no
-ValueDefault=0
-
-[lower-literals]
-Category=0
-Description=<html>This option specifies if Tidy should convert the value of an attribute that takes a list of predefined values to lower case. This is required for XHTML documents.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=lower-literals:yes|lower-literals:no
-ValueDefault=1
-
-[markup]
-Category=2
-Description=<html>This option specifies if Tidy should generate a pretty printed version of the markup. Note that Tidy won't generate a pretty printed version if it finds significant errors (see force-output).</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=markup:yes|markup:no
-ValueDefault=1
-
-[merge-divs]
-Category=0
-Choices=merge-divs:auto|merge-divs:yes|merge-divs:no
-ChoicesReadable=Merge Divs Auto|Do Merge Divs|Do Not Merge Divs
-Description="<html>Can be used to modify behavior of -c (--clean yes) option. This option specifies if Tidy should merge nested <div> such as '<div><div>...</div></div>'. If set to 'auto', the attributes of the inner <div> are moved to the outer one. As well, nested <div> with ID attributes are not merged. If set to 'yes', the attributes of the inner <div> are discarded with the exception of 'class' and 'style'.</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=0
-
-[ncr]
-Category=0
-Description=<html>This option specifies if Tidy should allow numeric character references.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=ncr:yes|ncr:no
-ValueDefault=1
-
-[new-blocklevel-tags]
-CallName=new-blocklevel-tags:
-Category=0
-Description="<html>This option specifies new block-level tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Note you can't change the content model for elements such as <TABLE>, <UL>, <OL> and <DL>. This option is ignored in XML mode.</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[new-empty-tags]
-CallName=new-empty-tags:
-Category=0
-Description="<html>This option specifies new empty inline tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Remember to also declare empty tags as either inline or blocklevel. This option is ignored in XML mode.</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[new-inline-tags]
-CallName=new-inline-tags:
-Category=0
-Description="<html>This option specifies new non-empty inline tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. This option is ignored in XML mode.</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[new-pre-tags]
-CallName=new-pre-tags:
-Category=0
-Description="<html>This option specifies new tags that are to be processed in exactly the same way as HTML's <PRE> element. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Note you can not as yet add new CDATA elements (similar to <SCRIPT>). This option is ignored in XML mode.</html>"
-EditorType=string
-Enabled=false
-ValueDefault=
-
-[newline]
-Category=3
-Choices=newline:LF|newline:CRLF|newline:CR
-Description="<html>The default is appropriate to the current platform: CRLF on PC-DOS, MS-Windows and OS/2, CR on Classic Mac OS, and LF everywhere else (Unix and Linux).</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=1
-
-[numeric-entities]
-Category=0
-Description="<html>This option specifies if Tidy should output entities other than the built-in HTML entities (&, <, > and ") in the numeric rather than the named entity form. Only entities compatible with the DOCTYPE declaration generated are used. Entities that can be represented in the output encoding are translated correspondingly.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=numeric-entities:yes|numeric-entities:no
-ValueDefault=0
-
-[output-bom]
-Category=3
-Choices=output-bom:auto|output-bom:yes|output-bom:no
-Description="<html>This option specifies if Tidy should write a Unicode Byte Order Mark character (BOM; also known as Zero Width No-Break Space; has value of U+FEFF) to the beginning of the output; only for UTF-8 and UTF-16 output encodings. If set to 'auto', this option causes Tidy to write a BOM to the output only if a BOM was present at the beginning of the input. A BOM is always written for XML/XHTML output using UTF-16 output encodings.</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=0
-
-[output-encoding]
-Category=3
-Choices=output-encoding:raw|output-encoding:ascii|output-encoding:latin0|output-encoding:latin1|output-encoding:utf8|output-encoding:iso2022|output-encoding:mac|output-encoding:win1252|output-encoding:ibm858|output-encoding:utf16le|output-encoding:utf16be|output-encoding:utf16|output-encoding:big5|output-encoding:shiftjis
-Description="<html>This option specifies the character encoding Tidy uses for the output. See char-encoding for more info. May only be different from input-encoding for Latin encodings (ascii, latin0, latin1, mac, win1252, ibm858).</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=1
-
-[output-html]
-Category=0
-Description="<html>This option specifies if Tidy should generate pretty printed output, writing it as HTML.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=output-html:yes|output-html:no
-ValueDefault=0
-
-[output-xhtml]
-Category=0
-Description="<html>This option specifies if Tidy should generate pretty printed output, writing it as extensible HTML. This option causes Tidy to set the DOCTYPE and default namespace as appropriate to XHTML. If a DOCTYPE or namespace is given they will checked for consistency with the content of the document. In the case of an inconsistency, the corrected values will appear in the output. For XHTML, entities can be written as named or numeric entities according to the setting of the 'numeric-entities' option. The original case of tags and attributes will be preserved, regardless of other options.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=output-xhtml:yes|output-xhtml:no
-ValueDefault=0
-
-[output-xml]
-Category=0
-Description="<html>This option specifies if Tidy should pretty print output, writing it as well-formed XML. Any entities not defined in XML 1.0 will be written as numeric entities to allow them to be parsed by a XML parser. The original case of tags and attributes will be preserved, regardless of other options.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=output-xml:yes|output-xml:no
-ValueDefault=0
-
-[preserve-entities]
-Category=0
-Description=<html>This option specifies if Tidy should preserve the well-formed entitites as found in the input.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=preserve-entities:yes|preserve-entities:no
-ValueDefault=0
-
-[punctuation-wrap]
-Category=2
-Description=<html>This option specifies if Tidy should line wrap after some Unicode or Chinese punctuation characters.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=punctuation-wrap:yes|punctuation-wrap:no
-ValueDefault=0
-
-[quote-ampersand]
-Category=0
-Description="<html>This option specifies if Tidy should output unadorned & characters as &.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=quote-ampersand:yes|quote-ampersand:no
-ValueDefault=1
-
-[quote-marks]
-Category=0
-Description="<html>This option specifies if Tidy should output ' characters as " as is preferred by some editing environments. The apostrophe character ' is written out as ' since many web browsers don't yet support '.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=quote-marks:yes|quote-marks:no
-ValueDefault=0
-
-[quote-nbsp]
-Category=0
-Description="<html>This option specifies if Tidy should output non-breaking space characters as entities, rather than as the Unicode character value 160 (decimal).</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=quote-nbsp:yes|quote-nbsp:no
-ValueDefault=1
-
-[repeated-attributes]
-Category=0
-Choices=repeated-attributes:keep-first|repeated-attributes:keep-last
-Description="<html>This option specifies if Tidy should keep the first or last attribute, if an attribute is repeated, e.g. has two align attributes.</html>"
-EditorType=multiple
-Enabled=false
-ValueDefault=1
-
-[replace-color]
-Category=0
-Description="<html>This option specifies if Tidy should replace numeric values in color attributes by HTML/XHTML color names where defined, e.g. replace '#ffffff' with 'white'.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=replace-color:yes|replace-color:no
-ValueDefault=0
-
-[show-body-only]
-Category=0
-Description=<html>This option specifies if Tidy should print only the contents of the body tag as an HTML fragment. Useful for incorporating existing whole pages as a portion of another page.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=show-body-only:yes|show-body-only:no
-ValueDefault=0
-
-[show-errors]
-CallName=show-errors:
-Category=1
-Description="<html>This option specifies what level of accessibility checking, if any, that Tidy should do. Level 0 is equivalent to Tidy Classic's accessibility checking. For more information on Tidy's accessibility checking, visit the Adaptive Technology Resource Centre at the University of Toronto.</html>"
-EditorType=numeric
-Enabled=true
-MaxVal=5000
-MinVal=0
-ValueDefault=6
-
-[show-warnings]
-Category=1
-Description=<html>This option specifies if Tidy should suppress warnings. This can be useful when a few errors are hidden in a flurry of warnings.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=show-warnings:yes|show-warnings:no
-ValueDefault=1
-
-[split]
-Category=2
-Description=<html>Currently not used. Tidy Classic only.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=split:yes|split:no
-ValueDefault=0
-
-[tab-size]
-CallName=tab-size:
-Category=2
-Description=<html>This option specifies the number of columns that Tidy uses between successive tab stops. It is used to map tabs to spaces when reading the input. Tidy never outputs tabs.</html>
-EditorType=numeric
-Enabled=true
-MaxVal=5000
-MinVal=0
-ValueDefault=8
-
-[uppercase-attributes]
-Category=0
-Description="<html>This option specifies if Tidy should output attribute names in upper case. The default is no, which results in lower case attribute names, except for XML input, where the original case is preserved.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=uppercase-attributes:yes|uppercase-attributes:no
-ValueDefault=0
-
-[vertical-space]
-Category=2
-Description=<html>This option specifies if Tidy should add some empty lines for readability.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=vertical-space:yes|vertical-space:no
-ValueDefault=0
-
-[word-2000]
-Category=0
-Description="<html>This option specifies if Tidy should go to great pains to strip out all the surplus stuff Microsoft Word 2000 inserts when you save Word documents as 'Web pages'. Doesn't handle embedded images or VML. You should consider using Word's 'Save As: Web Page, Filtered'.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=word-2000:yes|word-2000:no
-ValueDefault=0
-
-[wrap]
-CallName=wrap:
-Category=2
-Description=<html>This option specifies the right margin Tidy uses for line wrapping. Tidy tries to wrap lines so that they do not exceed this length. Set wrap to zero if you want to disable line wrapping.</html>
-EditorType=numeric
-Enabled=true
-MaxVal=5000
-MinVal=0
-ValueDefault=68
-
-[wrap-asp]
-Category=2
-Description="<html>This option specifies if Tidy should line wrap text contained within ASP pseudo elements, which look like: <% ... %>.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-asp:yes|wrap-asp:no
-ValueDefault=1
-
-[wrap-attributes]
-Category=2
-Description="<html>This option specifies if Tidy should line wrap attribute values, for easier editing. This option can be set independently of wrap-script-literals.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-attributes:yes|wrap-attributes:no
-ValueDefault=0
-
-[wrap-jste]
-Category=2
-Description="<html>This option specifies if Tidy should line wrap text contained within JSTE pseudo elements, which look like: <# ... #>.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-jste:yes|wrap-jste:no
-ValueDefault=1
-
-[wrap-php]
-Category=2
-Description="<html>This option specifies if Tidy should line wrap text contained within PHP pseudo elements, which look like: <?php ... ?>.</html>"
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-php:yes|wrap-php:no
-ValueDefault=1
-
-[wrap-script-literals]
-Category=2
-Description=<html>This option specifies if Tidy should line wrap string literals that appear in script attributes. Tidy wraps long script string literals by inserting a backslash character before the line break.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-script-literals:yes|wrap-script-literals:no
-ValueDefault=0
-
-[wrap-sections]
-Category=2
-Description=<html>This option specifies if Tidy should line wrap text contained within <![ ... ]> section tags.</html>
-EditorType=boolean
-Enabled=false
-TrueFalse=wrap-sections:yes|wrap-sections:no
-ValueDefault=0
+[header] +categories="HTML, XHTML, XML|Diagnostics|Pretty Print|Character Encoding|Miscellaneous" +cfgFileParameterEnding=cr +configFilename=htmltidy.cfg +fileTypes=*.html|*.htm +indenterFileName=tidy +indenterName=(HTML) Tidy +inputFileName=indentinput +inputFileParameter= +manual=http://tidy.sourceforge.net/docs/tidy_man.html +outputFileName=indentoutput +outputFileParameter="-o " +parameterOrder=poi +showHelpParameter=-h +stringparaminquotes=false +useCfgFileParameter="-q -config " +version=2007-05-24 + +[Quiet] +Category=4 +Description="<html>This option specifies if Tidy should output the summary of the numbers of errors and warnings, or the welcome or informational messages.</html>" +EditorType=boolean +Enabled=true +TrueFalse=quiet:yes|quiet:no +ValueDefault=1 + +[Uppercase tags] +Category=0 +Description=<html>This option specifies if Tidy should output tag names in upper case. The default is no, which results in lower case tag names, except for XML input, where the original case is preserved.</html> +EditorType=boolean +Enabled=false +TrueFalse=uppercase-tags:yes|uppercase-tags:no +ValueDefault=0 + +[accessibility-check] +CallName=accessibility-check: +Category=1 +Description="<html>This option specifies what level of accessibility checking, if any, that Tidy should do. Level 0 is equivalent to Tidy Classic's accessibility checking. For more information on Tidy's accessibility checking, visit the Adaptive Technology Resource Centre at the University of Toronto.</html>" +EditorType=numeric +Enabled=true +MaxVal=3 +MinVal=0 +ValueDefault=0 + +[add-xml-decl] +Category=0 +Description="<html>This option specifies if Tidy should add the XML declaration when outputting XML or XHTML. Note that if the input already includes an <?xml ... ?> declaration then this option will be ignored. If the encoding for the output is different from 'ascii', one of the utf encodings or 'raw', the declaration is always added as required by the XML standard.</html>" +EditorType=boolean +Enabled=false +TrueFalse=add-xml-decl:yes|add-xml-decl:no +ValueDefault=0 + +[add-xml-space] +Category=0 +Description="<html>This option specifies if Tidy should add xml:space='preserve' to elements such as <PRE>, <STYLE> and <SCRIPT> when generating XML. This is needed if the whitespace in such elements is to be parsed appropriately without having access to the DTD.</html>" +EditorType=boolean +Enabled=false +TrueFalse=add-xml-space:yes|add-xml-space:no +ValueDefault=0 + +[alt-text] +CallName=alt-text: +Category=0 +Description="<html>-This option specifies the default 'alt=' text Tidy uses for <IMG> attributes. This feature is dangerous as it suppresses further accessibility warnings. You are responsible for making your documents accessible to people who can not see the images!</html>" +EditorType=string +Enabled=false +ValueDefault= + +[ascii-chars] +Category=3 +Description="<html>Can be used to modify behavior of -c (--clean yes) option. If set to 'yes' when using -c, &emdash;, ”, and other named character entities are downgraded to their closest ascii equivalents.</html>" +EditorType=boolean +Enabled=false +TrueFalse=ascii-chars:yes|ascii-chars:no +ValueDefault=0 + +[assume-xml-procins] +Category=0 +Description=<html>This option specifies if Tidy should change the parsing of processing instructions to require ?> as the terminator rather than >. This option is automatically set if the input is in XML.</html> +EditorType=boolean +Enabled=false +TrueFalse=assume-xml-procins:yes|assume-xml-procins:no +ValueDefault=0 + +[bare] +Category=0 +Description="<html>This option specifies if Tidy should strip Microsoft specific HTML from Word 2000 documents, and output spaces rather than non-breaking spaces where they exist in the input.</html>" +EditorType=boolean +Enabled=false +TrueFalse=bare:yes|bare:no +ValueDefault=0 + +[break-before-br] +Category=2 +Description=<html>This option specifies if Tidy should output a line break before each <BR> element.</html> +EditorType=boolean +Enabled=false +TrueFalse=break-before-br:yes|break-before-br:no +ValueDefault=0 + +[char-encoding] +Category=3 +Choices=char-encoding:raw|char-encoding:ascii|char-encoding:latin0|char-encoding:latin1|char-encoding:utf8|char-encoding:iso2022|char-encoding:mac|char-encoding:win1252|char-encoding:ibm858|char-encoding:utf16le|char-encoding:utf16be|char-encoding:utf16|char-encoding:big5|char-encoding:shiftjis +Description="<html>This option specifies the character encoding Tidy uses for both the input and output. For ascii, Tidy will accept Latin-1 (ISO-8859-1) character values, but will use entities for all characters whose value > 127. For raw, Tidy will output values above 127 without translating them into entities. For latin1, characters above 255 will be written as entities. For utf8, Tidy assumes that both input and output is encoded as UTF-8. You can use iso2022 for files encoded using the ISO-2022 family of encodings e.g. ISO-2022-JP. For mac and win1252, Tidy will accept vendor specific character values, but will use entities for all characters whose value > 127.</html>" +EditorType=multiple +Enabled=false +ValueDefault=1 + +[clean] +Category=0 +Description=<html>This option specifies if Tidy should strip out surplus presentational tags and attributes replacing them by style rules and structural markup as appropriate. It works well on the HTML saved by Microsoft Office products.</html> +EditorType=boolean +Enabled=false +TrueFalse=clean:yes|clean:no +ValueDefault=0 + +[css-prefix] +CallName=css-prefix +Category=0 +Description="<html>-This option specifies the prefix that Tidy uses for styles rules. By default, 'c' will be used.</html>" +EditorType=string +Enabled=false +ValueDefault= + +[decorate-inferred-ul] +Category=0 +Description=<html>This option specifies if Tidy should decorate inferred UL elements with some CSS markup to avoid indentation to the right.</html> +EditorType=boolean +Enabled=false +TrueFalse=decorate-inferred-ul:yes|decorate-inferred-ul:no +ValueDefault=0 + +[doctype] +Category=0 +Choices=doctype:omit|doctype:auto|doctype:strict|doctype:transitional|doctype:user +Description=<html>This option specifies the DOCTYPE declaration generated by Tidy. If set to 'omit' the output won't contain a DOCTYPE declaration. If set to 'auto' (the default) Tidy will use an educated guess based upon the contents of the document. If set to 'strict', Tidy will set the DOCTYPE to the strict DTD. If set to 'loose', the DOCTYPE is set to the loose (transitional) DTD. Alternatively, you can supply a string for the formal public identifier (FPI). For example: doctype: '-//ACME//DTD HTML 3.14159//EN' If you specify the FPI for an XHTML document, Tidy will set the system identifier to an empty string. For an HTML document, Tidy adds a system identifier only if one was already present in order to preserve the processing mode of some browsers. Tidy leaves the DOCTYPE for generic XML documents unchanged. --doctype omit implies --numeric-entities yes. This option does not offer a validation of the document conformance.</html> +EditorType=multiple +Enabled=false +ValueDefault=1 + +[drop-empty-paras] +Category=0 +Description=<html>This option specifies if Tidy should discard empty paragraphs.</html> +EditorType=boolean +Enabled=false +TrueFalse=drop-empty-paras:yes|drop-empty-paras:no +ValueDefault=1 + +[drop-font-tags] +Category=0 +Description=<html>This option specifies if Tidy should discard <FONT> and <CENTER> tags without creating the corresponding style rules. This option can be set independently of the clean option.</html> +EditorType=boolean +Enabled=false +TrueFalse=drop-font-tags:yes|drop-font-tags:no +ValueDefault=0 + +[drop-proprietary-attributes] +Category=0 +Description="<html>This option specifies if Tidy should strip out proprietary attributes, such as MS data binding attributes. </html>" +EditorType=boolean +Enabled=false +TrueFalse=drop-proprietary-attributes:yes|drop-proprietary-attributes:no +ValueDefault=0 + +[enclose-block-text] +Category=0 +Description=<html>This option specifies if Tidy should insert a <P> element to enclose any text it finds in any element that allows mixed content for HTML transitional but not HTML strict.</html> +EditorType=boolean +Enabled=false +TrueFalse=enclose-block-text:yes|enclose-block-text:no +ValueDefault=0 + +[enclose-text] +Category=0 +Description=<html>This option specifies if Tidy should enclose any text it finds in the body element within a <P> element. This is useful when you want to take existing HTML and use it with a style sheet.</html> +EditorType=boolean +Enabled=false +TrueFalse=enclose-text:yes|enclose-text:no +ValueDefault=0 + +[escape-cdata] +Category=0 +Description=<html>This option specifies if Tidy should convert <![CDATA[]]> sections to normal text.</html> +EditorType=boolean +Enabled=false +TrueFalse=escape-cdata:yes|escape-cdata:no +ValueDefault=0 + +[fix-backslash] +Category=0 +Description=<html>This option specifies if Tidy should replace backslash characters '' in URLs by forward slashes '/'.</html> +EditorType=boolean +Enabled=false +TrueFalse=fix-backslash:yes|fix-backslash:no +ValueDefault=1 + +[fix-bad-comments] +Category=0 +Description="<html>This option specifies if Tidy should replace unexpected hyphens with '=' characters when it comes across adjacent hyphens. The default is yes. This option is provided for users of Cold Fusion which uses the comment syntax: <!--- ---></html>" +EditorType=boolean +Enabled=false +TrueFalse=fix-bad-comments:yes|fix-bad-comments:no +ValueDefault=1 + +[fix-uri] +Category=0 +Description="<html>This option specifies if Tidy should check attribute values that carry URIs for illegal characters and if such are found, escape them as HTML 4 recommends.</html>" +EditorType=boolean +Enabled=false +TrueFalse=fix-uri:yes|fix-uri:no +ValueDefault=1 + +[hide-comments] +Category=0 +Description=<html>This option specifies if Tidy should print out comments.</html> +EditorType=boolean +Enabled=false +TrueFalse=hide-comments:yes|hide-comments:no +ValueDefault=0 + +[hide-endtags] +Category=0 +Description=<html>This option specifies if Tidy should omit optional end-tags when generating the pretty printed markup. This option is ignored if you are outputting to XML.</html> +EditorType=boolean +Enabled=false +TrueFalse=hide-endtags:yes|hide-endtags:no +ValueDefault=0 + +[indent] +Category=2 +Description="<html>This option specifies if Tidy should indent block-level tags. If set to 'auto', this option causes Tidy to decide whether or not to indent the content of tags such as TITLE, H1-H6, LI, TD, TD, or P depending on whether or not the content includes a block-level element. You are advised to avoid setting indent to yes as this can expose layout bugs in some browsers.</html>" +EditorType=boolean +Enabled=false +TrueFalse=indent:yes|indent:no +ValueDefault=0 + +[indent-attributes] +Category=2 +Description=<html>This option specifies if Tidy should begin each attribute on a new line.</html> +EditorType=boolean +Enabled=false +TrueFalse=indent-attributes:yes|indent-attributes:no +ValueDefault=0 + +[indent-cdata] +Category=0 +Description=<html>This option specifies if Tidy should indent <![CDATA[]]> sections.</html> +EditorType=boolean +Enabled=false +TrueFalse=indent-cdata:yes|indent-cdata:no +ValueDefault=0 + +[indent-spaces] +CallName=indent-spaces: +Category=2 +Description="<html>This option specifies the number of spaces Tidy uses to indent content, when indentation is enabled.</html>" +EditorType=numeric +Enabled=true +MaxVal=5000 +MinVal=0 +ValueDefault=2 + +[input-encoding] +Category=3 +Choices=input-encoding:raw|input-encoding:ascii|input-encoding:latin0|input-encoding:latin1|input-encoding:utf8|input-encoding:iso2022|input-encoding:mac|input-encoding:win1252|input-encoding:ibm858|input-encoding:utf16le|input-encoding:utf16be|input-encoding:utf16|input-encoding:big5|input-encoding:shiftjis +Description=<html>This option specifies the character encoding Tidy uses for the input. See char-encoding for more info.</html> +EditorType=multiple +Enabled=false +ValueDefault=4 + +[input-xml] +Category=0 +Description=<html>This option specifies if Tidy should use the XML parser rather than the error correcting HTML parser.</html> +EditorType=boolean +Enabled=false +TrueFalse=input-xml:yes|input-xml:no +ValueDefault=0 + +[join-classes] +Category=0 +Description="<html>This option specifies if Tidy should combine class names to generate a single new class name, if multiple class assignments are detected on an element.</html>" +EditorType=boolean +Enabled=false +TrueFalse=join-classes:yes|join-classes:no +ValueDefault=0 + +[join-styles] +Category=0 +Description="<html>This option specifies if Tidy should combine styles to generate a single new style, if multiple style values are detected on an element.</html>" +EditorType=boolean +Enabled=false +TrueFalse=join-styles:yes|join-styles:no +ValueDefault=1 + +[literal-attributes] +Category=0 +Description=<html>This option specifies if Tidy should ensure that whitespace characters within attribute values are passed through unchanged.</html> +EditorType=boolean +Enabled=false +TrueFalse=literal-attributes:yes|literal-attributes:no +ValueDefault=0 + +[logical-emphasis] +Category=0 +Description="<html>This option specifies if Tidy should replace any occurrence of <I> by <EM> and any occurrence of <B> by <STRONG>. In both cases, the attributes are preserved unchanged. This option can be set independently of the clean and drop-font-tags options.</html>" +EditorType=boolean +Enabled=false +TrueFalse=logical-emphasis:yes|logical-emphasis:no +ValueDefault=0 + +[lower-literals] +Category=0 +Description=<html>This option specifies if Tidy should convert the value of an attribute that takes a list of predefined values to lower case. This is required for XHTML documents.</html> +EditorType=boolean +Enabled=false +TrueFalse=lower-literals:yes|lower-literals:no +ValueDefault=1 + +[markup] +Category=2 +Description=<html>This option specifies if Tidy should generate a pretty printed version of the markup. Note that Tidy won't generate a pretty printed version if it finds significant errors (see force-output).</html> +EditorType=boolean +Enabled=false +TrueFalse=markup:yes|markup:no +ValueDefault=1 + +[merge-divs] +Category=0 +Choices=merge-divs:auto|merge-divs:yes|merge-divs:no +ChoicesReadable=Merge Divs Auto|Do Merge Divs|Do Not Merge Divs +Description="<html>Can be used to modify behavior of -c (--clean yes) option. This option specifies if Tidy should merge nested <div> such as '<div><div>...</div></div>'. If set to 'auto', the attributes of the inner <div> are moved to the outer one. As well, nested <div> with ID attributes are not merged. If set to 'yes', the attributes of the inner <div> are discarded with the exception of 'class' and 'style'.</html>" +EditorType=multiple +Enabled=false +ValueDefault=0 + +[ncr] +Category=0 +Description=<html>This option specifies if Tidy should allow numeric character references.</html> +EditorType=boolean +Enabled=false +TrueFalse=ncr:yes|ncr:no +ValueDefault=1 + +[new-blocklevel-tags] +CallName=new-blocklevel-tags: +Category=0 +Description="<html>This option specifies new block-level tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Note you can't change the content model for elements such as <TABLE>, <UL>, <OL> and <DL>. This option is ignored in XML mode.</html>" +EditorType=string +Enabled=false +ValueDefault= + +[new-empty-tags] +CallName=new-empty-tags: +Category=0 +Description="<html>This option specifies new empty inline tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Remember to also declare empty tags as either inline or blocklevel. This option is ignored in XML mode.</html>" +EditorType=string +Enabled=false +ValueDefault= + +[new-inline-tags] +CallName=new-inline-tags: +Category=0 +Description="<html>This option specifies new non-empty inline tags. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. This option is ignored in XML mode.</html>" +EditorType=string +Enabled=false +ValueDefault= + +[new-pre-tags] +CallName=new-pre-tags: +Category=0 +Description="<html>This option specifies new tags that are to be processed in exactly the same way as HTML's <PRE> element. This option takes a space or comma separated list of tag names. Unless you declare new tags, Tidy will refuse to generate a tidied file if the input includes previously unknown tags. Note you can not as yet add new CDATA elements (similar to <SCRIPT>). This option is ignored in XML mode.</html>" +EditorType=string +Enabled=false +ValueDefault= + +[newline] +Category=3 +Choices=newline:LF|newline:CRLF|newline:CR +Description="<html>The default is appropriate to the current platform: CRLF on PC-DOS, MS-Windows and OS/2, CR on Classic Mac OS, and LF everywhere else (Unix and Linux).</html>" +EditorType=multiple +Enabled=false +ValueDefault=1 + +[numeric-entities] +Category=0 +Description="<html>This option specifies if Tidy should output entities other than the built-in HTML entities (&, <, > and ") in the numeric rather than the named entity form. Only entities compatible with the DOCTYPE declaration generated are used. Entities that can be represented in the output encoding are translated correspondingly.</html>" +EditorType=boolean +Enabled=false +TrueFalse=numeric-entities:yes|numeric-entities:no +ValueDefault=0 + +[output-bom] +Category=3 +Choices=output-bom:auto|output-bom:yes|output-bom:no +Description="<html>This option specifies if Tidy should write a Unicode Byte Order Mark character (BOM; also known as Zero Width No-Break Space; has value of U+FEFF) to the beginning of the output; only for UTF-8 and UTF-16 output encodings. If set to 'auto', this option causes Tidy to write a BOM to the output only if a BOM was present at the beginning of the input. A BOM is always written for XML/XHTML output using UTF-16 output encodings.</html>" +EditorType=multiple +Enabled=false +ValueDefault=0 + +[output-encoding] +Category=3 +Choices=output-encoding:raw|output-encoding:ascii|output-encoding:latin0|output-encoding:latin1|output-encoding:utf8|output-encoding:iso2022|output-encoding:mac|output-encoding:win1252|output-encoding:ibm858|output-encoding:utf16le|output-encoding:utf16be|output-encoding:utf16|output-encoding:big5|output-encoding:shiftjis +Description="<html>This option specifies the character encoding Tidy uses for the output. See char-encoding for more info. May only be different from input-encoding for Latin encodings (ascii, latin0, latin1, mac, win1252, ibm858).</html>" +EditorType=multiple +Enabled=false +ValueDefault=1 + +[output-html] +Category=0 +Description="<html>This option specifies if Tidy should generate pretty printed output, writing it as HTML.</html>" +EditorType=boolean +Enabled=false +TrueFalse=output-html:yes|output-html:no +ValueDefault=0 + +[output-xhtml] +Category=0 +Description="<html>This option specifies if Tidy should generate pretty printed output, writing it as extensible HTML. This option causes Tidy to set the DOCTYPE and default namespace as appropriate to XHTML. If a DOCTYPE or namespace is given they will checked for consistency with the content of the document. In the case of an inconsistency, the corrected values will appear in the output. For XHTML, entities can be written as named or numeric entities according to the setting of the 'numeric-entities' option. The original case of tags and attributes will be preserved, regardless of other options.</html>" +EditorType=boolean +Enabled=false +TrueFalse=output-xhtml:yes|output-xhtml:no +ValueDefault=0 + +[output-xml] +Category=0 +Description="<html>This option specifies if Tidy should pretty print output, writing it as well-formed XML. Any entities not defined in XML 1.0 will be written as numeric entities to allow them to be parsed by a XML parser. The original case of tags and attributes will be preserved, regardless of other options.</html>" +EditorType=boolean +Enabled=false +TrueFalse=output-xml:yes|output-xml:no +ValueDefault=0 + +[preserve-entities] +Category=0 +Description=<html>This option specifies if Tidy should preserve the well-formed entitites as found in the input.</html> +EditorType=boolean +Enabled=false +TrueFalse=preserve-entities:yes|preserve-entities:no +ValueDefault=0 + +[punctuation-wrap] +Category=2 +Description=<html>This option specifies if Tidy should line wrap after some Unicode or Chinese punctuation characters.</html> +EditorType=boolean +Enabled=false +TrueFalse=punctuation-wrap:yes|punctuation-wrap:no +ValueDefault=0 + +[quote-ampersand] +Category=0 +Description="<html>This option specifies if Tidy should output unadorned & characters as &.</html>" +EditorType=boolean +Enabled=false +TrueFalse=quote-ampersand:yes|quote-ampersand:no +ValueDefault=1 + +[quote-marks] +Category=0 +Description="<html>This option specifies if Tidy should output ' characters as " as is preferred by some editing environments. The apostrophe character ' is written out as ' since many web browsers don't yet support '.</html>" +EditorType=boolean +Enabled=false +TrueFalse=quote-marks:yes|quote-marks:no +ValueDefault=0 + +[quote-nbsp] +Category=0 +Description="<html>This option specifies if Tidy should output non-breaking space characters as entities, rather than as the Unicode character value 160 (decimal).</html>" +EditorType=boolean +Enabled=false +TrueFalse=quote-nbsp:yes|quote-nbsp:no +ValueDefault=1 + +[repeated-attributes] +Category=0 +Choices=repeated-attributes:keep-first|repeated-attributes:keep-last +Description="<html>This option specifies if Tidy should keep the first or last attribute, if an attribute is repeated, e.g. has two align attributes.</html>" +EditorType=multiple +Enabled=false +ValueDefault=1 + +[replace-color] +Category=0 +Description="<html>This option specifies if Tidy should replace numeric values in color attributes by HTML/XHTML color names where defined, e.g. replace '#ffffff' with 'white'.</html>" +EditorType=boolean +Enabled=false +TrueFalse=replace-color:yes|replace-color:no +ValueDefault=0 + +[show-body-only] +Category=0 +Description=<html>This option specifies if Tidy should print only the contents of the body tag as an HTML fragment. Useful for incorporating existing whole pages as a portion of another page.</html> +EditorType=boolean +Enabled=false +TrueFalse=show-body-only:yes|show-body-only:no +ValueDefault=0 + +[show-errors] +CallName=show-errors: +Category=1 +Description="<html>This option specifies what level of accessibility checking, if any, that Tidy should do. Level 0 is equivalent to Tidy Classic's accessibility checking. For more information on Tidy's accessibility checking, visit the Adaptive Technology Resource Centre at the University of Toronto.</html>" +EditorType=numeric +Enabled=true +MaxVal=5000 +MinVal=0 +ValueDefault=6 + +[show-warnings] +Category=1 +Description=<html>This option specifies if Tidy should suppress warnings. This can be useful when a few errors are hidden in a flurry of warnings.</html> +EditorType=boolean +Enabled=false +TrueFalse=show-warnings:yes|show-warnings:no +ValueDefault=1 + +[split] +Category=2 +Description=<html>Currently not used. Tidy Classic only.</html> +EditorType=boolean +Enabled=false +TrueFalse=split:yes|split:no +ValueDefault=0 + +[tab-size] +CallName=tab-size: +Category=2 +Description=<html>This option specifies the number of columns that Tidy uses between successive tab stops. It is used to map tabs to spaces when reading the input. Tidy never outputs tabs.</html> +EditorType=numeric +Enabled=true +MaxVal=5000 +MinVal=0 +ValueDefault=8 + +[uppercase-attributes] +Category=0 +Description="<html>This option specifies if Tidy should output attribute names in upper case. The default is no, which results in lower case attribute names, except for XML input, where the original case is preserved.</html>" +EditorType=boolean +Enabled=false +TrueFalse=uppercase-attributes:yes|uppercase-attributes:no +ValueDefault=0 + +[vertical-space] +Category=2 +Description=<html>This option specifies if Tidy should add some empty lines for readability.</html> +EditorType=boolean +Enabled=false +TrueFalse=vertical-space:yes|vertical-space:no +ValueDefault=0 + +[word-2000] +Category=0 +Description="<html>This option specifies if Tidy should go to great pains to strip out all the surplus stuff Microsoft Word 2000 inserts when you save Word documents as 'Web pages'. Doesn't handle embedded images or VML. You should consider using Word's 'Save As: Web Page, Filtered'.</html>" +EditorType=boolean +Enabled=false +TrueFalse=word-2000:yes|word-2000:no +ValueDefault=0 + +[wrap] +CallName=wrap: +Category=2 +Description=<html>This option specifies the right margin Tidy uses for line wrapping. Tidy tries to wrap lines so that they do not exceed this length. Set wrap to zero if you want to disable line wrapping.</html> +EditorType=numeric +Enabled=true +MaxVal=5000 +MinVal=0 +ValueDefault=68 + +[wrap-asp] +Category=2 +Description="<html>This option specifies if Tidy should line wrap text contained within ASP pseudo elements, which look like: <% ... %>.</html>" +EditorType=boolean +Enabled=false +TrueFalse=wrap-asp:yes|wrap-asp:no +ValueDefault=1 + +[wrap-attributes] +Category=2 +Description="<html>This option specifies if Tidy should line wrap attribute values, for easier editing. This option can be set independently of wrap-script-literals.</html>" +EditorType=boolean +Enabled=false +TrueFalse=wrap-attributes:yes|wrap-attributes:no +ValueDefault=0 + +[wrap-jste] +Category=2 +Description="<html>This option specifies if Tidy should line wrap text contained within JSTE pseudo elements, which look like: <# ... #>.</html>" +EditorType=boolean +Enabled=false +TrueFalse=wrap-jste:yes|wrap-jste:no +ValueDefault=1 + +[wrap-php] +Category=2 +Description="<html>This option specifies if Tidy should line wrap text contained within PHP pseudo elements, which look like: <?php ... ?>.</html>" +EditorType=boolean +Enabled=false +TrueFalse=wrap-php:yes|wrap-php:no +ValueDefault=1 + +[wrap-script-literals] +Category=2 +Description=<html>This option specifies if Tidy should line wrap string literals that appear in script attributes. Tidy wraps long script string literals by inserting a backslash character before the line break.</html> +EditorType=boolean +Enabled=false +TrueFalse=wrap-script-literals:yes|wrap-script-literals:no +ValueDefault=0 + +[wrap-sections] +Category=2 +Description=<html>This option specifies if Tidy should line wrap text contained within <![ ... ]> section tags.</html> +EditorType=boolean +Enabled=false +TrueFalse=wrap-sections:yes|wrap-sections:no +ValueDefault=0 diff --git a/indenters/uigui_vbsbeaut.ini b/indenters/uigui_vbsbeaut.ini index 46cbc76..0168a92 100755 --- a/indenters/uigui_vbsbeaut.ini +++ b/indenters/uigui_vbsbeaut.ini @@ -1,45 +1,45 @@ -[header]
-categories=General
-cfgFileParameterEnding=cr
-configFilename=
-fileTypes=*.vb
-indenterFileName=vbsbeaut.bat
-indenterName=VBSBeautifier (VB)
-inputFileName=indentinput
-inputFileParameter=" "
-manual=http://www.daansystems.com/vbsbeaut/
-outputFileName=indentinput
-outputFileParameter=none
-parameterOrder=pio
-showHelpParameter=
-stringparaminquotes=false
-useCfgFileParameter=
-version=1.10
-
-
-[Spaces]
-Category=0
-Description="<html>Replace tabs by this number of spaces</html>"
-Enabled=false
-EditorType=numeric
-CallName="-s"
-MinVal=0
-MaxVal=1024
-ValueDefault=4
-
-[Keywords]
-Category=0
-Description="<html>Change keywords</html>"
-Enabled=false
-EditorType=multiple
-Choices="|-u|-l|-n"
-ChoicesReadable="Properize keywords|Make keywords uppercase|Make keywords lowercase|Don't change keywords"
-ValueDefault=0
-
-[Split Dim]
-Category=0
-Description="<html>Split Dim statements</html>"
-Enabled=false
-EditorType=boolean
-TrueFalse=|-d
-ValueDefault=0
+[header] +categories=General +cfgFileParameterEnding=cr +configFilename= +fileTypes=*.vb +indenterFileName=vbsbeaut.bat +indenterName=VBSBeautifier (VB) +inputFileName=indentinput +inputFileParameter=" " +manual=http://www.daansystems.com/vbsbeaut/ +outputFileName=indentinput +outputFileParameter=none +parameterOrder=pio +showHelpParameter= +stringparaminquotes=false +useCfgFileParameter= +version=1.10 + + +[Spaces] +Category=0 +Description="<html>Replace tabs by this number of spaces</html>" +Enabled=false +EditorType=numeric +CallName="-s" +MinVal=0 +MaxVal=1024 +ValueDefault=4 + +[Keywords] +Category=0 +Description="<html>Change keywords</html>" +Enabled=false +EditorType=multiple +Choices="|-u|-l|-n" +ChoicesReadable="Properize keywords|Make keywords uppercase|Make keywords lowercase|Don't change keywords" +ValueDefault=0 + +[Split Dim] +Category=0 +Description="<html>Split Dim statements</html>" +Enabled=false +EditorType=boolean +TrueFalse=|-d +ValueDefault=0 diff --git a/indenters/uigui_xmlindent.ini b/indenters/uigui_xmlindent.ini index fcdd576..3717510 100755 --- a/indenters/uigui_xmlindent.ini +++ b/indenters/uigui_xmlindent.ini @@ -1,61 +1,61 @@ -[header]
-categories=General
-cfgFileParameterEnding=cr
-configFilename=
-fileTypes=*.xml|*.xslt
-indenterFileName=xmlindent
-indenterName=XML Indent (XML, XSL)
-inputFileName=indentinput
-inputFileParameter=
-manual=http://universalindent.sf.net/indentermanuals/xmlindent.txt
-outputFileName=indentoutput
-outputFileParameter="-o "
-parameterOrder=poi
-showHelpParameter=-h
-stringparaminquotes=false
-useCfgFileParameter=none
-version=0.2.17
-
-[Indent level]
-CallName="-i "
-Category=0
-Description=<html>Indent using n spaces or tabs.</html>
-EditorType=numeric
-Enabled=false
-MaxVal=120
-MinVal=0
-ValueDefault=4
-
-[Use tabs]
-Category=0
-Description=<html>Use tabs instead of spaces for indent.</html>
-EditorType=boolean
-TrueFalse=-t|
-ValueDefault=0
-
-[Maximum wrap columns]
-CallName="-l "
-Category=0
-Description=<html>Maximum columns for line wrapping.</html>
-EditorType=numeric
-Enabled=false
-MaxVal=120
-MinVal=0
-ValueDefault=80
-
-[Suppress newline at pos]
-CallName="-n "
-Category=0
-Description=<html>Suppress newline at position.</html>
-EditorType=numeric
-Enabled=false
-MaxVal=120
-MinVal=0
-ValueDefault=80
-
-[Force newline]
-Category=0
-Description=<html>Force newline on elements without children.</html>
-EditorType=boolean
-TrueFalse=-f|
-ValueDefault=0
+[header] +categories=General +cfgFileParameterEnding=cr +configFilename= +fileTypes=*.xml|*.xslt +indenterFileName=xmlindent +indenterName=XML Indent (XML, XSL) +inputFileName=indentinput +inputFileParameter= +manual=http://universalindent.sf.net/indentermanuals/xmlindent.txt +outputFileName=indentoutput +outputFileParameter="-o " +parameterOrder=poi +showHelpParameter=-h +stringparaminquotes=false +useCfgFileParameter=none +version=0.2.17 + +[Indent level] +CallName="-i " +Category=0 +Description=<html>Indent using n spaces or tabs.</html> +EditorType=numeric +Enabled=false +MaxVal=120 +MinVal=0 +ValueDefault=4 + +[Use tabs] +Category=0 +Description=<html>Use tabs instead of spaces for indent.</html> +EditorType=boolean +TrueFalse=-t| +ValueDefault=0 + +[Maximum wrap columns] +CallName="-l " +Category=0 +Description=<html>Maximum columns for line wrapping.</html> +EditorType=numeric +Enabled=false +MaxVal=120 +MinVal=0 +ValueDefault=80 + +[Suppress newline at pos] +CallName="-n " +Category=0 +Description=<html>Suppress newline at position.</html> +EditorType=numeric +Enabled=false +MaxVal=120 +MinVal=0 +ValueDefault=80 + +[Force newline] +Category=0 +Description=<html>Force newline on elements without children.</html> +EditorType=boolean +TrueFalse=-f| +ValueDefault=0 |