From d91fa39567f5659e3931cf61517d62fddcd87570 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Sat, 12 Jan 2002 20:42:42 +0100 Subject: Import Dev86src-0.16.1.tar.gz --- bcc/state.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'bcc/state.c') diff --git a/bcc/state.c b/bcc/state.c index 620b553..c14ff7b 100644 --- a/bcc/state.c +++ b/bcc/state.c @@ -188,6 +188,7 @@ PUBLIC void compound() /* have just seen "{" */ #endif spmark = sp; newlevel(); + expect_statement++; decllist(); softsp &= alignmask; if (sym != RBRACE) /* no need for locals if empty compound */ @@ -195,6 +196,7 @@ PUBLIC void compound() /* have just seen "{" */ returnflag = FALSE; while (sym != RBRACE && sym != EOFSYM) statement(); + expect_statement--; oldlevel(); if (!returnflag) { @@ -233,17 +235,27 @@ PUBLIC void compound() /* have just seen "{" */ PRIVATE void doasm() { - lparen(); + if (sym == LPAREN) nextsym(); if (sym!=STRINGCONST) error("string const expected"); else { - nextsym(); - constant.value.s[charptr-constant.value.s]='\0'; outnstr("!BCC_ASM"); - outbyte('\t'); - outnstr(constant.value.s); + for(;;) + { + constant.value.s[charptr-constant.value.s]='\0'; + outbyte('\t'); + outnstr(constant.value.s); + /* XXX: Need to investigate: wasting memory? + * + * charptr = constant.value.s; + */ + + nextsym(); + if (sym == COMMA) nextsym(); + if (sym!=STRINGCONST) break; + } outnstr("!BCC_ENDASM"); - rparen(); + if (sym == RPAREN) nextsym(); semicolon(); } } @@ -718,6 +730,10 @@ more: nextsym(); doif(); break; + case ELSESYM: + error("unexpected else"); + nextsym(); + break; case WHILESYM: nextsym(); dowhile(); -- cgit v1.2.1