(
args: Option<Box<ast::Arguments>>,
)
| 100 | } |
| 101 | |
| 102 | pub(super) fn split_class_def_args( |
| 103 | args: Option<Box<ast::Arguments>>, |
| 104 | ) -> (Option<PositionalArguments>, Option<KeywordArguments>) { |
| 105 | let args = match args { |
| 106 | None => return (None, None), |
| 107 | Some(args) => *args, |
| 108 | }; |
| 109 | let ast::Arguments { |
| 110 | node_index: _, |
| 111 | range: _, |
| 112 | args, |
| 113 | keywords, |
| 114 | } = args; |
| 115 | |
| 116 | let positional_arguments_range = args |
| 117 | .iter() |
| 118 | .map(|item| item.range()) |
| 119 | .reduce(|acc, next| acc.cover(next)) |
| 120 | .unwrap_or_default(); |
| 121 | // debug_assert!(range.contains_range(positional_arguments_range)); |
| 122 | let positional_arguments = PositionalArguments { |
| 123 | range: positional_arguments_range, |
| 124 | args, |
| 125 | }; |
| 126 | |
| 127 | let keyword_arguments_range = keywords |
| 128 | .iter() |
| 129 | .map(|item| item.range()) |
| 130 | .reduce(|acc, next| acc.cover(next)) |
| 131 | .unwrap_or_default(); |
| 132 | // debug_assert!(range.contains_range(keyword_arguments_range)); |
| 133 | let keyword_arguments = KeywordArguments { |
| 134 | range: keyword_arguments_range, |
| 135 | keywords, |
| 136 | }; |
| 137 | |
| 138 | (Some(positional_arguments), Some(keyword_arguments)) |
| 139 | } |
| 140 | |
| 141 | pub(super) fn merge_class_def_args( |
| 142 | positional_arguments: Option<PositionalArguments>, |
no test coverage detected