summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/rewriter/rewriter_p.h
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-05-26 10:04:47 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2009-05-26 10:11:31 (GMT)
commit678ae4a4226a4dc6f93ea394d8bdd7422dbb503c (patch)
treed744ca69851a3282f608a3e51bd7e605377c8d94 /src/declarative/qml/rewriter/rewriter_p.h
parenta1730a096a2ca44ef2fc1530a141ecbb9b3157ec (diff)
downloadQt-678ae4a4226a4dc6f93ea394d8bdd7422dbb503c.zip
Qt-678ae4a4226a4dc6f93ea394d8bdd7422dbb503c.tar.gz
Qt-678ae4a4226a4dc6f93ea394d8bdd7422dbb503c.tar.bz2
Don't check the QT_MODULE in the text rewriter, there's no need since it's private code.
Diffstat (limited to 'src/declarative/qml/rewriter/rewriter_p.h')
-rw-r--r--src/declarative/qml/rewriter/rewriter_p.h104
1 files changed, 51 insertions, 53 deletions
diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h
index 287df7a..02b4ee4 100644
--- a/src/declarative/qml/rewriter/rewriter_p.h
+++ b/src/declarative/qml/rewriter/rewriter_p.h
@@ -51,8 +51,6 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Declarative)
-
namespace JavaScript {
////////////////////////////////////////////////////////////////////////////////
@@ -60,21 +58,21 @@ namespace JavaScript {
////////////////////////////////////////////////////////////////////////////////
class Replacement
{
- int _offset;
- int _length;
- QString _text;
+ int _offset;
+ int _length;
+ QString _text;
public:
- Replacement(int offset = 0, int length = 0, const QString &text = QString())
- : _offset(offset), _length(length), _text(text)
- { }
+ Replacement(int offset = 0, int length = 0, const QString &text = QString())
+ : _offset(offset), _length(length), _text(text)
+ { }
- bool isNull() const { return _offset == _length; }
- operator bool() const { return ! isNull(); }
+ bool isNull() const { return _offset == _length; }
+ operator bool() const { return ! isNull(); }
- int offset() const { return _offset; }
- int length() const { return _length; }
- QString text() const { return _text; }
+ int offset() const { return _offset; }
+ int length() const { return _length; }
+ QString text() const { return _text; }
};
@@ -85,64 +83,64 @@ public:
class Rewriter: public AST::Visitor
{
protected:
- TextWriter textWriter;
+ TextWriter textWriter;
public:
- //
- // Token based API
- //
+ //
+ // Token based API
+ //
- /// Returns the text of the token at the given \a location.
- QString textAt(const AST::SourceLocation &location) const;
+ /// Returns the text of the token at the given \a location.
+ QString textAt(const AST::SourceLocation &location) const;
- QString textAt(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc) const;
+ QString textAt(const AST::SourceLocation &firstLoc,
+ const AST::SourceLocation &lastLoc) const;
- /// Replace the token at \a loc with the given \a text.
- void replace(const AST::SourceLocation &loc, const QString &text);
+ /// Replace the token at \a loc with the given \a text.
+ void replace(const AST::SourceLocation &loc, const QString &text);
- /// Remove the token at the given \a location.
- void remove(const AST::SourceLocation &location);
+ /// Remove the token at the given \a location.
+ void remove(const AST::SourceLocation &location);
- /// Remove all tokens in the range [\a firstLoc, \a lastLoc].
- void remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc);
+ /// Remove all tokens in the range [\a firstLoc, \a lastLoc].
+ void remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc);
- /// Insert \a text before the token at the given \a location.
- void insertTextBefore(const AST::SourceLocation &location, const QString &text);
+ /// Insert \a text before the token at the given \a location.
+ void insertTextBefore(const AST::SourceLocation &location, const QString &text);
- /// Insert \a text after the token at the given \a location.
- void insertTextAfter(const AST::SourceLocation &loc, const QString &text);
+ /// Insert \a text after the token at the given \a location.
+ void insertTextAfter(const AST::SourceLocation &loc, const QString &text);
- void moveTextBefore(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc);
+ void moveTextBefore(const AST::SourceLocation &firstLoc,
+ const AST::SourceLocation &lastLoc,
+ const AST::SourceLocation &loc);
- void moveTextAfter(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc);
+ void moveTextAfter(const AST::SourceLocation &firstLoc,
+ const AST::SourceLocation &lastLoc,
+ const AST::SourceLocation &loc);
- //
- // low-level offset based API
- //
- void replace(int offset, int length, const QString &text);
- void insertText(int offset, const QString &text);
- void removeText(int offset, int length);
+ //
+ // low-level offset based API
+ //
+ void replace(int offset, int length, const QString &text);
+ void insertText(int offset, const QString &text);
+ void removeText(int offset, int length);
- /// Visit the given \a node.
- void accept(AST::Node *node);
+ /// Visit the given \a node.
+ void accept(AST::Node *node);
- /// Returns the original unchanged source code.
- QString code() const { return _code; }
+ /// Returns the original unchanged source code.
+ QString code() const { return _code; }
- /// Returns the list of replacements.
- QList<Replacement> replacementList() const { return _replacementList; }
+ /// Returns the list of replacements.
+ QList<Replacement> replacementList() const { return _replacementList; }
protected:
- /// \internal
- void setCode(const QString &code) { _code = code; }
+ /// \internal
+ void setCode(const QString &code) { _code = code; }
private:
- QString _code;
- QList<Replacement> _replacementList;
+ QString _code;
+ QList<Replacement> _replacementList;
};
} // end of namespace JavaScript