build administrativa
[m6w6/ext-psi] / src / types / decl_enum.c
index df353398d2acface6ebaf3d0291292ff7af371c7..d76bb1ca0260d0d8f94a068a174c7e61c77d651c 100644 (file)
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *******************************************************************************/
 
-#include "php_psi_stdinc.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "php_config.h"
+#endif
 #include "data.h"
 
 struct psi_decl_enum *psi_decl_enum_init(zend_string *name, struct psi_plist *l)
@@ -51,13 +55,15 @@ void psi_decl_enum_free(struct psi_decl_enum **e_ptr)
 
 void psi_decl_enum_dump(struct psi_dump *dump, struct psi_decl_enum *e, unsigned level)
 {
-       bool is_anon = psi_decl_type_is_anon(e->name, "enum");
-       PSI_DUMP(dump, "enum %s%s%s {\n",
-                       is_anon ? "/* ":"", e->name->val, is_anon ? " */":"");
-       if (e->items) {
-               size_t i = 0;
-               struct psi_decl_enum_item *item;
+       size_t i = 0;
+       struct psi_decl_enum_item *item;
 
+       PSI_DUMP(dump, "enum ");
+       if (!psi_decl_type_is_anon(e->name, "enum")) {
+               PSI_DUMP(dump, "%s ", e->name->val);
+       }
+       if (e->items) {
+               PSI_DUMP(dump, "{\n");
                while (psi_plist_get(e->items, i++, &item)) {
                        if (i > 1) {
                                PSI_DUMP(dump, ",\n");
@@ -65,8 +71,8 @@ void psi_decl_enum_dump(struct psi_dump *dump, struct psi_decl_enum *e, unsigned
                        PSI_DUMP(dump, "%s", psi_t_indent(level + 1));
                        psi_decl_enum_item_dump(dump, item);
                }
+               PSI_DUMP(dump, "%s\n} ", psi_t_indent(level));
        }
-       PSI_DUMP(dump, "\n}");
 }
 
 bool psi_decl_enum_validate(struct psi_data *data, struct psi_decl_enum *e)