klauspost/asmfmt

Semicolon macro corner case

karalabe opened this issue · 1 comments

Me again :))

Found another tiny corner case with the semicolon formatting. When the semicolon is after a macro, it is not formatted. E.g.

Input:

#define MACRO1 NOP

#define MACRO2 \
  MOVQ AX,  BX  ;  \
  MACRO1        ;  \
  MOVQ BX,  AX

Output:

#define MACRO1 NOP

#define MACRO2 \
    MOVQ AX, BX; \
    MACRO1        ;\
    MOVQ BX, AX

Expected:

#define MACRO1 NOP

#define MACRO2 \
    MOVQ AX, BX; \
    MACRO1;      \
    MOVQ BX, AX

Note, that both the whitespace between the macro and the semicolon is left intact, and also the trailing slash is not aligned with te rest of the lines.

Small oversight on my part. The semicolon was fixed, but the change was never saved.

Fixed by #15