From b3ed9f553cbb1f7b7d11b6f04295262c523aa1f8 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Tue, 28 Jun 2011 11:11:23 +0400 Subject: [PATCH] tex_level now is correct on exit --- c/tex_parser/tables4.tex | 151 ++++++++++++++++++----------------- c/tex_parser/tex_table.c | 6 ++ c/tex_parser/tex_table.geany | 10 +-- 3 files changed, 90 insertions(+), 77 deletions(-) diff --git a/c/tex_parser/tables4.tex b/c/tex_parser/tables4.tex index 1033598..2f1a264 100644 --- a/c/tex_parser/tables4.tex +++ b/c/tex_parser/tables4.tex @@ -1,15 +1,22 @@ -\D{\c}{% - \f{T}\s\d\e{T}} -\D{\t}[1]{\l{\c #1}} -\A{\D{T}{}{}} +%\p{\tabularnewline}{\\} +%\a{\b}{\\} + +%%%%% +%\c +%\end + +%~ \D{\c}{% + %~ \f{T}\s\d\e{T}} +%~ \D{\t}[1]{\l{\c #1}} +%~ \A{\D{T}{}{}} %% B -\p{\t}{\\} +%~ \p{\t}{\\} %% U -\u[r]{b} +%~ \u[r]{b} -\end{HA} +%~ \end{HA} %\t{\T{p}} %\end{haha} @@ -53,128 +60,128 @@ DrosselTable1 \begin{longtable}{|>{\centering}p{0.11\linewidth}|>{\raggedright}p{0.05\linewidth}|>{\centering}p{0.07\paperwidth}|>{\centering}p{0.07\paperwidth}|>{\centering}m{0.07\paperheight}|>{\centering}m{0.07\paperheight}|>{\centering}p{0.07\paperheight}|>{\centering}p{0.07\paperheight}|} \hline -\multicolumn{8}{|c|}{Сводный протокол результатов испытания двигателя ТВ7-117В \textnumero{}}\tabularnewline -\multicolumn{8}{|c|}{Стенд \textnumero{}18 ~~ ИУД СИК ~ Дата: ~~~~~~~~ г. Время: -~~~~~~~~~ Рн = ~~~ мм рт ст~~ tвх = ~~~ $\,^{\circ}\mbox{C}$}\tabularnewline -\multicolumn{8}{|c|}{Характеристика ~~~~~~~ Акт сдачи, контрольные точки}\tabularnewline +\multicolumn{8}{|c|}{ 7-117 \textnumero{}}\tabularnewline +\multicolumn{8}{|c|}{ \textnumero{}18 ~~ ~ : ~~~~~~~~ . : +~~~~~~~~~ = ~~~ ~~ t = ~~~ $\,^{\circ}\mbox{C}$}\tabularnewline +\multicolumn{8}{|c|}{ ~~~~~~~ , }\tabularnewline \hline \endhead \hline -\multicolumn{2}{|>{\centering}m{0.11\linewidth}|}{\centering{}Составил} & \multicolumn{2}{c|}{Инженер по испытаниям} & Начальник БТК & Начальник участка УИД СИК & \multicolumn{2}{c|}{Представитель заказчика}\tabularnewline +\multicolumn{2}{|>{\centering}m{0.11\linewidth}|}{\centering{}} & \multicolumn{2}{c|}{ } & & & \multicolumn{2}{c|}{ }\tabularnewline \hline -\multicolumn{2}{|>{\centering}p{0.11\linewidth}|}{\centering{}\textit{Подпись}} & \multicolumn{2}{c|}{\textit{Подпись}} & \centering{}\textit{Подпись} & \centering{}\textit{Подпись} & \multicolumn{2}{c|}{\textit{Подпись}}\tabularnewline -\multicolumn{2}{|>{\centering}p{0.11\linewidth}|}{\textit{фамилия}} & \multicolumn{2}{c|}{\textit{фамилия}} & \multicolumn{1}{c|}{\textit{фамилия}} & \textit{фамилия} & \multicolumn{2}{c|}{\textit{фамилия}}\tabularnewline +\multicolumn{2}{|>{\centering}p{0.11\linewidth}|}{\centering{}\textit{}} & \multicolumn{2}{c|}{\textit{}} & \centering{}\textit{} & \centering{}\textit{} & \multicolumn{2}{c|}{\textit{}}\tabularnewline +\multicolumn{2}{|>{\centering}p{0.11\linewidth}|}{\textit{}} & \multicolumn{2}{c|}{\textit{}} & \multicolumn{1}{c|}{\textit{}} & \textit{} & \multicolumn{2}{c|}{\textit{}}\tabularnewline \hline \endfoot -\multicolumn{8}{|l|}{Усреднённые значения по режимам}\tabularnewline +\multicolumn{8}{|l|}{Σ }\tabularnewline \hline -\multicolumn{2}{|c|}{Параметр} & Nепр & Ce & Gт пр & nтк пр & t{*}z ст пр & Пк\tabularnewline +\multicolumn{2}{|c|}{} & N & Ce & G & n & t{*}z & \tabularnewline \hline -\multicolumn{2}{|>{\centering}p{0.07\paperwidth}|}{\centering{}Режим} & & & & & & \tabularnewline +\multicolumn{2}{|>{\centering}p{0.07\paperwidth}|}{\centering{}} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{ЗМГ} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{0,4 мП} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{0,4 } & & & & & & \tabularnewline \hline \multicolumn{2}{|l|}{Ne1650} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{Мкр} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{МП} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{} & & & & & & \tabularnewline \hline \multicolumn{2}{|l|}{Ne2500} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{Взл} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{30-мин.м.} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{30-..} & & & & & & \tabularnewline \hline -\multicolumn{8}{|c|}{Замеренные параметры}\tabularnewline +\multicolumn{8}{|c|}{ }\tabularnewline \hline -\multicolumn{2}{|c|}{Параметр} & Ne & Ce & Gт & nтк & t{*}z ст & Пк\tabularnewline +\multicolumn{2}{|c|}{} & Ne & Ce & G & n & t{*}z & \tabularnewline \hline -\multicolumn{2}{|l|}{ЗМГ} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{} & & & & & & \tabularnewline \hline -\multicolumn{2}{|l|}{2,5 мин.м.} & & & & & & \tabularnewline +\multicolumn{2}{|l|}{2,5 ..} & & & & & & \tabularnewline \hline -\multicolumn{8}{|c|}{Оценка режимов по ТУ}\tabularnewline +\multicolumn{8}{|c|}{ }\tabularnewline \hline -\multicolumn{2}{|c|}{Параметр} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{Neпр}}\selectlanguage{russian} +\multicolumn{2}{|c|}{} & \selectlanguage{english}% +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{Ne}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более nтк пр,\%}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + n ,\%}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{nст,\%}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{n,\%}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.09\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более t{*}z ст пр,$\,^{\circ}\mbox{C}$}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.09\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + t{*}z ,$\,^{\circ}\mbox{C}$}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.08\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более Ce г/л.с.ч.}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.08\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + Ce /...}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{Gт -пр, кг/час}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{G +, /}}\selectlanguage{russian} \tabularnewline \cline{1-2} -\multicolumn{2}{|c|}{Режим} & & & & & & \tabularnewline +\multicolumn{2}{|c|}{} & & & & & & \tabularnewline \hline - & ТУ & 1900 & 93,0 & 98,0$\pm$0,5 & 680 & 221 & -\tabularnewline + & & 1900 & 93,0 & 98,0$\pm$0,5 & 680 & 221 & -\tabularnewline \cline{2-8} -Мкр & Факт & & & & & & \tabularnewline + & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline - & ТУ & 2100 & 94,0 & 98,0$\pm$0,5 & 705 & - & -\tabularnewline + & & 2100 & 94,0 & 98,0$\pm$0,5 & 705 & - & -\tabularnewline \cline{2-8} -МП & Факт & & & & & & \tabularnewline + & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline - & ТУ & 2800 & 97,5 & 98,0$\pm$0,5 & 775 & 205 & -\tabularnewline + & & 2800 & 97,5 & 98,0$\pm$0,5 & 775 & 205 & -\tabularnewline \cline{2-8} -Взл & Факт & & & & & & \tabularnewline + & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline - & ТУ & 3000 & 98,5 & 98,0$\pm$0,5 & 795 & - & -\tabularnewline + & & 3000 & 98,5 & 98,0$\pm$0,5 & 795 & - & -\tabularnewline \cline{2-8} -30-мин.м. & Факт & & & & & & \tabularnewline +30-.. & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline -\multicolumn{8}{|c|}{Замеренные параметры}\tabularnewline +\multicolumn{8}{|c|}{ }\tabularnewline \hline -\multicolumn{2}{|c|}{Параметр} & \selectlanguage{english}% +\multicolumn{2}{|c|}{} & \selectlanguage{english}% \inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{Ne}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более nтк,\%}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + n,\%}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{nст,\%}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{n,\%}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.09\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более t{*}z ст,$\,^{\circ}\mbox{C}$}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.09\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + t{*}z ,$\,^{\circ}\mbox{C}$}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.08\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{не -более Ce г/л.с.ч.}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.08\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{ + Ce /...}}\selectlanguage{russian} & \selectlanguage{english}% -\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{Gт, -кг/час}}\selectlanguage{russian} +\inputencoding{latin9}\multirow{2}{0.07\paperwidth}{\inputencoding{koi8-r}\foreignlanguage{russian}{G, +/}}\selectlanguage{russian} \tabularnewline \cline{1-2} -\multicolumn{2}{|c|}{Режим} & & & & & & \tabularnewline +\multicolumn{2}{|c|}{} & & & & & & \tabularnewline \hline - & ТУ & - & & 80,0$\pm$0,5 & - & - & -\tabularnewline + & & - & & 80,0$\pm$0,5 & - & - & -\tabularnewline \cline{2-8} -ЗМГ & Факт & & & & & & \tabularnewline + & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline - & ТУ & - & 101,0 & 98,0$\pm$0,5 & 805 & - & -\tabularnewline + & & - & 101,0 & 98,0$\pm$0,5 & 805 & - & -\tabularnewline \cline{2-8} -2,5 мин.м. & Факт & & & & & & \tabularnewline +2,5 .. & & & & & & & \tabularnewline \cline{2-8} - & Откл. & & & & & & \tabularnewline + & . & & & & & & \tabularnewline \hline \multicolumn{3}{|c|}{A0} & & & & & \tabularnewline \hline @@ -182,8 +189,8 @@ DrosselTable1 \hline \multicolumn{3}{|c|}{A2} & & & & & \tabularnewline \hline -\multicolumn{3}{|c|}{СКО} & & & & & \tabularnewline +\multicolumn{3}{|c|}{} & & & & & \tabularnewline \hline -\multicolumn{3}{|c|}{Примечание} & \multicolumn{5}{c|}{}\tabularnewline +\multicolumn{3}{|c|}{} & \multicolumn{5}{c|}{}\tabularnewline \end{longtable} \end{document} diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 78158f7..8037c46 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -293,6 +293,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isalnum(c) || c == '#') { @@ -319,6 +320,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isgraph(c) || c < 0) { @@ -345,6 +347,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isgraph(c) || c < 0) { @@ -388,6 +391,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isalnum(c) || c == '#') { @@ -414,6 +418,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isgraph(c) || c < 0) { @@ -440,6 +445,7 @@ printf("tex_level = %lu, c = %c\n", tex_level, c); } else if (c == '}' || c == ']') { where_stack[tex_level--] = IN_UNDEF; + i--; } else if (isalnum(c) || c == '#') { diff --git a/c/tex_parser/tex_table.geany b/c/tex_parser/tex_table.geany index 4e81e41..601c724 100644 --- a/c/tex_parser/tex_table.geany +++ b/c/tex_parser/tex_table.geany @@ -17,11 +17,11 @@ long_line_column=72 [files] current_page=1 -FILE_NAME_0=1029;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_test.c;0 -FILE_NAME_1=1575;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.c;0 -FILE_NAME_2=119;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.h;0 -FILE_NAME_3=1762;C;0;16;1;1;1;/home/kolan/projects/include/zalloc_ext.h;0 -FILE_NAME_4=634;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_tags.h;0 +FILE_NAME_0=0;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_test.c;0 +FILE_NAME_1=1308;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.c;0 +FILE_NAME_2=2399;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.h;0 +FILE_NAME_3=599;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_tags.h;0 +FILE_NAME_4=1762;C;0;16;1;1;1;/home/kolan/projects/include/zalloc_ext.h;0 FILE_NAME_5=1859;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0 [build-menu]