genInline (iCode * ic)
{
char *buffer, *bp, *bp1;
+ bool inComment = FALSE;
D (emitcode (";", "genInline"));
_G.inLine += (!options.asmpeep);
- buffer = bp = bp1 = Safe_strdup(IC_INLINE(ic));
+ buffer = bp = bp1 = Safe_strdup (IC_INLINE(ic));
/* emit each line as a code */
while (*bp)
{
- if (*bp == '\n')
+ switch (*bp)
{
+ case ';':
+ inComment = TRUE;
+ ++bp;
+ break;
+
+ case '\n':
+ inComment = FALSE;
*bp++ = '\0';
emitcode (bp1, "");
bp1 = bp;
- }
- else
- {
+ break;
+
+ default:
/* Add \n for labels, not dirs such as c:\mydir */
- if ( (*bp == ':') && (isspace((unsigned char)bp[1])) )
+ if (!inComment && (*bp == ':') && (isspace((unsigned char)bp[1])))
{
- bp++;
+ ++bp;
*bp = '\0';
- bp++;
+ ++bp;
emitcode (bp1, "");
bp1 = bp;
}
else
- bp++;
+ ++bp;
+ break;
}
}
if (bp1 != bp)
emitcode (bp1, "");
- /* emitcode("",buffer); */
+
+ Safe_free (buffer);
+
_G.inLine -= (!options.asmpeep);
}