Browse Source

HPCC-15767 Final final changes taken from branch

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 9 years ago
parent
commit
2ee8e05000
4 changed files with 13 additions and 10 deletions
  1. 4 4
      ecl/hql/hqlexpr.cpp
  2. 1 0
      ecl/hql/hqlgram.y
  3. 1 1
      ecl/hql/hqlthql.cpp
  4. 7 5
      ecl/hqlcpp/hqlwcpp.cpp

+ 4 - 4
ecl/hql/hqlexpr.cpp

@@ -150,7 +150,8 @@ Different impure modifiers
   E.g., Some PIPE/SOAPCALLs, external function calls.
   A first step towards introducing a cost() function - where costly = cost(+inf)
 - EFFECT indicates the expression may have a side-effect.  The side-effect is tied to the expression that it is
-  associated with.  This only really has implications for ordering, which we currently make no guarantees about.
+  associated with.  It would have implications for ordering, which we currently make no guarantees about.  Also,
+  EVALUATE(EFFECT) should be forced to evaluate, rather than being optimized away.
 
 Pseudo modifier:
 - once [ Implies pure,fold(false) ]
@@ -10280,7 +10281,7 @@ IHqlExpression *CHqlSequence::clone(HqlExprArray &newkids)
 
 StringBuffer &CHqlSequence::toString(StringBuffer &ret)
 {
-    return ret.append(name);
+    return ret.append(name).append(":").append(seq);
 }
 
 //==============================================================================================================
@@ -10351,6 +10352,7 @@ CHqlExternalCall::CHqlExternalCall(IHqlExpression * _funcdef, ITypeInfo * _type,
         infoFlags |= (HEFnoduplicate);
     }
 
+    //Special case built in context functions for backward compatibility
     if (body->hasAttribute(ctxmethodAtom))
     {
         StringBuffer entrypoint;
@@ -11657,8 +11659,6 @@ IHqlExpression * ParameterBindTransformer::createExpandedCall(IHqlExpression * c
 {
     HqlExprArray actuals;
     unwindChildren(actuals, call);
-    while (actuals.ordinality() && actuals.tos().isAttribute())
-        actuals.pop();
 
     IHqlExpression * funcdef = call->queryBody()->queryFunctionDefinition();
     return createExpandedCall(funcdef, actuals);

+ 1 - 0
ecl/hql/hqlgram.y

@@ -3994,6 +3994,7 @@ functionModifiers
     :                   {   $$.setNullExpr(); }
     | VOLATILE          {   $$.setExpr(createAttribute(volatileAtom), $1); }
     ;
+
 service
     : startService funcDefs END
                         {

+ 1 - 1
ecl/hql/hqlthql.cpp

@@ -1456,7 +1456,7 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
                 for (unsigned idx = 0; idx < kids; idx++)
                 {
                     IHqlExpression *child = expr->queryChild(idx);
-                    if (!child->isAttribute())
+                    if (expandProcessed || !child->isAttribute())
                     {
                         if (!first)
                             s.append(", ");

+ 7 - 5
ecl/hqlcpp/hqlwcpp.cpp

@@ -1191,24 +1191,26 @@ StringBuffer & HqlCppWriter::generateExprCpp(IHqlExpression * expr)
                 else
                     out.append(str(funcdef->queryBody()->queryId()));
                 out.append('(');
+
+                bool needComma = false;
                 if (functionBodyUsesContext(props))
                 {
                     out.append("ctx");
-                    if (numArgs)
-                        out.append(',');
+                    needComma = true;
                 }
                 else if (props->hasAttribute(globalContextAtom))
                 {
                     out.append("gctx");
-                    if (numArgs)
-                        out.append(',');
+                    needComma = true;
                 }
                 for (unsigned index = firstArg; index < numArgs; index++)
                 {
                     IHqlExpression * cur = expr->queryChild(index);
                     if (!cur->isAttribute())
                     {
-                        if (index != firstArg) out.append(',');
+                        if (needComma)
+                            out.append(',');
+                        needComma = true;
                         generateExprCpp(cur);
                     }
                 }