весь документ прошли
This commit is contained in:
parent
40c572711b
commit
49e1eca45d
|
@ -88,7 +88,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str
|
|||
if (isalnum(c)) {
|
||||
tag = zalloc_append8_str(tag, c);
|
||||
|
||||
} else if (!tag && (c == '\\' || c == ',')) { // newline tag or \,
|
||||
} else if (!tag && (c == '\\' || c == ',' || c == '%')) { // newline tag or \,
|
||||
where_stack[tex_level--] = IN_UNDEF;
|
||||
|
||||
} else if (!tag) {
|
||||
|
@ -299,22 +299,6 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str
|
|||
break;
|
||||
|
||||
case IN_TAG_CLINE:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_END:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_ENDFOOT:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_ENDHEAD:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_HLINE:
|
||||
if (c == '{' || c == '[') { // tag params
|
||||
where_stack[++tex_level] = IN_TAGPARM;
|
||||
|
||||
|
@ -331,15 +315,54 @@ 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 (isgraph(c) || c < 0) {
|
||||
|
||||
} else {
|
||||
error->code = (int)i;
|
||||
error->message = "unexpected symbol (IN_TAG_HLINE)";
|
||||
error->message = "unexpected symbol (IN_TAG_UNKNOWN)";
|
||||
return error->code;
|
||||
}
|
||||
break;
|
||||
|
||||
case IN_TAG_END:
|
||||
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 (isgraph(c) || c < 0) {
|
||||
|
||||
} else {
|
||||
error->code = (int)i;
|
||||
error->message = "unexpected symbol (IN_TAG_UNKNOWN)";
|
||||
return error->code;
|
||||
}
|
||||
break;
|
||||
|
||||
case IN_TAG_ENDFOOT:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_ENDHEAD:
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_HLINE:
|
||||
where_stack[tex_level--] = IN_UNDEF;
|
||||
|
||||
break;
|
||||
|
||||
case IN_TAG_HSPACE:
|
||||
|
||||
break;
|
||||
|
@ -371,7 +394,29 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str
|
|||
break;
|
||||
|
||||
case IN_TAG_MULTIROW:
|
||||
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 (isgraph(c) || c < 0) {
|
||||
|
||||
} else {
|
||||
error->code = (int)i;
|
||||
error->message = "unexpected symbol (IN_TAG_MULTIROW)";
|
||||
return error->code;
|
||||
}
|
||||
break;
|
||||
|
||||
case IN_TAG_TABULARNEWLINE:
|
||||
|
|
Loading…
Reference in New Issue