View Single Post
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 02-14-2017 , 12:58   Re: [TUT] Compiling AMXX plugins with Sublime Text
Reply With Quote #46

Quote:
Originally Posted by Depresie View Post
Even if it may be computing expensive i don't think anyone will feel any difference, so i think you should go for it until they fix sublime
This is just not computing expensive, it is also my timing expensive. There are two bugs. The first is this:



If I write more code and more code, after some days we could get a solution computing
expensive accordingly to the size of the file you are editing `O(n)` * the number of file
you have on you project, for each time you edit and save some file. Therefore, if you have
a project within 10.000 file like mine, it will take a very big time to the computer to the
parsing all 10.000 files. This is due the dynamic syntax file creation. Each time a syntax
file is changed, Sublime Text must to re-parse all the project files, so is not wise to have
something changing them each time you edit you file.

So, just wait Sublime Text allow its syntax file to do multi-line regex matching, and this
problem is solved. I am not fixing it mostly because it do not bother me. If bother you,
just put the parenthesis on the line before like this when you are doing your functions call/definitions:



The other bug is a problem on my syntax, not with Sublime Text. I just do not figured out yet how to fix the unbalanced braces by the preprocessor:
Code:
370: public own_type:on_damage( id ) 371: { 372: #if defined DAMAGE_RECIEVED 373:     // id should be connected if this message is sent, but lets check anyway 374:     if( is_user_connected( id ) ) 375:     { 376: #else 377:     if( is_user_connected( attacker ) ) 378:     { 379: #endif 380:         ShowSyncHudMsg( attacker, g_MsgSync, "%i^n", damage ) 381:     } 382:     hi_girl() 383: } 384: 385: public on_damage( id ) 386: { 387:     get_user_attacker( id ) 388: }
It is not a big issue, it only happens if your source code has such preprocessor directive
doing the unbalancing of braces. The problem it will cause is just for the private functions
on the code after the unbalancing. They will be recognized as a function call, instead of a
function definition:



For now I am thinking about some strategy/trick to overcame such preprocessor mess.
I just do not figured it out yet. May be never, may be tomorrow. May you figure it out the tell me.
The C language syntax is doing this trick already, someone just have to understand how it is being
done, or came out with some new idea.

Quote:
Originally Posted by Depresie View Post
then release it in the general section
...
What i meant by providing screenshots was to make screenshots of the application, to give the people an idea what the application/package is like
So, I can take some screen shots and create a zip within Sublime Text and the Packages.
I do not see why a new thread on the General section. I can just added them to the first
post on this thread.

Anyways, people should not download programs like that. They should be able to download the
files from the origin sources and mount/compound the program by themselves. Thought, I am
shipping several packages and settings on the fist post, but they are all pure text files, anyone
can read and inspect what they are doing.

Quote:
Originally Posted by Mistrick View Post
addons_zz, one more exception. Red is Function Definition
Fixed. You can download the syntax I am attaching here and replace your on the folder
`Sublime Text Root/Data/Packages/Amxx Pawn`. I also update the file on the first post within it.
Attached Files
File Type: zip AmxxPawn.sublime-syntax.zip (4.6 KB, 89 views)
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 02-14-2017 at 23:19.
addons_zz is offline