From 5cc11088848a7884980bc00a96c9f3189e6de505 Mon Sep 17 00:00:00 2001 From: Sergio Medeiros Date: Thu, 30 Oct 2014 16:29:35 -0300 Subject: Updating printree --- lpprint.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lpprint.c b/lpprint.c index 03239fd..0730ca9 100644 --- a/lpprint.c +++ b/lpprint.c @@ -165,7 +165,8 @@ static const char *tagnames[] = { "not", "and", "call", "opencall", "rule", "grammar", "behind", - "capture", "run-time" + "capture", "run-time", + "throw", "labeled-choice" /* labeled failure */ }; @@ -193,7 +194,7 @@ void printtree (TTree *tree, int ident) { } case TBehind: { printf(" %d\n", tree->u.n); - printtree(sib1(tree), ident + 2); + printtree(sib1(tree), ident + 2); break; } case TCapture: { @@ -215,9 +216,16 @@ void printtree (TTree *tree, int ident) { } assert(rule->tag == TTrue); /* sentinel */ break; + } + case TThrow: { /* labeled failure */ + printf(" labels: %d\n", tree->labels); + break; } default: { int sibs = numsiblings[tree->tag]; + if (tree->tag == TLabChoice) { /* labeled failure */ + printf(" labels: %d\n", tree->labels); + } printf("\n"); if (sibs >= 1) { printtree(sib1(tree), ident + 2); -- cgit v1.2.3-55-g6feb