diff options
-rw-r--r-- | mixlib/mix_symbol_table.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/mixlib/mix_symbol_table.c b/mixlib/mix_symbol_table.c index 7f3c4df..36c15a9 100644 --- a/mixlib/mix_symbol_table.c +++ b/mixlib/mix_symbol_table.c @@ -19,7 +19,7 @@ * */ - +#include <ctype.h> /* isdigit */ #include "mix_symbol_table.h" /* Create an empty table */ @@ -111,20 +111,31 @@ mix_symbol_table_is_defined(const mix_symbol_table_t *table, const gchar *sym) } /* Print table */ +#define is_local_sym_(sym) \ + ((sym) && (strlen(sym)==2) && (sym[1] == 'B') && isdigit(sym[0])) + static void print_sym_rows_(gpointer symbol, gpointer value, gpointer file) { - mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); - fprintf((FILE *)file, "%s: %s%ld\n", (gchar *)symbol, - mix_word_is_negative(word)? "-":"", mix_word_magnitude(word)); + char *s = (char *)symbol; + if (!is_local_sym_(s)) { + mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); + fprintf((FILE *)file, "%s: %s%ld\n", s, + mix_word_is_negative(word)? "-":"", + mix_word_magnitude(word)); + } } static void print_sym_line_(gpointer symbol, gpointer value, gpointer file) { - mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); - fprintf((FILE *)file, ",%s =%s%ld", (gchar *)symbol, - mix_word_is_negative(word)? "-":"", mix_word_magnitude(word)); + char *s = (char *)symbol; + if (!is_local_sym_(s)) { + mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); + fprintf((FILE *)file, ",%s =%s%ld", s, + mix_word_is_negative(word)? "-":"", + mix_word_magnitude(word)); + } } void |