fix literal parser to go through all applicable
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 15 Nov 2010 07:41:00 +0000 (07:41 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Mon, 15 Nov 2010 07:41:00 +0000 (07:41 +0000)
git-svn-id: https://silmor.de/svn/softmagic/elam/trunk@629 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/elamengine.cpp

index d622a3f..00a4f87 100644 (file)
@@ -268,10 +268,16 @@ QPair< QString, QVariant > Engine::parseLiteral ( QString ex, int start)
                        cand<<d->parsers[i];
        if(cand.size()<1)
                return QPair<QString,QVariant>();
-       //sort them
+       //sort them (highest prio first)
        qSort(cand);
        //execute
-       return cand[0].parser(ex,*this,start);
+       for(int i=0;i<cand.size();i++){
+               QPair< QString, QVariant >r=cand[0].parser(ex,*this,start);
+               if(r.first.size()>0)
+                       return r;
+       }
+       //failure
+       return QPair< QString, QVariant >();
 }