Skip to content

Commit

Permalink
Merge pull request #1737 from lf-lang/strip-correspondences-c
Browse files Browse the repository at this point in the history
Clean `Correspondence` tags out of generated C code
  • Loading branch information
petervdonovan authored May 15, 2023
2 parents 1a3c073 + 749e332 commit 9fa0357
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
import static org.lflang.ASTUtils.allPorts;
import static org.lflang.ASTUtils.allReactions;
import static org.lflang.ASTUtils.allStateVars;
import static org.lflang.ASTUtils.convertToEmptyListIfNull;
import static org.lflang.ASTUtils.getInferredType;
import static org.lflang.ASTUtils.isInitialized;
import static org.lflang.ASTUtils.toDefinition;
Expand All @@ -51,6 +50,7 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
import org.eclipse.xtext.xbase.lib.StringExtensions;

import org.lflang.ASTUtils;
import org.lflang.generator.CodeMap;
import org.lflang.generator.DockerComposeGenerator;
import org.lflang.FileConfig;
import org.lflang.Target;
Expand Down Expand Up @@ -1029,10 +1029,10 @@ private void generateReactorClass(Reactor reactor) throws IOException {
generateUserPreamblesForReactor(reactor, src);
generateReactorClassBody(reactor, header, src);
header.pr("#endif // " + guardMacro);
FileUtil.writeToFile(header.toString(), fileConfig.getSrcGenPath().resolve(headerName), true);
FileUtil.writeToFile(CodeMap.fromGeneratedCode(header.toString()).getGeneratedCode(), fileConfig.getSrcGenPath().resolve(headerName), true);
var extension = targetConfig.platformOptions.platform == Platform.ARDUINO ? ".ino" :
CCppMode ? ".cpp" : ".c";
FileUtil.writeToFile(src.toString(), fileConfig.getSrcGenPath().resolve(CUtil.getName(reactor) + extension), true);
FileUtil.writeToFile(CodeMap.fromGeneratedCode(src.toString()).getGeneratedCode(), fileConfig.getSrcGenPath().resolve(CUtil.getName(reactor) + extension), true);
}

protected void generateReactorClassHeaders(Reactor reactor, String headerName, CodeBuilder header, CodeBuilder src) {
Expand Down

0 comments on commit 9fa0357

Please sign in to comment.