Commit 2a8327e5 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Obsoleted code.

parent ba200c78
...@@ -492,24 +492,6 @@ QByteArray Preprocessor::operator()(const QByteArray &filename, ...@@ -492,24 +492,6 @@ QByteArray Preprocessor::operator()(const QByteArray &filename,
return preprocessed; return preprocessed;
} }
QByteArray Preprocessor::operator()(const QByteArray &source)
{
QByteArray preprocessed;
preprocess(source, &preprocessed);
return preprocessed;
}
void Preprocessor::preprocess(const QByteArray &filename,
const QByteArray &source,
QByteArray *result)
{
const QByteArray previousFile = env.currentFile;
env.currentFile = filename;
preprocess(source, result);
env.currentFile = previousFile;
}
void Preprocessor::expand(const QByteArray &source, QByteArray *result) void Preprocessor::expand(const QByteArray &source, QByteArray *result)
{ {
_expand(source, result); _expand(source, result);
...@@ -536,13 +518,17 @@ Preprocessor::State Preprocessor::createStateFromSource(const QByteArray &source ...@@ -536,13 +518,17 @@ Preprocessor::State Preprocessor::createStateFromSource(const QByteArray &source
return state; return state;
} }
void Preprocessor::preprocess(const QByteArray &source, QByteArray *result) void Preprocessor::preprocess(const QByteArray &fileName, const QByteArray &source,
QByteArray *result)
{ {
QByteArray *previousResult = _result; QByteArray *previousResult = _result;
_result = result; _result = result;
pushState(createStateFromSource(source)); pushState(createStateFromSource(source));
const QByteArray previousFileName = env.currentFile;
env.currentFile = fileName;
const unsigned previousCurrentLine = env.currentLine; const unsigned previousCurrentLine = env.currentLine;
env.currentLine = 0; env.currentLine = 0;
...@@ -716,6 +702,8 @@ void Preprocessor::preprocess(const QByteArray &source, QByteArray *result) ...@@ -716,6 +702,8 @@ void Preprocessor::preprocess(const QByteArray &source, QByteArray *result)
} }
popState(); popState();
env.currentFile = previousFileName;
env.currentLine = previousCurrentLine; env.currentLine = previousCurrentLine;
_result = previousResult; _result = previousResult;
} }
......
...@@ -138,8 +138,6 @@ public: ...@@ -138,8 +138,6 @@ public:
QByteArray operator()(const QByteArray &filename, QByteArray operator()(const QByteArray &filename,
const QByteArray &source); const QByteArray &source);
QByteArray operator()(const QByteArray &source);
private: private:
enum { MAX_LEVEL = 512 }; enum { MAX_LEVEL = 512 };
...@@ -171,9 +169,6 @@ private: ...@@ -171,9 +169,6 @@ private:
const QByteArray &source, const QByteArray &source,
QByteArray *result); QByteArray *result);
void preprocess(const QByteArray &source,
QByteArray *result);
void expand(const QByteArray &source, QByteArray *result); void expand(const QByteArray &source, QByteArray *result);
void expand(const char *first, const char *last, QByteArray *result); void expand(const char *first, const char *last, QByteArray *result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment