diff options
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/parsetok.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c index 31c2385..ba98418 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -122,6 +122,7 @@ parsetok(tok, g, start, n_ret) { parser_state *ps; int ret; + int started = 0; if ((ps = newparser(g, start)) == NULL) { fprintf(stderr, "no mem for new parser\n"); @@ -139,6 +140,12 @@ parsetok(tok, g, start, n_ret) ret = tok->done; break; } + if (type == ENDMARKER && started) { + type = NEWLINE; /* Add an extra newline */ + started = 0; + } + else + started = 1; len = b - a; str = NEW(char, len + 1); if (str == NULL) { |