Addresses PR40999 https://bugs.llvm.org/show_bug.cgi?id=40999
Private fields and methods in javasceipt would get incorrectly indented (it sees them as preprocessor directives and hence left aligns them)
In this revision "#identifier" tokens tok::hash->tok::identifier are merged into a single new token
tok::identifier with the '#' contained inside the TokenText
class Example {
pub = 1;
#priv = 2;
static pub2 = "foo";
static #priv2 = "bar";
method() { this.#priv = 5; }
static staticMethod() {
switch (this.#priv) {
case '1':
#priv = 3;
break;
}
}
#privateMethod() {
this.#privateMethod(); // infinite loop
}
static #staticPrivateMethod() {}
}After this fix the code will be correctly indented
class Example {
pub = 1;
#priv = 2;
static pub2 = "foo";
static #priv2 = "bar";
method() { this.#priv = 5; }
static staticMethod() {
switch (this.#priv) {
case '1':
#priv = 3;
break;
}
}
#privateMethod() {
this.#privateMethod(); // infinite loop
}
static #staticPrivateMethod() {}
}
Honestly, I think we don't really do release notes for clang-format. Revert this, or I'll drop it when committing your change.