summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorFrank Celler <[email protected]>2012-04-21 23:30:34 +0200
committerFrank Celler <[email protected]>2012-04-21 23:30:34 +0200
commitfc125524b2ece07fc70e782cc1a232d794dd4f6d (patch)
treef8ab14472ca3bf890105e403c66b854af7da3754 /src/parse.y
parent2b9ed5acd140a95b3178b40eaf698955d7ff21eb (diff)
downloadmruby-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.y10
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;
}