diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ct.c | 13 | ||||
-rw-r--r-- | src/parser_bison.y | 6 |
2 files changed, 9 insertions, 10 deletions
@@ -209,19 +209,18 @@ static void ct_expr_print(const struct expr *expr) { const struct symbolic_constant *s; - printf("ct %s", ct_templates[expr->ct.key].token); - + printf("ct "); if (expr->ct.direction < 0) - return; + goto done; for (s = ct_dir_tbl.symbols; s->identifier != NULL; s++) { if (expr->ct.direction == (int) s->value) { - printf(" %s", s->identifier); - return; + printf("%s ", s->identifier); + break; } } - - printf(" %d", expr->ct.direction); + done: + printf("%s", ct_templates[expr->ct.key].token); } static bool ct_expr_cmp(const struct expr *e1, const struct expr *e2) diff --git a/src/parser_bison.y b/src/parser_bison.y index fcf84b9a..ca9b757a 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2252,18 +2252,18 @@ ct_expr : CT ct_key { $$ = ct_expr_alloc(&@$, $2, -1); } - | CT ct_key_dir STRING + | CT STRING ct_key_dir { struct error_record *erec; int8_t direction; - erec = ct_dir_parse(&@$, $3, &direction); + erec = ct_dir_parse(&@$, $2, &direction); if (erec != NULL) { erec_queue(erec, state->msgs); YYERROR; } - $$ = ct_expr_alloc(&@$, $2, direction); + $$ = ct_expr_alloc(&@$, $3, direction); } ; |