Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
151 stars 23 forks source link

Definitions containing bit shifts inside arrays cause linting to break #412

Closed Alienmario closed 4 months ago

Alienmario commented 4 months ago

Basic informations

Further Information

Usage of definitions containing bit shifts as array values causes linting to break:

#define A (1 << 0)
#define B (1 << 1)

int arr[] =
{
    A,
    B
};

Realistic use case:

int g_pDamageFlagList[] =
{
    DMG_PLASMA,
    DMG_SLOWBURN
};

Error messages

expected "`end`, `identifier`, `-`, `+`, `&`, `...`, `*`, `/`, `%`, `||`, `&&`, `|`, `^`, `==`, `!=`, `>`, `>=`, `<=`, `<`, `<<`, `>>`, `>>>`, `#include`, `#tryinclude`, `#define`, `,`, `#undef`, `#if`, `#elseif`, `#assert`, `preproc_else`, `preproc_endif`, `preproc_endinput`, `#pragma`, `#error`, `#warning`, `using __intrinsics__.Handle`, `assert`, `static_assert`, `=`, `forward`, `native`, `const`, `public`, `stock`, `static`, `new`, `decl`, `enum`, `}`, `struct`, `typedef`, `typeset`, `funcenum`, `functag`, `methodmap`, `[`, `void`, `bool`, `int`, `float`, `char`, `_`, `Float`, `String`, `any_type`, `while`, `else`, `case`, `default`, `_manual_semicolon`, `.`, `?`, `--`, `++`, `comment`, `_automatic_semicolon`, `preproc_include`, `preproc_tryinclude`, `preproc_macro`, `preproc_define`, `preproc_undefine`, `preproc_if`, `preproc_elseif`, `preproc_assert`, `preproc_pragma`, `preproc_error`, `preproc_warning`"sourcepawn-studio(syntax-error)