diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-01-12 20:42:42 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:46 +0200 |
commit | d91fa39567f5659e3931cf61517d62fddcd87570 (patch) | |
tree | 20583acd4f345a4f5c9a7772870ef972cb8a3b14 /bcc/state.c | |
parent | bff547eabb6678ec8e71ffbcfbf9a4f05c94d949 (diff) | |
download | dev86-d91fa39567f5659e3931cf61517d62fddcd87570.tar.gz |
Import Dev86src-0.16.1.tar.gzv0.16.1
Diffstat (limited to 'bcc/state.c')
-rw-r--r-- | bcc/state.c | 28 |
1 files changed, 22 insertions, 6 deletions
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(); |