fixed bugs and added enough runtime to execute first code after the compiler segfaults at shutdown

This commit is contained in:
Samuel D. Crow
2021-03-24 18:17:33 -05:00
parent 7c5bf76778
commit 48505d1ef8
11 changed files with 152 additions and 79 deletions

View File

@@ -31,18 +31,19 @@ void printSegment::generate()
output_cpp << "printf(\"%f\", " << op->boxName() << ");\n";
break;
default:
error(E_TYPE_MISMATCH);
break;
}
}
switch (sep)
{
case S_LINEFEED:
output_cpp << "puts(\"\n\");\n";
output_cpp << "puts(\"\\n\");\n";
return;
case S_SEMICOLON:
return;
case S_COMMA:
output_cpp << "putc('\t');\n";
output_cpp << "putc('\\t');\n";
return;
default:
error(E_BAD_SYNTAX);