Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 527

infinite include loop in jq. Two modules that need each other and one of them by a third

$
0
0

I have 2 modules that will convert code into strings, module1.jq and module2.jq

module1 converts the code of obj1 that have this form{ "code1":"254", "Object2s":[ {Object2}, {Object2} ] }

module2 converts the code of obj2 that have this form{ "code1":"574", "Object1s":[ {Object1}, {Object1} ] }

As you can see, both object include each other, so in module1 it will be a statementinclude "module2";and in module2 there will be an statementinclude "module1";

when using either of the modules, you´ll get an infinite loop.

module3.jqinclude "module1";

How can stop this from happening?

Any help will be apreciated

I try to define kind of variables unique for each module and go likeIn module1.jq$module_module1 = 1;if $module_module2 == 0 then include "module2";

In module2$module_module2 = 1;if $module_module1 == 0 then include "module1";

but it did not work.


Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>