TOGs SourcePawn Syntax Converter [MS Excel Based for now]
3 Attachment(s)
I wasnt sure which forum section to post this in, but since there are syntax highlighters and other indirectly related stuff to SP coding, I thought this the best fit.
I created some code in VBA in a Microsoft Excel environment to convert SourcePawn plugins from old syntax into new syntax. While the project is not yet finished, I thought I would release it for others to use, and for feedback (provided I have time to implement much feedback). It REALLY should be ported over to another language so that MS Excel isnt required. Despite all that, here it is. Perhaps in the future, myself or another will port my code to PHP and make a web version... Also, it isnt perfect (and probably never will be). Here is the identified TO-DO's, should I find the time for them...the point is that the tool gets you most of the way there, taking a lot of the work out of it (if not all).
To Do and Stuff Not Yet Handled:
Things handled by this program:
Usage/Instructions:
Note:The changelog is available with the spreadsheet in the "changelog" sheet. I hope this is helpful! To see the code in Excel, press Alt+F11, or right click the tab and click "View Code". This tool will NOT edit the source file, but will create a new file with the same name then " newsyntax" appended. If a file already exists with that name, it will get a number appended in addition to that. |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
You could also use Visual Basic Script *.vbs as a single file. Works for all Windows versions and should work for Linux with Wine aswell, i think (i saw MS Scripting Control in winetricks).
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
convert back to old syntax would be useful
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
what the fuck vba :psyduck:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Anyways, when I finish the project, I'll probably make a PHP page to do the same. For now though, the development is easier in VBA, specifically for the includes processing, which I'm working on now. I dont know if you can easily follow a recursive include model from PHP without the user uploading all of those files as well... |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Updated code and OP description.
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
great job!
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
:bacon:
Good Job! |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Updated to v1.1.1.
Here's the changelog (also viewable from the tool as another sheet).
Spoiler
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Looks nice but please don't even convert it to php, convert it to javascript otherwise we'll see bunch of pirated plugin saved in databases..
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Updated to v1.1.2. Changelog is in file. Added a lot of fixes to special circumstances and finished quite a few things on the to-do list.
P.S.: I meant to leave the old version up for reference, but accidentally clicked the remove button when uploading this version....Why is there no cancel!?!? |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Might as well make it a cross compiler, too. That way you can convert and compile in one step. That'd be cool. Any update on it being ported to PHP?
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Updated to version 1.1.4. Change log is in file. The main changes regard comments being processed correctly (in a couple situations, they could be processed as code previously).
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Welp, can't use this because Excel Starter doesn't allow running macros >:l
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Fuck excell. OP should copy paste to vba |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
You can make Notepad++ plugins too. Notepad++ can also run scripts though I'm not sure what language the scripts use.
Not sure why something couldn't be made in the format of one of those two options. |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
A php site would be nice
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Yes, a PHP site would indeed be wonderful. Upload source code, convert. Problem is, someone could set the site up to harvest any source code entered into it which would mean bad things for private plugins that are entered in.
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Just keep the php site open source, and no problem |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Or use Javascript instead.
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
With NPP doing the compiling, it will stay in the NPP console and you can double click the error/warning to go straight to the line it came from. Then, map the macro to a shortcut key. So, when all is said and done, I press ctrl+shift+b to compile a script that is anywhere and the .smx will appear next to it in the same folder. Note: The includes will need to be in the include folder relative to your compiler path. Currently, I run this script to compile:
Spoiler
I used to run a simpler script but found that on windows, pseudo mapped locations (through vsubst) seemed to add an extra slash, where it didnt for full paths. So, hence the checking for the slash at the end before adding it. ----------------------------------------------- As far as converting the whole thing to PHP, I was planning on doing it some time, but am too busy until around April, so it likely wouldnt happen until then. As far as exporting the code for you:
Spoiler
When April comes around, I'll check back in on this, unless someone else beats me to it. Perhaps we can get a github repo going with a PHP or java version created. |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Spoiler
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
why not just a transcompiler written in Python?
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Side Note: Perhaps someone can get me started with the right setup for coding/compiling scripts in Python. I've installed python 3.5 in the past and read several tutorials to learn the language....seems pretty straight forward....but I couldnt figure out what I was doing in the software and wasnt committed enough to spend forever looking for tutorials on how to compile, etc. Every tutorial I did find looked nothing like what I was looking at on my screen or had options that I was missing, etc. So, I dropped it for the time. |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
2 Attachment(s)
Quote:
Note: The processor doesnt handle splitting lines into multiple when multiple variable types are declared and the default values are set in the same line. This plugin has an instance of that. After fixing that, some view_as<>() stuff, and the AskPluginToLoad2 function, this is what I got. |
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
How in the world do you even get this too work?
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
@ThatOneGuy :3 Thanks!
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Quote:
Quote:
|
Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Cool! Thank you.
|
All times are GMT -4. The time now is 03:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.