Repository navigation
Fixes issue #1260 #1268 #1277 - #31
hschlichter merged 2 commits into
Conversation
Setting CT_ASSIGN_NL only for pc type is CT_ASSIGN & chunk next is new line As discussed with mihai changed the test case as it contradicts uncrustify#1260 & uncrustify#1268
| */ | ||
| if ((frm.pse[frm.pse_tos].type == CT_ASSIGN || frm.pse[frm.pse_tos].type == CT_ASSIGN_NL) && pc->type == CT_ASSIGN) | ||
| { | ||
| indent_pse_pop(frm, pc); |
There was a problem hiding this comment.
Isn't it the same as avoiding doing the indent_pse_push from below?
There was a problem hiding this comment.
Yes Mihai,
It will work if we avoid doing the indent_pse_push as well but,
the chunk that is responsible for indentation, which must be the last assignment operator in the series of consecutive assignments, should be in the stack.
Hence we are popping the unnecessary chunks and pushing the right one.
| y); | ||
| x = o.Func2(a, b, | ||
| y); | ||
| variablex = o.Func( |
There was a problem hiding this comment.
Why the change to the variable name?
There was a problem hiding this comment.
This was suggested by Mihai
There was a problem hiding this comment.
Ok, for purely visual purposes as I understood. Which is fine. Was just worried that the tokeniser actually behaved differently and that was the reason for the change.
…ltiple-assignments
|
@satishp87 we have found a regression on unity codebase after merging this PR. We will come back shortly with details. |
|
For instance, we have found this regression: diff --git a/output/staging/60036-UNI-99999.cs b/results/staging/60036-UNI-99999.cs
index eda66433..572a6f64 100644
--- a/output/staging/60036-UNI-99999.cs
+++ b/results/staging/60036-UNI-99999.cs
@@ -5,12 +5,12 @@ namespace Unity
public Resource Bar(File foo)
{
Resource resource = null;
switch (foo.GetExension())
{
case ".boo":
resource = new BooResource(type,
- paramA,
- paramB);
+ paramA,
+ paramB);
}
return resource;
}The indentation of parameters is reduced to first column relative to the variable assignment. I don't think it is what we want. One level of indentation would be ok instead. |
Setting CT_ASSIGN_NL only for pc type is CT_ASSIGN & chunk next is new line
For multiple consecutive assignments in single line , the indent of all these
assignments should be same and one more than this line's indent.
so popping the previous assign and pushing the new one
As discussed with mihai changed the test case as it contradicts uncrustify#1260 & uncrustify#1268