better with object_stack but still not correct

This commit is contained in:
Kolan Sh 2011-07-18 19:00:51 +04:00
parent a81c73dc23
commit 1e1bcf1236
1 changed files with 29 additions and 26 deletions

View File

@ -122,38 +122,41 @@ void tex_parse(const char *source, size_t len, struct tex_struct_s **tex_struct,
else if (!strcmp(tag, TEX_TAG_TABULARNEWLINE)) { else if (!strcmp(tag, TEX_TAG_TABULARNEWLINE)) {
where_stack[tex_level] = IN_TAG_TABULARNEWLINE; where_stack[tex_level] = IN_TAG_TABULARNEWLINE;
} else if (!strcmp(tag, TEX_TAG_ENDFIRSTHEAD)) { } else {
// subtable is first header - some actions here... if (!strcmp(tag, TEX_TAG_ENDFIRSTHEAD)) {
object_stack[obj_level] = OBJ_TABLE_SUBTABLE; // subtable is first header - some actions here...
#ifdef __TEX_PARSER_DEBUG object_stack[obj_level] = OBJ_TABLE_SUBTABLE;
puts("=OBJ_TABLE_SUBTABLE"); #ifdef __TEX_PARSER_DEBUG
#endif puts("=OBJ_TABLE_SUBTABLE");
#endif
} else if (!strcmp(tag, TEX_TAG_ENDHEAD)) { } else if (!strcmp(tag, TEX_TAG_ENDHEAD)) {
// subtable is header - some actions here... // subtable is header - some actions here...
object_stack[obj_level] = OBJ_TABLE_SUBTABLE; object_stack[obj_level] = OBJ_TABLE_SUBTABLE;
#ifdef __TEX_PARSER_DEBUG #ifdef __TEX_PARSER_DEBUG
puts("=OBJ_TABLE_SUBTABLE"); puts("=OBJ_TABLE_SUBTABLE");
#endif #endif
} else if (!strcmp(tag, TEX_TAG_ENDFIRSTFOOT)) { } else if (!strcmp(tag, TEX_TAG_ENDFIRSTFOOT)) {
// subtable is first footer - some actions here... // subtable is first footer - some actions here...
object_stack[obj_level] = OBJ_TABLE_SUBTABLE; object_stack[obj_level] = OBJ_TABLE_SUBTABLE;
#ifdef __TEX_PARSER_DEBUG #ifdef __TEX_PARSER_DEBUG
puts("=OBJ_TABLE_SUBTABLE"); puts("=OBJ_TABLE_SUBTABLE");
#endif #endif
} else if (!strcmp(tag, TEX_TAG_ENDFOOT)) { } else if (!strcmp(tag, TEX_TAG_ENDFOOT)) {
// subtable is footer - some actions here... // subtable is footer - some actions here...
object_stack[obj_level] = OBJ_TABLE_SUBTABLE; object_stack[obj_level] = OBJ_TABLE_SUBTABLE;
#ifdef __TEX_PARSER_DEBUG #ifdef __TEX_PARSER_DEBUG
puts("=OBJ_TABLE_SUBTABLE"); puts("=OBJ_TABLE_SUBTABLE");
#endif #endif
}
} else
where_stack[tex_level] = IN_TAG_UNKNOWN; where_stack[tex_level] = IN_TAG_UNKNOWN;
}
#ifdef __TEX_PARSER_DEBUG #ifdef __TEX_PARSER_DEBUG
printf("\\%s\n", tag); printf("\\%s\n", tag);
#endif #endif
zclear(&tag); zclear(&tag);