Fix a couple of string output issues

This commit is contained in:
Michael Hansen
2011-10-23 19:33:24 -07:00
parent f030a77767
commit b99f0acfb3
3 changed files with 4 additions and 2 deletions

View File

@@ -107,6 +107,8 @@ void OutputString(PycRef<PycString> str, char prefix, bool triple, FILE* F)
fprintf(F, "\\'");
else if (useQuotes && *ch == '"')
fprintf(F, "\\\"");
else if (*ch == '\\')
fprintf(F, "\\\\");
else
fputc(*ch, F);
}

View File

@@ -2,6 +2,7 @@
#define _PYC_STRING_H
#include "pyc_object.h"
#include "data.h"
#include <cstdio>
class PycString : public PycObject {
@@ -25,6 +26,6 @@ private:
};
void OutputString(PycRef<PycString> str, char prefix = 0,
bool triple = false, FILE* F = stdout);
bool triple = false, FILE* F = pyc_output);
#endif

View File

@@ -1,6 +1,5 @@
#include <cstring>
#include "ASTree.h"
#include "data.h"
#ifdef WIN32
# define PATHSEP '\\'