From b3355c88fadbc0c20a07d407a3c02a63e3fb59d5 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 27 Jun 2011 16:28:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=88=D0=BB=D0=B8=20=D0=B4=D0=BE?= =?UTF-8?q?=201312-=D0=B3=D0=BE=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB?= =?UTF-8?q?=D0=B0=20=C3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/tex_parser/tex_table.c | 50 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 6df5c43..1eb9d4c 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -263,7 +263,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str } else if (c == '}') { where_stack[tex_level--] = IN_UNDEF; - } else if (isalnum(c) || c == '#') { + } else if (isalnum(c) || c == '#' || c == '|' || c == '>') { } else { error->code = (int)i; @@ -293,7 +293,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str } else { error->code = (int)i; - error->message = "unexpected symbol (IN_TAG_UNKNOWN)"; + error->message = "unexpected symbol (IN_TAG_BEGIN)"; return error->code; } break; @@ -315,7 +315,29 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; case IN_TAG_HLINE: + 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_HLINE)"; + return error->code; + } break; case IN_TAG_HSPACE: @@ -323,7 +345,29 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; case IN_TAG_MULTICOLUMN: + 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_MULTICOLUMN)"; + return error->code; + } break; case IN_TAG_MULTIROW: @@ -351,7 +395,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str } else { error->code = (int)i; - error->message = "unexpected symbol (IN_TAG_UNKNOWN)"; + error->message = "unexpected symbol (IN_TAG_TABULARNEWLINE)"; return error->code; } break;