Skip to content

Commit 1a3d224

Browse files
committed
Move the code for handling __pragma in prefix form out of newfunc()
This fixes another bug with `__pragma` being expected twice in variable declarations starting with specifiers `public`, `static` and `stock`.
1 parent 46eb732 commit 1a3d224

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/compiler/sc1.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,8 +1741,11 @@ static void parse(void)
17411741
emit_flags &= ~efGLOBAL;
17421742
break;
17431743
case tNEW:
1744-
if (getclassspec(tok,&fpublic,&fstatic,&fstock,&fconst))
1744+
if (getclassspec(tok,&fpublic,&fstatic,&fstock,&fconst)) {
1745+
if (matchtoken(t__PRAGMA))
1746+
dopragma();
17451747
declglb(NULL,0,fpublic,fstatic,fstock,fconst);
1748+
} /* if */
17461749
break;
17471750
case tSTATIC:
17481751
if (matchtoken(tENUM)) {
@@ -2073,8 +2076,6 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
20732076
firstname=NULL;
20742077
} else {
20752078
tag=pc_addtag(NULL);
2076-
if (matchtoken(t__PRAGMA))
2077-
dopragma();
20782079
if (lex(&val,&str)!=tSYMBOL) /* read in (new) token */
20792080
error_suggest(20,str,NULL,estSYMBOL,esfFUNCTION); /* invalid symbol name */
20802081
assert(strlen(str)<=sNAMEMAX);

0 commit comments

Comments
 (0)