Preprocessor
The preprocessor edits files before they go to the LIGO compiler.
The JsLIGO compiler no longer supports preprocessor directives.
Instead of using the
#includeor#importdirectives, import namespaces in other files directly with theimportkeyword as described in Importing and using classes or Importing namespaces.The
#if,#else,#elif,#endif,#define,#undef, and#errordirectives are no longer supported. If you need to continue using them, you can run your JsLIGO code through a C++ preprocessor, which uses the same syntax. JsLIGO code with these directives does not compile.
Viewing the preprocessor output
It's rarely necessary to view the output of the preprocessor, but if you need to see the output to debug directives, you can view the output with the ligo print preprocessed command, as in this example: