]> ocean-lang.org Git - ocean/commitdiff
parsergen: remove starts_indented.
authorNeilBrown <neil@brown.name>
Thu, 2 Oct 2014 10:59:55 +0000 (20:59 +1000)
committerNeilBrown <neil@brown.name>
Thu, 2 Oct 2014 11:01:35 +0000 (21:01 +1000)
This is no longer used.

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

index 082cf117cb1abf8e2e3d50fcc89c6a806502ee71..f99d318482d9f1b3568515a3c2d4440dc75b94aa 100644 (file)
@@ -2437,9 +2437,8 @@ The `state` is the most important one and guides the parsing process.  The
 freeing function.  The symbol leads us to the right free function through
 `do_free`.
 
-The `indents` count and the `starts_indented` flag track the line
-indents in the symbol.  These are used to allow indent information to
-guide parsing and error recovery.
+The `indents` count tracks the line indents in the symbol.  These are
+used to allow indent information to guide parsing and error recovery.
 
 `since_newline` tracks how many stack frames since the last
 start-of-line (whether indented or not).  So if `since_newline` is
@@ -2462,7 +2461,6 @@ before the beginning.
                        short newline_permitted;
 
                        short sym;
-                       short starts_indented;
                        short indents;
                        short since_newline;
                        short since_indent;
@@ -2568,8 +2566,6 @@ removed. It is called _after_ we reduce a production, just before we
        {
                int i;
                p->tos -= num;
-               next->starts_indented =
-                       p->stack[p->tos].starts_indented;
                next->since_newline =
                        p->stack[p->tos].since_newline;
                next->indents = 0;
@@ -2663,7 +2659,6 @@ since the last state which could have been at the start of a line.
                        parser_trace(trace, &p, &next, tk, states, non_term, config->known_count);
 
                        if (next.sym == TK_in) {
-                               next.starts_indented = 1;
                                next.indents = 1;
                                next.since_newline = 0;
                                free(tk);
@@ -2720,7 +2715,6 @@ since the last state which could have been at the start of a line.
                        }
                        if (shift(&p, &next, tk, states)) {
                                next.since_newline = !(tk->num == TK_newline);
-                               next.starts_indented = 0;
                                next.indents = 0;
                                tk = NULL;
                                parser_trace_action(trace, "Shift");
@@ -2746,10 +2740,8 @@ since the last state which could have been at the start of a line.
                                        pop(&p, size, &frame, do_free);
                                else {
                                        frame.indents = next.indents;
-                                       frame.starts_indented = frame.indents;
                                        frame.since_newline = 1;
                                        next.indents = 0;
-                                       next.starts_indented = 0;
                                }
                                res = memdup(buf, bufsize);
                                memset(buf, 0, bufsize);
@@ -2883,8 +2875,7 @@ end inside square brackets.
                                        fputs(non_term[sym - TK_reserved - knowns],
                                              trace);
                                if (f->indents)
-                                       fprintf(trace, "%c%d", f->starts_indented?':':'.',
-                                               f->indents);
+                                       fprintf(trace, ".%d", f->indents);
                                if (f->since_newline == 0)
                                        fputs("/", trace);
                                fputs(" ", trace);
@@ -2898,8 +2889,7 @@ end inside square brackets.
                else
                        text_dump(trace, tk->txt, 20);
                if (n->indents)
-                       fprintf(trace, "%c%d", n->starts_indented?':':'.',
-                               n->indents);
+                       fprintf(trace, ".%d", n->indents);
                if (n->since_newline == 0)
                        fputs("/", trace);
                fputs("]", trace);