Browse Source

HPCC-18000 Do not require macro parameters when syntax checking

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 years ago
parent
commit
d9a8b9b44d
2 changed files with 33 additions and 1 deletions
  1. 1 1
      ecl/hql/hqlutil.cpp
  2. 32 0
      ecl/regress/issue18000.eclxml

+ 1 - 1
ecl/hql/hqlutil.cpp

@@ -9086,7 +9086,7 @@ IHqlExpression * expandMacroDefinition(IHqlExpression * expr, HqlLookupContext &
 static IHqlExpression * transformAttributeToQuery(IHqlExpression * expr, HqlLookupContext & ctx, bool syntaxCheck)
 {
     if (expr->isMacro())
-        return expandMacroDefinition(expr, ctx, true);
+        return expandMacroDefinition(expr, ctx, !syntaxCheck);
 
     if (expr->isFunction())
     {

+ 32 - 0
ecl/regress/issue18000.eclxml

@@ -0,0 +1,32 @@
+<Archive build="community_6.4.0-rc6Debug"
+         eclVersion="6.4.0"
+         legacyImport="0"
+         legacyWhen="0">
+ <Query attributePath="_local_directory_.issue18000"/>
+ <Option name="syntaxCheck" value="1"/>
+ <Module key="_local_directory_" name="_local_directory_">
+  <Attribute key="issue18000" name="issue18000" sourcePath="issue18000.ecl">
+   /*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2017 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+
+export issue18000(AttrName,FirstArg,SecondArg) := MACRO
+    AttrName := FirstArg + SecondArg;
+ENDMACRO;
+  </Attribute>
+ </Module>
+</Archive>