[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/bindings/smokegenerator
From:       Arno Rehn <kde () arnorehn ! de>
Date:       2009-05-31 20:56:05
Message-ID: 1243803365.740784.6436.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 976089 by arnorehn:

there are easier ways to check whether a type is
an integral type


 M  +1 -11     generatorvisitor.cpp  
 M  +0 -1      generatorvisitor.h  


--- trunk/playground/bindings/smokegenerator/generatorvisitor.cpp #976088:976089
@@ -57,15 +57,6 @@
     return ret;
 }
 
-inline
-bool GeneratorVisitor::isIntegralType(const QStringList& type)
-{
-    static QRegExp exp1("((un)?signed\\s+)?(short|int|long|long long|char)");
-    static QRegExp exp2("(bool|float|double|void)");
-    QString str = type.join(" ");
-    return exp1.exactMatch(str) || exp2.exactMatch(str);
-}
-
 // TODO: this might have to be improved for cases like 'Typedef::Nested foo'
 QPair<Class*, Typedef*> GeneratorVisitor::resolveType(const QString & name)
 {
@@ -407,8 +398,7 @@
 void GeneratorVisitor::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST* node)
 {
     tc->run(node);
-    // the method returns void - we don't need to create a new type for that
-    if (isIntegralType(tc->qualifiedName())) {
+    if (node->integrals) {
         currentType = Type(tc->qualifiedName().join(" "), tc->isConstant(), tc->isVolatile());
         createType = true;
         DefaultVisitor::visitSimpleTypeSpecifier(node);
--- trunk/playground/bindings/smokegenerator/generatorvisitor.h #976088:976089
@@ -39,7 +39,6 @@
 protected:
     inline const Token& token(std::size_t token) { return m_session->token_stream->token(token); }
     QPair<bool, bool> parseCv(const ListNode<std::size_t> *cv);
-    bool isIntegralType(const QStringList& type);
     QPair<Class*, Typedef*> resolveType(const QString& name);
 
     virtual void visitAccessSpecifier(AccessSpecifierAST* node);

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic