konsti
a51606a10a
Handle parentheses when formatting slice expressions ( #5882 )
...
**Summary** Fix the formatter crash with `x[(1) :: ]` and related code.
**Problem** For assigning comments in slices in subscripts, we need to
find the positions of the colons to assign comments before and after the
colon to the respective lower/upper/step node (or dangling in that
section). Formatting `x[(1) :: ]` was broken because we were looking for
a `:` after the `1` but didn't consider that there could be a `)`
outside the range of the lower node, which contains just the `1` and no
optional parentheses.
**Solution** Use the simple tokenizer directly and skip all closing
parentheses.
**Test Plan** I added regression tests.
Closes #5733
2023-07-19 15:25:25 +00:00
..
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-07-13 09:27:25 +00:00
2023-07-11 06:08:08 +00:00
2023-06-30 06:32:50 +00:00
2023-07-13 09:27:25 +00:00
2023-07-11 16:40:28 +02:00
2023-07-14 09:01:33 +02:00
2023-06-30 06:32:50 +00:00
2023-07-13 09:27:25 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-19 11:47:56 +00:00
2023-07-19 11:47:56 +00:00
2023-07-11 16:40:28 +02:00
2023-07-15 15:50:47 +01:00
2023-07-10 12:32:15 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:40:28 +02:00
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-07-03 21:48:44 +02:00
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:51:24 +02:00
2023-07-13 08:57:29 +02:00
2023-07-11 06:08:08 +00:00
2023-06-30 06:32:50 +00:00
2023-07-04 07:07:20 +00:00
2023-07-14 09:01:33 +02:00
2023-07-14 09:01:33 +02:00
2023-07-13 09:27:25 +00:00
2023-06-30 06:32:50 +00:00
2023-07-14 09:01:33 +02:00
2023-07-19 12:05:38 +00:00
2023-07-14 09:01:33 +02:00
2023-06-30 06:32:50 +00:00
2023-07-03 21:48:44 +02:00
2023-07-13 08:57:29 +02:00
2023-07-19 11:47:56 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:51:24 +02:00
2023-06-30 06:32:50 +00:00
2023-07-17 10:38:59 +02:00
2023-06-30 06:32:50 +00:00
2023-07-13 09:27:25 +00:00
2023-07-04 07:07:20 +00:00
2023-07-19 11:47:56 +00:00
2023-07-04 07:07:20 +00:00
2023-07-19 11:47:56 +00:00
2023-07-15 16:03:09 +01:00
2023-07-10 21:23:49 +02:00
2023-07-19 11:47:56 +00:00
2023-07-13 09:27:25 +00:00
2023-07-15 17:35:23 +01:00
2023-07-11 16:40:28 +02:00
2023-07-19 11:47:56 +00:00
2023-07-13 09:27:25 +00:00
2023-07-14 09:01:33 +02:00
2023-07-11 14:07:39 +02:00
2023-07-14 09:01:33 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 10:13:23 +02:00
2023-07-11 16:40:28 +02:00
2023-07-04 07:07:20 +00:00
2023-07-19 13:01:58 +02:00
2023-06-27 09:29:40 +00:00
2023-07-11 16:51:24 +02:00
2023-07-14 17:54:58 +02:00
2023-07-19 12:05:38 +00:00
2023-07-08 12:33:18 +02:00
2023-07-19 13:01:58 +02:00
2023-07-10 15:55:19 +02:00
2023-07-19 11:47:56 +00:00
2023-07-19 12:05:38 +00:00
2023-07-03 21:48:44 +02:00
2023-07-10 12:32:15 +00:00
2023-07-19 12:05:38 +00:00
2023-07-19 15:25:25 +00:00
2023-07-11 06:08:08 +00:00
2023-07-14 17:54:58 +02:00
2023-07-10 21:23:49 +02:00
2023-07-11 14:07:39 +02:00
2023-07-08 12:33:18 +02:00
2023-07-13 10:51:25 +00:00
2023-07-14 09:01:33 +02:00
2023-07-13 16:00:49 +02:00
2023-07-13 10:51:25 +00:00
2023-06-26 14:15:55 +02:00
2023-06-29 08:09:26 +02:00
2023-07-11 08:36:26 +02:00
2023-07-13 08:57:29 +02:00
2023-07-18 13:40:15 +02:00
2023-07-18 13:40:15 +02:00
2023-07-04 07:07:20 +00:00
2023-07-04 07:07:20 +00:00
2023-07-13 08:57:29 +02:00
2023-07-06 18:23:53 +00:00
2023-07-13 08:57:29 +02:00
2023-07-19 13:01:58 +02:00
2023-06-26 14:15:55 +02:00