summaryrefslogtreecommitdiff
path: root/yy/kalmia.l
diff options
context:
space:
mode:
Diffstat (limited to 'yy/kalmia.l')
-rw-r--r--yy/kalmia.l13
1 files changed, 7 insertions, 6 deletions
diff --git a/yy/kalmia.l b/yy/kalmia.l
index 85f68e3..42ab9e1 100644
--- a/yy/kalmia.l
+++ b/yy/kalmia.l
@@ -1,7 +1,7 @@
-%option noinput nounput noyywrap 8bit nodefault
+%option noinput nounput noyywrap noreject 8bit
%option reentrant bison-bridge bison-locations
%option prefix="kalmia"
-%start STRING TAG
+%start STRING TAG_START TAG
%{
#include <string.h>
@@ -39,18 +39,19 @@ ATTR ([\x20\x0a\x0d\x09]*)?"="
}
-<INITIAL>"<" { BEGIN(TAG); return S_TAG_OPEN; }
-<INITIAL>"</" { BEGIN(TAG); return E_TAG_OPEN; }
+<INITIAL>"<" { BEGIN(TAG_START); return S_TAG_OPEN; }
+<INITIAL>"</" { BEGIN(TAG_START); return E_TAG_OPEN; }
<TAG>">" { BEGIN(INITIAL); return TAG_CLOSE; }
<TAG>"/>" { BEGIN(INITIAL); return EMPTY_TAG_CLOSE; }
-<TAG>[a-zA-Z_:][a-zA-Z0-9\.\-_:]* {
+<TAG_START>[a-zA-Z_:][a-zA-Z0-9\.\-_:]* {
/* generic tag name */
+ BEGIN(TAG);
yylval->string = strdup(yytext);
return NAME;
}
-<TAG>[a-zA-Z_:][a-zA-Z0-9\.\-_:]*/{ATTR} {
+<TAG>[a-zA-Z_:][a-zA-Z0-9\.\-_:]* {
/* generic attribute key */
yylval->string = strdup(yytext);
return ATTR;