summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a64f711)
raw | patch | inline | side by side (parent: a64f711)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 13 Jun 2010 21:24:17 +0000 (23:24 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 13 Jun 2010 21:33:14 +0000 (23:33 +0200) |
src/l2l_scanner.l | patch | blob | history |
diff --git a/src/l2l_scanner.l b/src/l2l_scanner.l
index d02479d7370525f4336ccf14dead9eded4cb5b78..cf7000c567cf1bdc2925b8a136fe2d53f89937fc 100644 (file)
--- a/src/l2l_scanner.l
+++ b/src/l2l_scanner.l
* images/boxes
*/
-@(B|KT):{WHITESPACE}* {
+@(B|KT):{WHITESPACE}*((Abbildung|Listing)({WHITESPACE}|\n)+[0-9]+:)? {
_Bool is_image = 0;
_Bool is_box = 0;
+ char *label = NULL;
+
if (! strncmp(yytext, "@B:", 3))
is_image = 1;
else if (! strncmp(yytext, "@KT:", 4))
l2l_scanner_state = L2L_BODY;
}
+ label = strstr(yytext, "Abbildung");
+ if (! label)
+ label = strstr(yytext, "Listing");
+
+ if (label)
+ if (l2l_strbuf_append(&l2l_caption, "{\\bfseries %s}", label))
+ YY_FATAL_ERROR("ERROR: internal error");
+
l2l_buf_ptr = &l2l_caption;
if (is_image)
BEGIN(caption);