]> Pileus Git - ~andy/ct/blobdiff - scan.l
Fix bugs
[~andy/ct] / scan.l
diff --git a/scan.l b/scan.l
index 19f6777f48227aaed311d2d0c848371f048da239..c1b61e7082daf98c6828748d41aab2d7de71e67a 100644 (file)
--- a/scan.l
+++ b/scan.l
 /* %option nodebug */
 START [ \t]*<%
 END   [ \t]*%>[ \t]*
-DATA  ([^<\n]|<[^%])*
-CODE  [ \t\n]([^%\n]|%[^>])*
+DATA  ([^<\n]|<[^%])*\n*
+CODE  [ \t\n]([^%\n]|%[^>])*\n*
 %s IN FMT
 %%
+[[:space:]]*\n   { debug("NL    [%s]"); }
 <INITIAL>{START} { debug("START [%s]"); yylval = g_strdup(yytext); BEGIN(IN);      return START; }
 <INITIAL>{DATA}  { debug("DATA  [%s]"); yylval = g_strdup(yytext);                 return DATA;  }
 <IN>{END}        { debug("END   [%s]"); yylval = g_strdup(yytext); BEGIN(INITIAL); return END;   }
 <IN>=            { debug("OUT   [%s]"); yylval = g_strdup(yytext);                 return OUT;   }
 <IN>{CODE}       { debug("CODE  [%s]"); yylval = g_strdup(yytext);                 return DATA;  }
-[\n]             { debug("NL    [%s]"); }
 %%