201 lines
21 KiB
HTML
Executable File
201 lines
21 KiB
HTML
Executable File
<!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=cF1>Bool</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> num,</span><span class=cF1>Bool</span><span class=cF0> val)
|
|
<a name="l2"></a>{</span><span class=cF2>//Set compiler </span><a href="/Wb/Doc/Options.DD.HTML#l1"><span class=cF4>Option</span></a><span class=cF2> to val.</span><span class=cF0>
|
|
<a name="l3"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>BEqu</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->last_cc->opts,num,val);
|
|
<a name="l4"></a>}
|
|
<a name="l5"></a>
|
|
<a name="l6"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>GetOption</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> num)
|
|
<a name="l7"></a>{</span><span class=cF2>//Get state of compiler </span><a href="/Wb/Kernel/KernelA.HH.HTML#l1546"><span class=cF4>option</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l8"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Bt</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->last_cc->opts,num);
|
|
<a name="l9"></a>}
|
|
<a name="l10"></a>
|
|
<a name="l11"></a></span><span class=cF1>asm</span><span class=cF0> {
|
|
<a name="l12"></a></span><span class=cFD>_LAST_FUN</span><span class=cF0>:: </span><span class=cF2>//See </span><a href="/Wb/Kernel/KUtils.HC.HTML#l332"><span class=cF4>_CALL_IND</span></a><span class=cF0>
|
|
<a name="l13"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
|
|
<a name="l14"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>,</span><span class=cFC>RSP</span><span class=cF0>
|
|
<a name="l15"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
|
|
<a name="l16"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
|
|
<a name="l17"></a>
|
|
<a name="l18"></a> </span><span class=cF1>XOR</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>,</span><span class=cFC>RAX</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>,</span><span class=cFC>FS</span><span class=cF0>:</span><span class=cF9>CTask</span><span class=cF0>.last_fun[</span><span class=cFC>RAX</span><span class=cF0>]
|
|
<a name="l20"></a> </span><span class=cF1>TEST</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>,</span><span class=cFC>RAX</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF1>JZ</span><span class=cF0> @@10
|
|
<a name="l22"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>,</span><span class=cF9>U64</span><span class=cF0> </span><span class=cF9>CHashFun</span><span class=cF0>.exe_addr[</span><span class=cFC>RAX</span><span class=cF0>]
|
|
<a name="l23"></a>
|
|
<a name="l24"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>,</span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG1</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>//argc</span><span class=cF0>
|
|
<a name="l25"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG2</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>//argv</span><span class=cF0>
|
|
<a name="l26"></a> </span><span class=cF1>SHL</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>,3
|
|
<a name="l27"></a> </span><span class=cF1>SUB</span><span class=cF0> </span><span class=cFC>RSP</span><span class=cF0>,</span><span class=cFC>RCX</span><span class=cF0>
|
|
<a name="l28"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>,</span><span class=cFC>RSP</span><span class=cF0>
|
|
<a name="l29"></a> </span><span class=cF1>REP_MOVSB</span><span class=cF0>
|
|
<a name="l30"></a> </span><span class=cF1>TEST</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>,</span><span class=cFC>RDX</span><span class=cF0>
|
|
<a name="l31"></a> </span><span class=cF1>JZ</span><span class=cF0> @@05
|
|
<a name="l32"></a>
|
|
<a name="l33"></a> </span><span class=cF1>CALL</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>
|
|
<a name="l34"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
|
|
<a name="l35"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
|
|
<a name="l36"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
|
|
<a name="l37"></a> </span><span class=cF1>RET1</span><span class=cF0> 16
|
|
<a name="l38"></a>
|
|
<a name="l39"></a>@@05: </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>,</span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG1</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>//argc</span><span class=cF0>
|
|
<a name="l40"></a> </span><span class=cF1>SHL</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>,3
|
|
<a name="l41"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSP</span><span class=cF0>,</span><span class=cFC>RCX</span><span class=cF0>
|
|
<a name="l42"></a> </span><span class=cF1>XOR</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>,</span><span class=cFC>RAX</span><span class=cF0>
|
|
<a name="l43"></a>@@10: </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
|
|
<a name="l44"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
|
|
<a name="l45"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
|
|
<a name="l46"></a> </span><span class=cF1>RET1</span><span class=cF0> 16
|
|
<a name="l47"></a>}
|
|
<a name="l48"></a></span><span class=cF1>_extern</span><span class=cF0> </span><span class=cFD>_LAST_FUN</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LastFun</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> argc,</span><span class=cF9>I64</span><span class=cF0> *argv); </span><span class=cF2>//Execute last fun with args.</span><span class=cF0>
|
|
<a name="l49"></a>
|
|
<a name="l50"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PassTrace</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> i=0b10001111101)
|
|
<a name="l51"></a>{</span><span class=cF2>//Ctrls which optimizer passes are displayed.</span><span class=cF0>
|
|
<a name="l52"></a> </span><span class=cF9>I64</span><span class=cF0> old=</span><span class=cF5>Fs</span><span class=cF0>->last_cc->pass_trace;
|
|
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> (i) </span><span class=cF5>Fs</span><span class=cF0>->last_cc->saved_pass_trace=i;
|
|
<a name="l54"></a> </span><span class=cF5>Fs</span><span class=cF0>->last_cc->pass_trace=i;
|
|
<a name="l55"></a> </span><span class=cF1>return</span><span class=cF0> old;
|
|
<a name="l56"></a>}
|
|
<a name="l57"></a>
|
|
<a name="l58"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Trace</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> val=</span><span class=cF3>ON</span><span class=cF0>)
|
|
<a name="l59"></a>{</span><span class=cF2>//Displays assembly code output from compiler.</span><span class=cF0>
|
|
<a name="l60"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_TRACE</span><span class=cF0>,val);
|
|
<a name="l61"></a>}
|
|
<a name="l62"></a>
|
|
<a name="l63"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Echo</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> val)
|
|
<a name="l64"></a>{</span><span class=cF2>//Displays text as it is being compiled.</span><span class=cF0>
|
|
<a name="l65"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_ECHO</span><span class=cF0>,val);
|
|
<a name="l66"></a>}
|
|
<a name="l67"></a>
|
|
<a name="l68"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l69"></a>{</span><span class=cF2>//Injects text into the compile stream. Used in #exe{} blocks.</span><span class=cF0>
|
|
<a name="l70"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv),*st;
|
|
<a name="l71"></a> </span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc=</span><span class=cF5>Fs</span><span class=cF0>->last_cc;
|
|
<a name="l72"></a> </span><span class=cF9>CStreamBlk</span><span class=cF0> *tmpe=cc->last_stream_blk;
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (tmpe!=&cc->next_stream_blk) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l74"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s%s"</span><span class=cF0>,tmpe->body,buf);
|
|
<a name="l75"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpe->body);
|
|
<a name="l76"></a> tmpe->body=st;
|
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l78"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"No exe{} blk\n"</span><span class=cF0>);
|
|
<a name="l79"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l80"></a>}
|
|
<a name="l81"></a>
|
|
<a name="l82"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>StreamDir</span><span class=cF0>()
|
|
<a name="l83"></a>{
|
|
<a name="l84"></a> </span><span class=cF1>U8</span><span class=cF0> *dirname;
|
|
<a name="l85"></a> </span><span class=cF1>if</span><span class=cF0> (dirname=</span><span class=cF5>DirFile</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->last_cc->lex_include_stk->full_name</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l86"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"\"%s\""</span><span class=cF0>,dirname);
|
|
<a name="l87"></a> </span><span class=cF5>Free</span><span class=cF0>(dirname);
|
|
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l89"></a>}
|
|
<a name="l90"></a>
|
|
<a name="l91"></a></span><span class=cF9>CD2I32</span><span class=cF0> *</span><span class=cF5>LexD2I32</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CD2I32</span><span class=cF0> *p)
|
|
<a name="l92"></a>{</span><span class=cF2>//Not HolyC. Sprite-like lex 2D point.</span><span class=cF0>
|
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>'('</span><span class=cF0>)
|
|
<a name="l94"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting '(' at "</span><span class=cF0>);
|
|
<a name="l95"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip (</span><span class=cF0>
|
|
<a name="l96"></a> p->x=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
|
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>','</span><span class=cF0>)
|
|
<a name="l98"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting ',' at "</span><span class=cF0>);
|
|
<a name="l99"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip ,</span><span class=cF0>
|
|
<a name="l100"></a> p->y=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
|
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>')'</span><span class=cF0>)
|
|
<a name="l102"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting ')' at "</span><span class=cF0>);
|
|
<a name="l103"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip )</span><span class=cF0>
|
|
<a name="l104"></a> </span><span class=cF1>return</span><span class=cF0> p;
|
|
<a name="l105"></a>}
|
|
<a name="l106"></a>
|
|
<a name="l107"></a></span><span class=cF9>CD3I32</span><span class=cF0> *</span><span class=cF5>LexD3I32</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CD3I32</span><span class=cF0> *p)
|
|
<a name="l108"></a>{</span><span class=cF2>//Not HolyC. Sprite-like lex 3D point.</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>'('</span><span class=cF0>)
|
|
<a name="l110"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting '(' at "</span><span class=cF0>);
|
|
<a name="l111"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip (</span><span class=cF0>
|
|
<a name="l112"></a> p->x=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
|
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>','</span><span class=cF0>)
|
|
<a name="l114"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting ',' at "</span><span class=cF0>);
|
|
<a name="l115"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip ,</span><span class=cF0>
|
|
<a name="l116"></a> p->y=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
|
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>','</span><span class=cF0>)
|
|
<a name="l118"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting ',' at "</span><span class=cF0>);
|
|
<a name="l119"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip ,</span><span class=cF0>
|
|
<a name="l120"></a> p->z=</span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
|
|
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF6>')'</span><span class=cF0>)
|
|
<a name="l122"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Expecting ')' at "</span><span class=cF0>);
|
|
<a name="l123"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip )</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF1>return</span><span class=cF0> p;
|
|
<a name="l125"></a>}
|
|
<a name="l126"></a>
|
|
<a name="l127"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cFD>CmdLinePmt</span><span class=cF0>()
|
|
<a name="l128"></a>{
|
|
<a name="l129"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l130"></a> </span><span class=cF1>U8</span><span class=cF0> *res,*st;
|
|
<a name="l131"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>->new_answer) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>->answer_type&~1!=</span><span class=cF3>RT_I0</span><span class=cF0>) {
|
|
<a name="l133"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>->answer_type==</span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l134"></a> </span><span class=cF6>"%8.6fs ansf=%15.7g\n"</span><span class=cF0>,</span><span class=cF5>Fs</span><span class=cF0>->answer_time,</span><span class=cF5>Fs</span><span class=cF0>->answer;
|
|
<a name="l135"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l136"></a> </span><span class=cF6>"%8.6fs ans=0x%08X=%d\n"</span><span class=cF0>,</span><span class=cF5>Fs</span><span class=cF0>->answer_time,</span><span class=cF5>Fs</span><span class=cF0>->answer,</span><span class=cF5>Fs</span><span class=cF0>->answer;
|
|
<a name="l137"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
|
<a name="l138"></a> </span><span class=cF6>"%8.6fs\n"</span><span class=cF0>,</span><span class=cF5>Fs</span><span class=cF0>->answer_time;
|
|
<a name="l139"></a> </span><span class=cF5>Fs</span><span class=cF0>->answer=0;
|
|
<a name="l140"></a> }
|
|
<a name="l141"></a> </span><span class=cF5>Fs</span><span class=cF0>->new_answer=</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l142"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (st=</span><span class=cF5>DirCur</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l144"></a> </span><span class=cF6>"%s"</span><span class=cF0>,st;
|
|
<a name="l145"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l146"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l147"></a> </span><span class=cF6>'>'</span><span class=cF0>;
|
|
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsDbgMode</span><span class=cF0>&&</span><span class=cF5>IsRaw</span><span class=cF0>)
|
|
<a name="l149"></a> </span><span class=cF5>RawDr</span><span class=cF0>;
|
|
<a name="l150"></a>
|
|
<a name="l151"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->task_flags,</span><span class=cF3>TASKf_CMD_LINE_PMT</span><span class=cF0>);
|
|
<a name="l152"></a> st=</span><span class=cF5>GetStr</span><span class=cF0>(,,</span><span class=cF3>GSF_SHIFT_ESC_EXIT</span><span class=cF0>);
|
|
<a name="l153"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&</span><span class=cF5>Fs</span><span class=cF0>->task_flags,</span><span class=cF3>TASKf_CMD_LINE_PMT</span><span class=cF0>);
|
|
<a name="l154"></a>
|
|
<a name="l155"></a> i=</span><span class=cF5>StrLen</span><span class=cF0>(st);
|
|
<a name="l156"></a> res=</span><span class=cF5>MAlloc</span><span class=cF0>(i+1+2);
|
|
<a name="l157"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(res,st,i+1);
|
|
<a name="l158"></a> i--;
|
|
<a name="l159"></a> </span><span class=cF1>while</span><span class=cF0> (i>=0 && </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_white_space</span><span class=cF0>,res[i]</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l160"></a> i--;
|
|
<a name="l161"></a> i++;
|
|
<a name="l162"></a> </span><span class=cF1>if</span><span class=cF0> (i>0 && res[i-1]==</span><span class=cF6>';'</span><span class=cF0>)
|
|
<a name="l163"></a> res[i++]=</span><span class=cF6>';'</span><span class=cF0>; </span><span class=cF2>//The Lex goes one beyond</span><span class=cF0>
|
|
<a name="l164"></a> res[i++]=</span><span class=cF6>'\n'</span><span class=cF0>;</span><span class=cF2>//#define goes to '\n'</span><span class=cF0>
|
|
<a name="l165"></a> res[i]=0;
|
|
<a name="l166"></a>
|
|
<a name="l167"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l168"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l169"></a>}
|
|
</span></pre></body>
|
|
</html>
|