]> Pileus Git - ~andy/ct/blobdiff - scan.l
Add timestamp checking
[~andy/ct] / scan.l
diff --git a/scan.l b/scan.l
index c1b61e7082daf98c6828748d41aab2d7de71e67a..b080e5aaf6d90b9b0fef61debbd1b6da2e6e9890 100644 (file)
--- a/scan.l
+++ b/scan.l
@@ -7,17 +7,20 @@
 %option noyywrap
 %option nounput
 %option noinput
+%option yylineno
+%option never-interactive
 /* %option nodebug */
 START [ \t]*<%
-END   [ \t]*%>[ \t]*
+END   [ \t]*%>
 DATA  ([^<\n]|<[^%])*\n*
 CODE  [ \t\n]([^%\n]|%[^>])*\n*
-%s IN FMT
+%s IN
 %%
 [[: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>%            { debug("FMT   [%s]"); yylval = g_strdup(yytext);                 return FMT;   }
 <IN>{CODE}       { debug("CODE  [%s]"); yylval = g_strdup(yytext);                 return DATA;  }
 %%