mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
This was the one regression in test coverage for the parser. While adding this test, I realized we need to also make sure to not create consecutive whitespace, as it would create a non-idempotency in the formatter. The fuzzer has not discovered that yet, though I suspect it would after a while.
52 lines
656 B
Text
52 lines
656 B
Text
let a = [
|
|
42
|
|
// This is a comment before the trailing comma, that is going to be moved after it.
|
|
,
|
|
];
|
|
|
|
let b = [
|
|
42
|
|
// This one will merge
|
|
,
|
|
// With the one below it.
|
|
];
|
|
|
|
let c = [
|
|
// Blanks before the comma get dropped.
|
|
42
|
|
|
|
,
|
|
];
|
|
|
|
let d = [
|
|
// But blanks before the closing bracket do not.
|
|
42
|
|
|
|
];
|
|
|
|
null
|
|
|
|
# output:
|
|
let a = [
|
|
42,
|
|
// This is a comment before the trailing comma, that is going to be moved after it.
|
|
];
|
|
|
|
let b = [
|
|
42,
|
|
// This one will merge
|
|
// With the one below it.
|
|
];
|
|
|
|
let c = [
|
|
// Blanks before the comma get dropped.
|
|
42,
|
|
];
|
|
|
|
let d = [
|
|
// But blanks before the closing bracket do not.
|
|
42,
|
|
|
|
];
|
|
|
|
null
|