diff options
Diffstat (limited to 'bcc/state.c')
-rw-r--r-- | bcc/state.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/bcc/state.c b/bcc/state.c index cc821e3..36140c2 100644 --- a/bcc/state.c +++ b/bcc/state.c @@ -73,6 +73,7 @@ FORWARD void doswitch P((void)); FORWARD void dowhile P((void)); FORWARD void jumptocases P((void)); FORWARD void statement P((void)); +FORWARD void doasm P((void)); /* --- utility routines --- */ @@ -231,6 +232,22 @@ PUBLIC void compound() /* have just seen "{" */ rbrace(); } +PRIVATE void doasm() +{ + lparen(); + if (sym!=STRINGCONST) + error("string const expected"); + else { + nextsym(); + constant.value.s[charptr-constant.value.s]='\0'; + outnstr("!BCC_ASM"); + outnstr(constant.value.s); + outnstr("!BCC_ENDASM"); + rparen(); + semicolon(); + } +} + PRIVATE void dobreak() { offset_t spmark; @@ -747,10 +764,14 @@ more: case SEMICOLON: nextsym(); return; + case ASMSYM: + nextsym(); + doasm(); + break; case IDENT: case TYPEDEFNAME: blanks(); /* cannot afford nextsym() */ - while (ch == EOL && !eof) + while (ch == EOL && !eofile) { /* this now fails only on #controls and macros giving ':' */ skipeol(); |