c.tmbundle icon indicating copy to clipboard operation
c.tmbundle copied to clipboard

bitwise NOT operator did not get recognized properly when used with function and judging statement

Open ZsgsDesign opened this issue 3 years ago • 0 comments

Given the following code:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(~fscanf(user_output, "%d", &a)) {
        // ...
    }
}

The ~fscanf part inconsistently displayed itself as purple, while when using other operators it displays black for operator and then blues for the function name:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(fscanf(user_output, "%d", &a)) {
        // ...
    }
}
int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(+fscanf(user_output, "%d", &a)) {
        // ...
    }
}
int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(-fscanf(user_output, "%d", &a)) {
        // ...
    }
}

Even for bitwise XOR operator ^ the behavior stays the same:

int main(){
    int a, b;
    fscanf(input, "%d", &b);
    if(^fscanf(user_output, "%d", &a)) {
        // ...
    }
}

I believe this caused inconsistency and should be fixed in the future.

ZsgsDesign avatar Feb 28 '22 02:02 ZsgsDesign