picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit f6efb74973ca91194499726614f4bd784c86f156
parent fc004eec5e1d5ddbe505cf73dd39f3d37eb40335
Author: Alexander Burger <abu@software-lab.de>
Date:   Thu, 31 Jan 2013 11:15:11 +0100

Special handling of '+' and '-' in token read
Diffstat:
Mersatz/picolisp.jar | 0
Mersatz/sys.src | 22++++++++++++----------
Mlib/map | 80++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc/io.c | 4++--
Msrc/vers.h | 2+-
Msrc64/io.l | 8++++++--
Msrc64/tags | 136++++++++++++++++++++++++++++++++++++++++----------------------------------------
Msrc64/version.l | 4++--
8 files changed, 131 insertions(+), 125 deletions(-)

diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/ersatz/sys.src b/ersatz/sys.src @@ -1,4 +1,4 @@ -// 08dec12abu +// 31jan13abu // (c) Software Lab. Alexander Burger import java.util.*; @@ -1625,19 +1625,21 @@ public class PicoLisp { try {return strToNum(sb.toString(), ((Number)Scl.Car).Cnt);} catch (NumberFormatException e) {} } - String s = x.name(); - if (Chr >= 'A' && Chr <= 'Z' || Chr == '\\' || Chr >= 'a' && Chr <= 'z' || s.indexOf(Chr) >= 0) { - if (Chr == '\\') - get(); - StringBuilder sb = new StringBuilder(); - sb.append((char)Chr); - while (get() >= '0' && Chr <= '9' || Chr >= 'A' && Chr <= 'Z' || Chr == '\\' || Chr >= 'a' && Chr <= 'z' || s.indexOf(Chr) >= 0) { + if (Chr != '+' && Chr != '-') { + String s = x.name(); + if (Chr >= 'A' && Chr <= 'Z' || Chr == '\\' || Chr >= 'a' && Chr <= 'z' || s.indexOf(Chr) >= 0) { if (Chr == '\\') get(); + StringBuilder sb = new StringBuilder(); sb.append((char)Chr); + while (get() >= '0' && Chr <= '9' || Chr >= 'A' && Chr <= 'Z' || Chr == '\\' || Chr >= 'a' && Chr <= 'z' || s.indexOf(Chr) >= 0) { + if (Chr == '\\') + get(); + sb.append((char)Chr); + } + s = sb.toString(); + return s.equals("NIL")? Nil : mkSymbol(Nil, s, Env.intern()); } - s = sb.toString(); - return s.equals("NIL")? Nil : mkSymbol(Nil, s, Env.intern()); } c = (char)Chr; get(); diff --git a/lib/map b/lib/map @@ -29,7 +29,7 @@ adr (587 . "@src64/main.l") alarm (473 . "@src64/main.l") all (788 . "@src64/sym.l") and (1624 . "@src64/flow.l") -any (3979 . "@src64/io.l") +any (3983 . "@src64/io.l") append (1338 . "@src64/subr.l") apply (713 . "@src64/apply.l") arg (2573 . "@src64/main.l") @@ -83,12 +83,12 @@ cdddr (245 . "@src64/subr.l") cddr (79 . "@src64/subr.l") cdr (17 . "@src64/subr.l") chain (1141 . "@src64/subr.l") -char (3461 . "@src64/io.l") +char (3465 . "@src64/io.l") chop (1228 . "@src64/sym.l") circ (816 . "@src64/subr.l") circ? (2402 . "@src64/subr.l") clip (1799 . "@src64/subr.l") -close (4392 . "@src64/io.l") +close (4396 . "@src64/io.l") cmd (3183 . "@src64/main.l") cnt (1413 . "@src64/apply.l") co (2548 . "@src64/flow.l") @@ -99,7 +99,7 @@ cond (1919 . "@src64/flow.l") connect (224 . "@src64/net.l") cons (747 . "@src64/subr.l") copy (1225 . "@src64/subr.l") -ctl (4265 . "@src64/io.l") +ctl (4269 . "@src64/io.l") ctty (2978 . "@src64/main.l") cut (1931 . "@src64/sym.l") date (2687 . "@src64/main.l") @@ -116,14 +116,14 @@ dir (3113 . "@src64/main.l") dm (545 . "@src64/flow.l") do (2141 . "@src64/flow.l") e (2928 . "@src64/flow.l") -echo (4423 . "@src64/io.l") +echo (4427 . "@src64/io.l") env (599 . "@src64/main.l") -eof (3538 . "@src64/io.l") -eol (3529 . "@src64/io.l") -err (4245 . "@src64/io.l") +eof (3542 . "@src64/io.l") +eol (3533 . "@src64/io.l") +err (4249 . "@src64/io.l") errno (1575 . "@src64/main.l") eval (175 . "@src64/flow.l") -ext (5157 . "@src64/io.l") +ext (5161 . "@src64/io.l") ext? (1166 . "@src64/sym.l") extern (1032 . "@src64/sym.l") extra (1269 . "@src64/flow.l") @@ -138,13 +138,13 @@ find (1322 . "@src64/apply.l") fish (1613 . "@src64/apply.l") flg? (2445 . "@src64/subr.l") flip (1699 . "@src64/subr.l") -flush (5132 . "@src64/io.l") +flush (5136 . "@src64/io.l") fold (3521 . "@src64/sym.l") for (2230 . "@src64/flow.l") fork (3270 . "@src64/flow.l") format (2089 . "@src64/big.l") free (1960 . "@src64/db.l") -from (3557 . "@src64/io.l") +from (3561 . "@src64/io.l") full (1075 . "@src64/subr.l") fun? (750 . "@src64/sym.l") gc (435 . "@src64/gc.l") @@ -157,14 +157,14 @@ gt0 (2718 . "@src64/big.l") hash (2976 . "@src64/big.l") head (1820 . "@src64/subr.l") heap (519 . "@src64/main.l") -hear (3242 . "@src64/io.l") +hear (3246 . "@src64/io.l") host (190 . "@src64/net.l") id (1028 . "@src64/db.l") idx (2171 . "@src64/sym.l") if (1805 . "@src64/flow.l") if2 (1824 . "@src64/flow.l") ifn (1865 . "@src64/flow.l") -in (4205 . "@src64/io.l") +in (4209 . "@src64/io.l") inc (2256 . "@src64/big.l") index (2637 . "@src64/subr.l") info (3015 . "@src64/main.l") @@ -173,7 +173,7 @@ ipid (3215 . "@src64/flow.l") isa (967 . "@src64/flow.l") job (1429 . "@src64/flow.l") journal (971 . "@src64/db.l") -key (3390 . "@src64/io.l") +key (3394 . "@src64/io.l") kill (3247 . "@src64/flow.l") last (2044 . "@src64/subr.l") le0 (2693 . "@src64/big.l") @@ -181,14 +181,14 @@ length (2741 . "@src64/subr.l") let (1479 . "@src64/flow.l") let? (1540 . "@src64/flow.l") lieu (1157 . "@src64/db.l") -line (3713 . "@src64/io.l") -lines (3866 . "@src64/io.l") +line (3717 . "@src64/io.l") +lines (3870 . "@src64/io.l") link (1172 . "@src64/subr.l") lisp (2244 . "@src64/main.l") list (887 . "@src64/subr.l") listen (157 . "@src64/net.l") lit (150 . "@src64/flow.l") -load (4182 . "@src64/io.l") +load (4186 . "@src64/io.l") lock (1185 . "@src64/db.l") loop (2173 . "@src64/flow.l") low? (3387 . "@src64/sym.l") @@ -238,30 +238,30 @@ offset (2677 . "@src64/subr.l") on (1717 . "@src64/sym.l") onOff (1747 . "@src64/sym.l") one (1780 . "@src64/sym.l") -open (4349 . "@src64/io.l") +open (4353 . "@src64/io.l") opid (3231 . "@src64/flow.l") opt (3304 . "@src64/main.l") or (1640 . "@src64/flow.l") -out (4225 . "@src64/io.l") +out (4229 . "@src64/io.l") pack (1279 . "@src64/sym.l") pair (2394 . "@src64/subr.l") pass (754 . "@src64/apply.l") pat? (736 . "@src64/sym.l") path (1251 . "@src64/io.l") -peek (3445 . "@src64/io.l") +peek (3449 . "@src64/io.l") pick (1369 . "@src64/apply.l") -pipe (4286 . "@src64/io.l") -poll (3334 . "@src64/io.l") +pipe (4290 . "@src64/io.l") +poll (3338 . "@src64/io.l") pool (651 . "@src64/db.l") pop (1907 . "@src64/sym.l") port (5 . "@src64/net.l") -pr (5240 . "@src64/io.l") +pr (5244 . "@src64/io.l") pre? (1545 . "@src64/sym.l") -prin (5056 . "@src64/io.l") -prinl (5070 . "@src64/io.l") -print (5096 . "@src64/io.l") -println (5127 . "@src64/io.l") -printsp (5112 . "@src64/io.l") +prin (5060 . "@src64/io.l") +prinl (5074 . "@src64/io.l") +print (5100 . "@src64/io.l") +println (5131 . "@src64/io.l") +printsp (5116 . "@src64/io.l") prior (2713 . "@src64/subr.l") prog (1760 . "@src64/flow.l") prog1 (1768 . "@src64/flow.l") @@ -281,12 +281,12 @@ rand (3003 . "@src64/big.l") range (997 . "@src64/subr.l") rank (3048 . "@src64/subr.l") raw (451 . "@src64/main.l") -rd (5174 . "@src64/io.l") -read (2670 . "@src64/io.l") +rd (5178 . "@src64/io.l") +read (2674 . "@src64/io.l") replace (1499 . "@src64/subr.l") rest (2602 . "@src64/main.l") reverse (1678 . "@src64/subr.l") -rewind (5140 . "@src64/io.l") +rewind (5144 . "@src64/io.l") rollback (1803 . "@src64/db.l") rot (848 . "@src64/subr.l") run (306 . "@src64/flow.l") @@ -299,33 +299,33 @@ set (1616 . "@src64/sym.l") setq (1649 . "@src64/sym.l") sigio (489 . "@src64/main.l") size (2808 . "@src64/subr.l") -skip (3515 . "@src64/io.l") +skip (3519 . "@src64/io.l") sort (3977 . "@src64/subr.l") sp? (727 . "@src64/sym.l") -space (5074 . "@src64/io.l") +space (5078 . "@src64/io.l") split (1592 . "@src64/subr.l") stack (548 . "@src64/main.l") state (2009 . "@src64/flow.l") stem (1989 . "@src64/subr.l") -str (4033 . "@src64/io.l") +str (4037 . "@src64/io.l") str? (1145 . "@src64/sym.l") strip (1576 . "@src64/subr.l") struct (2035 . "@src64/main.l") sub? (1578 . "@src64/sym.l") sum (1460 . "@src64/apply.l") super (1225 . "@src64/flow.l") -sym (4019 . "@src64/io.l") +sym (4023 . "@src64/io.l") sym? (2434 . "@src64/subr.l") symbols (942 . "@src64/sym.l") -sync (3202 . "@src64/io.l") +sync (3206 . "@src64/io.l") sys (3067 . "@src64/flow.l") t (1751 . "@src64/flow.l") tail (1911 . "@src64/subr.l") -tell (3274 . "@src64/io.l") +tell (3278 . "@src64/io.l") text (1407 . "@src64/sym.l") throw (2493 . "@src64/flow.l") tick (3183 . "@src64/flow.l") -till (3624 . "@src64/io.l") +till (3628 . "@src64/io.l") time (2820 . "@src64/main.l") touch (1181 . "@src64/sym.l") trail (698 . "@src64/main.l") @@ -343,12 +343,12 @@ use (1573 . "@src64/flow.l") usec (2924 . "@src64/main.l") val (1597 . "@src64/sym.l") version (3318 . "@src64/main.l") -wait (3164 . "@src64/io.l") +wait (3168 . "@src64/io.l") when (1884 . "@src64/flow.l") while (2061 . "@src64/flow.l") wipe (3262 . "@src64/sym.l") with (1332 . "@src64/flow.l") -wr (5257 . "@src64/io.l") +wr (5261 . "@src64/io.l") xchg (1672 . "@src64/sym.l") xor (1701 . "@src64/flow.l") x| (2887 . "@src64/big.l") diff --git a/src/io.c b/src/io.c @@ -1,4 +1,4 @@ -/* 28dec12abu +/* 31jan13abu * (c) Software Lab. Alexander Burger */ @@ -1301,7 +1301,7 @@ any token(any x, int c) { byteSym(Chr, &i, &y); return symToNum(Pop(c1), (int)unDig(val(Scl)) / 2, '.', 0); } - { + if (Chr != '+' && Chr != '-') { char nm[bufSize(x)]; bufString(x, nm); diff --git a/src/vers.h b/src/vers.h @@ -1 +1 @@ -static byte Version[4] = {3,1,1,8}; +static byte Version[4] = {3,1,1,9}; diff --git a/src64/io.l b/src64/io.l @@ -1,4 +1,4 @@ -# 22nov12abu +# 31jan13abu # (c) Software Lab. Alexander Burger # Close file descriptor @@ -2605,6 +2605,10 @@ push A # <S /III> String length slen (S) (S I) ld A Y # Restore char + cmp B (char "+") # Sign? + jeq 90 + cmp B (char "-") + jeq 90 # Yes cmp B (char "a") # Lower case letter? if ge cmp B (char "z") @@ -2656,7 +2660,7 @@ call findSymX_E # Find or create symbol drop else - call getChar_A +90 call getChar_A call mkCharA_A # Return char ld E A call (Get_A) # Skip it diff --git a/src64/tags b/src64/tags @@ -653,74 +653,74 @@ sys/x86-64.linux.defs.l,1959 readA_E2314,60298 readC_E2498,64615 tokenCE_E2528,65206 -doRead2670,68667 -inReadyC_F2708,69507 -fdSetCL_X2720,69788 -fdRdSetCZL2732,70022 -fdWrSetCZL2739,70164 -rdSetCL_F2746,70313 -wrSetCL_F2751,70429 -rdSetRdyCL_F2756,70552 -waitFdCEX_A2778,71013 -doWait3164,83837 -doSync3202,84560 -doHear3242,85500 -doTell3274,86194 -fdSetC_Y3323,87282 -doPoll3334,87516 -doKey3390,88887 -doPeek3445,90326 -doChar3461,90604 -doSkip3515,91549 -doEol3529,91896 -doEof3538,92062 -doFrom3557,92419 -doTill3624,94088 -eolA_F3698,96037 -doLine3713,96341 -doLines3866,100381 -parseBCE_E3907,101282 -doAny3979,102937 -doSym4019,103875 -doStr4033,104134 -loadBEX_E4086,105260 -doLoad4182,107610 -doIn4205,108022 -doOut4225,108352 -doErr4245,108686 -doCtl4265,109021 -doPipe4286,109376 -doOpen4349,110922 -doClose4392,111902 -doEcho4423,112493 -putStdoutB4636,118017 -newline4679,118999 -space4683,119041 -outNumE4688,119105 -outWordA4695,119233 -prExtNmX4707,119471 -outOctA4715,119665 -outAoA4728,119933 -outStringS4740,120181 -outStringC4742,120251 -outNameE4752,120390 -prNameX4760,120507 -printE_E4770,120662 -printE4779,120798 -prinE_E4992,126414 -prinE5001,126550 -doPrin5056,127812 -doPrinl5070,128082 -doSpace5074,128150 -doPrint5096,128549 -doPrintsp5112,128844 -doPrintln5127,129133 -doFlush5132,129221 -doRewind5140,129358 -doExt5157,129748 -doRd5174,130087 -doPr5240,131867 -doWr5257,132199 +doRead2674,68743 +inReadyC_F2712,69583 +fdSetCL_X2724,69864 +fdRdSetCZL2736,70098 +fdWrSetCZL2743,70240 +rdSetCL_F2750,70389 +wrSetCL_F2755,70505 +rdSetRdyCL_F2760,70628 +waitFdCEX_A2782,71089 +doWait3168,83913 +doSync3206,84636 +doHear3246,85576 +doTell3278,86270 +fdSetC_Y3327,87358 +doPoll3338,87592 +doKey3394,88963 +doPeek3449,90402 +doChar3465,90680 +doSkip3519,91625 +doEol3533,91972 +doEof3542,92138 +doFrom3561,92495 +doTill3628,94164 +eolA_F3702,96113 +doLine3717,96417 +doLines3870,100457 +parseBCE_E3911,101358 +doAny3983,103013 +doSym4023,103951 +doStr4037,104210 +loadBEX_E4090,105336 +doLoad4186,107686 +doIn4209,108098 +doOut4229,108428 +doErr4249,108762 +doCtl4269,109097 +doPipe4290,109452 +doOpen4353,110998 +doClose4396,111978 +doEcho4427,112569 +putStdoutB4640,118093 +newline4683,119075 +space4687,119117 +outNumE4692,119181 +outWordA4699,119309 +prExtNmX4711,119547 +outOctA4719,119741 +outAoA4732,120009 +outStringS4744,120257 +outStringC4746,120327 +outNameE4756,120466 +prNameX4764,120583 +printE_E4774,120738 +printE4783,120874 +prinE_E4996,126490 +prinE5005,126626 +doPrin5060,127888 +doPrinl5074,128158 +doSpace5078,128226 +doPrint5100,128625 +doPrintsp5116,128920 +doPrintln5131,129209 +doFlush5136,129297 +doRewind5144,129434 +doExt5161,129824 +doRd5178,130163 +doPr5244,131943 +doWr5261,132275 ./apply.l,445 applyXYZ_E4,51 diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 19jan13abu +# 31jan13abu # (c) Software Lab. Alexander Burger -(de *Version 3 1 1 8) +(de *Version 3 1 1 9) # vi:et:ts=3:sw=3