cs2lint

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

commit ff5ca5ee074f4536c499e945d663c95068506a53
parent abd0447997ccb032dfc3fb25365bd7d99eed5f83
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date:   Sun, 19 Jul 2020 14:55:21 +0200

remove inexisting {} blocks parsing

Diffstat:
Mcubescript.atg | 33+++++++++++----------------------
1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/cubescript.atg b/cubescript.atg @@ -6,10 +6,10 @@ cr = '\r'. lf = '\n'. nonwhite = '\u0020'..'\u007e'. eol = ';' + cr + lf. -special = "(){}[]". +blocks = "()[]". strch = ANY - cr - lf - '"'. -wordch = nonwhite - '"' - special - eol - ' '. +wordch = nonwhite - '"' - blocks - eol - ' '. TOKENS @@ -42,28 +42,17 @@ statement = | newline . -squar_block = - '[' - { - statement - } - ']' +block = + code_block + | priority_block . -curly_block = - '{' - { - statement - } - '}' - . +block = code_block | priority_block . -round_block = - '(' - { - statement - } - ')' - . +/* execution delayed at end of block, mostly used to define "code blocks" */ +code_block = '[' { statement } ']' . + +/* immediate execution, mostly used for priority/calls */ +priority_block = '(' { statement } ')' . END CubeScript2 .