[HLF]Southclaw
Unregistered
With ~100 second compile times and the astounding ability to miss semicolons and other basic syntax after almost a decade of writing this language I am considering writing a static analysis tool for Pawn (most likely as a Sublime Text plugin).
This idea is actually mostly just for the experience of writing code to parse code (which I have done in the past, but I didn't use tokenisation or an AST) that's scope-aware.
The first bit would be to write a Pawn AST parser that's #include aware, function aware, recursion aware and a few other things. Next, I'd work on variable detection, "type" (tag) checking and small stuff.
I'd love to have some feedback from the community about this (if you all still exist of course!) would you use an analysis tool? (I'd probably write it regardless, it sounds fun... somehow) Have any of you experienced working with parsing source code or writing compilers (admittedly not totally related but still somewhat) before?
[HLF]Southclaw
Unregistered
Great to see some interest! I was thinking of getting a C linter and adapting it to support tags and Pawn qualifiers (native, public, etc) but I'll probably get bored of working with another codebase. I may use it as a starting point to learn though (the original lint source code is somewhere, splint is the modern version).
If you're into spaghetti python code though
I wrote a tool to grab Pawn function names a while ago and it still gives me headaches!
I'll probably use Python for this project too since speed won't be an issue and it's the language I'm most comfortable with. I'll update this thread once I have a starting point on GitHub!
Posts: 1,206
Threads: 39
Joined: Feb 2014
Reputation:
0
I'm definitely interested! I'll contribute if and where possible. Good luck!
Posts: 3,324
Threads: 96
Joined: Sep 2013
Extreme Studio is going to feature static analysis.
I've thought about making a VS plugin to support PAWN.
And yes I'd be interested in your tool, especially if it was for Notepad++.
Posts: 294
Threads: 12
Joined: Sep 2015
Reputation:
0
you can compile with -l for some compiler then check one file without any preprocessor and compile that again
so to compile code once as -l
then check .lst instead of code - no files and no preprocessor neede
then compile .lst instead of code
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by OneDay
you can compile with -l for some compiler then check one file without any preprocessor and compile that again
so to compile code once as -l
then check .lst instead of code - no files and no preprocessor neede
then compile .lst instead of code
|
Actually this was considered for ES, but was quickly determined the wrong way to go.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by OneDay
Why?
|
Because our lexer was better.
I have no doubt that Southclaw could make a great lexer also.
Posts: 622
Threads: 5
Joined: Feb 2009
Reputation:
0
Hello everyone,
any progress on this? or does anyone know about the existence of 'Linting/Static Analysis' tools that could be used 'non-interactively' aka from an automated script/job ?
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by Jayse
I also wonder about that, it would be awesome if we could have something like this in Sublime Text 3.
|
Extreme Studio. Built for PAWN, built for SA-MP.
Still in development but currently slow since the developer has a bunch of school shit going on right now. Me and him are pretty tight. In fact, I designed the logo and banner of the program.
Posts: 622
Threads: 5
Joined: Feb 2009
Reputation:
0
An IDE wouldn't be so useful for me. I was looking more into something like a tool that could be used 'non-interactively' to be able to automate Code Integration process.
Posts: 3,304
Threads: 58
Joined: Sep 2008
Reputation:
0
I'd love to see this and I'd be willing to contribute to what is described in the OP.
On a personal note I'd prefer seeing this in Atom than in Sublime, as I find it easier to use.
[HLF]Southclaw
Unregistered
I am still working on this, don't lose hope!
It will be a CLI + Plugin so automation for CI/builds will be possible like flake8/ESLint/Clint etc.
I am aiming to make the functionality similar to Anaconda's with warnings on save and live underlines/highlights of problems such as unused labels, undefined labels and maybe even some include structure/importing stuff.
And since it will be a CLI program, porting to other editors should be easy.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Honestly, I'd most rather see this on a VS plugin...
It is very much possible to port languages to VS and I've never seen it done for PAWN!
[HLF]Southclaw
Unregistered
Well once the linter is available, it can be ported to anything. Not sure how open Intellisense is, I'm not a huge fan of the text editor in VS anyway but once it's done I don't imagine hooking an executable script up to an editor is too hard anyway!
I'm currently still in the AST stage of things anyway, once I get this down the rest should be simple.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by [HLF]Southclaw
Well once the linter is available, it can be ported to anything. Not sure how open Intellisense is, I'm not a huge fan of the text editor in VS anyway but once it's done I don't imagine hooking an executable script up to an editor is too hard anyway!
I'm currently still in the AST stage of things anyway, once I get this down the rest should be simple.
|
I prefer Notepad++, I just haven't seen PAWN used in VS. I was just saying I think it'd be interesting to have PAWN in VS.
Posts: 622
Threads: 5
Joined: Feb 2009
Reputation:
0
Hi there!
Any news of this progress, or ETA available?