Skip to content

Commit

Permalink
子猫をだいすき
Browse files Browse the repository at this point in the history
  • Loading branch information
piernov committed Jan 13, 2017
1 parent c1f7c9a commit c75798c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public CodeGenerator(String language, String in, String out, InstructionParser i
* @param filename brainfuck program filename, will output to this filename with the extension for the selected language.
*/
public void generate(String filename) throws IOException {
wtf = new WriteTextFile(filename.substring(0, filename.lastIndexOf('.'))+"."+lang.getExtension());
String outFilename = filename.substring(0, filename.lastIndexOf('.')) + "." + lang.getExtension();

wtf = new WriteTextFile(outFilename);
wtf.clear(); // Empty file

front();
Expand All @@ -72,7 +74,7 @@ public void generate(String filename) throws IOException {
writeInstructions(ip.get());
footer();

setExecutable(filename);
setExecutable(outFilename);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public WriteTextFile(String filename) throws IOException {

/**
* Set append mode.
*
* @param append false to disable append mode.
*/
public void clear() {
renewFileOutputStream(true);
Expand Down

0 comments on commit c75798c

Please sign in to comment.