diff options
| author | Frank Celler <[email protected]> | 2012-04-21 23:30:34 +0200 |
|---|---|---|
| committer | Frank Celler <[email protected]> | 2012-04-21 23:30:34 +0200 |
| commit | fc125524b2ece07fc70e782cc1a232d794dd4f6d (patch) | |
| tree | f8ab14472ca3bf890105e403c66b854af7da3754 /src/parse.y | |
| parent | 2b9ed5acd140a95b3178b40eaf698955d7ff21eb (diff) | |
| download | mruby-fc125524b2ece07fc70e782cc1a232d794dd4f6d.tar.gz mruby-fc125524b2ece07fc70e782cc1a232d794dd4f6d.zip | |
only increment position, if no error has occured
Diffstat (limited to 'src/parse.y')
| -rw-r--r-- | src/parse.y | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/parse.y b/src/parse.y index 2bc78f577..9ffe6d33d 100644 --- a/src/parse.y +++ b/src/parse.y @@ -2976,12 +2976,16 @@ nextc(parser_state *p) c = *p->s++; } if (c == '\n') { - p->lineno++; - p->column = 0; + if (p->nerr < 1) { + p->lineno++; + p->column = 0; + } // must understand heredoc } else { - p->column++; + if (p->nerr < 1) { + p->column++; + } } return c; } |
