SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 26/08/2010, 04:13 PM   #1
Remis
Big Clucker
 
Join Date: Sep 2009
Posts: 62
Reputation: 4
Default Missing Brackets Finder [1.1.0] - NOW WITH GUI

PAWN: Missing angle brackets finder

Picture of the new GUI


About


This script, written in Perl, analyses your script in terms of angle brackets ( { }).
It tells you which bracket(s) have/has a missing bracket, so you can fix your code (the pawn compiler is buggy in this aspect. If there is one or more angle bracket missing somewhere, it outputs wrong errors or even crashes, so you have to go line-by-line).
It can also help you if you don't even know whether brackets are the problem and where to find them. This script isn't 100% accurate because it isn't psychic:

if(..)
{
if(..)
{
}

How could the script guess whether the first if or the seconds if has the missing pair?
But this script helps you in this case by telling you roughly where to look for a missing bracket.

It is released under the creativecommons 3 (http://creativecommons.org/licenses/by/3.0/)


Installation

You need to have the Perl VM installed. If you are using Windows, you have to install Perl at first.
Linux based systems and many other operating systems have it installed by default.

1. Go to http://www.activestate.com/activeperl/downloads and download it (the first one, Windows (x86))
2. Install activeperl
3. Download and unzip brackets.zip and start „missing brackets finder.exe“.
If activeperl is installed, a GUI should shown up.

The „perl“ folder inside is needed by the executable, so don't delete the folder.

If you are using a linux based system, just open the terminal and run „perl GUI.pl“. You also need to have the perl module „Tkx“ installed (you can install Tkx with the package installer: apt-get, yum, ..).

("missing bracket finder.exe" is compiled with mingw, "missing brackets finder alternative.exe" is compiled with the VC++ one (could complained about missing .dlls if you don't have the latest .net installed, thats why I replaced it))

Download (1.1.0 final)
1. Attachment
2. http://jeffersongta.de/downloads/brackets.zip

Source of everything is included


Known issues

- it reported a line, you go to the line but there isn't a missing bracket: Look for the missing bracket around the area where the bracket was reported (the function, ..) (should happen rarely - in investigation)
- works with large scripts (80k+ lines), but at the cost of memory (~60 MB) and execution time (won't be fixed. Rewritting in a programming language such as C++ would take too much time. I needed the dynamics of languages such as perl for this application)
- you are not able to move and touch the window while it is analyzing a script (won't be fixed.)

Changelog

Beta 5 → Final 1:
- Fixed problems with ' and „ in comments („// don't“ << made the script not working)
- create a how-to gallery, so EVERYONE is able to use this


Final 1 → Final 1.1:
- Easier to use
- Fixed many bugs
- GUI
- faster, improved most of the code



Credits
www.perl-community.de (GwenDragon and MatthiasW): Helped me using Text::Balanced, fixing some bugs and stripping out strings (text inside quotes) and gave me more tips in perl
Attached Files
File Type: zip brackets_OLD.zip (237.3 KB, 579 views)
File Type: zip brackets.zip (314.2 KB, 4025 views)

Last edited by Remis; 25/02/2011 at 04:26 PM.
Remis is offline   Reply With Quote
Old 26/08/2010, 04:20 PM   #2
Calgon
Godfather
 
Calgon's Avatar
 
Join Date: Jan 2009
Posts: 6,466
Reputation: 1126
Default Re: Missing Brackets Finder [Beta5]

Thanks, this is great.

Now to attempt to install it.
Calgon is offline   Reply With Quote
Old 27/08/2010, 09:20 AM   #3
[KMA]DlennartD
Huge Clucker
 
[KMA]DlennartD's Avatar
 
Join Date: Mar 2008
Location: The Netherlands
Posts: 364
Reputation: 4
Default Re: Missing Brackets Finder [Beta5]

this can really be handfull, sometimes i'm searching for hours to find that missing }
__________________
[KMA]DlennartD is offline   Reply With Quote
Old 27/08/2010, 02:42 PM   #4
gamer931215
High-roller
 
gamer931215's Avatar
 
Join Date: Feb 2010
Location: That box in front of your house stealing your wifi.
Posts: 1,277
Reputation: 322
Default Re: Missing Brackets Finder [Beta5]

Can really be helpfull, if youre missing one you will get A LOT of erros (26 most cases) and then the errors are all like sub/function not found/declared so you cant find where the problem is either. But is this only for linux ? (i dont want to install VM, with another OS onlt for one tool )
__________________

Thanks to Zh3r0 for this awesome signature!
gamer931215 is offline   Reply With Quote
Old 27/08/2010, 03:05 PM   #5
Remis
Big Clucker
 
Join Date: Sep 2009
Posts: 62
Reputation: 4
Default Re: Missing Brackets Finder [Beta5]

Quote:
Originally Posted by gamer931215 View Post
Can really be helpfull, if youre missing one you will get A LOT of erros (26 most cases) and then the errors are all like sub/function not found/declared so you cant find where the problem is either. But is this only for linux ? (i dont want to install VM, with another OS onlt for one tool )
No, Perl is available on over 100 platforms - including Windows.
You only need to install the VM. "Perl VM" sounds like something big, but it is just 20 MB or so (not sure). And it will be likewise a "normal" installation.
And I added a small "Why perl?".

Also to everyone who replied, thanks for the feedback!
Remis is offline   Reply With Quote
Old 16/09/2010, 05:09 PM   #6
sushihusi
Big Clucker
 
Join Date: Mar 2009
Posts: 168
Reputation: 2
Default Re: Missing Brackets Finder [Beta5]

7.Type in : perl brackets.pl scriptname (scriptname is the name of your script)

WHAT? I typed: perl brackets.pl lvdm
and it wrote: "Can't Open Perl Script "brackets.pl":No such file or directory"

What now?
sushihusi is offline   Reply With Quote
Old 16/09/2010, 07:53 PM   #7
Remis
Big Clucker
 
Join Date: Sep 2009
Posts: 62
Reputation: 4
Default Re: Missing Brackets Finder [Beta5]

Quote:
Originally Posted by sushihusi View Post
7.Type in : perl brackets.pl scriptname (scriptname is the name of your script)

WHAT? I typed: perl brackets.pl lvdm
and it wrote: "Can't Open Perl Script "brackets.pl":No such file or directory"

What now?
You didn't switch to the folder, where you unzipped the brackets.zip (cd ..).
And you forgot the .pwn extension: perl brackets.pl lvdm.pwn

I added pictures in my main post to demonstrate it better. (Look at the pictures of step 6).
In my example I downloaded the brackets.zip to the desktop, unzipped it and moved grandlarc.pwn to the folder, where I unzipped the brackets.zip.


Moreover I discovered a small bug (it doesn't have anything to do with this). I will fix it in the next days.

Edit: Bug fixed and topic updated

Last edited by Remis; 17/09/2010 at 06:43 PM.
Remis is offline   Reply With Quote
Old 11/12/2010, 05:19 AM   #8
The_Gangstas
Huge Clucker
 
Join Date: Nov 2010
Posts: 485
Reputation: 0
Default Re: Missing Brackets Finder [Beta5]

not working... i did everything correctly, anyhelp?
__________________
The_Gangstas is offline   Reply With Quote
Old 11/12/2010, 05:22 AM   #9
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 8,102
Reputation: 701
Default Re: Missing Brackets Finder [Beta5]

Quote:
Originally Posted by The_Gangstas View Post
not working... i did everything correctly, anyhelp?
I don't know the success rate for this tool, but I would go ahead and give "notepad++" a shot - it seems to point things like that out.
Scenario is offline   Reply With Quote
Old 11/12/2010, 05:24 AM   #10
The_Gangstas
Huge Clucker
 
Join Date: Nov 2010
Posts: 485
Reputation: 0
Default Re: Missing Brackets Finder [Beta5]

yes y_less recommended it, but how do we use notepad? i already downloaded it
__________________
The_Gangstas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Brackets sekol Help Archive 9 10/02/2011 01:48 PM
Position finder Sascha Help Archive 0 25/05/2010 11:22 PM
Missing brackets help (creating a teleport menu) Andy_McKinley Help Archive 14 26/03/2010 01:09 PM
Need Bug-Finder/Suggesters. cozza123456 Server Support 2 15/03/2010 05:50 PM
code for spawn at san fierro or pos finder cssbart Help Archive 3 06/12/2009 06:37 PM


All times are GMT. The time now is 06:36 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.