643 lines
73 KiB
Plaintext
643 lines
73 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"DolDoc"</span><span class=cF0>
|
||
|
<a name="l2"></a>
|
||
|
<a name="l3"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PrsDocFlagSingle</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>I64</span><span class=cF0> *_de_flags,</span><span class=cF9>U32</span><span class=cF0> *_type,</span><span class=cF1>Bool</span><span class=cF0> turn_on)
|
||
|
<a name="l4"></a>{
|
||
|
<a name="l5"></a> </span><span class=cF9>I64</span><span class=cF0> res=-1;
|
||
|
<a name="l6"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *tmph;
|
||
|
<a name="l7"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_IDENT</span><span class=cF0> &&
|
||
|
<a name="l8"></a> </span><span class=cF7>(</span><span class=cF0>tmph=</span><span class=cF5>HashFind</span><span class=cF0>(cc->cur_str,</span><span class=cFB>doldoc</span><span class=cF0>.hash,</span><span class=cF3>DHT_DOC_FLAG</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l9"></a> res=tmph->user_data0;
|
||
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (res<64) {
|
||
|
<a name="l11"></a> </span><span class=cF5>BEqu</span><span class=cF0>(_de_flags,res,turn_on);
|
||
|
<a name="l12"></a> </span><span class=cF1>switch</span><span class=cF0> (res) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l13"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_BLINK</span><span class=cF0>:
|
||
|
<a name="l14"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_INVERT</span><span class=cF0>:
|
||
|
<a name="l15"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_UNDERLINE</span><span class=cF0>:
|
||
|
<a name="l16"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SEL</span><span class=cF0>:
|
||
|
<a name="l17"></a> </span><span class=cF5>BEqu</span><span class=cF0>(_type,res,turn_on);
|
||
|
<a name="l18"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l20"></a> }
|
||
|
<a name="l21"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//skip flag</span><span class=cF0>
|
||
|
<a name="l22"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l23"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l24"></a>}
|
||
|
<a name="l25"></a>
|
||
|
<a name="l26"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PrsDocFlags</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>I64</span><span class=cF0> *_de_flags,</span><span class=cF9>U32</span><span class=cF0> *_type)
|
||
|
<a name="l27"></a>{
|
||
|
<a name="l28"></a> </span><span class=cF9>I64</span><span class=cF0> res=-1;
|
||
|
<a name="l29"></a> </span><span class=cF1>Bool</span><span class=cF0> turn_on;
|
||
|
<a name="l30"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF6>'+'</span><span class=cF0>)
|
||
|
<a name="l32"></a> turn_on=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l33"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF6>'-'</span><span class=cF0>)
|
||
|
<a name="l34"></a> turn_on=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l35"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l36"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l37"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l38"></a> res=</span><span class=cF5>PrsDocFlagSingle</span><span class=cF0>(cc,_de_flags,_type,turn_on);
|
||
|
<a name="l39"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l40"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l41"></a>}
|
||
|
<a name="l42"></a>
|
||
|
<a name="l43"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>Doc2PlainText</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e)
|
||
|
<a name="l44"></a>{</span><span class=cF2>//TODO: break strs</span><span class=cF0>
|
||
|
<a name="l45"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,attr=doc_e->attr,
|
||
|
<a name="l46"></a> t1,f1,de_flags,type;
|
||
|
<a name="l47"></a> </span><span class=cF1>U8</span><span class=cF0> *buf,*buf2;
|
||
|
<a name="l48"></a>
|
||
|
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_FOREGROUND</span><span class=cF0> &&
|
||
|
<a name="l50"></a> doc->flags&</span><span class=cF3>DOCF_COLOR_NAMES</span><span class=cF0> && 0<=attr<</span><span class=cF3>COLORS_NUM</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l51"></a> buf=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>attr,</span><span class=cF6>"ST_COLORS"</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l52"></a> attr=</span><span class=cF3>DOC_DFT</span><span class=cF0>;
|
||
|
<a name="l53"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l54"></a> buf=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>doc_e->type_u8,</span><span class=cF6>"ST_DOC_CMDS"</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8!=</span><span class=cF3>DOCT_ERROR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l56"></a> f1=</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[doc_e->type_u8];
|
||
|
<a name="l57"></a> t1=doc_e->type_u8|</span><span class=cFB>doldoc</span><span class=cF0>.dft_type_flags[doc_e->type_u8];
|
||
|
<a name="l58"></a>
|
||
|
<a name="l59"></a> de_flags=doc_e->de_flags&~(</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_SEL</span><span class=cF0>|
|
||
|
<a name="l60"></a> </span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>);
|
||
|
<a name="l61"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>DOCEf_FLAGS_NUM</span><span class=cF0>;i++)
|
||
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&f1,i</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&de_flags,i</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&de_flags,i</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>1<<i&</span><span class=cF3>DOCEG_HAS_ARG</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l65"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s+%Z"</span><span class=cF0>,buf,i,</span><span class=cF6>"ST_DOC_FLAGS"</span><span class=cF0>);
|
||
|
<a name="l66"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l67"></a> }
|
||
|
<a name="l68"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l69"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s-%Z"</span><span class=cF0>,buf,i,</span><span class=cF6>"ST_DOC_FLAGS"</span><span class=cF0>);
|
||
|
<a name="l70"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l71"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l72"></a> }
|
||
|
<a name="l73"></a> type=doc_e->type&~</span><span class=cF3>DOCET_SEL</span><span class=cF0>;
|
||
|
<a name="l74"></a> </span><span class=cF1>for</span><span class=cF0> (i=</span><span class=cF3>DOCEt_BLINK</span><span class=cF0>;i<=</span><span class=cF3>DOCEt_UNDERLINE</span><span class=cF0>;i++)
|
||
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&t1,i</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&type,i</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&type,i</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l77"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s+%Z"</span><span class=cF0>,buf,i,</span><span class=cF6>"ST_DOC_FLAGS"</span><span class=cF0>);
|
||
|
<a name="l78"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l79"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s-%Z"</span><span class=cF0>,buf,i,</span><span class=cF6>"ST_DOC_FLAGS"</span><span class=cF0>);
|
||
|
<a name="l80"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l81"></a> }
|
||
|
<a name="l82"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s,"</span><span class=cF0>,buf);
|
||
|
<a name="l83"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l84"></a> </span><span class=cF1>switch</span><span class=cF0> [doc_e->type_u8] {
|
||
|
<a name="l85"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>:
|
||
|
<a name="l86"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s%d,"</span><span class=cF0>,buf,doc_e->len);
|
||
|
<a name="l87"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l88"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s%d,"</span><span class=cF0>,buf,doc_e->hex_ed_width);
|
||
|
<a name="l89"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l90"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l91"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l92"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l93"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l94"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags&</span><span class=cF3>DOCF_COLOR_NAMES</span><span class=cF0> && 0<=attr<</span><span class=cF3>COLORS_NUM</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l96"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s%Z,"</span><span class=cF0>,buf,doc_e->attr,</span><span class=cF6>"ST_COLORS"</span><span class=cF0>);
|
||
|
<a name="l97"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l98"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l99"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l100"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_PAGE_LEN</span><span class=cF0>:
|
||
|
<a name="l101"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LEFT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l102"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_RIGHT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l103"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEADER</span><span class=cF0>:
|
||
|
<a name="l104"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOOTER</span><span class=cF0>:
|
||
|
<a name="l105"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INDENT</span><span class=cF0>:
|
||
|
<a name="l106"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_WORD_WRAP</span><span class=cF0>:
|
||
|
<a name="l107"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HIGHLIGHT</span><span class=cF0>:
|
||
|
<a name="l108"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BLINK</span><span class=cF0>:
|
||
|
<a name="l109"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INVERT</span><span class=cF0>:
|
||
|
<a name="l110"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_UNDERLINE</span><span class=cF0>:
|
||
|
<a name="l111"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_X</span><span class=cF0>:
|
||
|
<a name="l112"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (attr!=</span><span class=cF3>DOC_DFT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l114"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s%d,"</span><span class=cF0>,buf,doc_e->attr);
|
||
|
<a name="l115"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l116"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l117"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>-1: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l118"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l119"></a> }
|
||
|
<a name="l120"></a> de_flags=doc_e->de_flags & </span><span class=cF3>DOCEG_HAS_ARG</span><span class=cF0>;
|
||
|
<a name="l121"></a> </span><span class=cF1>while</span><span class=cF0> (de_flags) {
|
||
|
<a name="l122"></a> j=</span><span class=cF5>Bsf</span><span class=cF0>(de_flags);
|
||
|
<a name="l123"></a> </span><span class=cF5>Btr</span><span class=cF0>(&de_flags,j);
|
||
|
<a name="l124"></a> </span><span class=cF1>switch</span><span class=cF0> [j] </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l125"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_TAG</span><span class=cF0>:
|
||
|
<a name="l126"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0> || doc_e->type_u8==</span><span class=cF3>DOCT_MACRO</span><span class=cF0> &&
|
||
|
<a name="l127"></a> </span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0> &&
|
||
|
<a name="l128"></a> !</span><span class=cF5>StrCmp</span><span class=cF0>(doc_e->tag,doc_e->left_macro) ||
|
||
|
<a name="l129"></a> doc_e->de_flags&</span><span class=cF3>DOCEF_RIGHT_MACRO</span><span class=cF0> &&
|
||
|
<a name="l130"></a> !</span><span class=cF5>StrCmp</span><span class=cF0>(doc_e->tag,doc_e->right_macro)</span><span class=cF7>)</span><span class=cF0> ||
|
||
|
<a name="l131"></a> doc_e->de_flags&</span><span class=cF3>DOCEF_LST</span><span class=cF0> && !</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>doc_e->tag,</span><span class=cF6>"[]"</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l132"></a> doc_e->de_flags&</span><span class=cF3>DOCEF_DEFINE</span><span class=cF0>) {
|
||
|
<a name="l133"></a> buf2=buf;
|
||
|
<a name="l134"></a> buf=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l135"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l136"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0>>=4)
|
||
|
<a name="l138"></a> buf2=doc_e->tag+4;
|
||
|
<a name="l139"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l140"></a> buf2=</span><span class=cF6>""</span><span class=cF0>;
|
||
|
<a name="l141"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0>>=3)
|
||
|
<a name="l143"></a> buf2=doc_e->tag+3;
|
||
|
<a name="l144"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l145"></a> buf2=</span><span class=cF6>""</span><span class=cF0>;
|
||
|
<a name="l146"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l147"></a> buf2=doc_e->tag;
|
||
|
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[doc_e->type_u8],</span><span class=cF3>DOCEf_TAG</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l149"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s\"%$Q\","</span><span class=cF0>,buf,buf2);
|
||
|
<a name="l150"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l151"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sT=\"%$Q\","</span><span class=cF0>,buf,buf2);
|
||
|
<a name="l152"></a> }
|
||
|
<a name="l153"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l154"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEN</span><span class=cF0>:
|
||
|
<a name="l155"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sLEN=%d,"</span><span class=cF0>,buf,doc_e->len);
|
||
|
<a name="l156"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l157"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_AUX_STR</span><span class=cF0>:
|
||
|
<a name="l158"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sA=\"%$Q\","</span><span class=cF0>,buf,doc_e->aux_str);
|
||
|
<a name="l159"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l160"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_DEFINE</span><span class=cF0>:
|
||
|
<a name="l161"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sD=\"%$Q\","</span><span class=cF0>,buf,doc_e->define_str);
|
||
|
<a name="l162"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l163"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_HTML_LINK</span><span class=cF0>:
|
||
|
<a name="l164"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sHTML=\"%$Q\","</span><span class=cF0>,buf,doc_e->html_link);
|
||
|
<a name="l165"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l166"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEFT_EXP</span><span class=cF0>:
|
||
|
<a name="l167"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sLE=%d,"</span><span class=cF0>,buf,doc_e->left_exp);
|
||
|
<a name="l168"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l169"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEFT_MACRO</span><span class=cF0>:
|
||
|
<a name="l170"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sLM=\"%$Q\","</span><span class=cF0>,buf,doc_e->left_macro);
|
||
|
<a name="l171"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l172"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RIGHT_EXP</span><span class=cF0>:
|
||
|
<a name="l173"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sRE=%d,"</span><span class=cF0>,buf,doc_e->right_exp);
|
||
|
<a name="l174"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l175"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RIGHT_MACRO</span><span class=cF0>:
|
||
|
<a name="l176"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sRM=\"%$Q\","</span><span class=cF0>,buf,doc_e->right_macro);
|
||
|
<a name="l177"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l178"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_HAS_BIN</span><span class=cF0>:
|
||
|
<a name="l179"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sBI=%d,"</span><span class=cF0>,buf,doc_e->bin_num);
|
||
|
<a name="l180"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l181"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_BIN_PTR_LINK</span><span class=cF0>:
|
||
|
<a name="l182"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sBP=\"%$Q\","</span><span class=cF0>,buf,doc_e->bin_ptr_link);
|
||
|
<a name="l183"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l184"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RAW_TYPE</span><span class=cF0>:
|
||
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>&&doc_e->raw_type!=</span><span class=cF3>RT_I8</span><span class=cF0> ||
|
||
|
<a name="l186"></a> doc_e->type_u8!=</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>&&doc_e->raw_type!=</span><span class=cF3>RT_I64</span><span class=cF0>)
|
||
|
<a name="l187"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sRT=%Z,"</span><span class=cF0>,buf,doc_e->raw_type,</span><span class=cF6>"ST_RAW_TYPES"</span><span class=cF0>);
|
||
|
<a name="l188"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l189"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SHIFTED_X</span><span class=cF0>:
|
||
|
<a name="l190"></a> j=doc_e->type.u16[1]&0x1F;
|
||
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (j&0x10) j|=0xFFFFFFF0;
|
||
|
<a name="l192"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sSX=%d,"</span><span class=cF0>,buf,j);
|
||
|
<a name="l193"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l194"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l195"></a> j=doc_e->type>>21 &0x1F;
|
||
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (j&0x10) j|=0xFFFFFFF0;
|
||
|
<a name="l197"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sSY=%d,"</span><span class=cF0>,buf,j);
|
||
|
<a name="l198"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l199"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SCROLLING_X</span><span class=cF0>:
|
||
|
<a name="l200"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sSCX=%d,"</span><span class=cF0>,buf,doc_e->scroll_len);
|
||
|
<a name="l201"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l202"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_USER_DATA</span><span class=cF0>:
|
||
|
<a name="l203"></a> buf2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%sU=0x%X,"</span><span class=cF0>,buf,doc_e->user_data);
|
||
|
<a name="l204"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l205"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_FLAGS_NUM</span><span class=cF0>-1: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l206"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l207"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l208"></a> </span><span class=cF5>Free</span><span class=cF0>(buf); buf=buf2;
|
||
|
<a name="l209"></a> }
|
||
|
<a name="l210"></a> buf[</span><span class=cF5>StrLen</span><span class=cF0>(buf)-1]=0; </span><span class=cF2>//Kill last comma</span><span class=cF0>
|
||
|
<a name="l211"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l212"></a> buf2=</span><span class=cF5>StrNew</span><span class=cF0>(buf,doc->mem_task); </span><span class=cF2>//exact allocation</span><span class=cF0>
|
||
|
<a name="l213"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
||
|
<a name="l214"></a> </span><span class=cF1>return</span><span class=cF0> buf2;
|
||
|
<a name="l215"></a>}
|
||
|
<a name="l216"></a>
|
||
|
<a name="l217"></a></span><span class=cF9>CDocEntry</span><span class=cF0> *</span><span class=cF5>PrsDollarCmd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF1>U8</span><span class=cF0> *st)
|
||
|
<a name="l218"></a>{</span><span class=cF2>//Uses </span><a href="/Wb/Compiler/Lex.HC.HTML#l441"><span class=cF4>Lex</span></a><span class=cF2>() to parse a string and make Doc entries.</span><span class=cF0>
|
||
|
<a name="l219"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,de_flags,processed_flags,attr=</span><span class=cF3>DOC_DFT</span><span class=cF0>;
|
||
|
<a name="l220"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr,*st2;
|
||
|
<a name="l221"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l222"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *tmph;
|
||
|
<a name="l223"></a> </span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc=</span><span class=cF5>CmpCtrlNew</span><span class=cF0>(st,</span><span class=cF3>CCF_DONT_FREE_BUF</span><span class=cF0>);
|
||
|
<a name="l224"></a> </span><span class=cF9>CHashTable</span><span class=cF0> *old_hash_table_lst=cc->htc.hash_table_lst;
|
||
|
<a name="l225"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l226"></a> cc->htc.hash_table_lst=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_IDENT</span><span class=cF0>) {
|
||
|
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (tmph=</span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>cc->cur_str,</span><span class=cFB>doldoc</span><span class=cF0>.hash,</span><span class=cF3>DHT_DOC_CMD</span><span class=cF0>|</span><span class=cF3>DHT_COLOR</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l229"></a> </span><span class=cF1>if</span><span class=cF0> (tmph->type&</span><span class=cF3>DHT_DOC_CMD</span><span class=cF0>)
|
||
|
<a name="l230"></a> i=tmph->user_data0;
|
||
|
<a name="l231"></a> </span><span class=cF1>else</span><span class=cF0> {</span><span class=cF2>//DHT_COLOR</span><span class=cF0>
|
||
|
<a name="l232"></a> i=</span><span class=cF3>DOCT_FOREGROUND</span><span class=cF0>;
|
||
|
<a name="l233"></a> attr=tmph->user_data0;
|
||
|
<a name="l234"></a> }
|
||
|
<a name="l235"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l236"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l237"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//skip cmd code</span><span class=cF0>
|
||
|
<a name="l238"></a> doc_e=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocEntry</span><span class=cF7>)</span><span class=cF0>,doc->mem_task);
|
||
|
<a name="l239"></a> doc_e->type=i;
|
||
|
<a name="l240"></a> doc_e->de_flags=</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[i];
|
||
|
<a name="l241"></a> doc_e->type|=</span><span class=cFB>doldoc</span><span class=cF0>.dft_type_flags[i];
|
||
|
<a name="l242"></a> doc_e->raw_type=</span><span class=cF3>RT_I64</span><span class=cF0>;
|
||
|
<a name="l243"></a> doc_e->len=</span><span class=cF3>DOCE_LEN_DFT</span><span class=cF0>;
|
||
|
<a name="l244"></a> j=</span><span class=cF5>PrsDocFlags</span><span class=cF0>(cc,&doc_e->de_flags,&doc_e->type);
|
||
|
<a name="l245"></a> cc->htc.hash_table_lst=old_hash_table_lst;
|
||
|
<a name="l246"></a> </span><span class=cF1>switch</span><span class=cF0> [i] </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l247"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>:
|
||
|
<a name="l248"></a> doc_e->raw_type=</span><span class=cF3>RT_I8</span><span class=cF0>;
|
||
|
<a name="l249"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l250"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>:
|
||
|
<a name="l251"></a> </span><span class=cF1>while</span><span class=cF0> (cc->token==</span><span class=cF6>','</span><span class=cF0>)
|
||
|
<a name="l252"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l253"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l254"></a> doc_e->len=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
||
|
<a name="l255"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l256"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l257"></a> </span><span class=cF1>while</span><span class=cF0> (cc->token==</span><span class=cF6>','</span><span class=cF0>)
|
||
|
<a name="l258"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l259"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l260"></a> doc_e->hex_ed_width=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
||
|
<a name="l261"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l262"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l263"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l264"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_PAGE_LEN</span><span class=cF0>:
|
||
|
<a name="l265"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_LEFT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l266"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_RIGHT_MARGIN</span><span class=cF0>:
|
||
|
<a name="l267"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HEADER</span><span class=cF0>:
|
||
|
<a name="l268"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOOTER</span><span class=cF0>:
|
||
|
<a name="l269"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INDENT</span><span class=cF0>:
|
||
|
<a name="l270"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l271"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l272"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_FOREGROUND</span><span class=cF0>:
|
||
|
<a name="l273"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_DFT_BACKGROUND</span><span class=cF0>:
|
||
|
<a name="l274"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_WORD_WRAP</span><span class=cF0>:
|
||
|
<a name="l275"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_HIGHLIGHT</span><span class=cF0>:
|
||
|
<a name="l276"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_BLINK</span><span class=cF0>:
|
||
|
<a name="l277"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INVERT</span><span class=cF0>:
|
||
|
<a name="l278"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_UNDERLINE</span><span class=cF0>:
|
||
|
<a name="l279"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_X</span><span class=cF0>:
|
||
|
<a name="l280"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l281"></a> </span><span class=cF1>while</span><span class=cF0> (cc->token==</span><span class=cF6>','</span><span class=cF0>)
|
||
|
<a name="l282"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l283"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l284"></a> doc_e->attr=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
||
|
<a name="l285"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l286"></a> doc_e->attr=attr;
|
||
|
<a name="l287"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l288"></a>#</span><span class=cF1>assert</span><span class=cF0> </span><span class=cF3>DOCT_ERROR</span><span class=cF0>==</span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>-1
|
||
|
<a name="l289"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_ERROR</span><span class=cF0>:
|
||
|
<a name="l290"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l291"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l292"></a>
|
||
|
<a name="l293"></a> processed_flags=0;
|
||
|
<a name="l294"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l295"></a> cc->htc.hash_table_lst=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l296"></a> </span><span class=cF1>while</span><span class=cF0> (cc->token==</span><span class=cF6>','</span><span class=cF0>)
|
||
|
<a name="l297"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l298"></a> cc->htc.hash_table_lst=old_hash_table_lst;
|
||
|
<a name="l299"></a> j=</span><span class=cF5>PrsDocFlagSingle</span><span class=cF0>(cc,&doc_e->de_flags,&doc_e->type,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l300"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>de_flags=~processed_flags & doc_e->de_flags & </span><span class=cF3>DOCEG_HAS_ARG</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l301"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l302"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF6>'='</span><span class=cF0>)
|
||
|
<a name="l303"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l304"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l305"></a> j=</span><span class=cF5>Bsf</span><span class=cF0>(de_flags);
|
||
|
<a name="l306"></a> </span><span class=cF1>if</span><span class=cF0> (j<0 || </span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&processed_flags,j</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l307"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l308"></a> </span><span class=cF1>switch</span><span class=cF0> [j] {</span><span class=cF2>//TODO: Might check for expression errors</span><span class=cF0>
|
||
|
<a name="l309"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_TAG</span><span class=cF0>:
|
||
|
<a name="l310"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_e->tag) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l311"></a></span><span class=cF2>//If a $MA,LM=""$, Tag is filled when the LM is processed.</span><span class=cF0>
|
||
|
<a name="l312"></a> </span><span class=cF2>//if doc_e->df_flags&DOCEF_LST,</span><span class=cF0>
|
||
|
<a name="l313"></a> </span><span class=cF2>// Tag is filled when the Define is processed.</span><span class=cF0>
|
||
|
<a name="l314"></a> </span><span class=cF2>//(The dft_flag1.tag calls this after.)</span><span class=cF0>
|
||
|
<a name="l315"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) {
|
||
|
<a name="l316"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l317"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l318"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"[X] %s"</span><span class=cF0>,st2);
|
||
|
<a name="l319"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l320"></a> doc_e->min_col=1;
|
||
|
<a name="l321"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_LST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l322"></a> </span><span class=cF1>if</span><span class=cF0> (*st2!=</span><span class=cF6>'['</span><span class=cF0>) {
|
||
|
<a name="l323"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"[%s]"</span><span class=cF0>,st2);
|
||
|
<a name="l324"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l325"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l326"></a> st=st2;
|
||
|
<a name="l327"></a> doc_e->min_col=1;
|
||
|
<a name="l328"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & </span><span class=cF3>DOCEF_TREE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l329"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"+] %s"</span><span class=cF0>,st2);
|
||
|
<a name="l330"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l331"></a> doc_e->min_col=1;
|
||
|
<a name="l332"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l333"></a> st=st2;
|
||
|
<a name="l334"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(st,doc->mem_task);
|
||
|
<a name="l335"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l336"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l337"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l338"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l339"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l340"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEN</span><span class=cF0>:
|
||
|
<a name="l341"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l342"></a> doc_e->len=</span><span class=cF5>LexExpression</span><span class=cF0>(cc);
|
||
|
<a name="l343"></a> doc_e->de_flags&=~</span><span class=cF3>DOCEF_DFT_LEN</span><span class=cF0>;
|
||
|
<a name="l344"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l345"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l346"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l347"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_AUX_STR</span><span class=cF0>:
|
||
|
<a name="l348"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l349"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l350"></a> doc_e->aux_str=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l351"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l352"></a></span><span class=cF2>//</span><span class=cF8>Anchor</span><span class=cF0>
|
||
|
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>DOCT_DATA</span><span class=cF0>) { </span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocForm.HC.HTML#l209"><span class=cF4>DocForm</span></a><span class=cF2>()</span><span class=cF0>
|
||
|
<a name="l354"></a> </span><span class=cF1>if</span><span class=cF0> (ptr=</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>":"</span><span class=cF0>,doc_e->aux_str</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l355"></a> doc_e->min_col=ptr-doc_e->aux_str+1;
|
||
|
<a name="l356"></a> doc_e->tag=</span><span class=cF5>MAlloc</span><span class=cF0>(doc_e->len+doc_e->min_col+2,
|
||
|
<a name="l357"></a> doc->mem_task); </span><span class=cF2>//+2 because "_\0"</span><span class=cF0>
|
||
|
<a name="l358"></a> }
|
||
|
<a name="l359"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l360"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l361"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l362"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_DEFINE</span><span class=cF0>:
|
||
|
<a name="l363"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l364"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l365"></a> doc_e->define_str=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l366"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l367"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_LST</span><span class=cF0> && !doc_e->tag)
|
||
|
<a name="l368"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>"[]"</span><span class=cF0>,doc->mem_task);
|
||
|
<a name="l369"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l370"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l371"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l372"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_HTML_LINK</span><span class=cF0>:
|
||
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l374"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l375"></a> doc_e->html_link=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l376"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l377"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l378"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l379"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l380"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEFT_EXP</span><span class=cF0>:
|
||
|
<a name="l381"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l382"></a> doc_e->left_exp=</span><span class=cF5>LexExpression</span><span class=cF0>(cc);
|
||
|
<a name="l383"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l384"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l385"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l386"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_LEFT_MACRO</span><span class=cF0>:
|
||
|
<a name="l387"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l388"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l389"></a> doc_e->left_macro=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l390"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l391"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>DOCT_MACRO</span><span class=cF0> && !doc_e->tag)
|
||
|
<a name="l392"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->left_macro,doc->mem_task);
|
||
|
<a name="l393"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l394"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l395"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l396"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RIGHT_EXP</span><span class=cF0>:
|
||
|
<a name="l397"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l398"></a> doc_e->right_exp=</span><span class=cF5>LexExpression</span><span class=cF0>(cc);
|
||
|
<a name="l399"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l400"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l401"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l402"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RIGHT_MACRO</span><span class=cF0>:
|
||
|
<a name="l403"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l404"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l405"></a> doc_e->right_macro=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l406"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l407"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>DOCT_MACRO</span><span class=cF0> && !doc_e->tag)
|
||
|
<a name="l408"></a> doc_e->tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e->right_macro,doc->mem_task);
|
||
|
<a name="l409"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l410"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l411"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l412"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_HAS_BIN</span><span class=cF0>:
|
||
|
<a name="l413"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l414"></a> doc_e->bin_num=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
||
|
<a name="l415"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l416"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l417"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l418"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_BIN_PTR_LINK</span><span class=cF0>:
|
||
|
<a name="l419"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l420"></a> st2=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l421"></a> doc_e->bin_ptr_link=</span><span class=cF5>StrNew</span><span class=cF0>(st2,doc->mem_task);
|
||
|
<a name="l422"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l423"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>DocBinPtrRst</span><span class=cF7>(</span><span class=cF0>doc,doc_e</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l424"></a> doc_e->type=</span><span class=cF3>DOCT_ERROR</span><span class=cF0>;
|
||
|
<a name="l425"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l426"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l427"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l428"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_RAW_TYPE</span><span class=cF0>:
|
||
|
<a name="l429"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_IDENT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l430"></a> j=</span><span class=cF5>DefineMatch</span><span class=cF0>(cc->cur_str,</span><span class=cF6>"ST_RAW_TYPES"</span><span class=cF0>);
|
||
|
<a name="l431"></a> </span><span class=cF1>if</span><span class=cF0> (j<0)
|
||
|
<a name="l432"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l433"></a> doc_e->raw_type=j;
|
||
|
<a name="l434"></a> doc_e->de_flags&=~</span><span class=cF3>DOCEF_DFT_RAW_TYPE</span><span class=cF0>;
|
||
|
<a name="l435"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
|
||
|
<a name="l436"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l437"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l438"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l439"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SHIFTED_X</span><span class=cF0>:
|
||
|
<a name="l440"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l441"></a> doc_e->type|=(</span><span class=cF5>LexExpressionI64</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0> & 0x1F)<<16;
|
||
|
<a name="l442"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l443"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l444"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l445"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l446"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l447"></a> doc_e->type|=(</span><span class=cF5>LexExpressionI64</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0> & 0x1F)<<21;
|
||
|
<a name="l448"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l449"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l450"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l451"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_SCROLLING_X</span><span class=cF0>:
|
||
|
<a name="l452"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l453"></a> doc_e->scroll_len=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
||
|
<a name="l454"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l455"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l456"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l457"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_USER_DATA</span><span class=cF0>:
|
||
|
<a name="l458"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token)
|
||
|
<a name="l459"></a> doc_e->user_data=</span><span class=cF5>LexExpression</span><span class=cF0>(cc);
|
||
|
<a name="l460"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l461"></a> </span><span class=cF1>goto</span><span class=cF0> pd_err;
|
||
|
<a name="l462"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l463"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCEf_FLAGS_NUM</span><span class=cF0>-1: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l464"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l465"></a> }
|
||
|
<a name="l466"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l467"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l468"></a>pd_err:
|
||
|
<a name="l469"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_e)
|
||
|
<a name="l470"></a> doc_e=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocEntry</span><span class=cF7>)</span><span class=cF0>,doc->mem_task);
|
||
|
<a name="l471"></a> doc_e->type=</span><span class=cF3>DOCT_ERROR</span><span class=cF0>;
|
||
|
<a name="l472"></a> doc_e->de_flags=0;
|
||
|
<a name="l473"></a> }
|
||
|
<a name="l474"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags&</span><span class=cF3>DOCEF_LST</span><span class=cF0> && </span><span class=cF7>(</span><span class=cF0>doc_e->de_flags&</span><span class=cF3>DOCEF_REMALLOC_DATA</span><span class=cF0> ||
|
||
|
<a name="l475"></a> !(doc_e->de_flags&</span><span class=cF3>DOCEF_DEREF_DATA</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l476"></a> </span><span class=cF5>DocDataScan</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l477"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l478"></a> }
|
||
|
<a name="l479"></a> </span><span class=cF5>CmpCtrlDel</span><span class=cF0>(cc);
|
||
|
<a name="l480"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l481"></a> </span><span class=cF5>Fs</span><span class=cF0>->catch_except=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l482"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_e)
|
||
|
<a name="l483"></a> doc_e=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocEntry</span><span class=cF7>)</span><span class=cF0>,doc->mem_task);
|
||
|
<a name="l484"></a> doc_e->type=</span><span class=cF3>DOCT_ERROR</span><span class=cF0>;
|
||
|
<a name="l485"></a> doc_e->de_flags=0;
|
||
|
<a name="l486"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l487"></a> </span><span class=cF1>return</span><span class=cF0> doc_e;
|
||
|
<a name="l488"></a>}
|
||
|
<a name="l489"></a>
|
||
|
<a name="l490"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocEntryToggle</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l491"></a>{
|
||
|
<a name="l492"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc),old_color_names;
|
||
|
<a name="l493"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*cl1,*doc_ce2;
|
||
|
<a name="l494"></a> </span><span class=cF1>U8</span><span class=cF0> ch,*st,*st2;
|
||
|
<a name="l495"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k;
|
||
|
<a name="l496"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce!=doc &&
|
||
|
<a name="l497"></a> !</span><span class=cF7>(</span><span class=cF0>doc->flags&(</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_PLAIN_TEXT_TABS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l498"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>doc_ce->de_flags &
|
||
|
<a name="l499"></a> ~(</span><span class=cF3>DOCEF_TAG</span><span class=cF0>|</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCEF_WORD_WRAP</span><span class=cF0>|</span><span class=cF3>DOCEF_HIGHLIGHT</span><span class=cF0>|
|
||
|
<a name="l500"></a> </span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l501"></a> !</span><span class=cF7>(</span><span class=cF0>doc_ce->type&</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l502"></a> doc_ce2=doc_ce->last;
|
||
|
<a name="l503"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k<20;k++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l504"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce2!=doc) {
|
||
|
<a name="l505"></a> cl1=doc_ce2->last;
|
||
|
<a name="l506"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce2->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> &&
|
||
|
<a name="l507"></a> doc_ce->de_flags==doc_ce2->de_flags &&
|
||
|
<a name="l508"></a> doc_ce->type==doc_ce2->type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l509"></a> i=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce2->tag);
|
||
|
<a name="l510"></a> j=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l511"></a> st=</span><span class=cF5>MAlloc</span><span class=cF0>(i+j+1,doc->mem_task);
|
||
|
<a name="l512"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(st,doc_ce2->tag,i);
|
||
|
<a name="l513"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(st+i,doc_ce->tag,j+1);
|
||
|
<a name="l514"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l515"></a> doc_ce->tag=st;
|
||
|
<a name="l516"></a> doc_ce->max_col=i+j;
|
||
|
<a name="l517"></a> doc->cur_col+=i;
|
||
|
<a name="l518"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce2);
|
||
|
<a name="l519"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce2->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>)
|
||
|
<a name="l520"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce2);
|
||
|
<a name="l521"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l522"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l523"></a> doc_ce2=cl1;
|
||
|
<a name="l524"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l525"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l526"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l527"></a> doc_ce2=doc_ce->next;
|
||
|
<a name="l528"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k<20;k++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l529"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce2!=doc) {
|
||
|
<a name="l530"></a> cl1=doc_ce2->next;
|
||
|
<a name="l531"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce2->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> &&
|
||
|
<a name="l532"></a> doc_ce->de_flags==doc_ce2->de_flags &&
|
||
|
<a name="l533"></a> doc_ce->type==doc_ce2->type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l534"></a> i=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l535"></a> j=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce2->tag);
|
||
|
<a name="l536"></a> st=</span><span class=cF5>MAlloc</span><span class=cF0>(i+j+1,doc->mem_task);
|
||
|
<a name="l537"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(st,doc_ce->tag,i);
|
||
|
<a name="l538"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(st+i,doc_ce2->tag,j+1);
|
||
|
<a name="l539"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l540"></a> doc_ce->tag=st;
|
||
|
<a name="l541"></a> doc_ce->max_col=i+j;
|
||
|
<a name="l542"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce2);
|
||
|
<a name="l543"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce2->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>)
|
||
|
<a name="l544"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce2);
|
||
|
<a name="l545"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l546"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l547"></a> doc_ce2=cl1;
|
||
|
<a name="l548"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l549"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l550"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l551"></a> i=doc->cur_col;
|
||
|
<a name="l552"></a> </span><span class=cF1>while</span><span class=cF0> (i>doc_ce->min_col && doc_ce->tag[i]!=</span><span class=cF6>'$'</span><span class=cF0>)
|
||
|
<a name="l553"></a> i--;
|
||
|
<a name="l554"></a> j=doc->cur_col+1;
|
||
|
<a name="l555"></a> </span><span class=cF1>while</span><span class=cF0> (j<doc_ce->max_col && doc_ce->tag[j]!=</span><span class=cF6>'$'</span><span class=cF0>)
|
||
|
<a name="l556"></a> j++;
|
||
|
<a name="l557"></a> </span><span class=cF1>if</span><span class=cF0> (i<j-1 && doc_ce->min_col<=i<j<doc_ce->max_col &&
|
||
|
<a name="l558"></a> doc_ce->tag[i]==</span><span class=cF6>'$'</span><span class=cF0> && doc_ce->tag[j]==</span><span class=cF6>'$'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l559"></a> ch=doc_ce->tag[j+1];
|
||
|
<a name="l560"></a> doc_ce->tag[j+1]=0;
|
||
|
<a name="l561"></a> st=</span><span class=cF5>StrNew</span><span class=cF0>(doc_ce->tag+i);
|
||
|
<a name="l562"></a> doc_ce->tag[j+1]=ch;
|
||
|
<a name="l563"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(doc_ce->tag+i,doc_ce->tag+j+1);
|
||
|
<a name="l564"></a> doc->cur_col=i;
|
||
|
<a name="l565"></a> st2=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%q"</span><span class=cF0>,st);
|
||
|
<a name="l566"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce=</span><span class=cF5>DocPrint</span><span class=cF7>(</span><span class=cF0>doc,st2</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l567"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l568"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l569"></a> }
|
||
|
<a name="l570"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l571"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
||
|
<a name="l572"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l573"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l574"></a> old_color_names=</span><span class=cF5>LBts</span><span class=cF0>(&doc->flags,</span><span class=cF3>DOCf_COLOR_NAMES</span><span class=cF0>);
|
||
|
<a name="l575"></a> st=</span><span class=cF5>Doc2PlainText</span><span class=cF0>(doc,doc_ce);
|
||
|
<a name="l576"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&doc->flags,</span><span class=cF3>DOCf_COLOR_NAMES</span><span class=cF0>,old_color_names);
|
||
|
<a name="l577"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce);
|
||
|
<a name="l578"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$$%$Q$$"</span><span class=cF0>,st);
|
||
|
<a name="l579"></a> }
|
||
|
<a name="l580"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
||
|
<a name="l581"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l582"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l583"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l584"></a>}
|
||
|
<a name="l585"></a>
|
||
|
<a name="l586"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DocFlagsToggle</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> tog_flags)
|
||
|
<a name="l587"></a>{
|
||
|
<a name="l588"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l589"></a> </span><span class=cF9>I64</span><span class=cF0> size,flags=doc->flags^tog_flags;
|
||
|
<a name="l590"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
||
|
<a name="l591"></a> </span><span class=cF9>CDocUndo</span><span class=cF0> *u_next,*u_last;
|
||
|
<a name="l592"></a>
|
||
|
<a name="l593"></a> doc->flags=doc->flags&~</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>|</span><span class=cF3>DOCF_COLOR_NAMES</span><span class=cF0>;
|
||
|
<a name="l594"></a> st=</span><span class=cF5>DocSave</span><span class=cF0>(doc,&size);
|
||
|
<a name="l595"></a>
|
||
|
<a name="l596"></a> u_next=doc->undo_head.next;
|
||
|
<a name="l597"></a> u_last=doc->undo_head.last;
|
||
|
<a name="l598"></a> doc->undo_head.next=doc->undo_head.last=&doc->undo_head;
|
||
|
<a name="l599"></a>
|
||
|
<a name="l600"></a> </span><span class=cF5>DocRst</span><span class=cF0>(doc,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l601"></a> doc->undo_head.next=u_next;
|
||
|
<a name="l602"></a> doc->undo_head.last=u_last;
|
||
|
<a name="l603"></a> </span><span class=cF5>DocUndoCntSet</span><span class=cF0>(doc);
|
||
|
<a name="l604"></a> doc->flags=flags&~(</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>|</span><span class=cF3>DOCG_BL_IV_UL</span><span class=cF0>|</span><span class=cF3>DOCF_WORD_WRAP</span><span class=cF0>);
|
||
|
<a name="l605"></a> </span><span class=cF5>DocLoad</span><span class=cF0>(doc,st,size);
|
||
|
<a name="l606"></a> doc->flags|=flags&</span><span class=cF3>DOCF_NO_CURSOR</span><span class=cF0>;
|
||
|
<a name="l607"></a> </span><span class=cF5>DocCenter</span><span class=cF0>(doc);
|
||
|
<a name="l608"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l609"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l610"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l611"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|