Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e2d266

Browse files
committed
improve YAMLMapping printing
1 parent 1b908ce commit 3e2d266

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

javascript/ql/src/semmle/javascript/PrintAst.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,11 @@ module PrintYAML {
573573

574574
YAMLMappingMapNode() { this = TYAMLMappingNode(mapping, i) }
575575

576-
override string toString() { result = "(Mapping " + i + ")" }
576+
override string toString() {
577+
result = "(Mapping " + i + ")" and not exists(mapping.getKeyNode(i).(YAMLScalar).getValue())
578+
or
579+
result = "(Mapping " + i + ") " + mapping.getKeyNode(i).(YAMLScalar).getValue() + ":"
580+
}
577581

578582
/**
579583
* Holds if this print node represents the `index`th mapping of `m`.

0 commit comments

Comments
 (0)