formatter: better support for function calls from functions but it's still not great, requires more research

This commit is contained in:
Tyler Wilding
2024-05-19 00:13:22 -04:00
parent 32ec1c0100
commit 6eaeb31930
2 changed files with 10 additions and 31 deletions
+1 -1
View File
@@ -312,7 +312,7 @@ std::vector<std::string> apply_formatting(const FormatterTreeNode& curr_node,
if (i == (int)curr_node.refs.size() - 1 && form_lines.size() > 1 &&
(curr_node.formatting_config.hang_forms ||
curr_node.formatting_config.combine_first_two_lines)) {
form_lines.at(0) += fmt::format(" {}", form_lines.at(1));
form_lines.at(0) += fmt::format(" {}", str_util::ltrim(form_lines.at(1)));
form_lines.erase(form_lines.begin() + 1);
} else if ((i + 1) < (int)curr_node.refs.size()) {
const auto& next_ref = curr_node.refs.at(i + 1);
+9 -30
View File
@@ -150,39 +150,18 @@ Long array creation
(the-as (function none) (-> arr i)))))
===
!Nested function call
TODO - Nested function call
===
(set! (-> this attack-event)
(the-as symbol ((the-as
(function res-lump symbol symbol float structure (pointer res-tag) pointer object)
(method-of-type res-lump get-property-struct)
)
(-> this entity)
'attack-event
'interp
-1000000000.0
'dark-eco-pool
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(the-as symbol
((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct))
(-> this entity)
'attack-event)))
---
(set! (-> this attack-event)
(the-as symbol ((the-as
(function res-lump symbol symbol float structure (pointer res-tag) pointer object)
(method-of-type res-lump get-property-struct)
)
(-> this entity)
'attack-event
'interp
-1000000000.0
'dark-eco-pool
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(the-as symbol
((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct))
(-> this entity)
'attack-event)))