From b9782a0926d98ae7c1760437a62f582eafaec057 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 28 Jul 2016 15:26:37 -0400 Subject: [PATCH] phase 1 -- escape nl in comment joins the line. --- phase1.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phase1.cpp b/phase1.cpp index 2af7e09..62e7004 100644 --- a/phase1.cpp +++ b/phase1.cpp @@ -6,6 +6,7 @@ enum { st_text_esc, st_comment, + st_comment_esc, st_vstring, st_vstring_esc, @@ -42,6 +43,11 @@ int phase1::process(unsigned char c, int st) { line++; return st_text; + case st_comment_esc: + multiline = true; + line++; + return st_text; + case st_text_esc: case st_vstring_esc: case st_dstring_esc: @@ -82,9 +88,11 @@ text: break; case st_comment: - return st; + if (c == esc) return st_comment_esc; + return st_comment; break; + case st_comment_esc: case st_text_esc: case st_dstring_esc: case st_estring1_esc: