From 0686b0325862b7c36ea3bf012ccd9550f2669c97 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 28 May 2013 21:29:34 +0900 Subject: [PATCH] Fixing source info tracking in \ string escapes and multi-lined comments. --- sexp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sexp.c b/sexp.c index e0ff1977..7e1ddd5e 100644 --- a/sexp.c +++ b/sexp.c @@ -2161,7 +2161,10 @@ sexp sexp_read_string (sexp ctx, sexp in, int sentinel) { if (isspace(c)) { while (c==' ' || c=='\t') c=sexp_read_char(ctx, in); if (c=='\r') c=sexp_read_char(ctx, in); - if (c=='\n') do {c=sexp_read_char(ctx, in);} while (c==' ' || c=='\t'); + if (c=='\n') { + sexp_port_line(in)++; + do {c=sexp_read_char(ctx, in);} while (c==' ' || c=='\t'); + } } #endif } @@ -2822,6 +2825,8 @@ sexp sexp_read_raw (sexp ctx, sexp in) { while ((c1 = sexp_read_char(ctx, in)) == '|') ; if (c1 == '#') c2--; + } else if (c1 == '\n') { + sexp_port_line(in)++; } } if (c1 == EOF)