-#define CODE_PROP(PropName) \
- do { \
- code_props const *p = symbol_code_props_get (sym, PropName); \
- SET_KEY("has_" #PropName); \
- MUSCLE_INSERT_INT (key, !!p->code); \
- \
- if (p->code) \
- { \
- SET_KEY(#PropName "_file"); \
- MUSCLE_INSERT_STRING (key, p->location.start.file); \
- \
- SET_KEY(#PropName "_line"); \
- MUSCLE_INSERT_INT (key, p->location.start.line); \
- \
- SET_KEY(#PropName); \
- MUSCLE_INSERT_STRING_RAW (key, p->code); \
- } \
- } while (0)
-
- CODE_PROP(destructor);
- CODE_PROP(printer);
-#undef CODE_PROP
+ {
+ int j;
+ for (j = 0; j < CODE_PROPS_SIZE; ++j)
+ {
+ /* "printer", not "%printer". */
+ char const *pname = code_props_type_string (j) + 1;
+ code_props const *p = symbol_code_props_get (sym, j);
+ SET_KEY2("has", pname);
+ MUSCLE_INSERT_INT (key, !!p->code);
+
+ if (p->code)
+ {
+ SET_KEY2(pname, "file");
+ MUSCLE_INSERT_STRING (key, p->location.start.file);
+
+ SET_KEY2(pname, "line");
+ MUSCLE_INSERT_INT (key, p->location.start.line);
+
+ SET_KEY(pname);
+ MUSCLE_INSERT_STRING_RAW (key, p->code);
+ }
+ }
+ }
+#undef SET_KEY2