Skip to content

Commit

Permalink
Fix line adjustment logic for federated programs.
Browse files Browse the repository at this point in the history
It is bad that I had to modify ToLf to do this since the logic isn't
really in ToLf. The problem was that the line adjustment relies on
tagging the target code (without the fat braces), and the target code is
not recorded separately from the fat braces if they are entered into the
MalleableString machinery as all one string.
  • Loading branch information
petervdonovan committed May 21, 2023
1 parent 3d51b1b commit c44f91e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion org.lflang/src/org/lflang/ast/ToLf.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ public MalleableString caseCode(Code code) {
.map(String::stripTrailing)
.collect(Collectors.joining("\n"));
MalleableString singleLineRepresentation =
MalleableString.anyOf(String.format("{= %s =}", content.strip()));
new Builder()
.append("{= ")
.append(content.strip())
.append(" =}")
.get();
MalleableString multilineRepresentation =
new Builder()
.append(String.format("{=%n"))
Expand Down

0 comments on commit c44f91e

Please sign in to comment.