runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[BUG] Error on classnames being just numbers

Open PabstMirror opened this issue 4 years ago • 1 comments

Describe the bug Class names being just digits are valid in arma, but cause parse error.

To Reproduce config.cpp:

class CfgPatches {
    class 1 {
        units[] = {};
        requiredAddons[] = {};
    };
};

command: sqfvm.exe --input config.cpp --parse-only -a result: [ERR] [L2|C10|config.cpp] Parse Error: syntax error, unexpected NUMBER, expecting IDENT

Expected behavior It to work

PabstMirror avatar Feb 11 '21 06:02 PabstMirror

Additionally config names can be numbers, but throw error

class CfgPatches {
    class test {
        4 = "four";
        units[] = {};
        requiredAddons[] = {};
    };
};

[ERR] [L3|C8|config.cpp] Parse Error: syntax error, unexpected NUMBER, expecting delete or class or } or IDENT

getText (configfile >> "CfgPatches" >> "test" >> "4") = "four"

PabstMirror avatar Feb 11 '21 06:02 PabstMirror

Should be fixed in https://github.com/SQFvm/runtime/commit/017a2db6a4295d54ad14e1e1d47378bd7e5357b5

Please reopen if still affected with latest development release

X39 avatar Aug 04 '23 16:08 X39