From 0e1824475e2e7aee09dd2d5c38fc4ebd4b7ab8bb Mon Sep 17 00:00:00 2001 From: Elise Lennion Date: Mon, 19 Dec 2016 19:11:04 -0300 Subject: expression: Show the base which pre-defined constants are displayed so the user know how we express it. The base was added to all symbol tables, which are associated with datatype->sym_tbl, so they are displayed in the right base. Signed-off-by: Elise Lennion Signed-off-by: Pablo Neira Ayuso --- src/expression.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/expression.c') diff --git a/src/expression.c b/src/expression.c index 2aada77d..b7403c70 100644 --- a/src/expression.c +++ b/src/expression.c @@ -114,7 +114,11 @@ void expr_describe(const struct expr *expr) printf("\n"); if (expr->dtype->sym_tbl != NULL) { - printf("\npre-defined symbolic constants:\n"); + printf("\npre-defined symbolic constants "); + if (expr->dtype->sym_tbl->base == BASE_DECIMAL) + printf("(in decimal):\n"); + else + printf("(in hexadecimal):\n"); symbol_table_print(expr->dtype->sym_tbl, expr->dtype, expr->byteorder); } -- cgit v1.2.3