You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might have something to do with #20 and the member function ASFormatter::appendSpacePad().
When there is no character to peek (i.e.: at the end of the line), appendSpacePad refuses to append a space, which causes the content of the next line to "attach" to the current line without a space in between.
To fix this, the implementation of the newer AStyle might be helpful. They have two separate methods to append a space.
/** * append a space to the current formattedline, UNLESS the * last character is already a white-space character.*/voidASFormatter::appendSpacePad()
{
int len = formattedLine.length();
if (len > 0 && !isWhiteSpace(formattedLine[len - 1]))
{
formattedLine.append(1, '');
spacePadNum++;
if (maxCodeLength != string::npos)
{
// These compares reduce the frequency of function calls.if (isOkToSplitFormattedLine())
updateFormattedLineSplitPoints('');
if (formattedLine.length() > maxCodeLength)
testForTimeToSplitFormattedLine();
}
}
}
/** * append a space to the current formattedline, UNLESS the * next character is already a white-space character.*/voidASFormatter::appendSpaceAfter()
{
int len = currentLine.length();
if (charNum + 1 < len && !isWhiteSpace(currentLine[charNum + 1]))
{
formattedLine.append(1, '');
spacePadNum++;
if (maxCodeLength != string::npos)
{
// These compares reduce the frequency of function calls.if (isOkToSplitFormattedLine())
updateFormattedLineSplitPoints('');
if (formattedLine.length() > maxCodeLength)
testForTimeToSplitFormattedLine();
}
}
}
The text was updated successfully, but these errors were encountered:
Pull requests welcome. I have no good understanding of how old aStyle was converted to support Verilog by the original devs. If you have familiarity with these functions from the distant parent project, please see how they substitute into this project.
original file:
after formatting using
-a
expected
This might have something to do with #20 and the member function
ASFormatter::appendSpacePad()
.When there is no character to peek (i.e.: at the end of the line),
appendSpacePad
refuses to append a space, which causes the content of the next line to "attach" to the current line without a space in between.To fix this, the implementation of the newer AStyle might be helpful. They have two separate methods to append a space.
The text was updated successfully, but these errors were encountered: