From a7dfaf1b5331469cc6ded704e3eae146867853eb Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Wed, 10 Dec 2014 20:58:25 -0800 Subject: [PATCH] I lied. optimized lex scanner --- SANDBOX.PO | Bin 143360 -> 143360 bytes src/toolsrc/sb.pla | 56 ++++++++++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/SANDBOX.PO b/SANDBOX.PO index b40dff0af07725d2b2b231c41d6ee1575c2df898..de76e2ff51898365cee73eefe2f04ecd9606771d 100644 GIT binary patch delta 10285 zcmb7K4|r77mA~)Jo5}x>kRe1!!pvkcnOp|)5Jey`gh()wCw;*CFr=`??DUyNR)L+) zrqRy{RcZy1KMx$BD3nzS@<$NS^2aW=*lM?buw8AxD%Ewr*6nuX+qSqXA4v9h?tAkm zK)>#OAK!4#dFPya?m6e4bMCzv{4js;!~7%1m9mbx?2(!=75VJnm~U;(Wbd&zlo@~T ze)CHgF8HjYdH!P!{i7x6sx|AYTcs<<-udcM?=f|-SDtV_c<9fr^}h)oy69T}L2&guy|J-bs=BVc_-?_Xu&;8Hu^3MHv%bDl%ww|*-+}soRFu2rr&ef^NJZLiR>y}qU zzIfS`d7xWnj2RyWyR4^{kCw(+4_jmKo3i|MX%O;Dv_>aS~AwKoW zeoNXi*7E(G0*=d8J%0UL)SC21!C2}rCS3e=VzeIEQs>L1;3dX;^(rInBIhqd7bs&L z-7-rutv_!0x^#=R_R;w_c^bP+CBh`H_U4d&Xh=0)39F&Ue1>9uu(bv>pKpE8n`}(D zOqVvAnJ$yXWG=~uX$?L-wtPmt8ewITL7B^*&|;r4!#eo%yRv7z^;jy>+&o^@KN(V) zP*#?BkhF>X`g7CPBsd&D`x1Ux1+ESW6A z@{Jc8;)`O7v}ags5l>>tkB8ORqA)4RzhHdQ5SL@JHi5xFPlVLoD?Xm@)$$4Sj3?du zuKH>L%;u{w0?)uz9}Px$eR&|`6OH$*KW_6%Z(E-2&7oe)<%)z4Wh$>M$gfz znOLG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A)K+y z+t~>Fa#dp38Af-%wIMu!=DZ?ZyIbk)F@Mpz+_ZW`tYLb1Mo7Kpy03TcRW_b4@m^1_ zn}OBpj{U$OFHA*upTd0x{@(?69ffqUaWSBepV?m,{pJp(|GClLMk= 'A' and c <= 'Z' // return TRUE @@ -2627,19 +2645,13 @@ def scan // // Skip whitespace // - while ^scanptr == ' ' - scanptr = scanptr + 1 - loop + scanptr = skipspace(scanptr) tknptr = scanptr scanchr = ^scanptr // // Scan for token based on first character // - if !scanchr or scanchr == ';' - if token <> EOF_TKN - token = EOL_TKN - fin - elsif isalpha(scanchr) + if isalpha(scanchr) // // ID, either variable name or reserved word // @@ -2782,6 +2794,12 @@ def scan fin scanptr = scanptr + 1 break + is 0 + is ';' + if token <> EOF_TKN + token = EOL_TKN + fin + break otherwise // // Simple single character tokens