arras-energy / gridlabd

Arras Energy simulator
https://www.arras.energy/
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

#include () fails when output includes macros and comments #116

Closed dchassin closed 1 year ago

dchassin commented 1 year ago

Problem description

When the included GLM from a #include () macro contains macros or comments, the GLM compile fails.

Steps to reproduce

File test.glm:

#include (echo "#print test")

Shell:

gridlabd test.glm

Output:

/tmp/test.glm(1): syntax error at '#print test...'

Expected behavior

Output:

/tmp/test.glm(1): test

System information

Workaround

Replace #include (COMMAND) with

#exec COMMAND > tmpfile.glm
#include "tmpfile.glm"