summaryrefslogtreecommitdiffabout
path: root/lib/sitecing_enflesher.ll
authorMichael Krelin <hacker@klever.net>2005-03-30 21:58:44 (UTC)
committer Michael Krelin <hacker@klever.net>2005-03-30 21:58:44 (UTC)
commit5c757590c7561f6d85b3f9011aa0695c4111b379 (patch) (side-by-side diff)
treee0bf20ca58b3e7bd9cc4eda54db5674ba1d71db0 /lib/sitecing_enflesher.ll
parent3ddbfeafde93d1aab16a710498d86eef4e787406 (diff)
downloadsitecing-5c757590c7561f6d85b3f9011aa0695c4111b379.zip
sitecing-5c757590c7561f6d85b3f9011aa0695c4111b379.tar.gz
sitecing-5c757590c7561f6d85b3f9011aa0695c4111b379.tar.bz2
1. fixed a bug just introduced, preventing the last skeleton-generated file
from being written. 2. introduced pragma directive and pragma main=class 3. minor changes of no importance
Diffstat (limited to 'lib/sitecing_enflesher.ll') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/sitecing_enflesher.ll8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sitecing_enflesher.ll b/lib/sitecing_enflesher.ll
index 46489c7..bb667be 100644
--- a/lib/sitecing_enflesher.ll
+++ b/lib/sitecing_enflesher.ll
@@ -179,6 +179,7 @@ void sitecing_enflesher::enflesh() {
throw preprocessor_error(CODEPOINT,"failed to open skeleton file");
switch_streams(&ifs,NULL);
yylex();
+ outs_close();
}
void sitecing_enflesher::anchor() {
@@ -188,7 +189,7 @@ void sitecing_enflesher::anchor() {
anchor_time = false;
}
-void sitecing_enflesher::outs_open(const string& nfile) {
+void sitecing_enflesher::outs_close() {
if(!outs_filename.empty()) {
outs.flush();
outs.close();
@@ -244,6 +245,11 @@ void sitecing_enflesher::outs_open(const string& nfile) {
throw preprocessor_error(CODEPOINT,"failed to rename() generated output");
}
}
+ outs_filename.erase();
+}
+
+void sitecing_enflesher::outs_open(const string& nfile) {
+ outs_close();
outs_filename = nfile;
outs.open((nfile+".new").c_str(),ios::trunc);
if(!outs.good())