]> ocean-lang.org Git - ocean/commitdiff
parsergen: change 'again' to 'check_again'.
authorNeilBrown <neil@brown.name>
Fri, 5 Mar 2021 09:11:04 +0000 (20:11 +1100)
committerNeilBrown <neil@brown.name>
Wed, 10 Mar 2021 01:00:30 +0000 (12:00 +1100)
Sometimes I use 'again', sometimes 'check_again'.
Change all to use 'check_again'.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index e0a2167ef1eecf41936c4762d8935bd464190e86..86aa299fff058d07a9e562a21d006f9ccb2c1cf6 100644 (file)
@@ -1097,10 +1097,10 @@ combine these two functions into a single loop.
 
 ###### follow code
 
-       for (again = 0, p = 0;
+       for (check_again = 0, p = 0;
             p < g->production_count;
             p < g->production_count-1
-               ? p++ : again ? (again = 0, p = 0)
+               ? p++ : check_again ? (check_again = 0, p = 0)
                              : p++) {
                struct production *pr = g->productions[p];
                int b;
@@ -1111,7 +1111,7 @@ combine these two functions into a single loop.
                                break;
                        if (symset_union(&g->follow[bs->num],
                                         &g->follow[pr->head->num]))
-                               again = 1;
+                               check_again = 1;
                        if (!bs->nullable)
                                break;
                }
@@ -1126,7 +1126,7 @@ complete function.
 ###### functions
        static void build_follow(struct grammar *g)
        {
-               int s, again, p;
+               int s, check_again, p;
                g->follow = calloc(g->num_syms, sizeof(g->follow[0]));
                for (s = 0; s < g->num_syms; s++)
                        g->follow[s] = INIT_SYMSET;
@@ -1407,7 +1407,7 @@ so the item is ineffective.
                        continue;
                if (s->line_like)
                        is->starts_line = 1;
-               again = 1;
+               check_again = 1;
                if (type >= LALR) {
                        // Need the LA set.
                        int to_end;
@@ -1527,7 +1527,7 @@ with `TK_eof` as the LA set.
        {
                struct symset first = INIT_SYMSET;
                struct itemset *is;
-               int again;
+               int check_again;
                unsigned short la = 0;
                if (type >= LALR) {
                        // LA set just has eof
@@ -1539,15 +1539,15 @@ with `TK_eof` as the LA set.
                // production 0, offset 0 (with no data)
                symset_add(&first, item_num(0, 0), la);
                add_itemset(g, first, Non, 0, type);
-               for (again = 0, is = g->items;
+               for (check_again = 0, is = g->items;
                     is;
-                    is = is->next ?: again ? (again = 0, g->items) : NULL) {
+                    is = is->next ?: check_again ? (check_again = 0, g->items) : NULL) {
                        int i;
                        struct symset done = INIT_SYMSET;
                        if (is->completed)
                                continue;
                        is->completed = 1;
-                       again = 1;
+                       check_again = 1;
                        ## complete itemset
                        ## derive itemsets
                        symset_free(done);