cs2lint

CubeScript linter for Cube2 engine
git clone git://deadbeef.fr/cs2lint.git
Log | Files | Refs | README | LICENSE

commit 4d7f5f8d6a3e82ab7674aad28ef3fd9121e9a740
parent 034661a3b86b74f4ee2718d389775f4f8d155208
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date:   Sun, 19 Jul 2020 01:58:03 +0200

now returns EXIT_FAILURE if some errors where found

Diffstat:
Mcubescript.atg | 3++-
Mmain.cpp | 10++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/cubescript.atg b/cubescript.atg @@ -39,7 +39,8 @@ statement = | squar_block | curly_block | round_block - } statement_end + } + statement_end . squar_block = diff --git a/main.cpp b/main.cpp @@ -1,8 +1,18 @@ +#include <stdio.h> + #include "coco_build/Parser.h" int main() { + bool failed = false; Scanner scanner( stdin ); Parser parser( &scanner ); parser.Parse(); + failed = parser.errors && parser.errors->count > 0; + if( failed ) + { + wprintf( L"%d errors found\n", parser.errors->count : 0 ); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; }