diff --git a/src/scan.re.c b/src/scan.re.c index 7aeb76c..ce02ae7 100644 --- a/src/scan.re.c +++ b/src/scan.re.c @@ -817,28 +817,26 @@ static int scan_day(struct scan *const scan, union date32 date, /* fixme: This is a cool way of doing things. Avoid repetition, make all the things this way. */ - /* Text is only at the end of a line. */ * { fail = "text input"; goto catch; } - ws { fprintf(stderr, "text space\n"); continue; } + ws { continue; } "<<\n" @s0 => input_text_multi { // multi-line - line++; input.pair->a = s0; + line++; continue; } - @s0 anylabel @s1 / "\n" /*future*/ { // one line - line++; + @s0 anylabel? @s1 "\n" => line { // one line; last one 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); + if(input.future != yycnewline) + { fail = "use <>"; goto catch; } + line++; continue; } [^\x00\n] { continue; } [\x00] { fail = "missing closing \">>\""; goto catch; } "\n" { line++; continue; } - @s1 ">>" /*future*/ { + @s1 ">>" / [^>] /*future*/ { fprintf(stderr, "text: <<\n%.*s>>\n", (int)(s1 - input.pair->a), input.pair->a); input.pair->b = s1;