summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlrewrite.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-07-24 04:15:06 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2009-07-24 04:15:06 (GMT)
commit60cd50b800b6e6cf185df170c1b2cb41108a82b6 (patch)
treeb8995d6668d5f3a4f03bd31745f1be03a0da4080 /src/declarative/qml/qmlrewrite.cpp
parente6f14d21fa03d4301fcb7d7de1733bc65fe59e43 (diff)
downloadQt-60cd50b800b6e6cf185df170c1b2cb41108a82b6.zip
Qt-60cd50b800b6e6cf185df170c1b2cb41108a82b6.tar.gz
Qt-60cd50b800b6e6cf185df170c1b2cb41108a82b6.tar.bz2
Removed support for CSS-like literals.
Diffstat (limited to 'src/declarative/qml/qmlrewrite.cpp')
-rw-r--r--src/declarative/qml/qmlrewrite.cpp53
1 files changed, 1 insertions, 52 deletions
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp
index 02bf8fa..c708418 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qmlrewrite.cpp
@@ -61,7 +61,7 @@ void RewriteBinding::accept(AST::Node *node)
AST::Node::acceptChild(node, this);
}
-QString RewriteBinding::rewrite(QString code, unsigned position,
+QString RewriteBinding::rewrite(QString code, unsigned position,
AST::Statement *node)
{
TextWriter w;
@@ -101,57 +101,6 @@ bool RewriteBinding::visit(AST::ExpressionStatement *ast)
return false;
}
-bool RewriteBinding::visit(AST::NumericLiteral *node)
-{
- if (node->suffix != AST::NumericLiteral::noSuffix) {
- const int suffixLength = AST::NumericLiteral::suffixLength[node->suffix];
- const char *suffixSpell = AST::NumericLiteral::suffixSpell[node->suffix];
- QString pre;
- pre += QLatin1String("qmlNumberFrom");
- pre += QChar(QLatin1Char(suffixSpell[0])).toUpper();
- pre += QLatin1String(&suffixSpell[1]);
- pre += QLatin1Char('(');
- _writer->replace(node->literalToken.begin() - _position, 0, pre);
- _writer->replace(node->literalToken.end() - _position - suffixLength,
- suffixLength,
- QLatin1String(")"));
- }
-
- return false;
-}
-
-QString RewriteNumericLiterals::operator()(QString code, unsigned position, AST::Node *node)
-{
- TextWriter w;
- _writer = &w;
- _position = position;
-
- AST::Node::acceptChild(node, this);
-
- w.write(&code);
-
- return code;
-}
-
-bool RewriteNumericLiterals::visit(AST::NumericLiteral *node)
-{
- if (node->suffix != AST::NumericLiteral::noSuffix) {
- const int suffixLength = AST::NumericLiteral::suffixLength[node->suffix];
- const char *suffixSpell = AST::NumericLiteral::suffixSpell[node->suffix];
- QString pre;
- pre += QLatin1String("qmlNumberFrom");
- pre += QChar(QLatin1Char(suffixSpell[0])).toUpper();
- pre += QLatin1String(&suffixSpell[1]);
- pre += QLatin1Char('(');
- _writer->replace(node->literalToken.begin() - _position, 0, pre);
- _writer->replace(node->literalToken.end() - _position - suffixLength,
- suffixLength,
- QLatin1String(")"));
- }
-
- return false;
-}
-
} // namespace QmlRewrite
QT_END_NAMESPACE