X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/5d73144067d7b53112cbfd1bd5995f1b5063ef50..3204049e31e71c30d0dddf7cae8738c289dbd104:/src/output.c?ds=sidebyside diff --git a/src/output.c b/src/output.c index a7003edf..31bfd12d 100644 --- a/src/output.c +++ b/src/output.c @@ -408,12 +408,23 @@ symbol_definitions_output (FILE *out) { symbol *sym = symbols[i]; const char *key; + const char *value; #define SET_KEY(Entry) \ obstack_fgrow2 (&format_obstack, "symbol(%d, %s)", i, Entry); \ obstack_1grow (&format_obstack, 0); \ key = obstack_finish (&format_obstack); + // Whether the symbol has an identifier. + value = symbol_id_get (sym); + SET_KEY("has_id"); + MUSCLE_INSERT_INT (key, !!value); + + // Its identifier. + SET_KEY("id"); + MUSCLE_INSERT_STRING (key, value ? value : ""); + + // Its tag. Typically for documentation purpose. SET_KEY("tag"); MUSCLE_INSERT_STRING (key, sym->tag); @@ -427,10 +438,10 @@ symbol_definitions_output (FILE *out) SET_KEY("number"); MUSCLE_INSERT_INT (key, sym->number); - SET_KEY("has_type_name"); + SET_KEY("has_type"); MUSCLE_INSERT_INT (key, !!sym->type_name); - SET_KEY("type_name"); + SET_KEY("type"); MUSCLE_INSERT_STRING (key, sym->type_name ? sym->type_name : ""); #undef SET_KEY