aboutsummaryrefslogtreecommitdiff
path: root/lpprint.c
diff options
context:
space:
mode:
authorSérgio Queiroz <sqmedeiros@gmail.com>2017-12-18 15:39:00 -0300
committerSérgio Queiroz <sqmedeiros@gmail.com>2017-12-18 15:39:00 -0300
commitc6b98103f0ab2c4afb7216e73f2eacac58cbf952 (patch)
treea98bef21fff8702c66deac2315a6a10d7d1c26df /lpprint.c
parent4bdf8d40a9ca5f00e454a38d301a3ab35c9b50d5 (diff)
downloadlpeglabel-c6b98103f0ab2c4afb7216e73f2eacac58cbf952.tar.gz
lpeglabel-c6b98103f0ab2c4afb7216e73f2eacac58cbf952.tar.bz2
lpeglabel-c6b98103f0ab2c4afb7216e73f2eacac58cbf952.zip
Updating code to use the new syntax/semantics of labels
Diffstat (limited to 'lpprint.c')
-rw-r--r--lpprint.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/lpprint.c b/lpprint.c
index 342a2b6..8d5e087 100644
--- a/lpprint.c
+++ b/lpprint.c
@@ -111,11 +111,6 @@ void printinst (const Instruction *op, const Instruction *p) {
111 printf("%d", p->i.aux); 111 printf("%d", p->i.aux);
112 break; 112 break;
113 } 113 }
114 case IRecov: case ILabChoice: { /* labeled failure */
115 printjmp(op, p);
116 printcharset((p+2)->buff);
117 break;
118 }
119 default: break; 114 default: break;
120 } 115 }
121 printf("\n"); 116 printf("\n");
@@ -217,16 +212,15 @@ void printtree (TTree *tree, int ident) {
217 break; 212 break;
218 } 213 }
219 case TThrow: { /* labeled failure */ 214 case TThrow: { /* labeled failure */
215 if (tree->u.s.ps != 0)
216 assert(sib2(tree)->tag == TRule);
217 printf(" key: %d (rule: %d)\n", tree->key, sib2(tree)->cap);
220 printf(" labels: %d\n", tree->u.label); 218 printf(" labels: %d\n", tree->u.label);
221 break; 219 break;
222 } 220 }
223 default: { 221 default: {
224 int sibs = numsiblings[tree->tag]; 222 int sibs = numsiblings[tree->tag];
225 printf("\n"); 223 printf("\n");
226 if (tree->tag == TRecov || tree->tag == TLabChoice) { /* labeled failure */
227 printcharset(treelabelset(tree));
228 printf("\n");
229 }
230 if (sibs >= 1) { 224 if (sibs >= 1) {
231 printtree(sib1(tree), ident + 2); 225 printtree(sib1(tree), ident + 2);
232 if (sibs >= 2) 226 if (sibs >= 2)