From 624e1322a27a46498120e1b3f835f9bde2364451 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Tue, 28 Jun 2011 12:23:33 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=20=D1=81=D1=83=D1=82=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BB=D0=BE=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BD=D0=BE,=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=BB=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82?= =?UTF-8?q?=D0=BC=20=D0=B2=D1=85=D0=BE=D0=B4=D0=B0=20=D0=B2=20=D1=82=D0=B5?= =?UTF-8?q?=D0=B3=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/tex_parser/tex_table.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 8037c46..41ca5af 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -59,7 +59,9 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str /* read one character from input stream */ char c = table_source[i]; -printf("tex_level = %lu, c = %c\n", tex_level, c); + #ifdef __TEX_TABLE_DEBUG + printf("tex_level = %lu, c = %c\n", tex_level, c); + #endif /* looking at where_stack and encountered character */ switch (where_stack[tex_level]) { case IN_UNDEF: @@ -178,39 +180,25 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); #endif tag = zfree_null(tag); - } else if (c == '%') { + } else { #ifdef __TEX_TABLE_DEBUG printf("\\%s\n", tag); #endif tag = zfree_null(tag); where_stack[tex_level] = IN_TAG_UNKNOWN; - where_stack[++tex_level] = IN_COMMENT; - } else if (c == '{' || c == '[') { - #ifdef __TEX_TABLE_DEBUG - printf("\\%s\n", tag); - #endif - tag = zfree_null(tag); - where_stack[tex_level] = IN_TAG_UNKNOWN; - where_stack[++tex_level] = IN_TAGPARM; + } - } else if (isspace(c)) { // \tag { for example + if (isspace(c)) { // \tag { for example #ifdef __TEX_TABLE_DEBUG printf("\\%s\n", tag); #endif tag = zfree_null(tag); where_stack[tex_level] = IN_TAG_UNKNOWN; where_stack[++tex_level] = IN_SPACE; - - } else { // unknown tag - #ifdef __TEX_TABLE_DEBUG - printf("\\%s\n", tag); - #endif - tag = zfree_null(tag); - where_stack[tex_level] = IN_TAG_UNKNOWN; - } - - if (c == '\\' || c == '}' || c == ']') + } else if (c == '\\' || c == '}' + || c == ']' || c == '{' + || c == '[' || c == '%') i--; } break;