From 98c8f8dfc7aea28e8f0a8e7601ea3b2016f9767b Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 9 May 2023 01:21:13 -0700 Subject: [PATCH] Hmmm, not really that great with newlines. --- src/scan.re.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/scan.re.c b/src/scan.re.c index 2c61adb..7aeb76c 100644 --- a/src/scan.re.c +++ b/src/scan.re.c @@ -819,34 +819,26 @@ static int scan_day(struct scan *const scan, union date32 date, all the things this way. */ /* Text is only at the end of a line. */ * { fail = "text input"; goto catch; } - ws { continue; } - /* Hmmm. - "\n" { // empty is okay - line++; - fprintf(stderr, "text: \n"); - assert(input_text); - input.pair->a = input.pair->b = 0; - condition = input.future; - continue; - } */ + ws { fprintf(stderr, "text space\n"); continue; } "<<\n" @s0 => input_text_multi { // multi-line line++; input.pair->a = s0; continue; } - @s0 anylabel @s1 /*future*/ { // one line + @s0 anylabel @s1 / "\n" /*future*/ { // one line line++; fprintf(stderr, "text: <<%.*s>>\n", (int)(s1 - s0), s0); input.pair->a = s0, input.pair->b = s1; + assert(input.future == yycnewline); condition = input.future; + assert(1); continue; } [^\x00\n] { continue; } [\x00] { fail = "missing closing \">>\""; goto catch; } "\n" { line++; continue; } - @s1 ">>" { - line++; + @s1 ">>" /*future*/ { fprintf(stderr, "text: <<\n%.*s>>\n", (int)(s1 - input.pair->a), input.pair->a); input.pair->b = s1;