@@ -196,6 +196,34 @@ private static void generateSingleBitSet(final List<Token> tokens, final OutputM
196
196
197
197
writer .append ("}\n " );
198
198
}
199
+
200
+ try (Writer writer = outputManager .createOutput (setType + " bit set debug" ))
201
+ {
202
+ indent (writer , 0 , "impl core::fmt::Debug for %s {\n " , setType );
203
+ indent (writer , 1 , "fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {\n " );
204
+ indent (writer , 2 , "write!(fmt, \" %s[" , setType );
205
+
206
+ final StringBuilder string = new StringBuilder ();
207
+ final StringBuilder arguments = new StringBuilder ();
208
+ for (final Token token : tokens )
209
+ {
210
+ if (Signal .CHOICE != token .signal ())
211
+ {
212
+ continue ;
213
+ }
214
+
215
+ final String choiceName = formatMethodName (token .name ());
216
+ final String choiceBitIndex = token .encoding ().constValue ().toString ();
217
+
218
+ string .append (choiceName + "(" + choiceBitIndex + ")={}," );
219
+ arguments .append ("self.get_" + choiceName + "()," );
220
+ }
221
+
222
+ writer .append (string .toString () + "]\" ,\n " );
223
+ indent (writer , 3 , arguments .toString () + ")\n " );
224
+ indent (writer , 1 , "}\n " );
225
+ writer .append ("}\n " );
226
+ }
199
227
}
200
228
201
229
private static void generateMessageEncoder (
0 commit comments