Skip to content

Commit 72461fb

Browse files
committed
Make fmtscan support '__asm'
'__asm' is a historical keyword of GCC that the current documentation doesn't mention. Change-Id: Ia9c4d706f3cda5e6522fc964cf2e5171aed0e544
1 parent e96309f commit 72461fb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tools/fmtscan.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,10 @@ static get_char_t skip_macros(parser_t *p)
631631

632632
static get_char_t skip_inline_asm(parser_t *p, bool underscore)
633633
{
634-
get_char_t ch = get_char(p);
634+
int paren = 0;
635+
get_char_t ch;
636+
637+
ch = get_char(p);
635638
if (ch != 's')
636639
goto check_s_failed;
637640
if (UNLIKELY(ch == PARSER_EOF))
@@ -645,17 +648,17 @@ static get_char_t skip_inline_asm(parser_t *p, bool underscore)
645648
if (underscore) {
646649
ch = get_char(p);
647650
if (ch != '_')
648-
goto check_underline_1_failed;
651+
goto not_wrapped;
649652
if (UNLIKELY(ch == PARSER_EOF))
650653
return ch;
651654
ch = get_char(p);
652655
if (ch != '_')
653-
goto check_underline_2_failed;
656+
goto check_underline_failed;
654657
if (UNLIKELY(ch == PARSER_EOF))
655658
return ch;
656659
}
660+
not_wrapped:
657661

658-
int paren = 0;
659662
do {
660663
ch = get_char(p);
661664
if (ch == '\n') {
@@ -678,9 +681,8 @@ static get_char_t skip_inline_asm(parser_t *p, bool underscore)
678681
} while (paren);
679682
return PARSER_COMMENT_FOUND;
680683

681-
check_underline_2_failed:
684+
check_underline_failed:
682685
unget_char(p);
683-
check_underline_1_failed:
684686
unget_char(p);
685687
check_m_failed:
686688
unget_char(p);

0 commit comments

Comments
 (0)