From 5c757590c7561f6d85b3f9011aa0695c4111b379 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 30 Mar 2005 21:58:44 +0000 Subject: 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 --- (limited to 'lib/sitecing_enflesher.ll') 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()) -- cgit v0.9.0.2