Fri Aug 17, 2018 11:09 pm
Login Register Lost Password? Contact Us


Macro syntax check oddities

Comments and questions related to the Enterprise Control Language

Fri Oct 20, 2017 10:07 am Change Time Zone

Hi,

We recently upgraded from 6.0.2. to 6.4.2 and noticed that one of the changes is that macros are now syntax checked. We realized because we have a script that runs a syntax check on every file in the folder, and it started failing when syntax checking macros. I am, however, unsure what the correct approach should be and also there is some odd behavior. Here is an example:

Open a new builder, write
Code: Select all
EXPORT A := MACRO
    x := Files.LoadFile();
ENDMACRO;


and hit F7 -> No Errors...

Now save the file as A.ecl, hit F7 -> Error 'Unknown identifier “Files”'. I find this odd, because the fact that it is saved or not should not affect the syntax check?

Then, change the code by adding a random parameter:

Code: Select all
EXPORT A(b) := MACRO
    x := Files.LoadFile();
ENDMACRO;


F7 -> No Errors... - This is also odd, as the parameter does not change anything, but causes it to pass syntax check.

Finally, changing the code to

Code: Select all
EXPORT A := MODULE
    EXPORT A1 := MACRO
        x := Files.LoadFile();
        sdfgdsfdsaf THIS SHOULD REALLY NOT PASS!!!!
    ENDMACRO;
END;


F7 -> No Errors... So, just wrapping it in a module makes the syntax check pass (even if I add some nonsense).

So, what is the recommended approach here? If I leave the macros as they were (with no parameters for instance), they fail the syntax check even though they are fine at the point of extraction and work fine. If I add any(!) parameter or just wrap them in a module, then they pass the syntax check even if they are completely wrong (which kind of beats the point of syntax check)? What am I missing here?

Thanks

Nemanja
NP
 
Posts: 11
Joined: Fri Mar 24, 2017 1:13 pm

Fri Oct 20, 2017 2:52 pm Change Time Zone

Nemanja,

Good job!! This is a perfect bug report. Now you just need to copy/paste it all into a JIRA ticket for the developers to track and fix. :)

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1370
Joined: Wed Oct 26, 2011 7:40 pm

Tue Oct 24, 2017 4:58 pm Change Time Zone

NP
 
Posts: 11
Joined: Fri Mar 24, 2017 1:13 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron