Jump to content

Recommended Posts

sqflint.png Lint
Summary
SQFLint is command line tool, that checks specified files for syntax errors. It can output those errors in human readable format, or JSON for some futher processing.
 
Homepage: http://sqflint.zipek.cz/

Releases: https://github.com/SkaceKamen/sqflint/releases
Github: https://github.com/SkaceKamen/sqflint

 

(extension moved to separate thread)
 

Changelog

You can find changelog at releases page

Features

  • Syntax error checking
  • Undefined variable warnings
  • Exports some info about file for futher processing by external tools
  • Like 7

Share this post


Link to post
Share on other sites

Cool to see someone else attempting SQF syntax checking. Trust me. You don't know what you are getting yourself into. :P

I've already spotted numerous errors in your grammar file; most of the errors are with how you read commands: if, then, exitWith, etc. You should not treat them like outlier keywords/commands because they behave like other commands. Read the italic header in this page.

 

If you have any questions, I'll be here to help you out. I've been working on my grammar file since December 2015 and it still isn't perfect..........

  • Like 1

Share this post


Link to post
Share on other sites

Any help is appreciated. I've been trying to create usable parser for SQF some time too, this is my latest attempt which tries to do it the simplest way. No binary / unary commands checking, just some very basic stuff.

 

Well, control structures are commands, but the point of the grammar is to search for user made errors, not compile it. As long as any input acceptable in game is accepted in grammar and any input not accepted in game is not accepted in grammar everything should be all right :). If you know about some usage of those control structures, which is valid and won't be correctly parsed, please tell me.

  • Like 1

Share this post


Link to post
Share on other sites

nice to see another one to attempt controlling the beast :)

i've made T_D aware of your work; maybe he still has something useful from his attempt or other advice

make sure to look also into Squint; maybe SBSMac is even open to share his source or parts of it finally see you (guys) doing this

Share this post


Link to post
Share on other sites

Thanks for the article, my grammar source is pretty much the same (you can find it here) only with exception of having control structures defined explicitily. I'm wondering if there is any use to saving the [if/switch/while/for] type to variable...

 

EDIT: While reading it, I noticed some problems in my grammar file. Will probably update it when I'm done with preprocessor.

  • Like 2

Share this post


Link to post
Share on other sites

(moved extension to separate thread)

 

New release, v0.6.0, mainly fixing the parser:

  • Updated way code is parsed, enabling more complex analytics
  • Added option to check paths used in execVM ( -cp, -r )
  • Added option to treat warnings as errors
  • Added option to exit with ERR(1), when error is encountered
  • Variable declaration is now correctly recognized in params and for
  • Blocks not ending with semicolon are now correctly accepted
  • Fixed string quotes not being handled properly
  • Fixed token errors not being handled properly and leaking to stderr
  • Fixed JSON flag being ignored in some cases

You can find release packages at github.

  • Like 1

Share this post


Link to post
Share on other sites

Really nice work, this could become a big thing :)

 

Recommended your extension in my thread / website.

Share this post


Link to post
Share on other sites

I am using this daily, great stuff!

 

Just a suggestion: Add the returnvalue possibility for the switch/if cases

Share this post


Link to post
Share on other sites

By far on of the most potential plugins. Love using this on a daily base. Also eager for next release :).

Share this post


Link to post
Share on other sites

@SkaceKachna, I'm still getting loads of 'Possibly undefined variable' yellow warnings on variables defined in a global variables file earlier. All my own functions too -  it's not getting stuff out of CfgFunctions. Finding the red warnings is brilliant and it's a valuable tool because it's very reliable at getting these.

 

I was wondering; in the documentation, you say it works best with Armitxes SQF support extension and I use a different one, the Vladislav Sazonovs extension. Is it likely this is what is causing these yellow warnings?

 

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×