From 64c18d66528a8336411caccd000a8eb0327f166e Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 27 Jun 2011 16:24:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=88=D0=BB=D0=B8=20=D0=B4=D0=BE?= =?UTF-8?q?=201052-=D0=B3=D0=BE=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB?= =?UTF-8?q?=D0=B0=20symb=3D|?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/tex_parser/tex_table.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 0b573ba..6df5c43 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -273,27 +273,27 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; case IN_TAG_BEGIN: - if (isspace(c)) { - - } else if (c == '{' || c == '[') { // tag params + if (c == '{' || c == '[') { // tag params where_stack[++tex_level] = IN_TAGPARM; } else if (c == '\\') { // new tag tag = zfree_null(tag); where_stack[tex_level] = IN_TAG; - if (FALSE) { // longtable - } - } else if (c == '%') { where_stack[++tex_level] = IN_COMMENT; } else if (isspace(c)) { where_stack[++tex_level] = IN_SPACE; + } else if (c == '}') { + where_stack[tex_level--] = IN_UNDEF; + + } else if (isalnum(c) || c == '#') { + } else { error->code = (int)i; - error->message = "unexpected symbol (IN_TAG_BEGIN)"; + error->message = "unexpected symbol (IN_TAG_UNKNOWN)"; return error->code; } break; @@ -331,7 +331,29 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; case IN_TAG_TABULARNEWLINE: + if (c == '{' || c == '[') { // tag params + where_stack[++tex_level] = IN_TAGPARM; + } else if (c == '\\') { // new tag + tag = zfree_null(tag); + where_stack[tex_level] = IN_TAG; + + } else if (c == '%') { + where_stack[++tex_level] = IN_COMMENT; + + } else if (isspace(c)) { + where_stack[++tex_level] = IN_SPACE; + + } else if (c == '}') { + where_stack[tex_level--] = IN_UNDEF; + + } else if (isalnum(c) || c == '#') { + + } else { + error->code = (int)i; + error->message = "unexpected symbol (IN_TAG_UNKNOWN)"; + return error->code; + } break; case IN_TAG_SLASH: