]> ocean-lang.org Git - ocean/commitdiff
parsergen: make "code" arg to "gen_reduce" more obvious.
authorNeilBrown <neil@brown.name>
Fri, 5 Mar 2021 10:29:56 +0000 (21:29 +1100)
committerNeilBrown <neil@brown.name>
Wed, 10 Mar 2021 01:00:31 +0000 (12:00 +1100)
Call it "pre_reduce" so we know where the code goes.

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

index 815605c3f6a9c19f2ed5d47096ad9bb5ab2c3bce..fc95688efff4332384acd7034472d9b78a287d41 100644 (file)
@@ -2303,15 +2303,15 @@ transformed, and will cause an error when the code is compiled.
 ###### functions
 
        static void gen_reduce(FILE *f, struct grammar *g, char *file,
-                              struct code_node *code)
+                              struct code_node *pre_reduce)
        {
                int i;
                fprintf(f, "#line 1 \"gen_reduce\"\n");
                fprintf(f, "static int do_reduce(int prod, void **body, struct token_config *config, void *ret)\n");
                fprintf(f, "{\n");
                fprintf(f, "\tint ret_size = 0;\n");
-               if (code)
-                       code_node_print(f, code, file);
+               if (pre_reduce)
+                       code_node_print(f, pre_reduce, file);
 
                fprintf(f, "#line 4 \"gen_reduce\"\n");
                fprintf(f, "\tswitch(prod) {\n");