mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Handle CR LF newline natively in lexer
This commit is contained in:
@@ -3984,6 +3984,13 @@ nextc(parser_state *p)
|
||||
if (c >= 0) {
|
||||
p->column++;
|
||||
}
|
||||
if (c == '\r') {
|
||||
const int lf = nextc(p);
|
||||
if (lf == '\n') {
|
||||
return '\n';
|
||||
}
|
||||
pushback(p, lf);
|
||||
}
|
||||
return c;
|
||||
|
||||
eof:
|
||||
|
||||
Reference in New Issue
Block a user