SA-MP Forums Archive
[Tool/Web/Other] (Online) Tidy Code and Bracket Finder - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Tools and Files (https://sampforum.blast.hk/forumdisplay.php?fid=82)
+---- Thread: [Tool/Web/Other] (Online) Tidy Code and Bracket Finder (/showthread.php?tid=467821)



(Online) Tidy Code and Bracket Finder - ipsBruno - 05.10.2013

This is a tool to find brackets lost and tidy your code.




Link

http://ipsbr.net/portal/tabulador/





Code

http://pastebin.com/w6bwy97E

The new version works with strings and comments

Made in Javascript by me. This is free source code.




Example

(this only works in these cases)
pawn Code:
if (dataLength % 3){
static pads ;
    pads = dataLength % 3;

// print("hey, ho \"lets go\" "); {

for (; pads < 3; pads++)
            result[resultIndex++] = '=';
}

to


pawn Code:
if (dataLength % 3){
    static pads ;
    pads = dataLength % 3;

    // print("hey, ho \"lets go\" "); {

    for (; pads < 3; pads++)
    result[resultIndex++] = '=';
}

Thanks.


Re: (Online) Tidy Code and Bracket Finder - iZN - 05.10.2013

Nice work. Good for lazy scripters who doesn't wants to use TAB. Does your bracket finder doesn't count the commented bracket?


Respuesta: (Online) Tidy Code and Bracket Finder - ipsBruno - 05.10.2013

In most cases, it works with comments


Example:

pawn Code:
func(...) {
    // {


   

/*
    {

    {

    {
    */


    print("{ wow its work");
}
dont warn, if i put:

pawn Code:
func(...) {
    // {

{

    /* {

    {

    {

    {
    */



    print("{ wow its work");
}
he return:

Code:
Existem 1   { a mais demais no cуdigo

O erro foi encontrado antes da linha 3 no bracket 1
LINE 3, BRACKET 1


or



pawn Code:
func(...) {
    // {

{

    /* {

    {

    {

    {
    */


{{
    print("{ wow its work");
}
Code:
Existem 3   { a mais demais no cуdigo
O erro foi encontrado depois da linha 18 no bracket 3
Large scripts too: (no my script)

without tool:
http://pastebin.com/WDh2k22F

with tool:
http://pastebin.com/Agj4NmHX

Thanks Man


Re: (Online) Tidy Code and Bracket Finder - PT - 05.10.2013

Good Job ipsBruno =D


Re: (Online) Tidy Code and Bracket Finder - Gogorakis - 05.10.2013

Testing it with 90k lines script


Respuesta: Re: (Online) Tidy Code and Bracket Finder - ipsBruno - 05.10.2013

Quote:
Originally Posted by Gogorakis
View Post
Testing it with 90k lines script
and works 100%, works.



If works fine to you, warn me : P


Respuesta: (Online) Tidy Code and Bracket Finder - ipsBruno - 07.10.2013

I made small changes. Now calculating with more accurately the "lost brackets".

Thanks.


Re: (Online) Tidy Code and Bracket Finder - DanishHaq - 07.10.2013

Hm, good for newbies who think they are the best scripters ever lol.


Respuesta: Re: (Online) Tidy Code and Bracket Finder - ipsBruno - 07.10.2013

Quote:
Originally Posted by DanishHaq
View Post
Hm, good for newbies who think they are the best scripters ever lol.
Yeah Thanks!


Re: (Online) Tidy Code and Bracket Finder - Niko_boy - 08.10.2013

simply awesome! i can see many ppl with untidy unreadable codes , this surely help to improve it
good work.