formatter: Also allow /*...*/ as inline comments

Blueprint allows both `//` and `/*...*/` style comments, but if a
project prefers only `/*...*/` comments, it is currently not possible to
have these inline.

Therefore, treat these comments equal if they occur inline. To make this
easier to understand, we refactor the comment handling slightly to first
handle single-line comment whitespace, and then handle newlines for both
single-line and multi-line style comments.

Adjust the test accordingly to make sure this works.
This commit is contained in:
Matthijs Velsink 2025-06-12 19:00:56 +02:00
parent 5c7fb03da7
commit ed867269dd
2 changed files with 10 additions and 10 deletions

View file

@ -46,7 +46,7 @@ menu menu {
item ("test")
item {
label: "test";
label: "test"; /* Different inline comment style */
}
item ("test")