Skip to content

Commit b74ce35

Browse files
committed
Mark empty flags as well as locations and blocks
1 parent 4219186 commit b74ce35

File tree

461 files changed

+1522
-1521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+1522
-1521
lines changed

templates/lib/yarp/node.rb.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ module YARP
126126
inspector << "<%= pointer %><%= field.name %>: #{<%= field.name %>.inspect}\n"
127127
<%- when YARP::FlagsField -%>
128128
<%- flag = flags.find { |flag| flag.name == field.kind }.tap { |flag| raise unless flag } -%>
129-
inspector << "<%= pointer %><%= field.name %>: #{[<%= flag.values.map { |value| "(\"#{value.name.downcase}\" if #{value.name.downcase}?)" }.join(", ") %>].compact.join(", ")}\n"
129+
flags = [<%= flag.values.map { |value| "(\"#{value.name.downcase}\" if #{value.name.downcase}?)" }.join(", ") %>].compact
130+
inspector << "<%= pointer %><%= field.name %>: #{flags.empty? ? "∅" : flags.join(", ")}\n"
130131
<%- when YARP::LocationField, YARP::OptionalLocationField -%>
131132
inspector << "<%= pointer %><%= field.name %>: #{inspector.location(<%= field.name %>)}\n"
132133
<%- else -%>

test/yarp/snapshots/arithmetic.txt

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/yarp/snapshots/arrays.txt

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/yarp/snapshots/begin_ensure.txt

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)