Skip to content

Commit

Permalink
Correct empty maps in ExplicitValueVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Nov 27, 2023
1 parent 3f58969 commit 5cf18cc
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import com.fujitsu.vdmj.values.Value;

/**
* This visitor produces a toString of a value, with any named types expanded
* to be explicit if they are not within the current module.
* This visitor produces a toString of a value, with any record values expanded
* to be explicit (like mk_A`R) if they are not within the "from" module.
*/
public class ExplicitValueVisitor extends ValueVisitor<String, LexLocation>
{
Expand All @@ -48,6 +48,11 @@ public String caseValue(Value node, LexLocation arg)

public String caseMapValue(MapValue node, LexLocation from)
{
if (node.values.isEmpty())
{
return "{|->}";
}

StringBuilder sb = new StringBuilder();
sb.append("{");
String prefix = "";
Expand Down

0 comments on commit 5cf18cc

Please sign in to comment.