]> ocean-lang.org Git - ocean/commitdiff
pargergen: don't ignore first token
authorNeilBrown <neilb@suse.de>
Sat, 10 May 2014 23:40:32 +0000 (09:40 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 15 Jun 2014 05:40:03 +0000 (15:40 +1000)
When parsing the grammar we currently skip the first token by mistake.
It is often a TK_newline so not much is lost.  But not always...

Signed-off-by: NeilBrown <neilb@suse.de>
csrc/parsergen.mdc

index 1bb813e78318d20e6285db273abdae2d0086c7b4..aae8a3fa4bdad73ef7b06613292debd7347f513b 100644 (file)
@@ -545,7 +545,7 @@ Now we are ready to read in the grammar.
                };
 
                struct token_state *state = token_open(code, &conf);
-               struct token tk = token_next(state);
+               struct token tk;
                struct symbol *head = NULL;
                struct grammar *g;
                char *err = NULL;