clang-format: [JS] do not collapse - - to --.
In JavaScript, `- -1;` is legal syntax, the language allows unary minus. However the two tokens must not collapse together: `--1` is prefix decrement, i.e. different syntax. Before: - -1; ==> --1; After: - -1; ==> - -1; This change makes no attempt to format this "nicely", given by all likelihood this represents a programming mistake by the user, or odd generated code. The check is not guarded by language: this appears to be a problem in Java as well, and will also be beneficial when formatting syntactically incorrect C++ (e.g. during editing). Differential Revision: https://reviews.llvm.org/D99495
Loading
Please register or sign in to comment