1227 lines
136 KiB
Plaintext
1227 lines
136 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=cF9>CLexFile</span><span class=cF0> *</span><span class=cFD>LexFilePush</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l2"></a>{</span><span class=cF2>//#include file push.</span><span class=cF0>
|
||
|
<a name="l3"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CLexFile</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l4"></a> </span><span class=cF1>if</span><span class=cF0> (res->next=cc->lex_include_stk)
|
||
|
<a name="l5"></a> res->depth=res->next->depth+1;
|
||
|
<a name="l6"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l7"></a> res->depth=-1; </span><span class=cF2>//Include depth starts with -1.</span><span class=cF0>
|
||
|
<a name="l8"></a> </span><span class=cF1>return</span><span class=cF0> cc->lex_include_stk=res;
|
||
|
<a name="l9"></a>}
|
||
|
<a name="l10"></a>
|
||
|
<a name="l11"></a></span><span class=cF9>CLexFile</span><span class=cF0> *</span><span class=cFD>LexFilePop</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l12"></a>{</span><span class=cF2>//#include file pop.</span><span class=cF0>
|
||
|
<a name="l13"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf;
|
||
|
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf=cc->lex_include_stk) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l15"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>cc->lex_include_stk=tmpf->next</span><span class=cF7>)</span><span class=cF0> || !</span><span class=cF7>(</span><span class=cF0>cc->flags & </span><span class=cF3>CCF_DONT_FREE_BUF</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->flags & </span><span class=cF3>LFSF_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l17"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->doc)
|
||
|
<a name="l18"></a> </span><span class=cF5>DocDel</span><span class=cF0>(tmpf->doc);
|
||
|
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l20"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf->buf);;
|
||
|
<a name="l21"></a> }
|
||
|
<a name="l22"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf->full_name);
|
||
|
<a name="l23"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf);
|
||
|
<a name="l24"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l25"></a> </span><span class=cF1>return</span><span class=cF0> cc->lex_include_stk;
|
||
|
<a name="l26"></a>}
|
||
|
<a name="l27"></a>
|
||
|
<a name="l28"></a></span><span class=cF9>CCmpCtrl</span><span class=cF0> *</span><span class=cF5>CmpCtrlNew</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> flags=0,</span><span class=cF1>U8</span><span class=cF0> *filename=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l29"></a>{</span><span class=cF2>//MAlloc and Init CCmpCtrl.</span><span class=cF0>
|
||
|
<a name="l30"></a></span><span class=cF2>//Frees buf in </span><a href="/Wb/Compiler/Lex.HC.HTML#l58"><span class=cF4>CmpCtrlDel</span></a><span class=cF2> unless </span><a href="/Wb/Kernel/KernelA.HH.HTML#l2141"><span class=cF4>CCF_DONT_FREE_BUF</span></a><span class=cF2> flag is set.</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cF2>//FileName is for error reporting. If files are #included,</span><span class=cF0>
|
||
|
<a name="l32"></a> </span><span class=cF2>//new names are used. See </span><a href="/Wb/Apps/Psalmody/PsalmodyFile.HC.HTML#l203"><span class=cF4>Psalmody CmpCtrlNew</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l33"></a> </span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CCmpCtrl</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l34"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf;
|
||
|
<a name="l35"></a> </span><span class=cF5>QueInit</span><span class=cF0>(cc);
|
||
|
<a name="l36"></a> cc->flags=flags;
|
||
|
<a name="l37"></a> cc->opts=1<<</span><span class=cF3>OPTf_WARN_UNUSED_VAR</span><span class=cF0>|1<<</span><span class=cF3>OPTf_WARN_HEADER_MISMATCH</span><span class=cF0>;
|
||
|
<a name="l38"></a> cc->htc.hash_mask=</span><span class=cF3>HTG_TYPE_MASK</span><span class=cF0>-</span><span class=cF3>HTT_IMPORT_SYS_SYM</span><span class=cF0>;
|
||
|
<a name="l39"></a> cc->htc.define_hash_table=cc->htc.hash_table_lst=
|
||
|
<a name="l40"></a> cc->htc.glbl_hash_table=cc->htc.local_hash_table=</span><span class=cF5>Fs</span><span class=cF0>->hash_table;
|
||
|
<a name="l41"></a> </span><span class=cF1>if</span><span class=cF0> (flags&</span><span class=cF3>CCF_KEEP_AT_SIGN</span><span class=cF0>)
|
||
|
<a name="l42"></a> cc-></span><span class=cFB>char_bmp_alpha_numeric</span><span class=cF0>=</span><span class=cFB>char_bmp_alpha_numeric_no_at</span><span class=cF0>;
|
||
|
<a name="l43"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l44"></a> cc-></span><span class=cFB>char_bmp_alpha_numeric</span><span class=cF0>=</span><span class=cFB>char_bmp_alpha_numeric</span><span class=cF0>;
|
||
|
<a name="l45"></a> tmpf=</span><span class=cFD>LexFilePush</span><span class=cF0>(cc);
|
||
|
<a name="l46"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&cc->next_stream_blk);
|
||
|
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (filename)
|
||
|
<a name="l48"></a> tmpf->full_name=</span><span class=cF5>FileNameAbs</span><span class=cF0>(filename);
|
||
|
<a name="l49"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l50"></a> tmpf->full_name=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cFB>blkdev</span><span class=cF0>.tmp_filename);
|
||
|
<a name="l51"></a> </span><span class=cF1>if</span><span class=cF0> (flags & </span><span class=cF3>CCF_PMT</span><span class=cF0>)
|
||
|
<a name="l52"></a> buf=</span><span class=cF5>CAlloc</span><span class=cF0>(8);
|
||
|
<a name="l53"></a> tmpf->buf=tmpf->buf_ptr=tmpf->line_start=cc->cur_buf_ptr=buf;
|
||
|
<a name="l54"></a> tmpf->line_num=1;
|
||
|
<a name="l55"></a> </span><span class=cF1>return</span><span class=cF0> cc;
|
||
|
<a name="l56"></a>}
|
||
|
<a name="l57"></a>
|
||
|
<a name="l58"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>CmpCtrlDel</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l59"></a>{</span><span class=cF2>//Free CCmpCtrl.</span><span class=cF0>
|
||
|
<a name="l60"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFD>LexFilePop</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l61"></a> </span><span class=cF5>LinkedLstDel</span><span class=cF0>(cc->lex_prs_stk);
|
||
|
<a name="l62"></a> </span><span class=cF5>LinkedLstDel</span><span class=cF0>(cc->htc.next);
|
||
|
<a name="l63"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->ps);
|
||
|
<a name="l64"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_str);
|
||
|
<a name="l65"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_help_idx);
|
||
|
<a name="l66"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->dollar_buf);
|
||
|
<a name="l67"></a> </span><span class=cF5>Free</span><span class=cF0>(cc);
|
||
|
<a name="l68"></a>}
|
||
|
<a name="l69"></a>
|
||
|
<a name="l70"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>CmpCtrlSize</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l71"></a>{</span><span class=cF2>//Mem size of CCmpCtrl and its members.</span><span class=cF0>
|
||
|
<a name="l72"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf=cc->lex_include_stk;
|
||
|
<a name="l73"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
||
|
<a name="l74"></a> </span><span class=cF1>while</span><span class=cF0> (tmpf) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->next || !</span><span class=cF7>(</span><span class=cF0>cc->flags & </span><span class=cF3>CCF_DONT_FREE_BUF</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->flags & </span><span class=cF3>LFSF_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l77"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->doc)
|
||
|
<a name="l78"></a> res+=</span><span class=cF5>DocSize</span><span class=cF0>(tmpf->doc);
|
||
|
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l80"></a> res+=</span><span class=cF5>MSize2</span><span class=cF0>(tmpf->buf);
|
||
|
<a name="l81"></a> }
|
||
|
<a name="l82"></a> res+=</span><span class=cF5>MSize2</span><span class=cF0>(tmpf->full_name);
|
||
|
<a name="l83"></a> res+=</span><span class=cF5>MSize2</span><span class=cF0>(tmpf);
|
||
|
<a name="l84"></a> tmpf=tmpf->next;
|
||
|
<a name="l85"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l86"></a> res+=</span><span class=cF5>MSize2</span><span class=cF0>(cc->cur_str);
|
||
|
<a name="l87"></a> res+=</span><span class=cF5>MSize2</span><span class=cF0>(cc);
|
||
|
<a name="l88"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l89"></a>}
|
||
|
<a name="l90"></a>
|
||
|
<a name="l91"></a></span><span class=cF9>U32</span><span class=cF0> </span><span class=cFD>lex_zeros</span><span class=cF0>=0;
|
||
|
<a name="l92"></a>
|
||
|
<a name="l93"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cFD>LexDollar</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e)
|
||
|
<a name="l94"></a>{
|
||
|
<a name="l95"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
||
|
<a name="l96"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_IN_QUOTES</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l97"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->dollar_buf);
|
||
|
<a name="l98"></a> st=</span><span class=cF5>Doc2PlainText</span><span class=cF0>(doc,doc_e);
|
||
|
<a name="l99"></a> cc->dollar_buf=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"$%$Q$"</span><span class=cF0>,st);
|
||
|
<a name="l100"></a> cc->dollar_cnt=2;
|
||
|
<a name="l101"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l102"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l104"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l105"></a>}
|
||
|
<a name="l106"></a>
|
||
|
<a name="l107"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LexGetChar</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l108"></a>{</span><span class=cF2>//Get one char from stream. Allow put-back one.</span><span class=cF0>
|
||
|
<a name="l109"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr,*src;
|
||
|
<a name="l110"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf;
|
||
|
<a name="l111"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
||
|
<a name="l112"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
||
|
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Btr</span><span class=cF7>(</span><span class=cF0>&cc->flags,</span><span class=cF3>CCf_USE_LAST_U16</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l114"></a>lgc_start1:
|
||
|
<a name="l115"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>src=cc->cur_buf_ptr++</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l116"></a> cc->cur_buf_ptr=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l117"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_here;
|
||
|
<a name="l118"></a> }
|
||
|
<a name="l119"></a> </span><span class=cF1>switch</span><span class=cF0> [cc->last_U16=*src++] {
|
||
|
<a name="l120"></a> </span><span class=cF1>case</span><span class=cF0> 0:
|
||
|
<a name="l121"></a>lgc_here:
|
||
|
<a name="l122"></a> tmpf=cc->lex_include_stk;
|
||
|
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->flags & </span><span class=cF3>LFSF_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l124"></a> doc=tmpf->doc;
|
||
|
<a name="l125"></a> doc_e=tmpf->cur_entry;
|
||
|
<a name="l126"></a> doc_e=doc_e->next;
|
||
|
<a name="l127"></a>lgc_start2:
|
||
|
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc) {
|
||
|
<a name="l129"></a> tmpf->cur_entry=doc_e;
|
||
|
<a name="l130"></a> </span><span class=cF1>switch</span><span class=cF0> [doc_e->type_u8] </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l131"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TEXT</span><span class=cF0>:
|
||
|
<a name="l132"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->de_flags & ~</span><span class=cF7>(</span><span class=cF3>DOCEF_TAG</span><span class=cF0>|</span><span class=cF3>DOCEF_DEFINE</span><span class=cF0>|</span><span class=cF3>DOCEF_TAG_CB</span><span class=cF0>|
|
||
|
<a name="l133"></a> </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="l134"></a> </span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l135"></a> </span><span class=cFD>LexDollar</span><span class=cF7>(</span><span class=cF0>cc,doc,doc_e</span><span class=cF7>)</span><span class=cF0> && *</span><span class=cF7>(</span><span class=cF0>src=cc->dollar_buf</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l136"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l137"></a> tmpf->buf_ptr=cc->cur_buf_ptr=src;
|
||
|
<a name="l138"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*</span><span class=cF7>(</span><span class=cF0>src=doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l139"></a> tmpf->buf_ptr=cc->cur_buf_ptr=src;
|
||
|
<a name="l140"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l141"></a> doc_e=doc_e->next;
|
||
|
<a name="l142"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start2;
|
||
|
<a name="l143"></a> }
|
||
|
<a name="l144"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l145"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>:
|
||
|
<a name="l146"></a> tmpf->buf_ptr=cc->cur_buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l147"></a> tmpf->line_start=doc_e->next;
|
||
|
<a name="l148"></a> tmpf->line_num=doc_e->y+2;</span><span class=cF2>//+1 because NEW_LINE is on prev line</span><span class=cF0>
|
||
|
<a name="l149"></a></span><span class=cF2>//+1 because doc y starts at zero</span><span class=cF0>
|
||
|
<a name="l150"></a> </span><span class=cFB>cmp</span><span class=cF0>.compiled_lines++;
|
||
|
<a name="l151"></a> cc->last_U16=</span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l152"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_done;
|
||
|
<a name="l153"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_TAB</span><span class=cF0>:
|
||
|
<a name="l154"></a> tmpf->buf_ptr=cc->cur_buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l155"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l156"></a> cc->last_U16=</span><span class=cF6>'\t'</span><span class=cF0>;
|
||
|
<a name="l157"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_done;
|
||
|
<a name="l158"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INS_BIN</span><span class=cF0>:
|
||
|
<a name="l159"></a> tmpf->buf_ptr=cc->cur_buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l160"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l161"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_str);
|
||
|
<a name="l162"></a> cc->cur_str=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l163"></a> cc->cur_str_len=0;
|
||
|
<a name="l164"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->bin_data) {
|
||
|
<a name="l165"></a> ptr=</span><span class=cF5>MAlloc</span><span class=cF0>(doc_e->bin_data->size);
|
||
|
<a name="l166"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->bin_data->data)
|
||
|
<a name="l167"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(ptr,doc_e->bin_data->data,doc_e->bin_data->size);
|
||
|
<a name="l168"></a> cc->cur_str=ptr;
|
||
|
<a name="l169"></a> cc->cur_str_len=doc_e->bin_data->size;
|
||
|
<a name="l170"></a> }
|
||
|
<a name="l171"></a> cc->last_U16=</span><span class=cF3>TK_INS_BIN</span><span class=cF0>;
|
||
|
<a name="l172"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_done;
|
||
|
<a name="l173"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_INS_BIN_SIZE</span><span class=cF0>:
|
||
|
<a name="l174"></a> tmpf->buf_ptr=cc->cur_buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l175"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->bin_data)
|
||
|
<a name="l176"></a> cc->cur_i64=doc_e->bin_data->size;
|
||
|
<a name="l177"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l178"></a> cc->cur_i64=0;
|
||
|
<a name="l179"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l180"></a> cc->last_U16=</span><span class=cF3>TK_INS_BIN_SIZE</span><span class=cF0>;
|
||
|
<a name="l181"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_done;
|
||
|
<a name="l182"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_SHIFTED_Y</span><span class=cF0>:
|
||
|
<a name="l183"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>LexDollar</span><span class=cF7>(</span><span class=cF0>cc,doc,doc_e</span><span class=cF7>)</span><span class=cF0> && *</span><span class=cF7>(</span><span class=cF0>src=cc->dollar_buf</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l184"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l185"></a> tmpf->buf_ptr=cc->cur_buf_ptr=src;
|
||
|
<a name="l186"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l187"></a> tmpf->buf_ptr=cc->cur_buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l188"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l189"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr<0)
|
||
|
<a name="l190"></a> cc->last_U16=</span><span class=cF3>TK_SUPERSCRIPT</span><span class=cF0>;
|
||
|
<a name="l191"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_e->attr>0)
|
||
|
<a name="l192"></a> cc->last_U16=</span><span class=cF3>TK_SUBSCRIPT</span><span class=cF0>;
|
||
|
<a name="l193"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l194"></a> cc->last_U16=</span><span class=cF3>TK_NORMALSCRIPT</span><span class=cF0>;
|
||
|
<a name="l195"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_done;
|
||
|
<a name="l196"></a> }
|
||
|
<a name="l197"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l198"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_MARKER</span><span class=cF0>:
|
||
|
<a name="l199"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>DOCT_CURSOR</span><span class=cF0>:
|
||
|
<a name="l200"></a> doc_e=doc_e->next;
|
||
|
<a name="l201"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start2;
|
||
|
<a name="l202"></a> </span><span class=cF1>case</span><span class=cF0> 0xFF: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l203"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>LexDollar</span><span class=cF7>(</span><span class=cF0>cc,doc,doc_e</span><span class=cF7>)</span><span class=cF0> && *</span><span class=cF7>(</span><span class=cF0>src=cc->dollar_buf</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l205"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l206"></a> tmpf->buf_ptr=cc->cur_buf_ptr=src;
|
||
|
<a name="l207"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l208"></a> doc_e=doc_e->next;
|
||
|
<a name="l209"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start2;
|
||
|
<a name="l210"></a> }
|
||
|
<a name="l211"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l212"></a> }
|
||
|
<a name="l213"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc)
|
||
|
<a name="l214"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start1;
|
||
|
<a name="l215"></a> tmpf->cur_entry=doc->head.last; </span><span class=cF2>//When take next, will still be end.</span><span class=cF0>
|
||
|
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l217"></a> tmpf=cc->lex_include_stk;
|
||
|
<a name="l218"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->next) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l219"></a> tmpf=</span><span class=cFD>LexFilePop</span><span class=cF0>(cc);
|
||
|
<a name="l220"></a> cc->cur_buf_ptr=tmpf->buf_ptr;
|
||
|
<a name="l221"></a> cc->flags&=~</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l222"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>cc->last_U16=tmpf->last_U16</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l223"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start1;
|
||
|
<a name="l224"></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="l225"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_PMT</span><span class=cF0>) {
|
||
|
<a name="l226"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpf->buf);
|
||
|
<a name="l227"></a> ptr=</span><span class=cFD>CmdLinePmt</span><span class=cF0>;
|
||
|
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>ptr,</span><span class=cF6>"\n"</span><span class=cF7>)</span><span class=cF0> && !cc->pmt_line++ && !</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>ptr,</span><span class=cF6>"?\n"</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l229"></a> cc->flags & </span><span class=cF3>CCF_QUESTION_HELP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l230"></a> </span><span class=cF5>Free</span><span class=cF0>(ptr);
|
||
|
<a name="l231"></a> ptr=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>"Help;;\n"</span><span class=cF0>);
|
||
|
<a name="l232"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l233"></a> tmpf->buf=tmpf->buf_ptr=tmpf->line_start=cc->cur_buf_ptr=ptr;
|
||
|
<a name="l234"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start1;
|
||
|
<a name="l235"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l236"></a> </span><span class=cF1>if</span><span class=cF0> (src)
|
||
|
<a name="l237"></a> cc->cur_buf_ptr=src-1;
|
||
|
<a name="l238"></a> cc->last_U16=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l239"></a> }
|
||
|
<a name="l240"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l241"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l242"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CURSOR</span><span class=cF0>:
|
||
|
<a name="l243"></a> </span><span class=cF1>goto</span><span class=cF0> lgc_start1;
|
||
|
<a name="l244"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\n'</span><span class=cF0>:
|
||
|
<a name="l245"></a> tmpf=cc->lex_include_stk;
|
||
|
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpf->flags & </span><span class=cF3>LFSF_DOC</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l247"></a> tmpf->line_num++;
|
||
|
<a name="l248"></a> </span><span class=cFB>cmp</span><span class=cF0>.compiled_lines++;
|
||
|
<a name="l249"></a> tmpf->line_start=src;
|
||
|
<a name="l250"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l251"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l252"></a> </span><span class=cF1>case</span><span class=cF0> 0xFF: </span><span class=cF2>//nobound switch</span><span class=cF0>
|
||
|
<a name="l253"></a> }
|
||
|
<a name="l254"></a>lgc_done:
|
||
|
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (cc->last_U16==</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>)
|
||
|
<a name="l256"></a> cc->last_U16=</span><span class=cF3>CH_SPACE</span><span class=cF0>;
|
||
|
<a name="l257"></a> </span><span class=cF1>if</span><span class=cF0> (cc->opts & </span><span class=cF3>OPTF_ECHO</span><span class=cF0> &&
|
||
|
<a name="l258"></a> cc->last_U16<256 && </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_printable</span><span class=cF0>,cc->last_U16</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l259"></a> </span><span class=cF6>''</span><span class=cF0> cc->last_U16;
|
||
|
<a name="l260"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l261"></a> </span><span class=cF1>return</span><span class=cF0> cc->last_U16;
|
||
|
<a name="l262"></a>}
|
||
|
<a name="l263"></a>
|
||
|
<a name="l264"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexSkipEol</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l265"></a>{</span><span class=cF2>//</span><a href="/Wb/Compiler/Lex.HC.HTML#l107"><span class=cF4>LexGetChar</span></a><span class=cF2> to NULL until end-of-line.</span><span class=cF0>
|
||
|
<a name="l266"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
|
||
|
<a name="l267"></a> </span><span class=cF1>do</span><span class=cF0> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l268"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_non_eol</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l269"></a>}
|
||
|
<a name="l270"></a>
|
||
|
<a name="l271"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>LexFirstRem</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF1>U8</span><span class=cF0> *marker,</span><span class=cF9>I64</span><span class=cF0> _len=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l272"></a>{</span><span class=cF2>//</span><a href="/Wb/Compiler/Lex.HC.HTML#l107"><span class=cF4>LexGetChar</span></a><span class=cF2>() chars making str until marker.</span><span class=cF0>
|
||
|
<a name="l273"></a> </span><span class=cF1>U8</span><span class=cF0> *res,*ptr;
|
||
|
<a name="l274"></a> </span><span class=cF9>CQueVectU8</span><span class=cF0> *tmpv=</span><span class=cF5>QueVectU8New</span><span class=cF0>;
|
||
|
<a name="l275"></a> </span><span class=cF9>I64</span><span class=cF0> i,len=0;
|
||
|
<a name="l276"></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="l277"></a> i=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l278"></a> </span><span class=cF1>if</span><span class=cF0> (!i||</span><span class=cF5>StrOcc</span><span class=cF7>(</span><span class=cF0>marker,i</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l279"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l280"></a> </span><span class=cF5>QueVectU8Put</span><span class=cF0>(tmpv,len++,i);
|
||
|
<a name="l281"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l282"></a> </span><span class=cF1>if</span><span class=cF0> (i)
|
||
|
<a name="l283"></a> </span><span class=cF5>Bts</span><span class=cF0>(&cc->flags,</span><span class=cF3>CCf_USE_LAST_U16</span><span class=cF0>);
|
||
|
<a name="l284"></a> res=ptr=</span><span class=cF5>MAlloc</span><span class=cF0>(len+1);
|
||
|
<a name="l285"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<len;i++)
|
||
|
<a name="l286"></a> *ptr++=</span><span class=cF5>QueVectU8Get</span><span class=cF0>(tmpv,i);
|
||
|
<a name="l287"></a> *ptr=0;
|
||
|
<a name="l288"></a> </span><span class=cF5>QueVectU8Del</span><span class=cF0>(tmpv);
|
||
|
<a name="l289"></a> </span><span class=cF1>if</span><span class=cF0> (_len) *_len=len;
|
||
|
<a name="l290"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l291"></a>}
|
||
|
<a name="l292"></a>
|
||
|
<a name="l293"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>LexIncludeStr</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF1>U8</span><span class=cF0> *abs_filename,</span><span class=cF1>U8</span><span class=cF0> *src,</span><span class=cF1>Bool</span><span class=cF0> actual_file)
|
||
|
<a name="l294"></a>{
|
||
|
<a name="l295"></a> </span><span class=cFD>LexBackupLastChar</span><span class=cF0>(cc);
|
||
|
<a name="l296"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf=</span><span class=cFD>LexFilePush</span><span class=cF0>(cc);
|
||
|
<a name="l297"></a> </span><span class=cF1>if</span><span class=cF0> (actual_file)
|
||
|
<a name="l298"></a> tmpf->full_name=</span><span class=cF5>StrNew</span><span class=cF0>(abs_filename);
|
||
|
<a name="l299"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l300"></a> tmpf->full_name=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cFB>blkdev</span><span class=cF0>.tmp_filename);
|
||
|
<a name="l301"></a> tmpf->line_num=1;
|
||
|
<a name="l302"></a> tmpf->buf=tmpf->buf_ptr=tmpf->line_start=cc->cur_buf_ptr=src;
|
||
|
<a name="l303"></a>}
|
||
|
<a name="l304"></a>
|
||
|
<a name="l305"></a></span><span class=cF9>CDoc</span><span class=cF0> *</span><span class=cFD>LexDocRead</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *abs_filename,</span><span class=cF9>I64</span><span class=cF0> flags)
|
||
|
<a name="l306"></a>{
|
||
|
<a name="l307"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>(abs_filename);
|
||
|
<a name="l308"></a> </span><span class=cF1>U8</span><span class=cF0> *src;
|
||
|
<a name="l309"></a> </span><span class=cF9>I64</span><span class=cF0> size=0;
|
||
|
<a name="l310"></a> doc->flags|=flags;
|
||
|
<a name="l311"></a> src=</span><span class=cF5>FileRead</span><span class=cF0>(abs_filename,&size);
|
||
|
<a name="l312"></a> </span><span class=cF1>if</span><span class=cF0> (!src || !size) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l313"></a> </span><span class=cF5>Free</span><span class=cF0>(src);
|
||
|
<a name="l314"></a> src=</span><span class=cF5>CAlloc</span><span class=cF0>(1);
|
||
|
<a name="l315"></a> size=0;
|
||
|
<a name="l316"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l317"></a> </span><span class=cF5>DocLoad</span><span class=cF0>(doc,src,size);
|
||
|
<a name="l318"></a> </span><span class=cF5>Free</span><span class=cF0>(src);
|
||
|
<a name="l319"></a> </span><span class=cF1>return</span><span class=cF0> doc;
|
||
|
<a name="l320"></a>}
|
||
|
<a name="l321"></a>
|
||
|
<a name="l322"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cFD>cmp_type_flags_src_code</span><span class=cF0>[(</span><span class=cF3>DOCT_TYPES_NUM</span><span class=cF0>+63)/64]={
|
||
|
<a name="l323"></a> 1<<</span><span class=cF3>DOCT_TEXT</span><span class=cF0>|1<<</span><span class=cF3>DOCT_TAB</span><span class=cF0>|1<<</span><span class=cF3>DOCT_INS_BIN</span><span class=cF0>|1<<</span><span class=cF3>DOCT_INS_BIN_SIZE</span><span class=cF0>};
|
||
|
<a name="l324"></a>
|
||
|
<a name="l325"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>LexAttachDoc</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CLexFile</span><span class=cF0> *tmpf=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l326"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *abs_filename=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> col=0)
|
||
|
<a name="l327"></a>{</span><span class=cF2>//Start lexing doc. Give either doc or abs_filename.</span><span class=cF0>
|
||
|
<a name="l328"></a> </span><span class=cF1>if</span><span class=cF0> (!doc)
|
||
|
<a name="l329"></a> doc=</span><span class=cFD>LexDocRead</span><span class=cF0>(abs_filename,</span><span class=cF3>DOCF_DBL_DOLLARS</span><span class=cF0>);
|
||
|
<a name="l330"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpf) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l331"></a> </span><span class=cFD>LexBackupLastChar</span><span class=cF0>(cc);
|
||
|
<a name="l332"></a> tmpf=</span><span class=cFD>LexFilePush</span><span class=cF0>(cc);
|
||
|
<a name="l333"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l334"></a> </span><span class=cF1>if</span><span class=cF0> (!doc_e)
|
||
|
<a name="l335"></a> doc_e=doc->head.next;
|
||
|
<a name="l336"></a> tmpf->full_name=</span><span class=cF5>StrNew</span><span class=cF0>(doc->filename.name);
|
||
|
<a name="l337"></a> tmpf->doc=doc;
|
||
|
<a name="l338"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l339"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFD>cmp_type_flags_src_code</span><span class=cF0>,doc_e->type_u8</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l340"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l341"></a> doc_e=doc_e->next;
|
||
|
<a name="l342"></a> col=doc_e->min_col;
|
||
|
<a name="l343"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l345"></a> col=</span><span class=cF5>ClampI64</span><span class=cF0>(col,doc_e->min_col,doc_e->max_col);
|
||
|
<a name="l346"></a> tmpf->line_start=doc_e;
|
||
|
<a name="l347"></a> tmpf->buf=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l348"></a> tmpf->line_num=doc_e->y+1;
|
||
|
<a name="l349"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0>) {
|
||
|
<a name="l350"></a> tmpf->cur_entry=doc_e;
|
||
|
<a name="l351"></a> tmpf->buf_ptr=doc_e->tag;
|
||
|
<a name="l352"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l353"></a> tmpf->cur_entry=doc_e->last; </span><span class=cF2>//TODO: might be problem at begin of file</span><span class=cF0>
|
||
|
<a name="l354"></a> tmpf->buf_ptr=&</span><span class=cFD>lex_zeros</span><span class=cF0>;
|
||
|
<a name="l355"></a> }
|
||
|
<a name="l356"></a> tmpf->flags=</span><span class=cF3>LFSF_DOC</span><span class=cF0>;
|
||
|
<a name="l357"></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=cF2>//TODO: DocDel(doc)?</span><span class=cF0>
|
||
|
<a name="l358"></a> col=0;
|
||
|
<a name="l359"></a> tmpf->buf=tmpf->buf_ptr=tmpf->line_start=</span><span class=cF5>CAlloc</span><span class=cF0>(1);
|
||
|
<a name="l360"></a> tmpf->line_num=1;
|
||
|
<a name="l361"></a> tmpf->flags=0;
|
||
|
<a name="l362"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l363"></a> cc->cur_buf_ptr=tmpf->buf_ptr+col;
|
||
|
<a name="l364"></a> tmpf->last_U16=0;
|
||
|
<a name="l365"></a>}
|
||
|
<a name="l366"></a>
|
||
|
<a name="l367"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cFD>LexInStr</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF1>U8</span><span class=cF0> *buf,</span><span class=cF9>I64</span><span class=cF0> size,</span><span class=cF1>Bool</span><span class=cF0> *done)
|
||
|
<a name="l368"></a>{
|
||
|
<a name="l369"></a> </span><span class=cF9>I64</span><span class=cF0> i=0,j,k,ch;
|
||
|
<a name="l370"></a> *done=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l371"></a> </span><span class=cF1>while</span><span class=cF0> (i<size-1) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l372"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (!ch || ch==</span><span class=cF6>'"'</span><span class=cF0>) {
|
||
|
<a name="l374"></a> buf[i++]=0;
|
||
|
<a name="l375"></a> </span><span class=cF1>return</span><span class=cF0> i;
|
||
|
<a name="l376"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\\'</span><span class=cF0>) {
|
||
|
<a name="l377"></a> </span><span class=cF1>switch</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l378"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'0'</span><span class=cF0>:
|
||
|
<a name="l379"></a> buf[i++]=0;
|
||
|
<a name="l380"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l381"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\''</span><span class=cF0>:
|
||
|
<a name="l382"></a> buf[i++]=</span><span class=cF6>'\''</span><span class=cF0>;
|
||
|
<a name="l383"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l384"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\`'</span><span class=cF0>:
|
||
|
<a name="l385"></a> buf[i++]=</span><span class=cF6>'\`'</span><span class=cF0>;
|
||
|
<a name="l386"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l387"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\\'</span><span class=cF0>:
|
||
|
<a name="l388"></a> buf[i++]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l389"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l390"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'"'</span><span class=cF0>:
|
||
|
<a name="l391"></a> buf[i++]=</span><span class=cF6>'"'</span><span class=cF0>;
|
||
|
<a name="l392"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l393"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'d'</span><span class=cF0>:
|
||
|
<a name="l394"></a> buf[i++]=</span><span class=cF6>'$'</span><span class=cF0>;
|
||
|
<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=cF6>'n'</span><span class=cF0>:
|
||
|
<a name="l397"></a> buf[i++]=</span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l398"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l399"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'r'</span><span class=cF0>:
|
||
|
<a name="l400"></a> buf[i++]=</span><span class=cF6>'\r'</span><span class=cF0>;
|
||
|
<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=cF6>'t'</span><span class=cF0>:
|
||
|
<a name="l403"></a> buf[i++]=</span><span class=cF6>'\t'</span><span class=cF0>;
|
||
|
<a name="l404"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l405"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'x'</span><span class=cF0>:
|
||
|
<a name="l406"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'X'</span><span class=cF0>:
|
||
|
<a name="l407"></a> j=0;
|
||
|
<a name="l408"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k<2;k++) {
|
||
|
<a name="l409"></a> ch=</span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l410"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_hex_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l411"></a> </span><span class=cF1>if</span><span class=cF0> (ch<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l412"></a> j=j<<4+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l413"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l414"></a> j=j<<4+ch-</span><span class=cF6>'A'</span><span class=cF0>+10;
|
||
|
<a name="l415"></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="l416"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l417"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l418"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l419"></a> }
|
||
|
<a name="l420"></a> buf[i++]=j;
|
||
|
<a name="l421"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l422"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l423"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l424"></a> buf[i++]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l425"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l426"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0>) {
|
||
|
<a name="l427"></a> buf[i++]=</span><span class=cF6>'$'</span><span class=cF0>;
|
||
|
<a name="l428"></a> </span><span class=cF1>if</span><span class=cF0> (cc->dollar_cnt)
|
||
|
<a name="l429"></a> cc->dollar_cnt--;
|
||
|
<a name="l430"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF6>'$'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l431"></a> cc->dollar_cnt=1;
|
||
|
<a name="l432"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l433"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l434"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l435"></a> buf[i++]=ch;
|
||
|
<a name="l436"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l437"></a> *done=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l438"></a> </span><span class=cF1>return</span><span class=cF0> i;
|
||
|
<a name="l439"></a>}
|
||
|
<a name="l440"></a>
|
||
|
<a name="l441"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Lex</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l442"></a>{</span><span class=cF2>//Fetch next token.</span><span class=cF0>
|
||
|
<a name="l443"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k,l,ch;
|
||
|
<a name="l444"></a> </span><span class=cF9>CHash</span><span class=cF0> *tmph;
|
||
|
<a name="l445"></a> </span><span class=cF1>Bool</span><span class=cF0> str_done,in_str,neg_e;
|
||
|
<a name="l446"></a> </span><span class=cF1>U8</span><span class=cF0> *fbuf,*buf2,*buf3,buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
|
||
|
<a name="l447"></a> cc->last_line_num=cc->lex_include_stk->line_num;
|
||
|
<a name="l448"></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="l449"></a>lex_cont:
|
||
|
<a name="l450"></a> </span><span class=cF1>switch</span><span class=cF0> [ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)] {
|
||
|
<a name="l451"></a> </span><span class=cF1>case</span><span class=cF0> 0:
|
||
|
<a name="l452"></a> </span><span class=cF1>return</span><span class=cF0> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l453"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_SUPERSCRIPT</span><span class=cF0>:
|
||
|
<a name="l454"></a> ch=</span><span class=cF6>'>'</span><span class=cF0>;
|
||
|
<a name="l455"></a> </span><span class=cF1>goto</span><span class=cF0> lex_ident;
|
||
|
<a name="l456"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_SUBSCRIPT</span><span class=cF0>:
|
||
|
<a name="l457"></a> ch=</span><span class=cF6>'<'</span><span class=cF0>;
|
||
|
<a name="l458"></a> </span><span class=cF1>goto</span><span class=cF0> lex_ident;
|
||
|
<a name="l459"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_NORMALSCRIPT</span><span class=cF0>:
|
||
|
<a name="l460"></a> ch=</span><span class=cF6>'='</span><span class=cF0>;
|
||
|
<a name="l461"></a> </span><span class=cF1>goto</span><span class=cF0> lex_ident;
|
||
|
<a name="l462"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'@'</span><span class=cF0>:
|
||
|
<a name="l463"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_KEEP_AT_SIGN</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l464"></a> cc->token=ch;
|
||
|
<a name="l465"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l466"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l467"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'A'</span><span class=cF0>...</span><span class=cF6>'Z'</span><span class=cF0>:
|
||
|
<a name="l468"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'a'</span><span class=cF0>...</span><span class=cF6>'z'</span><span class=cF0>:
|
||
|
<a name="l469"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'_'</span><span class=cF0>:
|
||
|
<a name="l470"></a> </span><span class=cF1>case</span><span class=cF0> 128...255:
|
||
|
<a name="l471"></a>lex_ident:
|
||
|
<a name="l472"></a> i=0;
|
||
|
<a name="l473"></a> buf[i++]=ch;
|
||
|
<a name="l474"></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="l475"></a> </span><span class=cF1>if</span><span class=cF0> (i>=</span><span class=cF3>STR_LEN</span><span class=cF0>)
|
||
|
<a name="l476"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Ident limited to STR_LEN chars at "</span><span class=cF0>);
|
||
|
<a name="l477"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l478"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l479"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>cc-></span><span class=cFB>char_bmp_alpha_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l480"></a> buf[i++]=ch;
|
||
|
<a name="l481"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>TK_SUPERSCRIPT</span><span class=cF0>)
|
||
|
<a name="l482"></a> buf[i++]=</span><span class=cF6>'>'</span><span class=cF0>;
|
||
|
<a name="l483"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>TK_SUBSCRIPT</span><span class=cF0>)
|
||
|
<a name="l484"></a> buf[i++]=</span><span class=cF6>'<'</span><span class=cF0>;
|
||
|
<a name="l485"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>TK_NORMALSCRIPT</span><span class=cF0>)
|
||
|
<a name="l486"></a> buf[i++]=</span><span class=cF6>'='</span><span class=cF0>;
|
||
|
<a name="l487"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l488"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l489"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l490"></a> }
|
||
|
<a name="l491"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l492"></a> buf[i++]=0;
|
||
|
<a name="l493"></a> tmph=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l494"></a> </span><span class=cF1>if</span><span class=cF0> (cc->htc.local_var_lst)
|
||
|
<a name="l495"></a> cc->local_var_entry=</span><span class=cF5>MemberFind</span><span class=cF0>(buf,cc->htc.local_var_lst);
|
||
|
<a name="l496"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l497"></a> cc->local_var_entry=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l498"></a> </span><span class=cF1>if</span><span class=cF0> (!cc->local_var_entry && cc->htc.hash_table_lst)
|
||
|
<a name="l499"></a> tmph=</span><span class=cF5>HashFind</span><span class=cF0>(buf,cc->htc.hash_table_lst,cc->htc.hash_mask);
|
||
|
<a name="l500"></a> </span><span class=cF1>if</span><span class=cF0> (tmph)
|
||
|
<a name="l501"></a> j=tmph->type;
|
||
|
<a name="l502"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l503"></a> j=0;
|
||
|
<a name="l504"></a> </span><span class=cF1>if</span><span class=cF0> (j & </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>cc->flags & </span><span class=cF3>CCF_NO_DEFINES</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l505"></a> </span><span class=cFD>LexIncludeStr</span><span class=cF0>(cc,
|
||
|
<a name="l506"></a> tmph->str,</span><span class=cF5>StrNew</span><span class=cF7>(</span><span class=cF0>tmph(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *)->data</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l507"></a> cc->lex_include_stk->flags|=</span><span class=cF3>LFSF_DEFINE</span><span class=cF0>;
|
||
|
<a name="l508"></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="l509"></a> cc->hash_entry=tmph;
|
||
|
<a name="l510"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_str);
|
||
|
<a name="l511"></a> cc->cur_str=</span><span class=cF5>StrNew</span><span class=cF0>(buf);
|
||
|
<a name="l512"></a> cc->cur_str_len=i;
|
||
|
<a name="l513"></a> cc->token=</span><span class=cF3>TK_IDENT</span><span class=cF0>;
|
||
|
<a name="l514"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l515"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l516"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l517"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'0'</span><span class=cF0>...</span><span class=cF6>'9'</span><span class=cF0>:
|
||
|
<a name="l518"></a> i=ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l519"></a> ch=</span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l520"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'X'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l521"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
||
|
<a name="l522"></a> ch=</span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l523"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_hex_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l524"></a> </span><span class=cF1>if</span><span class=cF0> (ch<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l525"></a> i=i<<4+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l526"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l527"></a> i=i<<4+ch-</span><span class=cF6>'A'</span><span class=cF0>+10;
|
||
|
<a name="l528"></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="l529"></a> cc->cur_i64=i;
|
||
|
<a name="l530"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l531"></a> cc->token=</span><span class=cF3>TK_I64</span><span class=cF0>;
|
||
|
<a name="l532"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l533"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l534"></a> }
|
||
|
<a name="l535"></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> (ch==</span><span class=cF6>'B'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l536"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
||
|
<a name="l537"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l538"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'0'</span><span class=cF0>)
|
||
|
<a name="l539"></a> i=i<<1;
|
||
|
<a name="l540"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'1'</span><span class=cF0>)
|
||
|
<a name="l541"></a> i=i<<1+1;
|
||
|
<a name="l542"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l543"></a> cc->cur_i64=i;
|
||
|
<a name="l544"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l545"></a> cc->token=</span><span class=cF3>TK_I64</span><span class=cF0>;
|
||
|
<a name="l546"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l547"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l548"></a> }
|
||
|
<a name="l549"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l550"></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="l551"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_dec_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l552"></a> i=i*10+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l553"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l554"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'.'</span><span class=cF0> || ch==</span><span class=cF6>'e'</span><span class=cF0> || ch==</span><span class=cF6>'E'</span><span class=cF0>) </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l555"></a>lex_is_int:
|
||
|
<a name="l556"></a> cc->cur_i64=i;
|
||
|
<a name="l557"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l558"></a> cc->token=</span><span class=cF3>TK_I64</span><span class=cF0>;
|
||
|
<a name="l559"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l560"></a> }
|
||
|
<a name="l561"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l562"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l563"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'.'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l564"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l565"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'.'</span><span class=cF0>) {
|
||
|
<a name="l566"></a> cc->flags|=</span><span class=cF3>CCF_LAST_WAS_DOT</span><span class=cF0>;
|
||
|
<a name="l567"></a> </span><span class=cF1>goto</span><span class=cF0> lex_is_int;
|
||
|
<a name="l568"></a> }
|
||
|
<a name="l569"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l570"></a>lex_float_start:
|
||
|
<a name="l571"></a> k=0;
|
||
|
<a name="l572"></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="l573"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_dec_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l574"></a> i=i*10+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l575"></a> k++;
|
||
|
<a name="l576"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l577"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'e'</span><span class=cF0> || ch==</span><span class=cF6>'E'</span><span class=cF0>)
|
||
|
<a name="l578"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l579"></a> cc->cur_f64=i*</span><span class=cF5>Pow10I64</span><span class=cF0>(-k);
|
||
|
<a name="l580"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l581"></a> cc->token=</span><span class=cF3>TK_F64</span><span class=cF0>;
|
||
|
<a name="l582"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l583"></a> }
|
||
|
<a name="l584"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l585"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l586"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l587"></a> neg_e=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l588"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'-'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l589"></a> neg_e=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l590"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l591"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l592"></a> j=0;
|
||
|
<a name="l593"></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="l594"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_dec_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l595"></a> j=j*10+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l596"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l597"></a> </span><span class=cF1>if</span><span class=cF0> (neg_e)
|
||
|
<a name="l598"></a> cc->cur_f64=i*</span><span class=cF5>Pow10I64</span><span class=cF0>(-j-k);
|
||
|
<a name="l599"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l600"></a> cc->cur_f64=i*</span><span class=cF5>Pow10I64</span><span class=cF0>(j-k);
|
||
|
<a name="l601"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l602"></a> cc->token=</span><span class=cF3>TK_F64</span><span class=cF0>;
|
||
|
<a name="l603"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l604"></a> }
|
||
|
<a name="l605"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l606"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l607"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l608"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'"'</span><span class=cF0>:
|
||
|
<a name="l609"></a> cc->flags|=</span><span class=cF3>CCF_IN_QUOTES</span><span class=cF0>;
|
||
|
<a name="l610"></a> buf2=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l611"></a> i=0;
|
||
|
<a name="l612"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l613"></a> j=</span><span class=cFD>LexInStr</span><span class=cF0>(cc,buf,</span><span class=cF3>STR_LEN</span><span class=cF0>,&str_done);
|
||
|
<a name="l614"></a> buf3=</span><span class=cF5>MAlloc</span><span class=cF0>(i+j);
|
||
|
<a name="l615"></a> </span><span class=cF1>if</span><span class=cF0> (buf2) {
|
||
|
<a name="l616"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf3,buf2,i);
|
||
|
<a name="l617"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
|
||
|
<a name="l618"></a> buf2=buf3;
|
||
|
<a name="l619"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2+i,buf,j);
|
||
|
<a name="l620"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l621"></a> buf2=buf3;
|
||
|
<a name="l622"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2,buf,j);
|
||
|
<a name="l623"></a> }
|
||
|
<a name="l624"></a> i+=j;
|
||
|
<a name="l625"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (!str_done);
|
||
|
<a name="l626"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_str);
|
||
|
<a name="l627"></a> cc->cur_str=</span><span class=cF5>MAlloc</span><span class=cF0>(i);
|
||
|
<a name="l628"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(cc->cur_str,buf2,i);
|
||
|
<a name="l629"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
|
||
|
<a name="l630"></a> cc->cur_str_len=i;
|
||
|
<a name="l631"></a> cc->flags&=~</span><span class=cF3>CCF_IN_QUOTES</span><span class=cF0>;
|
||
|
<a name="l632"></a> cc->token=</span><span class=cF3>TK_STR</span><span class=cF0>;
|
||
|
<a name="l633"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l634"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\''</span><span class=cF0>:
|
||
|
<a name="l635"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_NO_CHAR_CONST</span><span class=cF0>)
|
||
|
<a name="l636"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l637"></a> k=0;
|
||
|
<a name="l638"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<8;j++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l639"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0> || ch==</span><span class=cF6>'\''</span><span class=cF0>)
|
||
|
<a name="l640"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l641"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\\'</span><span class=cF0>) {
|
||
|
<a name="l642"></a> </span><span class=cF1>switch</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l643"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'0'</span><span class=cF0>: k.u8[j]=0; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l644"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\''</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\''</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l645"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\`'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\`'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l646"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'"'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'"'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l647"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\\'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\\'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l648"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'d'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'$'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l649"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'n'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\n'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l650"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'r'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\r'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l651"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>: k.u8[j]=</span><span class=cF6>'\t'</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l652"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'x'</span><span class=cF0>:
|
||
|
<a name="l653"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'X'</span><span class=cF0>:
|
||
|
<a name="l654"></a> i=0;
|
||
|
<a name="l655"></a> </span><span class=cF1>for</span><span class=cF0> (l=0;l<2;l++) {
|
||
|
<a name="l656"></a> ch=</span><span class=cF5>ToUpper</span><span class=cF0>(</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l657"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_hex_numeric</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l658"></a> </span><span class=cF1>if</span><span class=cF0> (ch<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l659"></a> i=i<<4+ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l660"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l661"></a> i=i<<4+ch-</span><span class=cF6>'A'</span><span class=cF0>+10;
|
||
|
<a name="l662"></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="l663"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l664"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l665"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l666"></a> }
|
||
|
<a name="l667"></a> k.u8[j]=i;
|
||
|
<a name="l668"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l669"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l670"></a> k.u8[j]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l671"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l672"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l673"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0>) {
|
||
|
<a name="l674"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l675"></a> k.u8[j]=</span><span class=cF6>'$'</span><span class=cF0>;
|
||
|
<a name="l676"></a> </span><span class=cF1>if</span><span class=cF0> (ch!=</span><span class=cF6>'$'</span><span class=cF0>)
|
||
|
<a name="l677"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l678"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l679"></a> k.u8[j]=ch;
|
||
|
<a name="l680"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l681"></a> </span><span class=cF1>if</span><span class=cF0> (ch!=</span><span class=cF6>'\''</span><span class=cF0> && </span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0> && ch!=</span><span class=cF6>'\''</span><span class=cF0>)
|
||
|
<a name="l682"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Char const limited to 8 chars at "</span><span class=cF0>);
|
||
|
<a name="l683"></a> cc->cur_i64=k;
|
||
|
<a name="l684"></a> cc->token=</span><span class=cF3>TK_CHAR_CONST</span><span class=cF0>;
|
||
|
<a name="l685"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l686"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'#'</span><span class=cF0>:
|
||
|
<a name="l687"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_KEEP_SIGN_NUM</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l688"></a> cc->token=ch;
|
||
|
<a name="l689"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l690"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l691"></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>) </span><span class=cF2>//skip '#'</span><span class=cF0>
|
||
|
<a name="l692"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l693"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmph=cc->hash_entry</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l694"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l695"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmph->type & </span><span class=cF3>HTT_KEYWORD</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l696"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l697"></a> </span><span class=cF1>switch</span><span class=cF0> (i=tmph</span><span class=cF7>(</span><span class=cF9>CHashGeneric</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>->user_data0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l698"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_INCLUDE</span><span class=cF0>:
|
||
|
<a name="l699"></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_STR</span><span class=cF0>)
|
||
|
<a name="l700"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l701"></a> fbuf=</span><span class=cF5>ExtDft</span><span class=cF0>(cc->cur_str,</span><span class=cF6>"HC.Z"</span><span class=cF0>);
|
||
|
<a name="l702"></a> buf2=</span><span class=cF5>FileNameAbs</span><span class=cF0>(fbuf);
|
||
|
<a name="l703"></a> </span><span class=cF5>Free</span><span class=cF0>(fbuf);
|
||
|
<a name="l704"></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>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_DOC</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l705"></a> </span><span class=cF5>LexAttachDoc</span><span class=cF0>(cc,,,buf2);
|
||
|
<a name="l706"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l707"></a> </span><span class=cFD>LexIncludeStr</span><span class=cF0>(cc,buf2,</span><span class=cF5>FileRead</span><span class=cF7>(</span><span class=cF0>buf2</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l708"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
|
||
|
<a name="l709"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l710"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_DEFINE</span><span class=cF0>:
|
||
|
<a name="l711"></a> cc->flags|=</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l712"></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="l713"></a> tmph=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashDefineStr</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l714"></a> tmph->str=cc->cur_str;
|
||
|
<a name="l715"></a> cc->cur_str=0;
|
||
|
<a name="l716"></a> tmph->type=</span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>;
|
||
|
<a name="l717"></a> </span><span class=cF5>HashSrcFileSet</span><span class=cF0>(cc,tmph);
|
||
|
<a name="l718"></a>
|
||
|
<a name="l719"></a> </span><span class=cF1>do</span><span class=cF0> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc); </span><span class=cF2>//skip space between define name and start</span><span class=cF0>
|
||
|
<a name="l720"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_non_eol_white_space</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l721"></a>
|
||
|
<a name="l722"></a> i=j=0;
|
||
|
<a name="l723"></a> buf2=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l724"></a> </span><span class=cF1>if</span><span class=cF0> (ch) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l725"></a> in_str=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l726"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l727"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\\'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l728"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l729"></a> </span><span class=cF1>if</span><span class=cF0> (ch!=</span><span class=cF6>'\r'</span><span class=cF0> && ch!=</span><span class=cF6>'\n'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l730"></a> buf[j++]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l731"></a> buf[j++]=ch;
|
||
|
<a name="l732"></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> (ch==</span><span class=cF6>'\r'</span><span class=cF0> && </span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF6>'\n'</span><span class=cF0>)
|
||
|
<a name="l733"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l734"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l735"></a> buf[j++]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l736"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l737"></a> }
|
||
|
<a name="l738"></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> (ch!=</span><span class=cF6>'\n'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l739"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\"'</span><span class=cF0>)
|
||
|
<a name="l740"></a> in_str=!in_str;
|
||
|
<a name="l741"></a> buf[j++]=ch;
|
||
|
<a name="l742"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l743"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l744"></a> </span><span class=cF1>while</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l745"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'/'</span><span class=cF0>) {
|
||
|
<a name="l746"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l747"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'/'</span><span class=cF0> && !in_str) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l748"></a> </span><span class=cF1>do</span><span class=cF0> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l749"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_non_eol</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l750"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l751"></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="l752"></a> buf[j++]=</span><span class=cF6>'/'</span><span class=cF0>;
|
||
|
<a name="l753"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l754"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l755"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\\'</span><span class=cF0>) {
|
||
|
<a name="l756"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l757"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\"'</span><span class=cF0>) {
|
||
|
<a name="l758"></a> buf[j++]=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l759"></a> buf[j++]=ch;
|
||
|
<a name="l760"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l761"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l762"></a> ch=</span><span class=cF6>'\\'</span><span class=cF0>;
|
||
|
<a name="l763"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l764"></a> }
|
||
|
<a name="l765"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l766"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_non_eol</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l767"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\"'</span><span class=cF0>)
|
||
|
<a name="l768"></a> in_str=!in_str;
|
||
|
<a name="l769"></a> buf[j++]=ch;
|
||
|
<a name="l770"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l771"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l772"></a> </span><span class=cF1>if</span><span class=cF0> (j>=</span><span class=cF3>STR_LEN</span><span class=cF0>-4) {</span><span class=cF2>//Spot for ['\'][ch],[ch],[0]</span><span class=cF0>
|
||
|
<a name="l773"></a> buf[j++]=0;
|
||
|
<a name="l774"></a> buf3=</span><span class=cF5>MAlloc</span><span class=cF0>(i+j);
|
||
|
<a name="l775"></a> </span><span class=cF1>if</span><span class=cF0> (buf2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l776"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf3,buf2,i);
|
||
|
<a name="l777"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
|
||
|
<a name="l778"></a> buf2=buf3;
|
||
|
<a name="l779"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2+i,buf,j);
|
||
|
<a name="l780"></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="l781"></a> buf2=buf3;
|
||
|
<a name="l782"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2,buf,j);
|
||
|
<a name="l783"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l784"></a> i+=j-1;
|
||
|
<a name="l785"></a> j=0;
|
||
|
<a name="l786"></a> }
|
||
|
<a name="l787"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l788"></a> } </span><span class=cF1>while</span><span class=cF0> (ch==</span><span class=cF6>'\\'</span><span class=cF0>);
|
||
|
<a name="l789"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l790"></a> buf[j++]=0;
|
||
|
<a name="l791"></a> buf3=</span><span class=cF5>MAlloc</span><span class=cF0>(i+j);
|
||
|
<a name="l792"></a> </span><span class=cF1>if</span><span class=cF0> (buf2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l793"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf3,buf2,i);
|
||
|
<a name="l794"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
|
||
|
<a name="l795"></a> buf2=buf3;
|
||
|
<a name="l796"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2+i,buf,j);
|
||
|
<a name="l797"></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="l798"></a> buf2=buf3;
|
||
|
<a name="l799"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(buf2,buf,j);
|
||
|
<a name="l800"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l801"></a> tmph(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *)->data=buf2;
|
||
|
<a name="l802"></a> tmph(</span><span class=cF9>CHashDefineStr</span><span class=cF0> *)->cnt=-1;
|
||
|
<a name="l803"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmph,cc->htc.define_hash_table);
|
||
|
<a name="l804"></a> }
|
||
|
<a name="l805"></a> cc->flags&=~</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l806"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l807"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_ELSE</span><span class=cF0>:
|
||
|
<a name="l808"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l809"></a> cc->token=</span><span class=cF3>TK_ELSE</span><span class=cF0>;
|
||
|
<a name="l810"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l811"></a> }
|
||
|
<a name="l812"></a>lex_else:
|
||
|
<a name="l813"></a> j=1;
|
||
|
<a name="l814"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l815"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l816"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l817"></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>)
|
||
|
<a name="l818"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l819"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l820"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l821"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l822"></a> j++;
|
||
|
<a name="l823"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l824"></a> j--;
|
||
|
<a name="l825"></a> }
|
||
|
<a name="l826"></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="l827"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l828"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l829"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l830"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l831"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l832"></a>
|
||
|
<a name="l833"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_IF</span><span class=cF0>:
|
||
|
<a name="l834"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l835"></a> cc->token=</span><span class=cF3>TK_IF</span><span class=cF0>;
|
||
|
<a name="l836"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l837"></a> }
|
||
|
<a name="l838"></a>lex_if:
|
||
|
<a name="l839"></a> cc->flags|=</span><span class=cF3>CCF_IN_IF</span><span class=cF0>;
|
||
|
<a name="l840"></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>) {
|
||
|
<a name="l841"></a> cc->flags&=~</span><span class=cF3>CCF_IN_IF</span><span class=cF0>;
|
||
|
<a name="l842"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l843"></a> }
|
||
|
<a name="l844"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>LexExpression</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l845"></a> cc->flags&=~</span><span class=cF3>CCF_IN_IF</span><span class=cF0>;
|
||
|
<a name="l846"></a> </span><span class=cF1>switch</span><span class=cF0> (cc->token) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l847"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IF</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_if;
|
||
|
<a name="l848"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IFDEF</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_ifdef;
|
||
|
<a name="l849"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IFNDEF</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_ifndef;
|
||
|
<a name="l850"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IFAOT</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_ifaot;
|
||
|
<a name="l851"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IFJIT</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_ifjit;
|
||
|
<a name="l852"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_ELSE</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_else;
|
||
|
<a name="l853"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_ENDIF</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l854"></a> </span><span class=cF1>default</span><span class=cF0>: </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l855"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l856"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l857"></a> cc->flags&=~</span><span class=cF3>CCF_IN_IF</span><span class=cF0>;
|
||
|
<a name="l858"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF3>TK_ENDIF</span><span class=cF0> && cc->token!=</span><span class=cF3>TK_ELSE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l859"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_IF</span><span class=cF0> || cc->token==</span><span class=cF3>TK_IFDEF</span><span class=cF0> ||
|
||
|
<a name="l860"></a> cc->token==</span><span class=cF3>TK_IFNDEF</span><span class=cF0> || cc->token==</span><span class=cF3>TK_IFAOT</span><span class=cF0> ||
|
||
|
<a name="l861"></a> cc->token==</span><span class=cF3>TK_IFJIT</span><span class=cF0>)
|
||
|
<a name="l862"></a> j=2;
|
||
|
<a name="l863"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l864"></a> j=1;
|
||
|
<a name="l865"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l866"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l867"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l868"></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>)
|
||
|
<a name="l869"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l870"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l871"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l872"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l873"></a> j++;
|
||
|
<a name="l874"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l875"></a> j--;
|
||
|
<a name="l876"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ELSE</span><span class=cF0> && j==1)
|
||
|
<a name="l877"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l878"></a> }
|
||
|
<a name="l879"></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="l880"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l881"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l882"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l883"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l884"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l885"></a> }
|
||
|
<a name="l886"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l887"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_IFDEF</span><span class=cF0>:
|
||
|
<a name="l888"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l889"></a> cc->token=</span><span class=cF3>TK_IFDEF</span><span class=cF0>;
|
||
|
<a name="l890"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l891"></a> }
|
||
|
<a name="l892"></a>lex_ifdef:
|
||
|
<a name="l893"></a> cc->flags|=</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l894"></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>) {
|
||
|
<a name="l895"></a> cc->flags&=~</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l896"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l897"></a> }
|
||
|
<a name="l898"></a> cc->flags&=~</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l899"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF3>TK_IDENT</span><span class=cF0>)
|
||
|
<a name="l900"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l901"></a> </span><span class=cF1>if</span><span class=cF0> (cc->hash_entry)
|
||
|
<a name="l902"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l903"></a> j=1;
|
||
|
<a name="l904"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l905"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l906"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l907"></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>)
|
||
|
<a name="l908"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l909"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l910"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l911"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l912"></a> j++;
|
||
|
<a name="l913"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l914"></a> j--;
|
||
|
<a name="l915"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ELSE</span><span class=cF0> && j==1)
|
||
|
<a name="l916"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l917"></a> }
|
||
|
<a name="l918"></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="l919"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l920"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l921"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l922"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l923"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l924"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_IFNDEF</span><span class=cF0>:
|
||
|
<a name="l925"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l926"></a> cc->token=</span><span class=cF3>TK_IFNDEF</span><span class=cF0>;
|
||
|
<a name="l927"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l928"></a> }
|
||
|
<a name="l929"></a>lex_ifndef:
|
||
|
<a name="l930"></a> cc->flags|=</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l931"></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>) {
|
||
|
<a name="l932"></a> cc->flags&=~</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l933"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l934"></a> }
|
||
|
<a name="l935"></a> cc->flags&=~</span><span class=cF3>CCF_NO_DEFINES</span><span class=cF0>;
|
||
|
<a name="l936"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token!=</span><span class=cF3>TK_IDENT</span><span class=cF0>)
|
||
|
<a name="l937"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l938"></a> </span><span class=cF1>if</span><span class=cF0> (!cc->hash_entry)
|
||
|
<a name="l939"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l940"></a> j=1;
|
||
|
<a name="l941"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l942"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l943"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l944"></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>)
|
||
|
<a name="l945"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l946"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l947"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l948"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l949"></a> j++;
|
||
|
<a name="l950"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l951"></a> j--;
|
||
|
<a name="l952"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ELSE</span><span class=cF0> && j==1)
|
||
|
<a name="l953"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l954"></a> }
|
||
|
<a name="l955"></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="l956"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l957"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l958"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l959"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l960"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l961"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_IFAOT</span><span class=cF0>:
|
||
|
<a name="l962"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l963"></a> cc->token=</span><span class=cF3>TK_IFAOT</span><span class=cF0>;
|
||
|
<a name="l964"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l965"></a> }
|
||
|
<a name="l966"></a>lex_ifaot:
|
||
|
<a name="l967"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_AOT_COMPILE</span><span class=cF0>)
|
||
|
<a name="l968"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l969"></a> j=1;
|
||
|
<a name="l970"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l971"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l972"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l973"></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>)
|
||
|
<a name="l974"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l975"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l976"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l977"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l978"></a> j++;
|
||
|
<a name="l979"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l980"></a> j--;
|
||
|
<a name="l981"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ELSE</span><span class=cF0> && j==1)
|
||
|
<a name="l982"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l983"></a> }
|
||
|
<a name="l984"></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="l985"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l986"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l987"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l988"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l989"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l990"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_IFJIT</span><span class=cF0>:
|
||
|
<a name="l991"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l992"></a> cc->token=</span><span class=cF3>TK_IFAOT</span><span class=cF0>;
|
||
|
<a name="l993"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l994"></a> }
|
||
|
<a name="l995"></a>lex_ifjit:
|
||
|
<a name="l996"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>cc->flags & </span><span class=cF3>CCF_AOT_COMPILE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l997"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l998"></a> j=1;
|
||
|
<a name="l999"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l1000"></a> </span><span class=cF1>if</span><span class=cF0> (ch=</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1001"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'#'</span><span class=cF0>) {
|
||
|
<a name="l1002"></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>)
|
||
|
<a name="l1003"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1004"></a> i=</span><span class=cF5>PrsKeyWord</span><span class=cF0>(cc);
|
||
|
<a name="l1005"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_IF</span><span class=cF0> || i==</span><span class=cF3>KW_IFDEF</span><span class=cF0> || i==</span><span class=cF3>KW_IFNDEF</span><span class=cF0> ||
|
||
|
<a name="l1006"></a> i==</span><span class=cF3>KW_IFAOT</span><span class=cF0> || i==</span><span class=cF3>KW_IFJIT</span><span class=cF0>)
|
||
|
<a name="l1007"></a> j++;
|
||
|
<a name="l1008"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ENDIF</span><span class=cF0>)
|
||
|
<a name="l1009"></a> j--;
|
||
|
<a name="l1010"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>KW_ELSE</span><span class=cF0> && j==1)
|
||
|
<a name="l1011"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1012"></a> }
|
||
|
<a name="l1013"></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="l1014"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l1015"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1016"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1017"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l1018"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1019"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_ENDIF</span><span class=cF0>:
|
||
|
<a name="l1020"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_IN_IF</span><span class=cF0>) {
|
||
|
<a name="l1021"></a> cc->token=</span><span class=cF3>TK_ENDIF</span><span class=cF0>;
|
||
|
<a name="l1022"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1023"></a> }
|
||
|
<a name="l1024"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1025"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_ASSERT</span><span class=cF0>:
|
||
|
<a name="l1026"></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>)
|
||
|
<a name="l1027"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1028"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>LexExpression</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1029"></a> </span><span class=cF5>LexWarn</span><span class=cF0>(cc,</span><span class=cF6>"Assert Failed "</span><span class=cF0>);
|
||
|
<a name="l1030"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1031"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_EXE</span><span class=cF0>:
|
||
|
<a name="l1032"></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>)
|
||
|
<a name="l1033"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1034"></a> </span><span class=cFD>PrsStreamBlk</span><span class=cF0>(cc);
|
||
|
<a name="l1035"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1036"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_HELP_INDEX</span><span class=cF0>:
|
||
|
<a name="l1037"></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_STR</span><span class=cF0>)
|
||
|
<a name="l1038"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1039"></a> </span><span class=cF5>Free</span><span class=cF0>(cc->cur_help_idx);
|
||
|
<a name="l1040"></a> cc->cur_help_idx=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc,,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1041"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1042"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>KW_HELP_FILE</span><span class=cF0>:
|
||
|
<a name="l1043"></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_STR</span><span class=cF0>)
|
||
|
<a name="l1044"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1045"></a> tmph=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashSrcSym</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1046"></a> fbuf=</span><span class=cF5>ExtDft</span><span class=cF0>(cc->cur_str,</span><span class=cF6>"DD.Z"</span><span class=cF0>);
|
||
|
<a name="l1047"></a> tmph->str=</span><span class=cF5>FileNameAbs</span><span class=cF0>(fbuf);
|
||
|
<a name="l1048"></a> </span><span class=cF5>Free</span><span class=cF0>(fbuf);
|
||
|
<a name="l1049"></a> tmph->type=</span><span class=cF3>HTT_HELP_FILE</span><span class=cF0>|</span><span class=cF3>HTF_PUBLIC</span><span class=cF0>;
|
||
|
<a name="l1050"></a> </span><span class=cF5>HashSrcFileSet</span><span class=cF0>(cc,tmph);
|
||
|
<a name="l1051"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmph,cc->htc.glbl_hash_table);
|
||
|
<a name="l1052"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1053"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1054"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1055"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\n'</span><span class=cF0>:
|
||
|
<a name="l1056"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>cc->flags&</span><span class=cF3>CCF_KEEP_NEW_LINES</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1057"></a> </span><span class=cF1>break</span><span class=cF0>; </span><span class=cF2>//else fall through</span><span class=cF0>
|
||
|
<a name="l1058"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_INS_BIN</span><span class=cF0>:
|
||
|
<a name="l1059"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_INS_BIN_SIZE</span><span class=cF0>:
|
||
|
<a name="l1060"></a> cc->token=ch;
|
||
|
<a name="l1061"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1062"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'.'</span><span class=cF0>:
|
||
|
<a name="l1063"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_KEEP_DOT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1064"></a> cc->token=ch;
|
||
|
<a name="l1065"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1066"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1067"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_LAST_WAS_DOT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1068"></a> cc->flags&=~</span><span class=cF3>CCF_LAST_WAS_DOT</span><span class=cF0>;
|
||
|
<a name="l1069"></a> </span><span class=cF1>goto</span><span class=cF0> lex_dot_dot;
|
||
|
<a name="l1070"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1071"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l1072"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=ch<=</span><span class=cF6>'9'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1073"></a> i=0;
|
||
|
<a name="l1074"></a> </span><span class=cF1>goto</span><span class=cF0> lex_float_start;
|
||
|
<a name="l1075"></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> (ch==</span><span class=cF6>'.'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1076"></a>lex_dot_dot:
|
||
|
<a name="l1077"></a> cc->token=</span><span class=cF3>TK_DOT_DOT</span><span class=cF0>;
|
||
|
<a name="l1078"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>LexGetChar</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'.'</span><span class=cF0>)
|
||
|
<a name="l1079"></a> cc->token=</span><span class=cF3>TK_ELLIPSIS</span><span class=cF0>;
|
||
|
<a name="l1080"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1081"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1082"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1083"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1084"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1085"></a> cc->token=</span><span class=cF6>'.'</span><span class=cF0>;
|
||
|
<a name="l1086"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1087"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'!'</span><span class=cF0>:
|
||
|
<a name="l1088"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'$'</span><span class=cF0>...</span><span class=cF6>'&'</span><span class=cF0>:
|
||
|
<a name="l1089"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'('</span><span class=cF0>...</span><span class=cF6>'-'</span><span class=cF0>:
|
||
|
<a name="l1090"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'/'</span><span class=cF0>:
|
||
|
<a name="l1091"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>':'</span><span class=cF0>...</span><span class=cF6>'?'</span><span class=cF0>:
|
||
|
<a name="l1092"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'['</span><span class=cF0>:
|
||
|
<a name="l1093"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>']'</span><span class=cF0>...</span><span class=cF6>'^'</span><span class=cF0>:
|
||
|
<a name="l1094"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'{'</span><span class=cF0>...</span><span class=cF6>'~'</span><span class=cF0>:
|
||
|
<a name="l1095"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'`'</span><span class=cF0>:
|
||
|
<a name="l1096"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>i=</span><span class=cFB>cmp</span><span class=cF0>.dual_U16_tokens1[ch]</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1097"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0>) {
|
||
|
<a name="l1098"></a> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l1099"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1100"></a> cc->token=</span><span class=cF6>'$'</span><span class=cF0>;
|
||
|
<a name="l1101"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1102"></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> (ch) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1103"></a> </span><span class=cF1>do</span><span class=cF0> ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l1104"></a> </span><span class=cF1>while</span><span class=cF0> (ch && ch!=</span><span class=cF6>'$'</span><span class=cF0>);
|
||
|
<a name="l1105"></a> </span><span class=cF1>if</span><span class=cF0> (!ch) {
|
||
|
<a name="l1106"></a> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l1107"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1108"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1109"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l1110"></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="l1111"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1112"></a> cc->token=</span><span class=cF6>'$'</span><span class=cF0>;
|
||
|
<a name="l1113"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1114"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1115"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1116"></a> cc->token=ch;
|
||
|
<a name="l1117"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1118"></a> }
|
||
|
<a name="l1119"></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="l1120"></a> j=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l1121"></a> </span><span class=cF1>if</span><span class=cF0> (i.u16[0]==j) {
|
||
|
<a name="l1122"></a> i>>=16;
|
||
|
<a name="l1123"></a> </span><span class=cF1>if</span><span class=cF0> (!i) </span><span class=cF7>{</span><span class=cF2>// "/*"</span><span class=cF0>
|
||
|
<a name="l1124"></a> j=1;
|
||
|
<a name="l1125"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l1126"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1127"></a> </span><span class=cF1>return</span><span class=cF0> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l1128"></a>lex_check_comment:
|
||
|
<a name="l1129"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'*'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1130"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1131"></a> </span><span class=cF1>return</span><span class=cF0> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l1132"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'/'</span><span class=cF0>)
|
||
|
<a name="l1133"></a> j--;
|
||
|
<a name="l1134"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1135"></a> </span><span class=cF1>goto</span><span class=cF0> lex_check_comment;
|
||
|
<a name="l1136"></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> (ch==</span><span class=cF6>'/'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1137"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>ch=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1138"></a> </span><span class=cF1>return</span><span class=cF0> cc->token=</span><span class=cF3>TK_EOF</span><span class=cF0>;
|
||
|
<a name="l1139"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'*'</span><span class=cF0>)
|
||
|
<a name="l1140"></a> j++;
|
||
|
<a name="l1141"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1142"></a> </span><span class=cF1>goto</span><span class=cF0> lex_check_comment;
|
||
|
<a name="l1143"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1144"></a> } </span><span class=cF1>while</span><span class=cF0> (j);
|
||
|
<a name="l1145"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l1146"></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="l1147"></a> cc->token=i;
|
||
|
<a name="l1148"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1149"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1150"></a> }
|
||
|
<a name="l1151"></a> </span><span class=cF1>if</span><span class=cF0> (i=</span><span class=cFB>cmp</span><span class=cF0>.dual_U16_tokens2[ch]) {
|
||
|
<a name="l1152"></a> </span><span class=cF1>if</span><span class=cF0> (i.u16[0]==j) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1153"></a> i>>=16;
|
||
|
<a name="l1154"></a> </span><span class=cF1>if</span><span class=cF0> (!i) {</span><span class=cF2>// "//"</span><span class=cF0>
|
||
|
<a name="l1155"></a> </span><span class=cF5>LexSkipEol</span><span class=cF0>(cc);
|
||
|
<a name="l1156"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags&</span><span class=cF3>CCF_KEEP_NEW_LINES</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1157"></a> cc->token=</span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l1158"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1159"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1160"></a> </span><span class=cF1>goto</span><span class=cF0> lex_cont;
|
||
|
<a name="l1161"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1162"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>TK_SHL</span><span class=cF0> || i==</span><span class=cF3>TK_SHR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1163"></a> j=</span><span class=cF5>LexGetChar</span><span class=cF0>(cc);
|
||
|
<a name="l1164"></a> </span><span class=cF1>if</span><span class=cF0> (j==</span><span class=cF6>'='</span><span class=cF0>) {
|
||
|
<a name="l1165"></a> </span><span class=cF1>if</span><span class=cF0> (i==</span><span class=cF3>TK_SHL</span><span class=cF0>)
|
||
|
<a name="l1166"></a> i=</span><span class=cF3>TK_SHL_EQU</span><span class=cF0>;
|
||
|
<a name="l1167"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1168"></a> i=</span><span class=cF3>TK_SHR_EQU</span><span class=cF0>;
|
||
|
<a name="l1169"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1170"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1171"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1172"></a> cc->token=i;
|
||
|
<a name="l1173"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1174"></a> }
|
||
|
<a name="l1175"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1176"></a> </span><span class=cF1>if</span><span class=cF0> (i=</span><span class=cFB>cmp</span><span class=cF0>.dual_U16_tokens3[ch]) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1177"></a> </span><span class=cF1>if</span><span class=cF0> (i.u16[0]==j) {
|
||
|
<a name="l1178"></a> cc->token=i.u16[1];
|
||
|
<a name="l1179"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1180"></a> }
|
||
|
<a name="l1181"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1182"></a> }
|
||
|
<a name="l1183"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1184"></a> cc->token=ch;
|
||
|
<a name="l1185"></a> </span><span class=cF1>goto</span><span class=cF0> lex_end;
|
||
|
<a name="l1186"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1187"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_TKS_NUM</span><span class=cF0>:
|
||
|
<a name="l1188"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1189"></a> }
|
||
|
<a name="l1190"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1191"></a>lex_end:
|
||
|
<a name="l1192"></a> </span><span class=cF5>LexGetChar</span><span class=cF0>(cc); </span><span class=cF2>//Do this so WAS_NEW_LINE is right</span><span class=cF0>
|
||
|
<a name="l1193"></a> cc->flags|=</span><span class=cF3>CCF_USE_LAST_U16</span><span class=cF0>;
|
||
|
<a name="l1194"></a> </span><span class=cF1>return</span><span class=cF0> cc->token;
|
||
|
<a name="l1195"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|