From 76a2b5a904ff6ad8d890e3142f02d2c5d8663435 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Tue, 12 Jul 2011 19:13:22 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BE=D0=BC?= =?UTF-8?q?=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/tex_parser/tex_parser.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/c/tex_parser/tex_parser.c b/c/tex_parser/tex_parser.c index cdddc4a..2660f57 100644 --- a/c/tex_parser/tex_parser.c +++ b/c/tex_parser/tex_parser.c @@ -79,7 +79,6 @@ void tex_parse(const char *source, size_t len, struct tex_struct_s **tex_struct, zclear(&tag); where_stack[++tex_level] = IN_TAG; - } else if (isspace(c)) { where_stack[++tex_level] = IN_SPACE; @@ -155,11 +154,16 @@ void tex_parse(const char *source, size_t len, struct tex_struct_s **tex_struct, if (param) printf("IN_TAGPARM: {%s}\n", param); #endif - where_stack[tex_level--] = IN_UNDEF; - /*if (tex_level && where_stack[tex_level - 1] == IN_TAG_BEGIN + if (tex_level && where_stack[tex_level - 1] == IN_TAG_BEGIN && !strcmp(param, TEX_PARAM_TABLE)) - where_stack[tex_level++] = IN_TABLE;*/ + where_stack[tex_level++] = IN_TABLE; + + if (tex_level && where_stack[tex_level - 1] == IN_TAG_END + && !strcmp(param, TEX_PARAM_TABLE)) + where_stack[tex_level--] = IN_UNDEF; + + where_stack[tex_level--] = IN_UNDEF; } else if (c == '\\') { // new tag zclear(&tag); @@ -217,6 +221,13 @@ void tex_parse(const char *source, size_t len, struct tex_struct_s **tex_struct, case IN_FORMULA: + break; + + case IN_TABLE: + *tex_struct = zalloc_append64(*tex_struct, + + + break; default: