From 1547049eb0f33b2e44dbec493a298d19db9319c3 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 19 Feb 2019 16:32:15 +0000 Subject: [PATCH] Correctly handle multi-character newlines (e.g. CR LF) when parsing #line directives. Bug report thanks to Denis Naumov. --- re2c/bootstrap/src/parse/lex.cc | 4 ++-- re2c/bootstrap/src/parse/lex.h | 2 +- re2c/src/parse/lex.re | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/re2c/bootstrap/src/parse/lex.cc b/re2c/bootstrap/src/parse/lex.cc index ce767035..309871d0 100644 --- a/re2c/bootstrap/src/parse/lex.cc +++ b/re2c/bootstrap/src/parse/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */ +/* Generated by re2c 1.1.1 on Tue Feb 19 16:29:01 2019 */ #line 1 "../src/parse/lex.re" #include "src/util/c99_stdint.h" #include @@ -478,7 +478,7 @@ yy82: YYCURSOR = yyt1; #line 213 "../src/parse/lex.re" { - out.wraw(tok, ptr + 1); + out.wraw(tok, ptr).ws("\n"); set_sourceline(); goto next; } diff --git a/re2c/bootstrap/src/parse/lex.h b/re2c/bootstrap/src/parse/lex.h index fdbb2929..9d8ee86b 100644 --- a/re2c/bootstrap/src/parse/lex.h +++ b/re2c/bootstrap/src/parse/lex.h @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */ +/* Generated by re2c 1.1.1 on Tue Feb 19 16:29:01 2019 */ #include #include "src/util/forbid_copy.h" diff --git a/re2c/src/parse/lex.re b/re2c/src/parse/lex.re index 9b4dd3e5..eb0fd564 100644 --- a/re2c/src/parse/lex.re +++ b/re2c/src/parse/lex.re @@ -211,7 +211,7 @@ loop: } linedir / lineinf { - out.wraw(tok, ptr + 1); + out.wraw(tok, ptr).ws("\n"); set_sourceline(); goto next; } -- 2.40.0