@@ -168,6 +168,39 @@ static FormFormattingConfig new_deftype_rule(
168168 return cfg;
169169}
170170
171+ static FormFormattingConfig new_defproc_rule (
172+ int start_index,
173+ int num_columns_to_compute_widths,
174+ const std::vector<int >& inlining_preventation_indices) {
175+ FormFormattingConfig cfg;
176+ cfg.has_constant_pairs = true ;
177+ cfg.config_set = true ;
178+ cfg.hang_forms = false ;
179+ cfg.inline_until_index = [start_index](std::vector<std::string> curr_lines) {
180+ // if (curr_lines.size() >= 4 && curr_lines.at(3) == "()") {
181+ // return 4;
182+ // }
183+ return start_index;
184+ };
185+ for (const auto & index : inlining_preventation_indices) {
186+ auto temp_config = std::make_shared<FormFormattingConfig>();
187+ temp_config->config_set = true ;
188+ temp_config->prevent_inlining = true ;
189+ temp_config->hang_forms = false ;
190+ temp_config->indentation_width = 1 ;
191+ auto temp_list_config = std::make_shared<FormFormattingConfig>();
192+ temp_list_config->force_inline = false ;
193+ temp_list_config->hang_forms = false ;
194+ temp_config->default_index_config = temp_list_config;
195+ if (index == 3 ) {
196+ temp_config->determine_column_widths_for_list_elements = true ;
197+ temp_config->num_columns_to_compute_widths = num_columns_to_compute_widths;
198+ }
199+ cfg.index_configs .emplace (index, temp_config);
200+ }
201+ return cfg;
202+ }
203+
171204static FormFormattingConfig new_binding_rule (int form_head_width) {
172205 FormFormattingConfig cfg;
173206 cfg.config_set = true ;
@@ -253,6 +286,9 @@ const std::unordered_map<std::string, FormFormattingConfig> opengoal_form_config
253286 {" defmethod" , new_defmethod_rule (3 )},
254287 {" lambda" , new_lambda_rule (2 )},
255288 {" deftype" , new_deftype_rule (3 , 1 , {3 , 4 , 5 , 6 })},
289+ {" defproc" , new_defproc_rule (3 , 1 , {3 , 4 , 5 , 6 })},
290+ {" suspend-for" , new_flow_rule (2 )},
291+ {" spawn-proc" , new_flow_rule (2 )},
256292 {" defun" , new_flow_rule (3 )},
257293 {" defun-recursive" , new_flow_rule (4 )},
258294 {" defun-debug-recursive" , new_flow_rule (4 )},
@@ -281,12 +317,14 @@ const std::unordered_map<std::string, FormFormattingConfig> opengoal_form_config
281317 {" protect" , new_binding_rule (4 )},
282318 {" let*" , new_binding_rule (5 )},
283319 {" rlet" , new_binding_rule (5 )},
320+ {" mlet" , new_binding_rule (5 )},
284321 {" when" , new_flow_rule (2 )},
285322 {" unless" , new_flow_rule (2 )},
286323 {" with-profiler" , new_flow_rule (2 )},
287324 {" with-pc" , new_flow_rule (0 )},
288325 {" #unless" , new_flow_rule (2 )},
289326 {" #when" , new_flow_rule (2 )},
327+ {" #when-game" , new_flow_rule (2 )},
290328 {" countdown" , new_flow_rule (2 )},
291329 {" until" , new_flow_rule (2 )},
292330 {" loop" , new_flow_rule (0 )},
0 commit comments